Skip to content
Snippets Groups Projects
Commit a65c5a39 authored by Douglas Gregor's avatar Douglas Gregor
Browse files

Make cpuid.h actually work with -std=c99 <rdar://problem/12552716>.

While we're here, extend the module map to cover most of the
newly-added instrinsic headers. Only wmmintrin.h is missing, because
it needs to be split into AES/PCLMUL subheaders (as a separate commit).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167398 91177308-0d34-0410-b5e6-96231b3b80d8
parent 984e2eb5
No related branches found
No related tags found
No related merge requests found
...@@ -28,6 +28,6 @@ ...@@ -28,6 +28,6 @@
static inline int __get_cpuid (unsigned int level, unsigned int *eax, static inline int __get_cpuid (unsigned int level, unsigned int *eax,
unsigned int *ebx, unsigned int *ecx, unsigned int *ebx, unsigned int *ecx,
unsigned int *edx) { unsigned int *edx) {
asm("cpuid" : "=a"(*eax), "=b" (*ebx), "=c"(*ecx), "=d"(*edx) : "0"(level)); __asm("cpuid" : "=a"(*eax), "=b" (*ebx), "=c"(*ecx), "=d"(*edx) : "0"(level));
return 1; return 1;
} }
...@@ -25,6 +25,11 @@ module _Builtin_intrinsics [system] { ...@@ -25,6 +25,11 @@ module _Builtin_intrinsics [system] {
header "mmintrin.h" header "mmintrin.h"
} }
explicit module f16c {
requires f16c
header "f16cintrin.h"
}
explicit module sse { explicit module sse {
requires sse requires sse
export mmx export mmx
...@@ -62,6 +67,12 @@ module _Builtin_intrinsics [system] { ...@@ -62,6 +67,12 @@ module _Builtin_intrinsics [system] {
header "nmmintrin.h" header "nmmintrin.h"
} }
explicit module sse4a {
requires sse4a
export sse3
header "nmmintrin.h"
}
explicit module avx { explicit module avx {
requires avx requires avx
export sse4_2 export sse4_2
...@@ -84,6 +95,11 @@ module _Builtin_intrinsics [system] { ...@@ -84,6 +95,11 @@ module _Builtin_intrinsics [system] {
header "bmi2intrin.h" header "bmi2intrin.h"
} }
explicit module fma {
requires fma
header "fmaintrin.h"
}
explicit module fma4 { explicit module fma4 {
requires fma4 requires fma4
export sse3 export sse3
...@@ -104,5 +120,11 @@ module _Builtin_intrinsics [system] { ...@@ -104,5 +120,11 @@ module _Builtin_intrinsics [system] {
requires mm3dnow requires mm3dnow
header "mm3dnow.h" header "mm3dnow.h"
} }
explicit module xop {
requires xop
export fma4
header "xopintrin.h"
}
} }
} }
// RUN: rm -rf %t // RUN: rm -rf %t
// RUN: %clang -fsyntax-only -fmodules -fmodule-cache-path %t -D__need_wint_t %s -Xclang -verify // RUN: %clang -fsyntax-only -fmodules -fmodule-cache-path %t -D__need_wint_t %s -Xclang -verify
// RUN: %clang -fsyntax-only -std=c99 -fmodules -fmodule-cache-path %t -D__need_wint_t %s -Xclang -verify
// expected-no-diagnostics // expected-no-diagnostics
#ifdef __SSE__ #ifdef __SSE__
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment