* x86-tune-sched.c (ix86_adjust_cost): Fix Zen support.
[official-gcc.git] / gcc / config / i386 / immintrin.h
blobb52f58efa405d9e6ab407e350bbfc7a602583b77
1 /* Copyright (C) 2008-2017 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 <avx512vpopcntdqintrin.h>
77 #include <shaintrin.h>
79 #include <lzcntintrin.h>
81 #include <bmiintrin.h>
83 #include <bmi2intrin.h>
85 #include <fmaintrin.h>
87 #include <f16cintrin.h>
89 #include <rtmintrin.h>
91 #include <xtestintrin.h>
93 #ifndef __RDRND__
94 #pragma GCC push_options
95 #pragma GCC target("rdrnd")
96 #define __DISABLE_RDRND__
97 #endif /* __RDRND__ */
98 extern __inline int
99 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
100 _rdrand16_step (unsigned short *__P)
102 return __builtin_ia32_rdrand16_step (__P);
105 extern __inline int
106 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
107 _rdrand32_step (unsigned int *__P)
109 return __builtin_ia32_rdrand32_step (__P);
111 #ifdef __DISABLE_RDRND__
112 #undef __DISABLE_RDRND__
113 #pragma GCC pop_options
114 #endif /* __DISABLE_RDRND__ */
116 #ifndef __RDPID__
117 #pragma GCC push_options
118 #pragma GCC target("rdpid")
119 #define __DISABLE_RDPID__
120 #endif /* __RDPID__ */
121 extern __inline unsigned int
122 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
123 _rdpid_u32 (void)
125 return __builtin_ia32_rdpid ();
127 #ifdef __DISABLE_RDPID__
128 #undef __DISABLE_RDPID__
129 #pragma GCC pop_options
130 #endif /* __DISABLE_RDPID__ */
132 #ifdef __x86_64__
134 #ifndef __FSGSBASE__
135 #pragma GCC push_options
136 #pragma GCC target("fsgsbase")
137 #define __DISABLE_FSGSBASE__
138 #endif /* __FSGSBASE__ */
139 extern __inline unsigned int
140 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
141 _readfsbase_u32 (void)
143 return __builtin_ia32_rdfsbase32 ();
146 extern __inline unsigned long long
147 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
148 _readfsbase_u64 (void)
150 return __builtin_ia32_rdfsbase64 ();
153 extern __inline unsigned int
154 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
155 _readgsbase_u32 (void)
157 return __builtin_ia32_rdgsbase32 ();
160 extern __inline unsigned long long
161 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
162 _readgsbase_u64 (void)
164 return __builtin_ia32_rdgsbase64 ();
167 extern __inline void
168 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
169 _writefsbase_u32 (unsigned int __B)
171 __builtin_ia32_wrfsbase32 (__B);
174 extern __inline void
175 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
176 _writefsbase_u64 (unsigned long long __B)
178 __builtin_ia32_wrfsbase64 (__B);
181 extern __inline void
182 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
183 _writegsbase_u32 (unsigned int __B)
185 __builtin_ia32_wrgsbase32 (__B);
188 extern __inline void
189 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
190 _writegsbase_u64 (unsigned long long __B)
192 __builtin_ia32_wrgsbase64 (__B);
194 #ifdef __DISABLE_FSGSBASE__
195 #undef __DISABLE_FSGSBASE__
196 #pragma GCC pop_options
197 #endif /* __DISABLE_FSGSBASE__ */
199 #ifndef __RDRND__
200 #pragma GCC push_options
201 #pragma GCC target("rdrnd")
202 #define __DISABLE_RDRND__
203 #endif /* __RDRND__ */
204 extern __inline int
205 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
206 _rdrand64_step (unsigned long long *__P)
208 return __builtin_ia32_rdrand64_step (__P);
210 #ifdef __DISABLE_RDRND__
211 #undef __DISABLE_RDRND__
212 #pragma GCC pop_options
213 #endif /* __DISABLE_RDRND__ */
215 #endif /* __x86_64__ */
217 #endif /* _IMMINTRIN_H_INCLUDED */