]>
git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/i386/x86gprintrin.h
1 /* Copyright (C) 2020-2021 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 _X86GPRINTRIN_H_INCLUDED
25 #define _X86GPRINTRIN_H_INCLUDED
27 #include <ia32intrin.h>
33 #include <adxintrin.h>
35 #include <bmiintrin.h>
37 #include <bmi2intrin.h>
39 #include <cetintrin.h>
41 #include <cldemoteintrin.h>
43 #include <clflushoptintrin.h>
45 #include <clwbintrin.h>
47 #include <clzerointrin.h>
49 #include <enqcmdintrin.h>
51 #include <fxsrintrin.h>
53 #include <lzcntintrin.h>
55 #include <lwpintrin.h>
57 #include <movdirintrin.h>
59 #include <mwaitxintrin.h>
61 #include <pconfigintrin.h>
63 #include <popcntintrin.h>
65 #include <pkuintrin.h>
67 #include <rdseedintrin.h>
69 #include <rtmintrin.h>
71 #include <serializeintrin.h>
73 #include <sgxintrin.h>
75 #include <tbmintrin.h>
77 #include <tsxldtrkintrin.h>
79 #include <uintrintrin.h>
81 #include <waitpkgintrin.h>
83 #include <wbnoinvdintrin.h>
85 #include <xsaveintrin.h>
87 #include <xsavecintrin.h>
89 #include <xsaveoptintrin.h>
91 #include <xsavesintrin.h>
93 #include <xtestintrin.h>
95 #include <hresetintrin.h>
98 __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
101 __builtin_ia32_wbinvd ();
105 #pragma GCC push_options
106 #pragma GCC target("rdrnd")
107 #define __DISABLE_RDRND__
108 #endif /* __RDRND__ */
110 __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
111 _rdrand16_step (unsigned short *__P
)
113 return __builtin_ia32_rdrand16_step (__P
);
117 __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
118 _rdrand32_step (unsigned int *__P
)
120 return __builtin_ia32_rdrand32_step (__P
);
122 #ifdef __DISABLE_RDRND__
123 #undef __DISABLE_RDRND__
124 #pragma GCC pop_options
125 #endif /* __DISABLE_RDRND__ */
128 #pragma GCC push_options
129 #pragma GCC target("rdpid")
130 #define __DISABLE_RDPID__
131 #endif /* __RDPID__ */
132 extern __inline
unsigned int
133 __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
136 return __builtin_ia32_rdpid ();
138 #ifdef __DISABLE_RDPID__
139 #undef __DISABLE_RDPID__
140 #pragma GCC pop_options
141 #endif /* __DISABLE_RDPID__ */
146 #pragma GCC push_options
147 #pragma GCC target("fsgsbase")
148 #define __DISABLE_FSGSBASE__
149 #endif /* __FSGSBASE__ */
150 extern __inline
unsigned int
151 __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
152 _readfsbase_u32 (void)
154 return __builtin_ia32_rdfsbase32 ();
157 extern __inline
unsigned long long
158 __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
159 _readfsbase_u64 (void)
161 return __builtin_ia32_rdfsbase64 ();
164 extern __inline
unsigned int
165 __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
166 _readgsbase_u32 (void)
168 return __builtin_ia32_rdgsbase32 ();
171 extern __inline
unsigned long long
172 __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
173 _readgsbase_u64 (void)
175 return __builtin_ia32_rdgsbase64 ();
179 __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
180 _writefsbase_u32 (unsigned int __B
)
182 __builtin_ia32_wrfsbase32 (__B
);
186 __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
187 _writefsbase_u64 (unsigned long long __B
)
189 __builtin_ia32_wrfsbase64 (__B
);
193 __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
194 _writegsbase_u32 (unsigned int __B
)
196 __builtin_ia32_wrgsbase32 (__B
);
200 __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
201 _writegsbase_u64 (unsigned long long __B
)
203 __builtin_ia32_wrgsbase64 (__B
);
205 #ifdef __DISABLE_FSGSBASE__
206 #undef __DISABLE_FSGSBASE__
207 #pragma GCC pop_options
208 #endif /* __DISABLE_FSGSBASE__ */
211 #pragma GCC push_options
212 #pragma GCC target("rdrnd")
213 #define __DISABLE_RDRND__
214 #endif /* __RDRND__ */
216 __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
217 _rdrand64_step (unsigned long long *__P
)
219 return __builtin_ia32_rdrand64_step (__P
);
221 #ifdef __DISABLE_RDRND__
222 #undef __DISABLE_RDRND__
223 #pragma GCC pop_options
224 #endif /* __DISABLE_RDRND__ */
226 #endif /* __x86_64__ */
229 #pragma GCC push_options
230 #pragma GCC target("ptwrite")
231 #define __DISABLE_PTWRITE__
236 __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
237 _ptwrite64 (unsigned long long __B
)
239 __builtin_ia32_ptwrite64 (__B
);
241 #endif /* __x86_64__ */
244 __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
245 _ptwrite32 (unsigned __B
)
247 __builtin_ia32_ptwrite32 (__B
);
249 #ifdef __DISABLE_PTWRITE__
250 #undef __DISABLE_PTWRITE__
251 #pragma GCC pop_options
252 #endif /* __DISABLE_PTWRITE__ */
254 #endif /* __iamcu__ */
256 #endif /* _X86GPRINTRIN_H_INCLUDED. */