1 /*===------------- avx512vbmivlintrin.h - VBMI intrinsics ------------------===
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 *===-----------------------------------------------------------------------===
25 #error "Never use <avx512vbmivlintrin.h> directly; include <immintrin.h> instead."
28 #ifndef __VBMIVLINTRIN_H
29 #define __VBMIVLINTRIN_H
31 /* Define the default attributes for the functions in this file. */
32 #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512vbmi,avx512vl")))
35 static __inline__ __m128i __DEFAULT_FN_ATTRS
36 _mm_mask2_permutex2var_epi8 (__m128i __A
, __m128i __I
, __mmask16 __U
,
39 return (__m128i
) __builtin_ia32_vpermi2varqi128_mask ((__v16qi
) __A
,
47 static __inline__ __m256i __DEFAULT_FN_ATTRS
48 _mm256_mask2_permutex2var_epi8 (__m256i __A
, __m256i __I
,
49 __mmask32 __U
, __m256i __B
)
51 return (__m256i
) __builtin_ia32_vpermi2varqi256_mask ((__v32qi
) __A
,
59 static __inline__ __m128i __DEFAULT_FN_ATTRS
60 _mm_permutex2var_epi8 (__m128i __A
, __m128i __I
, __m128i __B
)
62 return (__m128i
) __builtin_ia32_vpermt2varqi128_mask ((__v16qi
) __I
70 static __inline__ __m128i __DEFAULT_FN_ATTRS
71 _mm_mask_permutex2var_epi8 (__m128i __A
, __mmask16 __U
, __m128i __I
,
74 return (__m128i
) __builtin_ia32_vpermt2varqi128_mask ((__v16qi
) __I
82 static __inline__ __m128i __DEFAULT_FN_ATTRS
83 _mm_maskz_permutex2var_epi8 (__mmask16 __U
, __m128i __A
, __m128i __I
,
86 return (__m128i
) __builtin_ia32_vpermt2varqi128_maskz ((__v16qi
) __I
94 static __inline__ __m256i __DEFAULT_FN_ATTRS
95 _mm256_permutex2var_epi8 (__m256i __A
, __m256i __I
, __m256i __B
)
97 return (__m256i
) __builtin_ia32_vpermt2varqi256_mask ((__v32qi
) __I
105 static __inline__ __m256i __DEFAULT_FN_ATTRS
106 _mm256_mask_permutex2var_epi8 (__m256i __A
, __mmask32 __U
,
107 __m256i __I
, __m256i __B
)
109 return (__m256i
) __builtin_ia32_vpermt2varqi256_mask ((__v32qi
) __I
117 static __inline__ __m256i __DEFAULT_FN_ATTRS
118 _mm256_maskz_permutex2var_epi8 (__mmask32 __U
, __m256i __A
,
119 __m256i __I
, __m256i __B
)
121 return (__m256i
) __builtin_ia32_vpermt2varqi256_maskz ((__v32qi
) __I
129 static __inline__ __m128i __DEFAULT_FN_ATTRS
130 _mm_permutexvar_epi8 (__m128i __A
, __m128i __B
)
132 return (__m128i
) __builtin_ia32_permvarqi128_mask ((__v16qi
) __B
,
134 (__v16qi
) _mm_undefined_si128 (),
138 static __inline__ __m128i __DEFAULT_FN_ATTRS
139 _mm_maskz_permutexvar_epi8 (__mmask16 __M
, __m128i __A
, __m128i __B
)
141 return (__m128i
) __builtin_ia32_permvarqi128_mask ((__v16qi
) __B
,
143 (__v16qi
) _mm_setzero_si128 (),
147 static __inline__ __m128i __DEFAULT_FN_ATTRS
148 _mm_mask_permutexvar_epi8 (__m128i __W
, __mmask16 __M
, __m128i __A
,
151 return (__m128i
) __builtin_ia32_permvarqi128_mask ((__v16qi
) __B
,
157 static __inline__ __m256i __DEFAULT_FN_ATTRS
158 _mm256_permutexvar_epi8 (__m256i __A
, __m256i __B
)
160 return (__m256i
) __builtin_ia32_permvarqi256_mask ((__v32qi
) __B
,
162 (__v32qi
) _mm256_undefined_si256 (),
166 static __inline__ __m256i __DEFAULT_FN_ATTRS
167 _mm256_maskz_permutexvar_epi8 (__mmask32 __M
, __m256i __A
,
170 return (__m256i
) __builtin_ia32_permvarqi256_mask ((__v32qi
) __B
,
172 (__v32qi
) _mm256_setzero_si256 (),
176 static __inline__ __m256i __DEFAULT_FN_ATTRS
177 _mm256_mask_permutexvar_epi8 (__m256i __W
, __mmask32 __M
, __m256i __A
,
180 return (__m256i
) __builtin_ia32_permvarqi256_mask ((__v32qi
) __B
,
186 static __inline__ __m128i __DEFAULT_FN_ATTRS
187 _mm_mask_multishift_epi64_epi8 (__m128i __W
, __mmask16 __M
, __m128i __X
, __m128i __Y
)
189 return (__m128i
) __builtin_ia32_vpmultishiftqb128_mask ((__v16qi
) __X
,
195 static __inline__ __m128i __DEFAULT_FN_ATTRS
196 _mm_maskz_multishift_epi64_epi8 (__mmask16 __M
, __m128i __X
, __m128i __Y
)
198 return (__m128i
) __builtin_ia32_vpmultishiftqb128_mask ((__v16qi
) __X
,
201 _mm_setzero_si128 (),
205 static __inline__ __m128i __DEFAULT_FN_ATTRS
206 _mm_multishift_epi64_epi8 (__m128i __X
, __m128i __Y
)
208 return (__m128i
) __builtin_ia32_vpmultishiftqb128_mask ((__v16qi
) __X
,
211 _mm_undefined_si128 (),
215 static __inline__ __m256i __DEFAULT_FN_ATTRS
216 _mm256_mask_multishift_epi64_epi8 (__m256i __W
, __mmask32 __M
, __m256i __X
, __m256i __Y
)
218 return (__m256i
) __builtin_ia32_vpmultishiftqb256_mask ((__v32qi
) __X
,
224 static __inline__ __m256i __DEFAULT_FN_ATTRS
225 _mm256_maskz_multishift_epi64_epi8 (__mmask32 __M
, __m256i __X
, __m256i __Y
)
227 return (__m256i
) __builtin_ia32_vpmultishiftqb256_mask ((__v32qi
) __X
,
230 _mm256_setzero_si256 (),
234 static __inline__ __m256i __DEFAULT_FN_ATTRS
235 _mm256_multishift_epi64_epi8 (__m256i __X
, __m256i __Y
)
237 return (__m256i
) __builtin_ia32_vpmultishiftqb256_mask ((__v32qi
) __X
,
240 _mm256_undefined_si256 (),
245 #undef __DEFAULT_FN_ATTRS