Initial support for AVX-512{VL,BW,DQ}
[official-gcc.git] / gcc / config / i386 / immintrin.h
blob5d921822248a180607843435f78a388eddfd1519
1 /* Copyright (C) 2008-2014 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 <shaintrin.h>
65 #include <lzcntintrin.h>
67 #include <bmiintrin.h>
69 #include <bmi2intrin.h>
71 #include <fmaintrin.h>
73 #include <f16cintrin.h>
75 #include <rtmintrin.h>
77 #include <xtestintrin.h>
79 #ifndef __RDRND__
80 #pragma GCC push_options
81 #pragma GCC target("rdrnd")
82 #define __DISABLE_RDRND__
83 #endif /* __RDRND__ */
84 extern __inline int
85 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
86 _rdrand16_step (unsigned short *__P)
88 return __builtin_ia32_rdrand16_step (__P);
91 extern __inline int
92 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
93 _rdrand32_step (unsigned int *__P)
95 return __builtin_ia32_rdrand32_step (__P);
97 #ifdef __DISABLE_RDRND__
98 #undef __DISABLE_RDRND__
99 #pragma GCC pop_options
100 #endif /* __DISABLE_RDRND__ */
102 #ifdef __x86_64__
104 #ifndef __FSGSBASE__
105 #pragma GCC push_options
106 #pragma GCC target("fsgsbase")
107 #define __DISABLE_FSGSBASE__
108 #endif /* __FSGSBASE__ */
109 extern __inline unsigned int
110 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
111 _readfsbase_u32 (void)
113 return __builtin_ia32_rdfsbase32 ();
116 extern __inline unsigned long long
117 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
118 _readfsbase_u64 (void)
120 return __builtin_ia32_rdfsbase64 ();
123 extern __inline unsigned int
124 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
125 _readgsbase_u32 (void)
127 return __builtin_ia32_rdgsbase32 ();
130 extern __inline unsigned long long
131 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
132 _readgsbase_u64 (void)
134 return __builtin_ia32_rdgsbase64 ();
137 extern __inline void
138 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
139 _writefsbase_u32 (unsigned int __B)
141 __builtin_ia32_wrfsbase32 (__B);
144 extern __inline void
145 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
146 _writefsbase_u64 (unsigned long long __B)
148 __builtin_ia32_wrfsbase64 (__B);
151 extern __inline void
152 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
153 _writegsbase_u32 (unsigned int __B)
155 __builtin_ia32_wrgsbase32 (__B);
158 extern __inline void
159 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
160 _writegsbase_u64 (unsigned long long __B)
162 __builtin_ia32_wrgsbase64 (__B);
164 #ifdef __DISABLE_FSGSBASE__
165 #undef __DISABLE_FSGSBASE__
166 #pragma GCC pop_options
167 #endif /* __DISABLE_FSGSBASE__ */
169 #ifndef __RDRND__
170 #pragma GCC push_options
171 #pragma GCC target("rdrnd")
172 #define __DISABLE_RDRND__
173 #endif /* __RDRND__ */
174 extern __inline int
175 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
176 _rdrand64_step (unsigned long long *__P)
178 return __builtin_ia32_rdrand64_step (__P);
180 #ifdef __DISABLE_RDRND__
181 #undef __DISABLE_RDRND__
182 #pragma GCC pop_options
183 #endif /* __DISABLE_RDRND__ */
185 #endif /* __x86_64__ */
187 #endif /* _IMMINTRIN_H_INCLUDED */