diff options
author | tmsriram <tmsriram@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-06-23 06:15:19 +0000 |
---|---|---|
committer | tmsriram <tmsriram@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-06-23 06:15:19 +0000 |
commit | ef21d40e1ef4c72997688d5716a6f4ef5a72b499 (patch) | |
tree | bcbdec95b4f436d90004456b20b84ef68cf1e7c8 /gcc/config/i386/wmmintrin.h | |
parent | 60777f693d3ac0ad238b9c009f6d094d2a550d24 (diff) | |
download | gcc-ef21d40e1ef4c72997688d5716a6f4ef5a72b499.tar.gz |
Allow mmintrin headers to work with function specific target opts. Please
see discussion here:
http://gcc.gnu.org/ml/gcc-patches/2013-04/msg00740.html
* config/i386/i386.c (ix86_pragma_target_parse): Restore target
when current target options does not apply.
* config/i386/i386-protos.h (ix86_reset_previous_fndecl): New function.
* config/i386/i386.c (ix86_reset_previous_fndecl): Ditto.
* config/i386/bmiintrin.h: Pass appropriate target attributes to header.
* config/i386/mmintrin.h: Ditto.
* config/i386/nmmintrin.h: Ditto.
* config/i386/avx2intrin.h: Ditto.
* config/i386/fxsrintrin.h: Ditto.
* config/i386/tbmintrin.h: Ditto.
* config/i386/xsaveintrin.h: Ditto.
* config/i386/f16cintrin.h: Ditto.
* config/i386/xtestintrin.h: Ditto.
* config/i386/xsaveoptintrin.h: Ditto.
* config/i386/bmi2intrin.h: Ditto.
* config/i386/lzcntintrin.h: Ditto.
* config/i386/smmintrin.h: Ditto.
* config/i386/wmmintrin.h: Ditto.
* config/i386/x86intrin.h: Remove all header include guards.
* config/i386/prfchwintrin.h: Ditto.
* config/i386/pmmintrin.h: Ditto.
* config/i386/tmmintrin.h: Ditto.
* config/i386/xmmintrin.h: Ditto.
* config/i386/popcntintrin.h: Ditto.
* config/i386/rdseedintrin.h: Ditto.
* config/i386/ammintrin.h: Ditto.
* config/i386/emmintrin.h: Ditto.
* config/i386/immintrin.h: Remove all header include guards.
* config/i386/fma4intrin.h: Ditto.
* config/i386/lwpintrin.h: Ditto.
* config/i386/xopintrin.h: Ditto.
* config/i386/ia32intrin.h: Ditto.
* config/i386/avxintrin.h: Ditto.
* config/i386/rtmintrin.h: Ditto.
* config/i386/fmaintrin.h: Ditto.
* config/i386/mm3dnow.h: Ditto.
* testsuite/gcc.target/i386/intrinsics_1.c: New test.
* testsuite/gcc.target/i386/intrinsics_2.c: Ditto.
* testsuite/gcc.target/i386/intrinsics_3.c: Ditto.
* testsuite/gcc.target/i386/intrinsics_4.c: Ditto.
* testsuite/gcc.target/i386/intrinsics_5.c: Ditto.
* testsuite/gcc.target/i386/intrinsics_6.c: Ditto.
* testsuite/gcc.target/i386/avx-1.c: Provide macros for builtins
needing immediate arguments in f16cintrin.h and rtmintrin.h.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@200349 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/i386/wmmintrin.h')
-rw-r--r-- | gcc/config/i386/wmmintrin.h | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/gcc/config/i386/wmmintrin.h b/gcc/config/i386/wmmintrin.h index 93c24f41ce6..defcfd82acc 100644 --- a/gcc/config/i386/wmmintrin.h +++ b/gcc/config/i386/wmmintrin.h @@ -30,13 +30,14 @@ /* We need definitions from the SSE2 header file. */ #include <emmintrin.h> -#if !defined (__AES__) && !defined (__PCLMUL__) -# error "AES/PCLMUL instructions not enabled" -#else - /* AES */ -#ifdef __AES__ +#ifndef __AES__ +#pragma GCC push_options +#pragma GCC target("aes") +#define __DISABLE_AES__ +#endif /* __AES__ */ + /* Performs 1 round of AES decryption of the first m128i using the second m128i as a round key. */ extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) @@ -92,11 +93,20 @@ _mm_aeskeygenassist_si128 (__m128i __X, const int __C) ((__m128i) __builtin_ia32_aeskeygenassist128 ((__v2di)(__m128i)(X), \ (int)(C))) #endif -#endif /* __AES__ */ + +#ifdef __DISABLE_AES__ +#undef __DISABLE_AES__ +#pragma GCC pop_options +#endif /* __DISABLE_AES__ */ /* PCLMUL */ -#ifdef __PCLMUL__ +#ifndef __PCLMUL__ +#pragma GCC push_options +#pragma GCC target("pclmul") +#define __DISABLE_PCLMUL__ +#endif /* __PCLMUL__ */ + /* Performs carry-less integer multiplication of 64-bit halves of 128-bit input operands. The third parameter inducates which 64-bit haves of the input parameters v1 and v2 should be used. It must be @@ -113,8 +123,10 @@ _mm_clmulepi64_si128 (__m128i __X, __m128i __Y, const int __I) ((__m128i) __builtin_ia32_pclmulqdq128 ((__v2di)(__m128i)(X), \ (__v2di)(__m128i)(Y), (int)(I))) #endif -#endif /* __PCLMUL__ */ -#endif /* __AES__/__PCLMUL__ */ +#ifdef __DISABLE_PCLMUL__ +#undef __DISABLE_PCLMUL__ +#pragma GCC pop_options +#endif /* __DISABLE_PCLMUL__ */ #endif /* _WMMINTRIN_H_INCLUDED */ |