Add AVX512 k-mask intrinsics
[official-gcc.git] / gcc / config / i386 / immintrin.h
blob3fd3c9c3e00e6d373d9c495aedf20d3e78414445
1 /* Copyright (C) 2008-2016 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)
8 any later version.
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
27 #include <mmintrin.h>
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 <shaintrin.h>
77 #include <lzcntintrin.h>
79 #include <bmiintrin.h>
81 #include <bmi2intrin.h>
83 #include <fmaintrin.h>
85 #include <f16cintrin.h>
87 #include <rtmintrin.h>
89 #include <xtestintrin.h>
91 #ifndef __RDRND__
92 #pragma GCC push_options
93 #pragma GCC target("rdrnd")
94 #define __DISABLE_RDRND__
95 #endif /* __RDRND__ */
96 extern __inline int
97 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
98 _rdrand16_step (unsigned short *__P)
100 return __builtin_ia32_rdrand16_step (__P);
103 extern __inline int
104 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
105 _rdrand32_step (unsigned int *__P)
107 return __builtin_ia32_rdrand32_step (__P);
109 #ifdef __DISABLE_RDRND__
110 #undef __DISABLE_RDRND__
111 #pragma GCC pop_options
112 #endif /* __DISABLE_RDRND__ */
114 #ifdef __x86_64__
116 #ifndef __FSGSBASE__
117 #pragma GCC push_options
118 #pragma GCC target("fsgsbase")
119 #define __DISABLE_FSGSBASE__
120 #endif /* __FSGSBASE__ */
121 extern __inline unsigned int
122 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
123 _readfsbase_u32 (void)
125 return __builtin_ia32_rdfsbase32 ();
128 extern __inline unsigned long long
129 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
130 _readfsbase_u64 (void)
132 return __builtin_ia32_rdfsbase64 ();
135 extern __inline unsigned int
136 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
137 _readgsbase_u32 (void)
139 return __builtin_ia32_rdgsbase32 ();
142 extern __inline unsigned long long
143 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
144 _readgsbase_u64 (void)
146 return __builtin_ia32_rdgsbase64 ();
149 extern __inline void
150 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
151 _writefsbase_u32 (unsigned int __B)
153 __builtin_ia32_wrfsbase32 (__B);
156 extern __inline void
157 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
158 _writefsbase_u64 (unsigned long long __B)
160 __builtin_ia32_wrfsbase64 (__B);
163 extern __inline void
164 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
165 _writegsbase_u32 (unsigned int __B)
167 __builtin_ia32_wrgsbase32 (__B);
170 extern __inline void
171 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
172 _writegsbase_u64 (unsigned long long __B)
174 __builtin_ia32_wrgsbase64 (__B);
176 #ifdef __DISABLE_FSGSBASE__
177 #undef __DISABLE_FSGSBASE__
178 #pragma GCC pop_options
179 #endif /* __DISABLE_FSGSBASE__ */
181 #ifndef __RDRND__
182 #pragma GCC push_options
183 #pragma GCC target("rdrnd")
184 #define __DISABLE_RDRND__
185 #endif /* __RDRND__ */
186 extern __inline int
187 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
188 _rdrand64_step (unsigned long long *__P)
190 return __builtin_ia32_rdrand64_step (__P);
192 #ifdef __DISABLE_RDRND__
193 #undef __DISABLE_RDRND__
194 #pragma GCC pop_options
195 #endif /* __DISABLE_RDRND__ */
197 #endif /* __x86_64__ */
199 #endif /* _IMMINTRIN_H_INCLUDED */