comparison gcc/config/i386/wmmintrin.h @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents a06113de4d67
children 84e7813d76e9
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 /* Copyright (C) 2008, 2009 Free Software Foundation, Inc. 1 /* Copyright (C) 2008-2017 Free Software Foundation, Inc.
2 2
3 This file is part of GCC. 3 This file is part of GCC.
4 4
5 GCC is free software; you can redistribute it and/or modify 5 GCC is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
28 #define _WMMINTRIN_H_INCLUDED 28 #define _WMMINTRIN_H_INCLUDED
29 29
30 /* We need definitions from the SSE2 header file. */ 30 /* We need definitions from the SSE2 header file. */
31 #include <emmintrin.h> 31 #include <emmintrin.h>
32 32
33 #if !defined (__AES__) && !defined (__PCLMUL__)
34 # error "AES/PCLMUL instructions not enabled"
35 #else
36
37 /* AES */ 33 /* AES */
38 34
39 #ifdef __AES__ 35 #ifndef __AES__
36 #pragma GCC push_options
37 #pragma GCC target("aes")
38 #define __DISABLE_AES__
39 #endif /* __AES__ */
40
40 /* Performs 1 round of AES decryption of the first m128i using 41 /* Performs 1 round of AES decryption of the first m128i using
41 the second m128i as a round key. */ 42 the second m128i as a round key. */
42 extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) 43 extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
43 _mm_aesdec_si128 (__m128i __X, __m128i __Y) 44 _mm_aesdec_si128 (__m128i __X, __m128i __Y)
44 { 45 {
90 #else 91 #else
91 #define _mm_aeskeygenassist_si128(X, C) \ 92 #define _mm_aeskeygenassist_si128(X, C) \
92 ((__m128i) __builtin_ia32_aeskeygenassist128 ((__v2di)(__m128i)(X), \ 93 ((__m128i) __builtin_ia32_aeskeygenassist128 ((__v2di)(__m128i)(X), \
93 (int)(C))) 94 (int)(C)))
94 #endif 95 #endif
95 #endif /* __AES__ */ 96
97 #ifdef __DISABLE_AES__
98 #undef __DISABLE_AES__
99 #pragma GCC pop_options
100 #endif /* __DISABLE_AES__ */
96 101
97 /* PCLMUL */ 102 /* PCLMUL */
98 103
99 #ifdef __PCLMUL__ 104 #ifndef __PCLMUL__
105 #pragma GCC push_options
106 #pragma GCC target("pclmul")
107 #define __DISABLE_PCLMUL__
108 #endif /* __PCLMUL__ */
109
100 /* Performs carry-less integer multiplication of 64-bit halves of 110 /* Performs carry-less integer multiplication of 64-bit halves of
101 128-bit input operands. The third parameter inducates which 64-bit 111 128-bit input operands. The third parameter inducates which 64-bit
102 haves of the input parameters v1 and v2 should be used. It must be 112 haves of the input parameters v1 and v2 should be used. It must be
103 a compile time constant. */ 113 a compile time constant. */
104 #ifdef __OPTIMIZE__ 114 #ifdef __OPTIMIZE__
111 #else 121 #else
112 #define _mm_clmulepi64_si128(X, Y, I) \ 122 #define _mm_clmulepi64_si128(X, Y, I) \
113 ((__m128i) __builtin_ia32_pclmulqdq128 ((__v2di)(__m128i)(X), \ 123 ((__m128i) __builtin_ia32_pclmulqdq128 ((__v2di)(__m128i)(X), \
114 (__v2di)(__m128i)(Y), (int)(I))) 124 (__v2di)(__m128i)(Y), (int)(I)))
115 #endif 125 #endif
116 #endif /* __PCLMUL__ */
117 126
118 #endif /* __AES__/__PCLMUL__ */ 127 #ifdef __DISABLE_PCLMUL__
128 #undef __DISABLE_PCLMUL__
129 #pragma GCC pop_options
130 #endif /* __DISABLE_PCLMUL__ */
119 131
120 #endif /* _WMMINTRIN_H_INCLUDED */ 132 #endif /* _WMMINTRIN_H_INCLUDED */