avx512vbmivlintrin.h 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. /* Copyright (C) 2013-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. #error "Never use <avx512vbmivlintrin.h> directly; include <immintrin.h> instead."
  20. #endif
  21. #ifndef _AVX512VBMIVLINTRIN_H_INCLUDED
  22. #define _AVX512VBMIVLINTRIN_H_INCLUDED
  23. #if !defined(__AVX512VL__) || !defined(__AVX512VBMI__)
  24. #pragma GCC push_options
  25. #pragma GCC target("avx512vbmi,avx512vl")
  26. #define __DISABLE_AVX512VBMIVL__
  27. #endif /* __AVX512VBMIVL__ */
  28. extern __inline __m256i
  29. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  30. _mm256_mask_multishift_epi64_epi8 (__m256i __W, __mmask32 __M, __m256i __X, __m256i __Y)
  31. {
  32. return (__m256i) __builtin_ia32_vpmultishiftqb256_mask ((__v32qi) __X,
  33. (__v32qi) __Y,
  34. (__v32qi) __W,
  35. (__mmask32) __M);
  36. }
  37. extern __inline __m256i
  38. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  39. _mm256_maskz_multishift_epi64_epi8 (__mmask32 __M, __m256i __X, __m256i __Y)
  40. {
  41. return (__m256i) __builtin_ia32_vpmultishiftqb256_mask ((__v32qi) __X,
  42. (__v32qi) __Y,
  43. (__v32qi)
  44. _mm256_setzero_si256 (),
  45. (__mmask32) __M);
  46. }
  47. extern __inline __m256i
  48. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  49. _mm256_multishift_epi64_epi8 (__m256i __X, __m256i __Y)
  50. {
  51. return (__m256i) __builtin_ia32_vpmultishiftqb256_mask ((__v32qi) __X,
  52. (__v32qi) __Y,
  53. (__v32qi)
  54. _mm256_undefined_si256 (),
  55. (__mmask32) -1);
  56. }
  57. extern __inline __m128i
  58. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  59. _mm_mask_multishift_epi64_epi8 (__m128i __W, __mmask16 __M, __m128i __X, __m128i __Y)
  60. {
  61. return (__m128i) __builtin_ia32_vpmultishiftqb128_mask ((__v16qi) __X,
  62. (__v16qi) __Y,
  63. (__v16qi) __W,
  64. (__mmask16) __M);
  65. }
  66. extern __inline __m128i
  67. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  68. _mm_maskz_multishift_epi64_epi8 (__mmask16 __M, __m128i __X, __m128i __Y)
  69. {
  70. return (__m128i) __builtin_ia32_vpmultishiftqb128_mask ((__v16qi) __X,
  71. (__v16qi) __Y,
  72. (__v16qi)
  73. _mm_setzero_si128 (),
  74. (__mmask16) __M);
  75. }
  76. extern __inline __m128i
  77. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  78. _mm_multishift_epi64_epi8 (__m128i __X, __m128i __Y)
  79. {
  80. return (__m128i) __builtin_ia32_vpmultishiftqb128_mask ((__v16qi) __X,
  81. (__v16qi) __Y,
  82. (__v16qi)
  83. _mm_undefined_si128 (),
  84. (__mmask16) -1);
  85. }
  86. extern __inline __m256i
  87. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  88. _mm256_permutexvar_epi8 (__m256i __A, __m256i __B)
  89. {
  90. return (__m256i) __builtin_ia32_permvarqi256_mask ((__v32qi) __B,
  91. (__v32qi) __A,
  92. (__v32qi)
  93. _mm256_undefined_si256 (),
  94. (__mmask32) -1);
  95. }
  96. extern __inline __m256i
  97. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  98. _mm256_maskz_permutexvar_epi8 (__mmask32 __M, __m256i __A,
  99. __m256i __B)
  100. {
  101. return (__m256i) __builtin_ia32_permvarqi256_mask ((__v32qi) __B,
  102. (__v32qi) __A,
  103. (__v32qi)
  104. _mm256_setzero_si256 (),
  105. (__mmask32) __M);
  106. }
  107. extern __inline __m256i
  108. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  109. _mm256_mask_permutexvar_epi8 (__m256i __W, __mmask32 __M, __m256i __A,
  110. __m256i __B)
  111. {
  112. return (__m256i) __builtin_ia32_permvarqi256_mask ((__v32qi) __B,
  113. (__v32qi) __A,
  114. (__v32qi) __W,
  115. (__mmask32) __M);
  116. }
  117. extern __inline __m128i
  118. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  119. _mm_permutexvar_epi8 (__m128i __A, __m128i __B)
  120. {
  121. return (__m128i) __builtin_ia32_permvarqi128_mask ((__v16qi) __B,
  122. (__v16qi) __A,
  123. (__v16qi)
  124. _mm_undefined_si128 (),
  125. (__mmask16) -1);
  126. }
  127. extern __inline __m128i
  128. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  129. _mm_maskz_permutexvar_epi8 (__mmask16 __M, __m128i __A, __m128i __B)
  130. {
  131. return (__m128i) __builtin_ia32_permvarqi128_mask ((__v16qi) __B,
  132. (__v16qi) __A,
  133. (__v16qi)
  134. _mm_setzero_si128 (),
  135. (__mmask16) __M);
  136. }
  137. extern __inline __m128i
  138. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  139. _mm_mask_permutexvar_epi8 (__m128i __W, __mmask16 __M, __m128i __A,
  140. __m128i __B)
  141. {
  142. return (__m128i) __builtin_ia32_permvarqi128_mask ((__v16qi) __B,
  143. (__v16qi) __A,
  144. (__v16qi) __W,
  145. (__mmask16) __M);
  146. }
  147. extern __inline __m256i
  148. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  149. _mm256_permutex2var_epi8 (__m256i __A, __m256i __I, __m256i __B)
  150. {
  151. return (__m256i) __builtin_ia32_vpermt2varqi256_mask ((__v32qi) __I
  152. /* idx */ ,
  153. (__v32qi) __A,
  154. (__v32qi) __B,
  155. (__mmask32) -1);
  156. }
  157. extern __inline __m256i
  158. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  159. _mm256_mask_permutex2var_epi8 (__m256i __A, __mmask32 __U,
  160. __m256i __I, __m256i __B)
  161. {
  162. return (__m256i) __builtin_ia32_vpermt2varqi256_mask ((__v32qi) __I
  163. /* idx */ ,
  164. (__v32qi) __A,
  165. (__v32qi) __B,
  166. (__mmask32)
  167. __U);
  168. }
  169. extern __inline __m256i
  170. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  171. _mm256_mask2_permutex2var_epi8 (__m256i __A, __m256i __I,
  172. __mmask32 __U, __m256i __B)
  173. {
  174. return (__m256i) __builtin_ia32_vpermi2varqi256_mask ((__v32qi) __A,
  175. (__v32qi) __I
  176. /* idx */ ,
  177. (__v32qi) __B,
  178. (__mmask32)
  179. __U);
  180. }
  181. extern __inline __m256i
  182. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  183. _mm256_maskz_permutex2var_epi8 (__mmask32 __U, __m256i __A,
  184. __m256i __I, __m256i __B)
  185. {
  186. return (__m256i) __builtin_ia32_vpermt2varqi256_maskz ((__v32qi) __I
  187. /* idx */ ,
  188. (__v32qi) __A,
  189. (__v32qi) __B,
  190. (__mmask32)
  191. __U);
  192. }
  193. extern __inline __m128i
  194. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  195. _mm_permutex2var_epi8 (__m128i __A, __m128i __I, __m128i __B)
  196. {
  197. return (__m128i) __builtin_ia32_vpermt2varqi128_mask ((__v16qi) __I
  198. /* idx */ ,
  199. (__v16qi) __A,
  200. (__v16qi) __B,
  201. (__mmask16) -1);
  202. }
  203. extern __inline __m128i
  204. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  205. _mm_mask_permutex2var_epi8 (__m128i __A, __mmask16 __U, __m128i __I,
  206. __m128i __B)
  207. {
  208. return (__m128i) __builtin_ia32_vpermt2varqi128_mask ((__v16qi) __I
  209. /* idx */ ,
  210. (__v16qi) __A,
  211. (__v16qi) __B,
  212. (__mmask16)
  213. __U);
  214. }
  215. extern __inline __m128i
  216. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  217. _mm_mask2_permutex2var_epi8 (__m128i __A, __m128i __I, __mmask16 __U,
  218. __m128i __B)
  219. {
  220. return (__m128i) __builtin_ia32_vpermi2varqi128_mask ((__v16qi) __A,
  221. (__v16qi) __I
  222. /* idx */ ,
  223. (__v16qi) __B,
  224. (__mmask16)
  225. __U);
  226. }
  227. extern __inline __m128i
  228. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  229. _mm_maskz_permutex2var_epi8 (__mmask16 __U, __m128i __A, __m128i __I,
  230. __m128i __B)
  231. {
  232. return (__m128i) __builtin_ia32_vpermt2varqi128_maskz ((__v16qi) __I
  233. /* idx */ ,
  234. (__v16qi) __A,
  235. (__v16qi) __B,
  236. (__mmask16)
  237. __U);
  238. }
  239. #ifdef __DISABLE_AVX512VBMIVL__
  240. #undef __DISABLE_AVX512VBMIVL__
  241. #pragma GCC pop_options
  242. #endif /* __DISABLE_AVX512VBMIVL__ */
  243. #endif /* _AVX512VBMIVLINTRIN_H_INCLUDED */