]> granicus.if.org Git - clang/commitdiff
Disallow direct inclusion of avxintrin.h. Users should include immintrin.h instead...
authorBenjamin Kramer <benny.kra@googlemail.com>
Fri, 20 Aug 2010 23:00:03 +0000 (23:00 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Fri, 20 Aug 2010 23:00:03 +0000 (23:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111692 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Headers/avxintrin.h
test/Headers/x86-intrinsics-headers.c

index 160f4c1e2bc96cd28f17ceaeab2bc7b7ef7f02bb..884d31cb8917b966fdf74596f2920218223cf8fc 100644 (file)
  *===-----------------------------------------------------------------------===
  */
 
-#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 @@ _mm256_castsi128_si256(__m128i in)
   __m128i zero = _mm_setzero_si128();
   return __builtin_shufflevector(in, zero, 0, 1, 2, 2);
 }
-
-#endif /* __AVX__ */
-
-#endif /* __AVXINTRIN_H */
index b3beab1c51aec44eb2de37c4aefcce7b73cf932e..ba833ec0389367a9d45e9a593f5e0ecadfc5c4ab 100644 (file)
@@ -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