avx512vbmiintrin.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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 <avx512vbmiintrin.h> directly; include <immintrin.h> instead."
  20. #endif
  21. #ifndef _AVX512VBMIINTRIN_H_INCLUDED
  22. #define _AVX512VBMIINTRIN_H_INCLUDED
  23. #ifndef __AVX512VBMI__
  24. #pragma GCC push_options
  25. #pragma GCC target("avx512vbmi")
  26. #define __DISABLE_AVX512VBMI__
  27. #endif /* __AVX512VBMI__ */
  28. extern __inline __m512i
  29. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  30. _mm512_mask_multishift_epi64_epi8 (__m512i __W, __mmask64 __M, __m512i __X, __m512i __Y)
  31. {
  32. return (__m512i) __builtin_ia32_vpmultishiftqb512_mask ((__v64qi) __X,
  33. (__v64qi) __Y,
  34. (__v64qi) __W,
  35. (__mmask64) __M);
  36. }
  37. extern __inline __m512i
  38. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  39. _mm512_maskz_multishift_epi64_epi8 (__mmask64 __M, __m512i __X, __m512i __Y)
  40. {
  41. return (__m512i) __builtin_ia32_vpmultishiftqb512_mask ((__v64qi) __X,
  42. (__v64qi) __Y,
  43. (__v64qi)
  44. _mm512_setzero_si512 (),
  45. (__mmask64) __M);
  46. }
  47. extern __inline __m512i
  48. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  49. _mm512_multishift_epi64_epi8 (__m512i __X, __m512i __Y)
  50. {
  51. return (__m512i) __builtin_ia32_vpmultishiftqb512_mask ((__v64qi) __X,
  52. (__v64qi) __Y,
  53. (__v64qi)
  54. _mm512_undefined_epi32 (),
  55. (__mmask64) -1);
  56. }
  57. extern __inline __m512i
  58. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  59. _mm512_permutexvar_epi8 (__m512i __A, __m512i __B)
  60. {
  61. return (__m512i) __builtin_ia32_permvarqi512_mask ((__v64qi) __B,
  62. (__v64qi) __A,
  63. (__v64qi)
  64. _mm512_undefined_epi32 (),
  65. (__mmask64) -1);
  66. }
  67. extern __inline __m512i
  68. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  69. _mm512_maskz_permutexvar_epi8 (__mmask64 __M, __m512i __A,
  70. __m512i __B)
  71. {
  72. return (__m512i) __builtin_ia32_permvarqi512_mask ((__v64qi) __B,
  73. (__v64qi) __A,
  74. (__v64qi)
  75. _mm512_setzero_si512(),
  76. (__mmask64) __M);
  77. }
  78. extern __inline __m512i
  79. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  80. _mm512_mask_permutexvar_epi8 (__m512i __W, __mmask64 __M, __m512i __A,
  81. __m512i __B)
  82. {
  83. return (__m512i) __builtin_ia32_permvarqi512_mask ((__v64qi) __B,
  84. (__v64qi) __A,
  85. (__v64qi) __W,
  86. (__mmask64) __M);
  87. }
  88. extern __inline __m512i
  89. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  90. _mm512_permutex2var_epi8 (__m512i __A, __m512i __I, __m512i __B)
  91. {
  92. return (__m512i) __builtin_ia32_vpermt2varqi512_mask ((__v64qi) __I
  93. /* idx */ ,
  94. (__v64qi) __A,
  95. (__v64qi) __B,
  96. (__mmask64) -1);
  97. }
  98. extern __inline __m512i
  99. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  100. _mm512_mask_permutex2var_epi8 (__m512i __A, __mmask64 __U,
  101. __m512i __I, __m512i __B)
  102. {
  103. return (__m512i) __builtin_ia32_vpermt2varqi512_mask ((__v64qi) __I
  104. /* idx */ ,
  105. (__v64qi) __A,
  106. (__v64qi) __B,
  107. (__mmask64)
  108. __U);
  109. }
  110. extern __inline __m512i
  111. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  112. _mm512_mask2_permutex2var_epi8 (__m512i __A, __m512i __I,
  113. __mmask64 __U, __m512i __B)
  114. {
  115. return (__m512i) __builtin_ia32_vpermi2varqi512_mask ((__v64qi) __A,
  116. (__v64qi) __I
  117. /* idx */ ,
  118. (__v64qi) __B,
  119. (__mmask64)
  120. __U);
  121. }
  122. extern __inline __m512i
  123. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  124. _mm512_maskz_permutex2var_epi8 (__mmask64 __U, __m512i __A,
  125. __m512i __I, __m512i __B)
  126. {
  127. return (__m512i) __builtin_ia32_vpermt2varqi512_maskz ((__v64qi) __I
  128. /* idx */ ,
  129. (__v64qi) __A,
  130. (__v64qi) __B,
  131. (__mmask64)
  132. __U);
  133. }
  134. #ifdef __DISABLE_AVX512VBMI__
  135. #undef __DISABLE_AVX512VBMI__
  136. #pragma GCC pop_options
  137. #endif /* __DISABLE_AVX512VBMI__ */
  138. #endif /* _AVX512VBMIINTRIN_H_INCLUDED */