Index: clang/lib/Headers/bmiintrin.h =================================================================== --- clang/lib/Headers/bmiintrin.h +++ clang/lib/Headers/bmiintrin.h @@ -111,7 +111,8 @@ #undef __RELAXED_FN_ATTRS -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__BMI__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__BMI__) /* Define the default attributes for the functions in this file. */ #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("bmi"))) @@ -420,6 +421,7 @@ #undef __DEFAULT_FN_ATTRS -#endif /* !defined(_MSC_VER) || __has_feature(modules) || defined(__BMI__) */ +#endif /* !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) \ + || defined(__BMI__) */ #endif /* __BMIINTRIN_H */ Index: clang/lib/Headers/immintrin.h =================================================================== --- clang/lib/Headers/immintrin.h +++ clang/lib/Headers/immintrin.h @@ -10,198 +10,231 @@ #ifndef __IMMINTRIN_H #define __IMMINTRIN_H -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__MMX__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__MMX__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__SSE__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__SSE__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__SSE2__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__SSE2__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__SSE3__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__SSE3__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__SSSE3__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__SSSE3__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || \ +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ (defined(__SSE4_2__) || defined(__SSE4_1__)) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || \ +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ (defined(__AES__) || defined(__PCLMUL__)) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__CLFLUSHOPT__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__CLFLUSHOPT__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__CLWB__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__CLWB__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__AVX__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX2__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__AVX2__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__F16C__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__F16C__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__VPCLMULQDQ__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__VPCLMULQDQ__) #include #endif /* No feature check desired due to internal checks */ #include -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__BMI2__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__BMI2__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__LZCNT__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__LZCNT__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__POPCNT__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__POPCNT__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__FMA__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__FMA__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512F__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__AVX512F__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512VL__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__AVX512VL__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512BW__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__AVX512BW__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512BITALG__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__AVX512BITALG__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512CD__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__AVX512CD__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512VPOPCNTDQ__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__AVX512VPOPCNTDQ__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || \ +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ (defined(__AVX512VL__) && defined(__AVX512VPOPCNTDQ__)) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512VNNI__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__AVX512VNNI__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || \ +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ (defined(__AVX512VL__) && defined(__AVX512VNNI__)) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512DQ__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__AVX512DQ__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || \ +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ (defined(__AVX512VL__) && defined(__AVX512BITALG__)) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || \ +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ (defined(__AVX512VL__) && defined(__AVX512BW__)) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || \ +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ (defined(__AVX512VL__) && defined(__AVX512CD__)) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || \ +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ (defined(__AVX512VL__) && defined(__AVX512DQ__)) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512ER__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__AVX512ER__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512IFMA__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__AVX512IFMA__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || \ +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ (defined(__AVX512IFMA__) && defined(__AVX512VL__)) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512VBMI__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__AVX512VBMI__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || \ +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ (defined(__AVX512VBMI__) && defined(__AVX512VL__)) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512VBMI2__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__AVX512VBMI2__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || \ +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ (defined(__AVX512VBMI2__) && defined(__AVX512VL__)) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512PF__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__AVX512PF__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512BF16__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__AVX512BF16__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || \ +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ (defined(__AVX512VL__) && defined(__AVX512BF16__)) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__PKU__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__PKU__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__VAES__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__VAES__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__GFNI__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__GFNI__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__RDPID__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__RDPID__) /// Returns the value of the IA32_TSC_AUX MSR (0xc0000103). /// /// \headerfile @@ -213,7 +246,8 @@ } #endif // __RDPID__ -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__RDRND__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__RDRND__) static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("rdrnd"))) _rdrand16_step(unsigned short *__p) { @@ -235,7 +269,8 @@ #endif #endif /* __RDRND__ */ -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__FSGSBASE__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__FSGSBASE__) #ifdef __x86_64__ static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase"))) _readfsbase_u32(void) @@ -288,7 +323,8 @@ #endif #endif /* __FSGSBASE__ */ -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__MOVBE__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__MOVBE__) /* The structs used below are to force the load/store to be unaligned. This * is accomplished with the __packed__ attribute. The __may_alias__ prevents @@ -347,35 +383,42 @@ #endif #endif /* __MOVBE */ -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__RTM__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__RTM__) #include #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__SHA__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__SHA__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__FXSR__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__FXSR__) #include #endif /* No feature check desired due to internal MSC_VER checks */ #include -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__XSAVEOPT__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__XSAVEOPT__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__XSAVEC__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__XSAVEC__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__XSAVES__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__XSAVES__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__SHSTK__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__SHSTK__) #include #endif @@ -383,62 +426,73 @@ * whereas others are also available at all times. */ #include -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__RDSEED__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__RDSEED__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__WBNOINVD__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__WBNOINVD__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__CLDEMOTE__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__CLDEMOTE__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__WAITPKG__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__WAITPKG__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || \ - defined(__MOVDIRI__) || defined(__MOVDIR64B__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__MOVDIRI__) || defined(__MOVDIR64B__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__PCONFIG__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__PCONFIG__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__SGX__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__SGX__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__PTWRITE__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__PTWRITE__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__INVPCID__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__INVPCID__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || \ - defined(__AVX512VP2INTERSECT__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__AVX512VP2INTERSECT__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || \ - (defined(__AVX512VL__) && defined(__AVX512VP2INTERSECT__)) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + (defined(__AVX512VL__) && defined(__AVX512VP2INTERSECT__)) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__ENQCMD__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__ENQCMD__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__SERIALIZE__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__SERIALIZE__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__TSXLDTRK__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__TSXLDTRK__) #include #endif Index: clang/lib/Headers/x86intrin.h =================================================================== --- clang/lib/Headers/x86intrin.h +++ clang/lib/Headers/x86intrin.h @@ -14,39 +14,48 @@ #include -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__3dNOW__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__3dNOW__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__PRFCHW__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__PRFCHW__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__SSE4A__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__SSE4A__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__FMA4__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__FMA4__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__XOP__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__XOP__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__TBM__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__TBM__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__LWP__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__LWP__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__MWAITX__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__MWAITX__) #include #endif -#if !defined(_MSC_VER) || __has_feature(modules) || defined(__CLZERO__) +#if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \ + defined(__CLZERO__) #include #endif Index: clang/test/Headers/x86intrin-2.c =================================================================== --- clang/test/Headers/x86intrin-2.c +++ clang/test/Headers/x86intrin-2.c @@ -1,10 +1,11 @@ -// RUN: %clang_cc1 -fsyntax-only -ffreestanding -Wcast-qual %s -verify -// RUN: %clang_cc1 -fsyntax-only -ffreestanding -flax-vector-conversions=none -Wcast-qual %s -verify -// RUN: %clang_cc1 -fsyntax-only -ffreestanding -Wcast-qual -x c++ %s -verify +// RUN: %clang_cc1 -triple i386-unknown-unknown -fsyntax-only -ffreestanding -Wcast-qual %s -verify +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fsyntax-only -ffreestanding -Wcast-qual %s -verify +// RUN: %clang_cc1 -triple i386-unknown-unknown -fsyntax-only -ffreestanding -flax-vector-conversions=none -Wcast-qual %s -verify +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fsyntax-only -ffreestanding -flax-vector-conversions=none -Wcast-qual %s -verify +// RUN: %clang_cc1 -triple i386-unknown-unknown -fsyntax-only -ffreestanding -Wcast-qual -x c++ %s -verify +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fsyntax-only -ffreestanding -Wcast-qual -x c++ %s -verify // expected-no-diagnostics -#if defined(i386) || defined(__x86_64__) - // Include the metaheader that includes all x86 intrinsic headers. #include @@ -133,5 +134,3 @@ int __attribute__((__target__("rtm"))) xtest_wrap(void) { return _xtest(); } - -#endif