avx512vbmi2intrin.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557
  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 <avx512vbmi2intrin.h> directly; include <immintrin.h> instead."
  20. #endif
  21. #ifndef __AVX512VBMI2INTRIN_H_INCLUDED
  22. #define __AVX512VBMI2INTRIN_H_INCLUDED
  23. #if !defined(__AVX512VBMI2__)
  24. #pragma GCC push_options
  25. #pragma GCC target("avx512vbmi2")
  26. #define __DISABLE_AVX512VBMI2__
  27. #endif /* __AVX512VBMI2__ */
  28. #ifdef __OPTIMIZE__
  29. extern __inline __m512i
  30. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  31. _mm512_shrdi_epi16 (__m512i __A, __m512i __B, int __C)
  32. {
  33. return (__m512i) __builtin_ia32_vpshrd_v32hi ((__v32hi)__A, (__v32hi) __B,
  34. __C);
  35. }
  36. extern __inline __m512i
  37. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  38. _mm512_shrdi_epi32 (__m512i __A, __m512i __B, int __C)
  39. {
  40. return (__m512i) __builtin_ia32_vpshrd_v16si ((__v16si)__A, (__v16si) __B,
  41. __C);
  42. }
  43. extern __inline __m512i
  44. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  45. _mm512_mask_shrdi_epi32 (__m512i __A, __mmask16 __B, __m512i __C, __m512i __D,
  46. int __E)
  47. {
  48. return (__m512i)__builtin_ia32_vpshrd_v16si_mask ((__v16si)__C,
  49. (__v16si) __D, __E, (__v16si) __A, (__mmask16)__B);
  50. }
  51. extern __inline __m512i
  52. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  53. _mm512_maskz_shrdi_epi32 (__mmask16 __A, __m512i __B, __m512i __C, int __D)
  54. {
  55. return (__m512i)__builtin_ia32_vpshrd_v16si_mask ((__v16si)__B,
  56. (__v16si) __C, __D, (__v16si) _mm512_setzero_si512 (), (__mmask16)__A);
  57. }
  58. extern __inline __m512i
  59. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  60. _mm512_shrdi_epi64 (__m512i __A, __m512i __B, int __C)
  61. {
  62. return (__m512i) __builtin_ia32_vpshrd_v8di ((__v8di)__A, (__v8di) __B, __C);
  63. }
  64. extern __inline __m512i
  65. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  66. _mm512_mask_shrdi_epi64 (__m512i __A, __mmask8 __B, __m512i __C, __m512i __D,
  67. int __E)
  68. {
  69. return (__m512i)__builtin_ia32_vpshrd_v8di_mask ((__v8di)__C, (__v8di) __D,
  70. __E, (__v8di) __A, (__mmask8)__B);
  71. }
  72. extern __inline __m512i
  73. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  74. _mm512_maskz_shrdi_epi64 (__mmask8 __A, __m512i __B, __m512i __C, int __D)
  75. {
  76. return (__m512i)__builtin_ia32_vpshrd_v8di_mask ((__v8di)__B, (__v8di) __C,
  77. __D, (__v8di) _mm512_setzero_si512 (), (__mmask8)__A);
  78. }
  79. extern __inline __m512i
  80. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  81. _mm512_shldi_epi16 (__m512i __A, __m512i __B, int __C)
  82. {
  83. return (__m512i) __builtin_ia32_vpshld_v32hi ((__v32hi)__A, (__v32hi) __B,
  84. __C);
  85. }
  86. extern __inline __m512i
  87. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  88. _mm512_shldi_epi32 (__m512i __A, __m512i __B, int __C)
  89. {
  90. return (__m512i) __builtin_ia32_vpshld_v16si ((__v16si)__A, (__v16si) __B,
  91. __C);
  92. }
  93. extern __inline __m512i
  94. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  95. _mm512_mask_shldi_epi32 (__m512i __A, __mmask16 __B, __m512i __C, __m512i __D,
  96. int __E)
  97. {
  98. return (__m512i)__builtin_ia32_vpshld_v16si_mask ((__v16si)__C,
  99. (__v16si) __D, __E, (__v16si) __A, (__mmask16)__B);
  100. }
  101. extern __inline __m512i
  102. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  103. _mm512_maskz_shldi_epi32 (__mmask16 __A, __m512i __B, __m512i __C, int __D)
  104. {
  105. return (__m512i)__builtin_ia32_vpshld_v16si_mask ((__v16si)__B,
  106. (__v16si) __C, __D, (__v16si) _mm512_setzero_si512 (), (__mmask16)__A);
  107. }
  108. extern __inline __m512i
  109. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  110. _mm512_shldi_epi64 (__m512i __A, __m512i __B, int __C)
  111. {
  112. return (__m512i) __builtin_ia32_vpshld_v8di ((__v8di)__A, (__v8di) __B, __C);
  113. }
  114. extern __inline __m512i
  115. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  116. _mm512_mask_shldi_epi64 (__m512i __A, __mmask8 __B, __m512i __C, __m512i __D,
  117. int __E)
  118. {
  119. return (__m512i)__builtin_ia32_vpshld_v8di_mask ((__v8di)__C, (__v8di) __D,
  120. __E, (__v8di) __A, (__mmask8)__B);
  121. }
  122. extern __inline __m512i
  123. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  124. _mm512_maskz_shldi_epi64 (__mmask8 __A, __m512i __B, __m512i __C, int __D)
  125. {
  126. return (__m512i)__builtin_ia32_vpshld_v8di_mask ((__v8di)__B, (__v8di) __C,
  127. __D, (__v8di) _mm512_setzero_si512 (), (__mmask8)__A);
  128. }
  129. #else
  130. #define _mm512_shrdi_epi16(A, B, C) \
  131. ((__m512i) __builtin_ia32_vpshrd_v32hi ((__v32hi)(__m512i)(A), \
  132. (__v32hi)(__m512i)(B),(int)(C)))
  133. #define _mm512_shrdi_epi32(A, B, C) \
  134. ((__m512i) __builtin_ia32_vpshrd_v16si ((__v16si)(__m512i)(A), \
  135. (__v16si)(__m512i)(B),(int)(C)))
  136. #define _mm512_mask_shrdi_epi32(A, B, C, D, E) \
  137. ((__m512i) __builtin_ia32_vpshrd_v16si_mask ((__v16si)(__m512i)(C), \
  138. (__v16si)(__m512i)(D), \
  139. (int)(E), \
  140. (__v16si)(__m512i)(A), \
  141. (__mmask16)(B)))
  142. #define _mm512_maskz_shrdi_epi32(A, B, C, D) \
  143. ((__m512i) \
  144. __builtin_ia32_vpshrd_v16si_mask ((__v16si)(__m512i)(B), \
  145. (__v16si)(__m512i)(C),(int)(D), \
  146. (__v16si)(__m512i)_mm512_setzero_si512 (), \
  147. (__mmask16)(A)))
  148. #define _mm512_shrdi_epi64(A, B, C) \
  149. ((__m512i) __builtin_ia32_vpshrd_v8di ((__v8di)(__m512i)(A), \
  150. (__v8di)(__m512i)(B),(int)(C)))
  151. #define _mm512_mask_shrdi_epi64(A, B, C, D, E) \
  152. ((__m512i) __builtin_ia32_vpshrd_v8di_mask ((__v8di)(__m512i)(C), \
  153. (__v8di)(__m512i)(D), (int)(E), \
  154. (__v8di)(__m512i)(A), \
  155. (__mmask8)(B)))
  156. #define _mm512_maskz_shrdi_epi64(A, B, C, D) \
  157. ((__m512i) \
  158. __builtin_ia32_vpshrd_v8di_mask ((__v8di)(__m512i)(B), \
  159. (__v8di)(__m512i)(C),(int)(D), \
  160. (__v8di)(__m512i)_mm512_setzero_si512 (), \
  161. (__mmask8)(A)))
  162. #define _mm512_shldi_epi16(A, B, C) \
  163. ((__m512i) __builtin_ia32_vpshld_v32hi ((__v32hi)(__m512i)(A), \
  164. (__v32hi)(__m512i)(B),(int)(C)))
  165. #define _mm512_shldi_epi32(A, B, C) \
  166. ((__m512i) __builtin_ia32_vpshld_v16si ((__v16si)(__m512i)(A), \
  167. (__v16si)(__m512i)(B),(int)(C)))
  168. #define _mm512_mask_shldi_epi32(A, B, C, D, E) \
  169. ((__m512i) __builtin_ia32_vpshld_v16si_mask ((__v16si)(__m512i)(C), \
  170. (__v16si)(__m512i)(D), \
  171. (int)(E), \
  172. (__v16si)(__m512i)(A), \
  173. (__mmask16)(B)))
  174. #define _mm512_maskz_shldi_epi32(A, B, C, D) \
  175. ((__m512i) \
  176. __builtin_ia32_vpshld_v16si_mask ((__v16si)(__m512i)(B), \
  177. (__v16si)(__m512i)(C),(int)(D), \
  178. (__v16si)(__m512i)_mm512_setzero_si512 (), \
  179. (__mmask16)(A)))
  180. #define _mm512_shldi_epi64(A, B, C) \
  181. ((__m512i) __builtin_ia32_vpshld_v8di ((__v8di)(__m512i)(A), \
  182. (__v8di)(__m512i)(B), (int)(C)))
  183. #define _mm512_mask_shldi_epi64(A, B, C, D, E) \
  184. ((__m512i) __builtin_ia32_vpshld_v8di_mask ((__v8di)(__m512i)(C), \
  185. (__v8di)(__m512i)(D), (int)(E), \
  186. (__v8di)(__m512i)(A), \
  187. (__mmask8)(B)))
  188. #define _mm512_maskz_shldi_epi64(A, B, C, D) \
  189. ((__m512i) \
  190. __builtin_ia32_vpshld_v8di_mask ((__v8di)(__m512i)(B), \
  191. (__v8di)(__m512i)(C),(int)(D), \
  192. (__v8di)(__m512i)_mm512_setzero_si512 (), \
  193. (__mmask8)(A)))
  194. #endif
  195. extern __inline __m512i
  196. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  197. _mm512_shrdv_epi16 (__m512i __A, __m512i __B, __m512i __C)
  198. {
  199. return (__m512i) __builtin_ia32_vpshrdv_v32hi ((__v32hi)__A, (__v32hi) __B,
  200. (__v32hi) __C);
  201. }
  202. extern __inline __m512i
  203. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  204. _mm512_shrdv_epi32 (__m512i __A, __m512i __B, __m512i __C)
  205. {
  206. return (__m512i) __builtin_ia32_vpshrdv_v16si ((__v16si)__A, (__v16si) __B,
  207. (__v16si) __C);
  208. }
  209. extern __inline __m512i
  210. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  211. _mm512_mask_shrdv_epi32 (__m512i __A, __mmask16 __B, __m512i __C, __m512i __D)
  212. {
  213. return (__m512i)__builtin_ia32_vpshrdv_v16si_mask ((__v16si)__A,
  214. (__v16si) __C, (__v16si) __D, (__mmask16)__B);
  215. }
  216. extern __inline __m512i
  217. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  218. _mm512_maskz_shrdv_epi32 (__mmask16 __A, __m512i __B, __m512i __C, __m512i __D)
  219. {
  220. return (__m512i)__builtin_ia32_vpshrdv_v16si_maskz ((__v16si)__B,
  221. (__v16si) __C, (__v16si) __D, (__mmask16)__A);
  222. }
  223. extern __inline __m512i
  224. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  225. _mm512_shrdv_epi64 (__m512i __A, __m512i __B, __m512i __C)
  226. {
  227. return (__m512i) __builtin_ia32_vpshrdv_v8di ((__v8di)__A, (__v8di) __B,
  228. (__v8di) __C);
  229. }
  230. extern __inline __m512i
  231. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  232. _mm512_mask_shrdv_epi64 (__m512i __A, __mmask8 __B, __m512i __C, __m512i __D)
  233. {
  234. return (__m512i)__builtin_ia32_vpshrdv_v8di_mask ((__v8di)__A, (__v8di) __C,
  235. (__v8di) __D, (__mmask8)__B);
  236. }
  237. extern __inline __m512i
  238. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  239. _mm512_maskz_shrdv_epi64 (__mmask8 __A, __m512i __B, __m512i __C, __m512i __D)
  240. {
  241. return (__m512i)__builtin_ia32_vpshrdv_v8di_maskz ((__v8di)__B, (__v8di) __C,
  242. (__v8di) __D, (__mmask8)__A);
  243. }
  244. extern __inline __m512i
  245. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  246. _mm512_shldv_epi16 (__m512i __A, __m512i __B, __m512i __C)
  247. {
  248. return (__m512i) __builtin_ia32_vpshldv_v32hi ((__v32hi)__A, (__v32hi) __B,
  249. (__v32hi) __C);
  250. }
  251. extern __inline __m512i
  252. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  253. _mm512_shldv_epi32 (__m512i __A, __m512i __B, __m512i __C)
  254. {
  255. return (__m512i) __builtin_ia32_vpshldv_v16si ((__v16si)__A, (__v16si) __B,
  256. (__v16si) __C);
  257. }
  258. extern __inline __m512i
  259. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  260. _mm512_mask_shldv_epi32 (__m512i __A, __mmask16 __B, __m512i __C, __m512i __D)
  261. {
  262. return (__m512i)__builtin_ia32_vpshldv_v16si_mask ((__v16si)__A,
  263. (__v16si) __C, (__v16si) __D, (__mmask16)__B);
  264. }
  265. extern __inline __m512i
  266. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  267. _mm512_maskz_shldv_epi32 (__mmask16 __A, __m512i __B, __m512i __C, __m512i __D)
  268. {
  269. return (__m512i)__builtin_ia32_vpshldv_v16si_maskz ((__v16si)__B,
  270. (__v16si) __C, (__v16si) __D, (__mmask16)__A);
  271. }
  272. extern __inline __m512i
  273. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  274. _mm512_shldv_epi64 (__m512i __A, __m512i __B, __m512i __C)
  275. {
  276. return (__m512i) __builtin_ia32_vpshldv_v8di ((__v8di)__A, (__v8di) __B,
  277. (__v8di) __C);
  278. }
  279. extern __inline __m512i
  280. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  281. _mm512_mask_shldv_epi64 (__m512i __A, __mmask8 __B, __m512i __C, __m512i __D)
  282. {
  283. return (__m512i)__builtin_ia32_vpshldv_v8di_mask ((__v8di)__A, (__v8di) __C,
  284. (__v8di) __D, (__mmask8)__B);
  285. }
  286. extern __inline __m512i
  287. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  288. _mm512_maskz_shldv_epi64 (__mmask8 __A, __m512i __B, __m512i __C, __m512i __D)
  289. {
  290. return (__m512i)__builtin_ia32_vpshldv_v8di_maskz ((__v8di)__B, (__v8di) __C,
  291. (__v8di) __D, (__mmask8)__A);
  292. }
  293. #ifdef __DISABLE_AVX512VBMI2__
  294. #undef __DISABLE_AVX512VBMI2__
  295. #pragma GCC pop_options
  296. #endif /* __DISABLE_AVX512VBMI2__ */
  297. #if !defined(__AVX512VBMI2__) || !defined(__AVX512BW__)
  298. #pragma GCC push_options
  299. #pragma GCC target("avx512vbmi2,avx512bw")
  300. #define __DISABLE_AVX512VBMI2BW__
  301. #endif /* __AVX512VBMI2BW__ */
  302. extern __inline __m512i
  303. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  304. _mm512_mask_compress_epi8 (__m512i __A, __mmask64 __B, __m512i __C)
  305. {
  306. return (__m512i) __builtin_ia32_compressqi512_mask ((__v64qi)__C,
  307. (__v64qi)__A, (__mmask64)__B);
  308. }
  309. extern __inline __m512i
  310. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  311. _mm512_maskz_compress_epi8 (__mmask64 __A, __m512i __B)
  312. {
  313. return (__m512i) __builtin_ia32_compressqi512_mask ((__v64qi)__B,
  314. (__v64qi)_mm512_setzero_si512 (), (__mmask64)__A);
  315. }
  316. extern __inline void
  317. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  318. _mm512_mask_compressstoreu_epi8 (void * __A, __mmask64 __B, __m512i __C)
  319. {
  320. __builtin_ia32_compressstoreuqi512_mask ((__v64qi *) __A, (__v64qi) __C,
  321. (__mmask64) __B);
  322. }
  323. extern __inline __m512i
  324. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  325. _mm512_mask_compress_epi16 (__m512i __A, __mmask32 __B, __m512i __C)
  326. {
  327. return (__m512i) __builtin_ia32_compresshi512_mask ((__v32hi)__C,
  328. (__v32hi)__A, (__mmask32)__B);
  329. }
  330. extern __inline __m512i
  331. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  332. _mm512_maskz_compress_epi16 (__mmask32 __A, __m512i __B)
  333. {
  334. return (__m512i) __builtin_ia32_compresshi512_mask ((__v32hi)__B,
  335. (__v32hi)_mm512_setzero_si512 (), (__mmask32)__A);
  336. }
  337. extern __inline void
  338. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  339. _mm512_mask_compressstoreu_epi16 (void * __A, __mmask32 __B, __m512i __C)
  340. {
  341. __builtin_ia32_compressstoreuhi512_mask ((__v32hi *) __A, (__v32hi) __C,
  342. (__mmask32) __B);
  343. }
  344. extern __inline __m512i
  345. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  346. _mm512_mask_expand_epi8 (__m512i __A, __mmask64 __B, __m512i __C)
  347. {
  348. return (__m512i) __builtin_ia32_expandqi512_mask ((__v64qi) __C,
  349. (__v64qi) __A,
  350. (__mmask64) __B);
  351. }
  352. extern __inline __m512i
  353. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  354. _mm512_maskz_expand_epi8 (__mmask64 __A, __m512i __B)
  355. {
  356. return (__m512i) __builtin_ia32_expandqi512_maskz ((__v64qi) __B,
  357. (__v64qi) _mm512_setzero_si512 (), (__mmask64) __A);
  358. }
  359. extern __inline __m512i
  360. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  361. _mm512_mask_expandloadu_epi8 (__m512i __A, __mmask64 __B, const void * __C)
  362. {
  363. return (__m512i) __builtin_ia32_expandloadqi512_mask ((const __v64qi *) __C,
  364. (__v64qi) __A, (__mmask64) __B);
  365. }
  366. extern __inline __m512i
  367. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  368. _mm512_maskz_expandloadu_epi8 (__mmask64 __A, const void * __B)
  369. {
  370. return (__m512i) __builtin_ia32_expandloadqi512_maskz ((const __v64qi *) __B,
  371. (__v64qi) _mm512_setzero_si512 (), (__mmask64) __A);
  372. }
  373. extern __inline __m512i
  374. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  375. _mm512_mask_expand_epi16 (__m512i __A, __mmask32 __B, __m512i __C)
  376. {
  377. return (__m512i) __builtin_ia32_expandhi512_mask ((__v32hi) __C,
  378. (__v32hi) __A,
  379. (__mmask32) __B);
  380. }
  381. extern __inline __m512i
  382. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  383. _mm512_maskz_expand_epi16 (__mmask32 __A, __m512i __B)
  384. {
  385. return (__m512i) __builtin_ia32_expandhi512_maskz ((__v32hi) __B,
  386. (__v32hi) _mm512_setzero_si512 (), (__mmask32) __A);
  387. }
  388. extern __inline __m512i
  389. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  390. _mm512_mask_expandloadu_epi16 (__m512i __A, __mmask32 __B, const void * __C)
  391. {
  392. return (__m512i) __builtin_ia32_expandloadhi512_mask ((const __v32hi *) __C,
  393. (__v32hi) __A, (__mmask32) __B);
  394. }
  395. extern __inline __m512i
  396. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  397. _mm512_maskz_expandloadu_epi16 (__mmask32 __A, const void * __B)
  398. {
  399. return (__m512i) __builtin_ia32_expandloadhi512_maskz ((const __v32hi *) __B,
  400. (__v32hi) _mm512_setzero_si512 (), (__mmask32) __A);
  401. }
  402. #ifdef __OPTIMIZE__
  403. extern __inline __m512i
  404. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  405. _mm512_mask_shrdi_epi16 (__m512i __A, __mmask32 __B, __m512i __C, __m512i __D,
  406. int __E)
  407. {
  408. return (__m512i)__builtin_ia32_vpshrd_v32hi_mask ((__v32hi)__C,
  409. (__v32hi) __D, __E, (__v32hi) __A, (__mmask32)__B);
  410. }
  411. extern __inline __m512i
  412. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  413. _mm512_maskz_shrdi_epi16 (__mmask32 __A, __m512i __B, __m512i __C, int __D)
  414. {
  415. return (__m512i)__builtin_ia32_vpshrd_v32hi_mask ((__v32hi)__B,
  416. (__v32hi) __C, __D, (__v32hi) _mm512_setzero_si512 (), (__mmask32)__A);
  417. }
  418. extern __inline __m512i
  419. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  420. _mm512_mask_shldi_epi16 (__m512i __A, __mmask32 __B, __m512i __C, __m512i __D,
  421. int __E)
  422. {
  423. return (__m512i)__builtin_ia32_vpshld_v32hi_mask ((__v32hi)__C,
  424. (__v32hi) __D, __E, (__v32hi) __A, (__mmask32)__B);
  425. }
  426. extern __inline __m512i
  427. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  428. _mm512_maskz_shldi_epi16 (__mmask32 __A, __m512i __B, __m512i __C, int __D)
  429. {
  430. return (__m512i)__builtin_ia32_vpshld_v32hi_mask ((__v32hi)__B,
  431. (__v32hi) __C, __D, (__v32hi) _mm512_setzero_si512 (), (__mmask32)__A);
  432. }
  433. #else
  434. #define _mm512_mask_shrdi_epi16(A, B, C, D, E) \
  435. ((__m512i) __builtin_ia32_vpshrd_v32hi_mask ((__v32hi)(__m512i)(C), \
  436. (__v32hi)(__m512i)(D), \
  437. (int)(E), \
  438. (__v32hi)(__m512i)(A), \
  439. (__mmask32)(B)))
  440. #define _mm512_maskz_shrdi_epi16(A, B, C, D) \
  441. ((__m512i) \
  442. __builtin_ia32_vpshrd_v32hi_mask ((__v32hi)(__m512i)(B), \
  443. (__v32hi)(__m512i)(C),(int)(D), \
  444. (__v32hi)(__m512i)_mm512_setzero_si512 (), \
  445. (__mmask32)(A)))
  446. #define _mm512_mask_shldi_epi16(A, B, C, D, E) \
  447. ((__m512i) __builtin_ia32_vpshld_v32hi_mask ((__v32hi)(__m512i)(C), \
  448. (__v32hi)(__m512i)(D), \
  449. (int)(E), \
  450. (__v32hi)(__m512i)(A), \
  451. (__mmask32)(B)))
  452. #define _mm512_maskz_shldi_epi16(A, B, C, D) \
  453. ((__m512i) \
  454. __builtin_ia32_vpshld_v32hi_mask ((__v32hi)(__m512i)(B), \
  455. (__v32hi)(__m512i)(C),(int)(D), \
  456. (__v32hi)(__m512i)_mm512_setzero_si512 (), \
  457. (__mmask32)(A)))
  458. #endif
  459. extern __inline __m512i
  460. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  461. _mm512_mask_shrdv_epi16 (__m512i __A, __mmask32 __B, __m512i __C, __m512i __D)
  462. {
  463. return (__m512i)__builtin_ia32_vpshrdv_v32hi_mask ((__v32hi)__A,
  464. (__v32hi) __C, (__v32hi) __D, (__mmask32)__B);
  465. }
  466. extern __inline __m512i
  467. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  468. _mm512_maskz_shrdv_epi16 (__mmask32 __A, __m512i __B, __m512i __C, __m512i __D)
  469. {
  470. return (__m512i)__builtin_ia32_vpshrdv_v32hi_maskz ((__v32hi)__B,
  471. (__v32hi) __C, (__v32hi) __D, (__mmask32)__A);
  472. }
  473. extern __inline __m512i
  474. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  475. _mm512_mask_shldv_epi16 (__m512i __A, __mmask32 __B, __m512i __C, __m512i __D)
  476. {
  477. return (__m512i)__builtin_ia32_vpshldv_v32hi_mask ((__v32hi)__A,
  478. (__v32hi) __C, (__v32hi) __D, (__mmask32)__B);
  479. }
  480. extern __inline __m512i
  481. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  482. _mm512_maskz_shldv_epi16 (__mmask32 __A, __m512i __B, __m512i __C, __m512i __D)
  483. {
  484. return (__m512i)__builtin_ia32_vpshldv_v32hi_maskz ((__v32hi)__B,
  485. (__v32hi) __C, (__v32hi) __D, (__mmask32)__A);
  486. }
  487. #ifdef __DISABLE_AVX512VBMI2BW__
  488. #undef __DISABLE_AVX512VBMI2BW__
  489. #pragma GCC pop_options
  490. #endif /* __DISABLE_AVX512VBMI2BW__ */
  491. #endif /* __AVX512VBMI2INTRIN_H_INCLUDED */