[cfe-commits] r111692 - in /cfe/trunk: lib/Headers/avxintrin.h test/Headers/x86-intrinsics-headers.c

Benjamin Kramer benny.kra at googlemail.com
Fri Aug 20 16:00:04 PDT 2010


Author: d0k
Date: Fri Aug 20 18:00:03 2010
New Revision: 111692

URL: http://llvm.org/viewvc/llvm-project?rev=111692&view=rev
Log:
Disallow direct inclusion of avxintrin.h. Users should include immintrin.h instead. This matches GCC's behavior.

Modified:
    cfe/trunk/lib/Headers/avxintrin.h
    cfe/trunk/test/Headers/x86-intrinsics-headers.c

Modified: cfe/trunk/lib/Headers/avxintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avxintrin.h?rev=111692&r1=111691&r2=111692&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/avxintrin.h (original)
+++ cfe/trunk/lib/Headers/avxintrin.h Fri Aug 20 18:00:03 2010
@@ -21,12 +21,9 @@
  *===-----------------------------------------------------------------------===
  */
 
-#ifndef __AVXINTRIN_H
-#define __AVXINTRIN_H
-
-#ifndef __AVX__
-#error "AVX instruction set not enabled"
-#else
+#ifndef __IMMINTRIN_H
+#error "Never use <avxintrin.h> directly; include <immintrin.h> instead."
+#endif
 
 typedef double __v4df __attribute__ ((__vector_size__ (32)));
 typedef float __v8sf __attribute__ ((__vector_size__ (32)));
@@ -1157,7 +1154,3 @@
   __m128i zero = _mm_setzero_si128();
   return __builtin_shufflevector(in, zero, 0, 1, 2, 2);
 }
-
-#endif /* __AVX__ */
-
-#endif /* __AVXINTRIN_H */

Modified: cfe/trunk/test/Headers/x86-intrinsics-headers.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Headers/x86-intrinsics-headers.c?rev=111692&r1=111691&r2=111692&view=diff
==============================================================================
--- cfe/trunk/test/Headers/x86-intrinsics-headers.c (original)
+++ cfe/trunk/test/Headers/x86-intrinsics-headers.c Fri Aug 20 18:00:03 2010
@@ -4,33 +4,16 @@
 
 #if defined(i386) || defined(__x86_64__)
 
-#  if defined(__MMX__)
-#include <emmintrin.h>
+#ifdef __MMX__
 #include <mm_malloc.h>
-#  endif
-
-#  if defined(__SSE__)
-#include <xmmintrin.h>
-#  endif
-
-#  if defined(__SSE3__)
-#include <pmmintrin.h>
-#  endif
-
-#  if defined(__SSSE3__)
-#include <tmmintrin.h>
-#  endif
-
-#  if defined(__SSE4_1__)
-#include <smmintrin.h>
-#  endif
+#endif
 
-#  if defined(__SSE4_2__)
+#ifdef __SSE4_2__
+// nmmintrin forwards to smmintrin.
 #include <nmmintrin.h>
-#  endif
+#endif
 
-#  if defined(__AVX__)
-#include <avxintrin.h>
-#  endif
+// immintrin includes all other intel intrinsic headers.
+#include <immintrin.h>
 
 #endif





More information about the cfe-commits mailing list