1 /* Copyright (C) 2008-2018 Free Software Foundation, Inc.
3 This file is part of GCC.
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
7 the Free Software Foundation; either version 3, or (at your option)
10 GCC is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 Under Section 7 of GPL version 3, you are granted additional
16 permissions described in the GCC Runtime Library Exception, version
17 3.1, as published by the Free Software Foundation.
19 You should have received a copy of the GNU General Public License and
20 a copy of the GCC Runtime Library Exception along with this program;
21 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
22 <http://www.gnu.org/licenses/>. */
24 #ifndef _IMMINTRIN_H_INCLUDED
25 #define _IMMINTRIN_H_INCLUDED
29 #include <xmmintrin.h>
31 #include <emmintrin.h>
33 #include <pmmintrin.h>
35 #include <tmmintrin.h>
37 #include <smmintrin.h>
39 #include <wmmintrin.h>
41 #include <avxintrin.h>
43 #include <avx2intrin.h>
45 #include <avx512fintrin.h>
47 #include <avx512erintrin.h>
49 #include <avx512pfintrin.h>
51 #include <avx512cdintrin.h>
53 #include <avx512vlintrin.h>
55 #include <avx512bwintrin.h>
57 #include <avx512dqintrin.h>
59 #include <avx512vlbwintrin.h>
61 #include <avx512vldqintrin.h>
63 #include <avx512ifmaintrin.h>
65 #include <avx512ifmavlintrin.h>
67 #include <avx512vbmiintrin.h>
69 #include <avx512vbmivlintrin.h>
71 #include <avx5124fmapsintrin.h>
73 #include <avx5124vnniwintrin.h>
75 #include <avx512vpopcntdqintrin.h>
77 #include <avx512vbmi2intrin.h>
79 #include <avx512vbmi2vlintrin.h>
81 #include <avx512vnniintrin.h>
83 #include <avx512vnnivlintrin.h>
85 #include <avx512vpopcntdqvlintrin.h>
87 #include <avx512bitalgintrin.h>
89 #include <shaintrin.h>
91 #include <lzcntintrin.h>
93 #include <bmiintrin.h>
95 #include <bmi2intrin.h>
97 #include <fmaintrin.h>
99 #include <f16cintrin.h>
101 #include <rtmintrin.h>
103 #include <xtestintrin.h>
105 #include <cetintrin.h>
107 #include <gfniintrin.h>
109 #include <vaesintrin.h>
111 #include <vpclmulqdqintrin.h>
114 __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
117 __builtin_ia32_wbinvd ();
121 #pragma GCC push_options
122 #pragma GCC target("rdrnd")
123 #define __DISABLE_RDRND__
124 #endif /* __RDRND__ */
126 __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
127 _rdrand16_step (unsigned short *__P
)
129 return __builtin_ia32_rdrand16_step (__P
);
133 __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
134 _rdrand32_step (unsigned int *__P
)
136 return __builtin_ia32_rdrand32_step (__P
);
138 #ifdef __DISABLE_RDRND__
139 #undef __DISABLE_RDRND__
140 #pragma GCC pop_options
141 #endif /* __DISABLE_RDRND__ */
144 #pragma GCC push_options
145 #pragma GCC target("rdpid")
146 #define __DISABLE_RDPID__
147 #endif /* __RDPID__ */
148 extern __inline
unsigned int
149 __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
152 return __builtin_ia32_rdpid ();
154 #ifdef __DISABLE_RDPID__
155 #undef __DISABLE_RDPID__
156 #pragma GCC pop_options
157 #endif /* __DISABLE_RDPID__ */
162 #pragma GCC push_options
163 #pragma GCC target("fsgsbase")
164 #define __DISABLE_FSGSBASE__
165 #endif /* __FSGSBASE__ */
166 extern __inline
unsigned int
167 __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
168 _readfsbase_u32 (void)
170 return __builtin_ia32_rdfsbase32 ();
173 extern __inline
unsigned long long
174 __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
175 _readfsbase_u64 (void)
177 return __builtin_ia32_rdfsbase64 ();
180 extern __inline
unsigned int
181 __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
182 _readgsbase_u32 (void)
184 return __builtin_ia32_rdgsbase32 ();
187 extern __inline
unsigned long long
188 __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
189 _readgsbase_u64 (void)
191 return __builtin_ia32_rdgsbase64 ();
195 __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
196 _writefsbase_u32 (unsigned int __B
)
198 __builtin_ia32_wrfsbase32 (__B
);
202 __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
203 _writefsbase_u64 (unsigned long long __B
)
205 __builtin_ia32_wrfsbase64 (__B
);
209 __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
210 _writegsbase_u32 (unsigned int __B
)
212 __builtin_ia32_wrgsbase32 (__B
);
216 __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
217 _writegsbase_u64 (unsigned long long __B
)
219 __builtin_ia32_wrgsbase64 (__B
);
221 #ifdef __DISABLE_FSGSBASE__
222 #undef __DISABLE_FSGSBASE__
223 #pragma GCC pop_options
224 #endif /* __DISABLE_FSGSBASE__ */
227 #pragma GCC push_options
228 #pragma GCC target("rdrnd")
229 #define __DISABLE_RDRND__
230 #endif /* __RDRND__ */
232 __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
233 _rdrand64_step (unsigned long long *__P
)
235 return __builtin_ia32_rdrand64_step (__P
);
237 #ifdef __DISABLE_RDRND__
238 #undef __DISABLE_RDRND__
239 #pragma GCC pop_options
240 #endif /* __DISABLE_RDRND__ */
242 #endif /* __x86_64__ */
244 #endif /* _IMMINTRIN_H_INCLUDED */