immintrin.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. /* Copyright (C) 2008-2019 Free Software Foundation, Inc.
  2. This file is part of GCC.
  3. GCC is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation; either version 3, or (at your option)
  6. any later version.
  7. GCC is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. Under Section 7 of GPL version 3, you are granted additional
  12. permissions described in the GCC Runtime Library Exception, version
  13. 3.1, as published by the Free Software Foundation.
  14. You should have received a copy of the GNU General Public License and
  15. a copy of the GCC Runtime Library Exception along with this program;
  16. see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  17. <http://www.gnu.org/licenses/>. */
  18. #ifndef _IMMINTRIN_H_INCLUDED
  19. #define _IMMINTRIN_H_INCLUDED
  20. #include <mmintrin.h>
  21. #include <xmmintrin.h>
  22. #include <emmintrin.h>
  23. #include <pmmintrin.h>
  24. #include <tmmintrin.h>
  25. #include <smmintrin.h>
  26. #include <wmmintrin.h>
  27. #include <fxsrintrin.h>
  28. #include <xsaveintrin.h>
  29. #include <xsaveoptintrin.h>
  30. #include <xsavesintrin.h>
  31. #include <xsavecintrin.h>
  32. #include <avxintrin.h>
  33. #include <avx2intrin.h>
  34. #include <avx512fintrin.h>
  35. #include <avx512erintrin.h>
  36. #include <avx512pfintrin.h>
  37. #include <avx512cdintrin.h>
  38. #include <avx512vlintrin.h>
  39. #include <avx512bwintrin.h>
  40. #include <avx512dqintrin.h>
  41. #include <avx512vlbwintrin.h>
  42. #include <avx512vldqintrin.h>
  43. #include <avx512ifmaintrin.h>
  44. #include <avx512ifmavlintrin.h>
  45. #include <avx512vbmiintrin.h>
  46. #include <avx512vbmivlintrin.h>
  47. #include <avx5124fmapsintrin.h>
  48. #include <avx5124vnniwintrin.h>
  49. #include <avx512vpopcntdqintrin.h>
  50. #include <avx512vbmi2intrin.h>
  51. #include <avx512vbmi2vlintrin.h>
  52. #include <avx512vnniintrin.h>
  53. #include <avx512vnnivlintrin.h>
  54. #include <avx512vpopcntdqvlintrin.h>
  55. #include <avx512bitalgintrin.h>
  56. #include <shaintrin.h>
  57. #include <lzcntintrin.h>
  58. #include <bmiintrin.h>
  59. #include <bmi2intrin.h>
  60. #include <fmaintrin.h>
  61. #include <f16cintrin.h>
  62. #include <rtmintrin.h>
  63. #include <xtestintrin.h>
  64. #include <cetintrin.h>
  65. #include <gfniintrin.h>
  66. #include <vaesintrin.h>
  67. #include <vpclmulqdqintrin.h>
  68. #include <movdirintrin.h>
  69. #include <sgxintrin.h>
  70. #include <pconfigintrin.h>
  71. #include <waitpkgintrin.h>
  72. #include <cldemoteintrin.h>
  73. #include <rdseedintrin.h>
  74. #include <prfchwintrin.h>
  75. #include <adxintrin.h>
  76. #include <clwbintrin.h>
  77. #include <clflushoptintrin.h>
  78. #include <wbnoinvdintrin.h>
  79. #include <pkuintrin.h>
  80. extern __inline void
  81. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  82. _wbinvd (void)
  83. {
  84. __builtin_ia32_wbinvd ();
  85. }
  86. #ifndef __RDRND__
  87. #pragma GCC push_options
  88. #pragma GCC target("rdrnd")
  89. #define __DISABLE_RDRND__
  90. #endif /* __RDRND__ */
  91. extern __inline int
  92. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  93. _rdrand16_step (unsigned short *__P)
  94. {
  95. return __builtin_ia32_rdrand16_step (__P);
  96. }
  97. extern __inline int
  98. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  99. _rdrand32_step (unsigned int *__P)
  100. {
  101. return __builtin_ia32_rdrand32_step (__P);
  102. }
  103. #ifdef __DISABLE_RDRND__
  104. #undef __DISABLE_RDRND__
  105. #pragma GCC pop_options
  106. #endif /* __DISABLE_RDRND__ */
  107. #ifndef __RDPID__
  108. #pragma GCC push_options
  109. #pragma GCC target("rdpid")
  110. #define __DISABLE_RDPID__
  111. #endif /* __RDPID__ */
  112. extern __inline unsigned int
  113. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  114. _rdpid_u32 (void)
  115. {
  116. return __builtin_ia32_rdpid ();
  117. }
  118. #ifdef __DISABLE_RDPID__
  119. #undef __DISABLE_RDPID__
  120. #pragma GCC pop_options
  121. #endif /* __DISABLE_RDPID__ */
  122. #ifdef __x86_64__
  123. #ifndef __FSGSBASE__
  124. #pragma GCC push_options
  125. #pragma GCC target("fsgsbase")
  126. #define __DISABLE_FSGSBASE__
  127. #endif /* __FSGSBASE__ */
  128. extern __inline unsigned int
  129. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  130. _readfsbase_u32 (void)
  131. {
  132. return __builtin_ia32_rdfsbase32 ();
  133. }
  134. extern __inline unsigned long long
  135. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  136. _readfsbase_u64 (void)
  137. {
  138. return __builtin_ia32_rdfsbase64 ();
  139. }
  140. extern __inline unsigned int
  141. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  142. _readgsbase_u32 (void)
  143. {
  144. return __builtin_ia32_rdgsbase32 ();
  145. }
  146. extern __inline unsigned long long
  147. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  148. _readgsbase_u64 (void)
  149. {
  150. return __builtin_ia32_rdgsbase64 ();
  151. }
  152. extern __inline void
  153. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  154. _writefsbase_u32 (unsigned int __B)
  155. {
  156. __builtin_ia32_wrfsbase32 (__B);
  157. }
  158. extern __inline void
  159. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  160. _writefsbase_u64 (unsigned long long __B)
  161. {
  162. __builtin_ia32_wrfsbase64 (__B);
  163. }
  164. extern __inline void
  165. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  166. _writegsbase_u32 (unsigned int __B)
  167. {
  168. __builtin_ia32_wrgsbase32 (__B);
  169. }
  170. extern __inline void
  171. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  172. _writegsbase_u64 (unsigned long long __B)
  173. {
  174. __builtin_ia32_wrgsbase64 (__B);
  175. }
  176. #ifdef __DISABLE_FSGSBASE__
  177. #undef __DISABLE_FSGSBASE__
  178. #pragma GCC pop_options
  179. #endif /* __DISABLE_FSGSBASE__ */
  180. #ifndef __RDRND__
  181. #pragma GCC push_options
  182. #pragma GCC target("rdrnd")
  183. #define __DISABLE_RDRND__
  184. #endif /* __RDRND__ */
  185. extern __inline int
  186. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  187. _rdrand64_step (unsigned long long *__P)
  188. {
  189. return __builtin_ia32_rdrand64_step (__P);
  190. }
  191. #ifdef __DISABLE_RDRND__
  192. #undef __DISABLE_RDRND__
  193. #pragma GCC pop_options
  194. #endif /* __DISABLE_RDRND__ */
  195. #endif /* __x86_64__ */
  196. #ifndef __PTWRITE__
  197. #pragma GCC push_options
  198. #pragma GCC target("ptwrite")
  199. #define __DISABLE_PTWRITE__
  200. #endif
  201. #ifdef __x86_64__
  202. extern __inline void
  203. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  204. _ptwrite64 (unsigned long long __B)
  205. {
  206. __builtin_ia32_ptwrite64 (__B);
  207. }
  208. #endif /* __x86_64__ */
  209. extern __inline void
  210. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  211. _ptwrite32 (unsigned __B)
  212. {
  213. __builtin_ia32_ptwrite32 (__B);
  214. }
  215. #ifdef __DISABLE_PTWRITE__
  216. #undef __DISABLE_PTWRITE__
  217. #pragma GCC pop_options
  218. #endif /* __DISABLE_PTWRITE__ */
  219. #endif /* _IMMINTRIN_H_INCLUDED */