1 /* Copyright (C) 2008-2018 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 <avxintrin.h> 42 43 #include <avx2intrin.h> 44 45 #include <avx512fintrin.h> 46 47 #include <avx512erintrin.h> 48 49 #include <avx512pfintrin.h> 50 51 #include <avx512cdintrin.h> 52 53 #include <avx512vlintrin.h> 54 55 #include <avx512bwintrin.h> 56 57 #include <avx512dqintrin.h> 58 59 #include <avx512vlbwintrin.h> 60 61 #include <avx512vldqintrin.h> 62 63 #include <avx512ifmaintrin.h> 64 65 #include <avx512ifmavlintrin.h> 66 67 #include <avx512vbmiintrin.h> 68 69 #include <avx512vbmivlintrin.h> 70 71 #include <avx5124fmapsintrin.h> 72 73 #include <avx5124vnniwintrin.h> 74 75 #include <avx512vpopcntdqintrin.h> 76 77 #include <avx512vbmi2intrin.h> 78 79 #include <avx512vbmi2vlintrin.h> 80 81 #include <avx512vnniintrin.h> 82 83 #include <avx512vnnivlintrin.h> 84 85 #include <avx512vpopcntdqvlintrin.h> 86 87 #include <avx512bitalgintrin.h> 88 89 #include <shaintrin.h> 90 91 #include <lzcntintrin.h> 92 93 #include <bmiintrin.h> 94 95 #include <bmi2intrin.h> 96 97 #include <fmaintrin.h> 98 99 #include <f16cintrin.h> 100 101 #include <rtmintrin.h> 102 103 #include <xtestintrin.h> 104 105 #include <cetintrin.h> 106 107 #include <gfniintrin.h> 108 109 #include <vaesintrin.h> 110 111 #include <vpclmulqdqintrin.h> 112 113 #include <movdirintrin.h> 114 115 extern __inline void 116 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) 117 _wbinvd (void) 118 { 119 __builtin_ia32_wbinvd (); 120 } 121 122 #ifndef __RDRND__ 123 #pragma GCC push_options 124 #pragma GCC target("rdrnd") 125 #define __DISABLE_RDRND__ 126 #endif /* __RDRND__ */ 127 extern __inline int 128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) 129 _rdrand16_step (unsigned short *__P) 130 { 131 return __builtin_ia32_rdrand16_step (__P); 132 } 133 134 extern __inline int 135 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) 136 _rdrand32_step (unsigned int *__P) 137 { 138 return __builtin_ia32_rdrand32_step (__P); 139 } 140 #ifdef __DISABLE_RDRND__ 141 #undef __DISABLE_RDRND__ 142 #pragma GCC pop_options 143 #endif /* __DISABLE_RDRND__ */ 144 145 #ifndef __RDPID__ 146 #pragma GCC push_options 147 #pragma GCC target("rdpid") 148 #define __DISABLE_RDPID__ 149 #endif /* __RDPID__ */ 150 extern __inline unsigned int 151 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) 152 _rdpid_u32 (void) 153 { 154 return __builtin_ia32_rdpid (); 155 } 156 #ifdef __DISABLE_RDPID__ 157 #undef __DISABLE_RDPID__ 158 #pragma GCC pop_options 159 #endif /* __DISABLE_RDPID__ */ 160 161 #ifdef __x86_64__ 162 163 #ifndef __FSGSBASE__ 164 #pragma GCC push_options 165 #pragma GCC target("fsgsbase") 166 #define __DISABLE_FSGSBASE__ 167 #endif /* __FSGSBASE__ */ 168 extern __inline unsigned int 169 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) 170 _readfsbase_u32 (void) 171 { 172 return __builtin_ia32_rdfsbase32 (); 173 } 174 175 extern __inline unsigned long long 176 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) 177 _readfsbase_u64 (void) 178 { 179 return __builtin_ia32_rdfsbase64 (); 180 } 181 182 extern __inline unsigned int 183 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) 184 _readgsbase_u32 (void) 185 { 186 return __builtin_ia32_rdgsbase32 (); 187 } 188 189 extern __inline unsigned long long 190 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) 191 _readgsbase_u64 (void) 192 { 193 return __builtin_ia32_rdgsbase64 (); 194 } 195 196 extern __inline void 197 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) 198 _writefsbase_u32 (unsigned int __B) 199 { 200 __builtin_ia32_wrfsbase32 (__B); 201 } 202 203 extern __inline void 204 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) 205 _writefsbase_u64 (unsigned long long __B) 206 { 207 __builtin_ia32_wrfsbase64 (__B); 208 } 209 210 extern __inline void 211 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) 212 _writegsbase_u32 (unsigned int __B) 213 { 214 __builtin_ia32_wrgsbase32 (__B); 215 } 216 217 extern __inline void 218 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) 219 _writegsbase_u64 (unsigned long long __B) 220 { 221 __builtin_ia32_wrgsbase64 (__B); 222 } 223 #ifdef __DISABLE_FSGSBASE__ 224 #undef __DISABLE_FSGSBASE__ 225 #pragma GCC pop_options 226 #endif /* __DISABLE_FSGSBASE__ */ 227 228 #ifndef __RDRND__ 229 #pragma GCC push_options 230 #pragma GCC target("rdrnd") 231 #define __DISABLE_RDRND__ 232 #endif /* __RDRND__ */ 233 extern __inline int 234 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) 235 _rdrand64_step (unsigned long long *__P) 236 { 237 return __builtin_ia32_rdrand64_step (__P); 238 } 239 #ifdef __DISABLE_RDRND__ 240 #undef __DISABLE_RDRND__ 241 #pragma GCC pop_options 242 #endif /* __DISABLE_RDRND__ */ 243 244 #endif /* __x86_64__ */ 245 246 #endif /* _IMMINTRIN_H_INCLUDED */ 247