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)
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 <shaintrin.h>
73 #include <lzcntintrin.h>
75 #include <bmiintrin.h>
77 #include <bmi2intrin.h>
79 #include <fmaintrin.h>
81 #include <f16cintrin.h>
83 #include <rtmintrin.h>
85 #include <xtestintrin.h>
88 #pragma GCC push_options
89 #pragma GCC target("rdrnd")
90 #define __DISABLE_RDRND__
91 #endif /* __RDRND__ */
93 __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
94 _rdrand16_step (unsigned short *__P
)
96 return __builtin_ia32_rdrand16_step (__P
);
100 __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
101 _rdrand32_step (unsigned int *__P
)
103 return __builtin_ia32_rdrand32_step (__P
);
105 #ifdef __DISABLE_RDRND__
106 #undef __DISABLE_RDRND__
107 #pragma GCC pop_options
108 #endif /* __DISABLE_RDRND__ */
113 #pragma GCC push_options
114 #pragma GCC target("fsgsbase")
115 #define __DISABLE_FSGSBASE__
116 #endif /* __FSGSBASE__ */
117 extern __inline
unsigned int
118 __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
119 _readfsbase_u32 (void)
121 return __builtin_ia32_rdfsbase32 ();
124 extern __inline
unsigned long long
125 __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
126 _readfsbase_u64 (void)
128 return __builtin_ia32_rdfsbase64 ();
131 extern __inline
unsigned int
132 __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
133 _readgsbase_u32 (void)
135 return __builtin_ia32_rdgsbase32 ();
138 extern __inline
unsigned long long
139 __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
140 _readgsbase_u64 (void)
142 return __builtin_ia32_rdgsbase64 ();
146 __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
147 _writefsbase_u32 (unsigned int __B
)
149 __builtin_ia32_wrfsbase32 (__B
);
153 __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
154 _writefsbase_u64 (unsigned long long __B
)
156 __builtin_ia32_wrfsbase64 (__B
);
160 __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
161 _writegsbase_u32 (unsigned int __B
)
163 __builtin_ia32_wrgsbase32 (__B
);
167 __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
168 _writegsbase_u64 (unsigned long long __B
)
170 __builtin_ia32_wrgsbase64 (__B
);
172 #ifdef __DISABLE_FSGSBASE__
173 #undef __DISABLE_FSGSBASE__
174 #pragma GCC pop_options
175 #endif /* __DISABLE_FSGSBASE__ */
178 #pragma GCC push_options
179 #pragma GCC target("rdrnd")
180 #define __DISABLE_RDRND__
181 #endif /* __RDRND__ */
183 __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
184 _rdrand64_step (unsigned long long *__P
)
186 return __builtin_ia32_rdrand64_step (__P
);
188 #ifdef __DISABLE_RDRND__
189 #undef __DISABLE_RDRND__
190 #pragma GCC pop_options
191 #endif /* __DISABLE_RDRND__ */
193 #endif /* __x86_64__ */
195 #endif /* _IMMINTRIN_H_INCLUDED */