[cfe-commits] r167398 - in /cfe/trunk: lib/Headers/cpuid.h lib/Headers/module.map test/Modules/compiler_builtins.m

Douglas Gregor dgregor at apple.com
Mon Nov 5 12:11:10 PST 2012


Author: dgregor
Date: Mon Nov  5 14:11:10 2012
New Revision: 167398

URL: http://llvm.org/viewvc/llvm-project?rev=167398&view=rev
Log:
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).


Modified:
    cfe/trunk/lib/Headers/cpuid.h
    cfe/trunk/lib/Headers/module.map
    cfe/trunk/test/Modules/compiler_builtins.m

Modified: cfe/trunk/lib/Headers/cpuid.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/cpuid.h?rev=167398&r1=167397&r2=167398&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/cpuid.h (original)
+++ cfe/trunk/lib/Headers/cpuid.h Mon Nov  5 14:11:10 2012
@@ -28,6 +28,6 @@
 static inline int __get_cpuid (unsigned int level, unsigned int *eax,
                                unsigned int *ebx, unsigned int *ecx,
                                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;
 }

Modified: cfe/trunk/lib/Headers/module.map
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/module.map?rev=167398&r1=167397&r2=167398&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/module.map (original)
+++ cfe/trunk/lib/Headers/module.map Mon Nov  5 14:11:10 2012
@@ -25,6 +25,11 @@
       header "mmintrin.h"
     }
 
+    explicit module f16c {
+      requires f16c
+      header "f16cintrin.h"
+    }
+
     explicit module sse {
       requires sse
       export mmx
@@ -62,6 +67,12 @@
       header "nmmintrin.h"
     }
 
+    explicit module sse4a {
+      requires sse4a
+      export sse3
+      header "nmmintrin.h"
+    }
+
     explicit module avx {
       requires avx
       export sse4_2
@@ -84,6 +95,11 @@
       header "bmi2intrin.h"
     }
 
+    explicit module fma {
+      requires fma
+      header "fmaintrin.h"
+    }
+
     explicit module fma4 {
       requires fma4
       export sse3
@@ -104,5 +120,11 @@
       requires mm3dnow
       header "mm3dnow.h"
     }
+
+    explicit module xop {
+      requires xop
+      export fma4
+      header "xopintrin.h"
+    }
   }
 }

Modified: cfe/trunk/test/Modules/compiler_builtins.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/compiler_builtins.m?rev=167398&r1=167397&r2=167398&view=diff
==============================================================================
--- cfe/trunk/test/Modules/compiler_builtins.m (original)
+++ cfe/trunk/test/Modules/compiler_builtins.m Mon Nov  5 14:11:10 2012
@@ -1,5 +1,6 @@
 // RUN: rm -rf %t
 // 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
 
 #ifdef __SSE__





More information about the cfe-commits mailing list