1 /* Copyright (C) 2008-2020 Free Software Foundation, Inc. 2 3 This file is part of GCC. 4 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. 9 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. 14 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. 18 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/>. */ 23 24 #ifndef _IMMINTRIN_H_INCLUDED 25 #define _IMMINTRIN_H_INCLUDED 26 27 #include <mmintrin.h> 28 29 #include <xmmintrin.h> 30 31 #include <emmintrin.h> 32 33 #include <pmmintrin.h> 34 35 #include <tmmintrin.h> 36 37 #include <smmintrin.h> 38 39 #include <wmmintrin.h> 40 41 #include <fxsrintrin.h> 42 43 #include <xsaveintrin.h> 44 45 #include <xsaveoptintrin.h> 46 47 #include <xsavesintrin.h> 48 49 #include <xsavecintrin.h> 50 51 #include <avxintrin.h> 52 53 #include <avx2intrin.h> 54 55 #include <avx512fintrin.h> 56 57 #include <avx512erintrin.h> 58 59 #include <avx512pfintrin.h> 60 61 #include <avx512cdintrin.h> 62 63 #include <avx512vlintrin.h> 64 65 #include <avx512bwintrin.h> 66 67 #include <avx512dqintrin.h> 68 69 #include <avx512vlbwintrin.h> 70 71 #include <avx512vldqintrin.h> 72 73 #include <avx512ifmaintrin.h> 74 75 #include <avx512ifmavlintrin.h> 76 77 #include <avx512vbmiintrin.h> 78 79 #include <avx512vbmivlintrin.h> 80 81 #include <avx5124fmapsintrin.h> 82 83 #include <avx5124vnniwintrin.h> 84 85 #include <avx512vpopcntdqintrin.h> 86 87 #include <avx512vbmi2intrin.h> 88 89 #include <avx512vbmi2vlintrin.h> 90 91 #include <avx512vnniintrin.h> 92 93 #include <avx512vnnivlintrin.h> 94 95 #include <avx512vpopcntdqvlintrin.h> 96 97 #include <avx512bitalgintrin.h> 98 99 #include <avx512vp2intersectintrin.h> 100 101 #include <avx512vp2intersectvlintrin.h> 102 103 #include <shaintrin.h> 104 105 #include <lzcntintrin.h> 106 107 #include <bmiintrin.h> 108 109 #include <bmi2intrin.h> 110 111 #include <fmaintrin.h> 112 113 #include <f16cintrin.h> 114 115 #include <rtmintrin.h> 116 117 #include <xtestintrin.h> 118 119 #include <cetintrin.h> 120 121 #include <gfniintrin.h> 122 123 #include <vaesintrin.h> 124 125 #include <vpclmulqdqintrin.h> 126 127 #include <movdirintrin.h> 128 129 #include <sgxintrin.h> 130 131 #include <pconfigintrin.h> 132 133 #include <waitpkgintrin.h> 134 135 #include <cldemoteintrin.h> 136 137 #include <avx512bf16vlintrin.h> 138 139 #include <avx512bf16intrin.h> 140 141 #include <enqcmdintrin.h> 142 143 #include <rdseedintrin.h> 144 145 #include <prfchwintrin.h> 146 147 #include <adxintrin.h> 148 149 #include <clwbintrin.h> 150 151 #include <clflushoptintrin.h> 152 153 #include <wbnoinvdintrin.h> 154 155 #include <pkuintrin.h> 156 157 extern __inline void 158 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) 159 _wbinvd (void) 160 { 161 __builtin_ia32_wbinvd (); 162 } 163 164 #ifndef __RDRND__ 165 #pragma GCC push_options 166 #pragma GCC target("rdrnd") 167 #define __DISABLE_RDRND__ 168 #endif /* __RDRND__ */ 169 extern __inline int 170 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) 171 _rdrand16_step (unsigned short *__P) 172 { 173 return __builtin_ia32_rdrand16_step (__P); 174 } 175 176 extern __inline int 177 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) 178 _rdrand32_step (unsigned int *__P) 179 { 180 return __builtin_ia32_rdrand32_step (__P); 181 } 182 #ifdef __DISABLE_RDRND__ 183 #undef __DISABLE_RDRND__ 184 #pragma GCC pop_options 185 #endif /* __DISABLE_RDRND__ */ 186 187 #ifndef __RDPID__ 188 #pragma GCC push_options 189 #pragma GCC target("rdpid") 190 #define __DISABLE_RDPID__ 191 #endif /* __RDPID__ */ 192 extern __inline unsigned int 193 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) 194 _rdpid_u32 (void) 195 { 196 return __builtin_ia32_rdpid (); 197 } 198 #ifdef __DISABLE_RDPID__ 199 #undef __DISABLE_RDPID__ 200 #pragma GCC pop_options 201 #endif /* __DISABLE_RDPID__ */ 202 203 #ifdef __x86_64__ 204 205 #ifndef __FSGSBASE__ 206 #pragma GCC push_options 207 #pragma GCC target("fsgsbase") 208 #define __DISABLE_FSGSBASE__ 209 #endif /* __FSGSBASE__ */ 210 extern __inline unsigned int 211 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) 212 _readfsbase_u32 (void) 213 { 214 return __builtin_ia32_rdfsbase32 (); 215 } 216 217 extern __inline unsigned long long 218 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) 219 _readfsbase_u64 (void) 220 { 221 return __builtin_ia32_rdfsbase64 (); 222 } 223 224 extern __inline unsigned int 225 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) 226 _readgsbase_u32 (void) 227 { 228 return __builtin_ia32_rdgsbase32 (); 229 } 230 231 extern __inline unsigned long long 232 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) 233 _readgsbase_u64 (void) 234 { 235 return __builtin_ia32_rdgsbase64 (); 236 } 237 238 extern __inline void 239 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) 240 _writefsbase_u32 (unsigned int __B) 241 { 242 __builtin_ia32_wrfsbase32 (__B); 243 } 244 245 extern __inline void 246 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) 247 _writefsbase_u64 (unsigned long long __B) 248 { 249 __builtin_ia32_wrfsbase64 (__B); 250 } 251 252 extern __inline void 253 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) 254 _writegsbase_u32 (unsigned int __B) 255 { 256 __builtin_ia32_wrgsbase32 (__B); 257 } 258 259 extern __inline void 260 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) 261 _writegsbase_u64 (unsigned long long __B) 262 { 263 __builtin_ia32_wrgsbase64 (__B); 264 } 265 #ifdef __DISABLE_FSGSBASE__ 266 #undef __DISABLE_FSGSBASE__ 267 #pragma GCC pop_options 268 #endif /* __DISABLE_FSGSBASE__ */ 269 270 #ifndef __RDRND__ 271 #pragma GCC push_options 272 #pragma GCC target("rdrnd") 273 #define __DISABLE_RDRND__ 274 #endif /* __RDRND__ */ 275 extern __inline int 276 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) 277 _rdrand64_step (unsigned long long *__P) 278 { 279 return __builtin_ia32_rdrand64_step (__P); 280 } 281 #ifdef __DISABLE_RDRND__ 282 #undef __DISABLE_RDRND__ 283 #pragma GCC pop_options 284 #endif /* __DISABLE_RDRND__ */ 285 286 #endif /* __x86_64__ */ 287 288 #ifndef __PTWRITE__ 289 #pragma GCC push_options 290 #pragma GCC target("ptwrite") 291 #define __DISABLE_PTWRITE__ 292 #endif 293 294 #ifdef __x86_64__ 295 extern __inline void 296 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) 297 _ptwrite64 (unsigned long long __B) 298 { 299 __builtin_ia32_ptwrite64 (__B); 300 } 301 #endif /* __x86_64__ */ 302 303 extern __inline void 304 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) 305 _ptwrite32 (unsigned __B) 306 { 307 __builtin_ia32_ptwrite32 (__B); 308 } 309 #ifdef __DISABLE_PTWRITE__ 310 #undef __DISABLE_PTWRITE__ 311 #pragma GCC pop_options 312 #endif /* __DISABLE_PTWRITE__ */ 313 314 #endif /* _IMMINTRIN_H_INCLUDED */ 315