clang  8.0.0svn
avx512vbmivlintrin.h
Go to the documentation of this file.
1 /*===------------- avx512vbmivlintrin.h - VBMI intrinsics ------------------===
2  *
3  *
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:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *
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
20  * THE SOFTWARE.
21  *
22  *===-----------------------------------------------------------------------===
23  */
24 #ifndef __IMMINTRIN_H
25 #error "Never use <avx512vbmivlintrin.h> directly; include <immintrin.h> instead."
26 #endif
27 
28 #ifndef __VBMIVLINTRIN_H
29 #define __VBMIVLINTRIN_H
30 
31 /* Define the default attributes for the functions in this file. */
32 #define __DEFAULT_FN_ATTRS128 __attribute__((__always_inline__, __nodebug__, __target__("avx512vbmi,avx512vl"), __min_vector_width__(128)))
33 #define __DEFAULT_FN_ATTRS256 __attribute__((__always_inline__, __nodebug__, __target__("avx512vbmi,avx512vl"), __min_vector_width__(256)))
34 
35 
36 static __inline__ __m128i __DEFAULT_FN_ATTRS128
37 _mm_permutex2var_epi8(__m128i __A, __m128i __I, __m128i __B)
38 {
39  return (__m128i)__builtin_ia32_vpermi2varqi128((__v16qi)__A,
40  (__v16qi)__I,
41  (__v16qi)__B);
42 }
43 
44 static __inline__ __m128i __DEFAULT_FN_ATTRS128
45 _mm_mask_permutex2var_epi8(__m128i __A, __mmask16 __U, __m128i __I,
46  __m128i __B)
47 {
48  return (__m128i)__builtin_ia32_selectb_128(__U,
49  (__v16qi)_mm_permutex2var_epi8(__A, __I, __B),
50  (__v16qi)__A);
51 }
52 
53 static __inline__ __m128i __DEFAULT_FN_ATTRS128
54 _mm_mask2_permutex2var_epi8(__m128i __A, __m128i __I, __mmask16 __U,
55  __m128i __B)
56 {
57  return (__m128i)__builtin_ia32_selectb_128(__U,
58  (__v16qi)_mm_permutex2var_epi8(__A, __I, __B),
59  (__v16qi)__I);
60 }
61 
62 static __inline__ __m128i __DEFAULT_FN_ATTRS128
63 _mm_maskz_permutex2var_epi8(__mmask16 __U, __m128i __A, __m128i __I,
64  __m128i __B)
65 {
66  return (__m128i)__builtin_ia32_selectb_128(__U,
67  (__v16qi)_mm_permutex2var_epi8(__A, __I, __B),
68  (__v16qi)_mm_setzero_si128());
69 }
70 
71 static __inline__ __m256i __DEFAULT_FN_ATTRS256
72 _mm256_permutex2var_epi8(__m256i __A, __m256i __I, __m256i __B)
73 {
74  return (__m256i)__builtin_ia32_vpermi2varqi256((__v32qi)__A, (__v32qi)__I,
75  (__v32qi)__B);
76 }
77 
78 static __inline__ __m256i __DEFAULT_FN_ATTRS256
79 _mm256_mask_permutex2var_epi8(__m256i __A, __mmask32 __U, __m256i __I,
80  __m256i __B)
81 {
82  return (__m256i)__builtin_ia32_selectb_256(__U,
83  (__v32qi)_mm256_permutex2var_epi8(__A, __I, __B),
84  (__v32qi)__A);
85 }
86 
87 static __inline__ __m256i __DEFAULT_FN_ATTRS256
88 _mm256_mask2_permutex2var_epi8(__m256i __A, __m256i __I, __mmask32 __U,
89  __m256i __B)
90 {
91  return (__m256i)__builtin_ia32_selectb_256(__U,
92  (__v32qi)_mm256_permutex2var_epi8(__A, __I, __B),
93  (__v32qi)__I);
94 }
95 
96 static __inline__ __m256i __DEFAULT_FN_ATTRS256
97 _mm256_maskz_permutex2var_epi8(__mmask32 __U, __m256i __A, __m256i __I,
98  __m256i __B)
99 {
100  return (__m256i)__builtin_ia32_selectb_256(__U,
101  (__v32qi)_mm256_permutex2var_epi8(__A, __I, __B),
102  (__v32qi)_mm256_setzero_si256());
103 }
104 
105 static __inline__ __m128i __DEFAULT_FN_ATTRS128
106 _mm_permutexvar_epi8 (__m128i __A, __m128i __B)
107 {
108  return (__m128i)__builtin_ia32_permvarqi128((__v16qi)__B, (__v16qi)__A);
109 }
110 
111 static __inline__ __m128i __DEFAULT_FN_ATTRS128
112 _mm_maskz_permutexvar_epi8 (__mmask16 __M, __m128i __A, __m128i __B)
113 {
114  return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M,
115  (__v16qi)_mm_permutexvar_epi8(__A, __B),
116  (__v16qi)_mm_setzero_si128());
117 }
118 
119 static __inline__ __m128i __DEFAULT_FN_ATTRS128
120 _mm_mask_permutexvar_epi8 (__m128i __W, __mmask16 __M, __m128i __A,
121  __m128i __B)
122 {
123  return (__m128i)__builtin_ia32_selectb_128((__mmask16)__M,
124  (__v16qi)_mm_permutexvar_epi8(__A, __B),
125  (__v16qi)__W);
126 }
127 
128 static __inline__ __m256i __DEFAULT_FN_ATTRS256
129 _mm256_permutexvar_epi8 (__m256i __A, __m256i __B)
130 {
131  return (__m256i)__builtin_ia32_permvarqi256((__v32qi) __B, (__v32qi) __A);
132 }
133 
134 static __inline__ __m256i __DEFAULT_FN_ATTRS256
136  __m256i __B)
137 {
138  return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M,
139  (__v32qi)_mm256_permutexvar_epi8(__A, __B),
140  (__v32qi)_mm256_setzero_si256());
141 }
142 
143 static __inline__ __m256i __DEFAULT_FN_ATTRS256
144 _mm256_mask_permutexvar_epi8 (__m256i __W, __mmask32 __M, __m256i __A,
145  __m256i __B)
146 {
147  return (__m256i)__builtin_ia32_selectb_256((__mmask32)__M,
148  (__v32qi)_mm256_permutexvar_epi8(__A, __B),
149  (__v32qi)__W);
150 }
151 
152 static __inline__ __m128i __DEFAULT_FN_ATTRS128
153 _mm_mask_multishift_epi64_epi8 (__m128i __W, __mmask16 __M, __m128i __X, __m128i __Y)
154 {
155  return (__m128i) __builtin_ia32_vpmultishiftqb128_mask ((__v16qi) __X,
156  (__v16qi) __Y,
157  (__v16qi) __W,
158  (__mmask16) __M);
159 }
160 
161 static __inline__ __m128i __DEFAULT_FN_ATTRS128
162 _mm_maskz_multishift_epi64_epi8 (__mmask16 __M, __m128i __X, __m128i __Y)
163 {
164  return (__m128i) __builtin_ia32_vpmultishiftqb128_mask ((__v16qi) __X,
165  (__v16qi) __Y,
166  (__v16qi)
168  (__mmask16) __M);
169 }
170 
171 static __inline__ __m128i __DEFAULT_FN_ATTRS128
172 _mm_multishift_epi64_epi8 (__m128i __X, __m128i __Y)
173 {
174  return (__m128i) __builtin_ia32_vpmultishiftqb128_mask ((__v16qi) __X,
175  (__v16qi) __Y,
176  (__v16qi)
178  (__mmask16) -1);
179 }
180 
181 static __inline__ __m256i __DEFAULT_FN_ATTRS256
182 _mm256_mask_multishift_epi64_epi8 (__m256i __W, __mmask32 __M, __m256i __X, __m256i __Y)
183 {
184  return (__m256i) __builtin_ia32_vpmultishiftqb256_mask ((__v32qi) __X,
185  (__v32qi) __Y,
186  (__v32qi) __W,
187  (__mmask32) __M);
188 }
189 
190 static __inline__ __m256i __DEFAULT_FN_ATTRS256
191 _mm256_maskz_multishift_epi64_epi8 (__mmask32 __M, __m256i __X, __m256i __Y)
192 {
193  return (__m256i) __builtin_ia32_vpmultishiftqb256_mask ((__v32qi) __X,
194  (__v32qi) __Y,
195  (__v32qi)
197  (__mmask32) __M);
198 }
199 
200 static __inline__ __m256i __DEFAULT_FN_ATTRS256
201 _mm256_multishift_epi64_epi8 (__m256i __X, __m256i __Y)
202 {
203  return (__m256i) __builtin_ia32_vpmultishiftqb256_mask ((__v32qi) __X,
204  (__v32qi) __Y,
205  (__v32qi)
207  (__mmask32) -1);
208 }
209 
210 
211 #undef __DEFAULT_FN_ATTRS128
212 #undef __DEFAULT_FN_ATTRS256
213 
214 #endif
static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_mask_permutexvar_epi8(__m128i __W, __mmask16 __M, __m128i __A, __m128i __B)
#define __DEFAULT_FN_ATTRS128
static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_maskz_permutexvar_epi8(__mmask32 __M, __m256i __A, __m256i __B)
#define __DEFAULT_FN_ATTRS256
unsigned int __mmask32
static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_mask2_permutex2var_epi8(__m128i __A, __m128i __I, __mmask16 __U, __m128i __B)
static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_maskz_multishift_epi64_epi8(__mmask16 __M, __m128i __X, __m128i __Y)
static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_maskz_permutexvar_epi8(__mmask16 __M, __m128i __A, __m128i __B)
static __inline__ __m256i __DEFAULT_FN_ATTRS _mm256_undefined_si256(void)
Create a 256-bit integer vector with undefined values.
Definition: avxintrin.h:3604
static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_maskz_permutex2var_epi8(__mmask32 __U, __m256i __A, __m256i __I, __m256i __B)
static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_multishift_epi64_epi8(__m256i __X, __m256i __Y)
static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_permutexvar_epi8(__m256i __A, __m256i __B)
static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_permutexvar_epi8(__m128i __A, __m128i __B)
static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_permutex2var_epi8(__m128i __A, __m128i __I, __m128i __B)
static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_mask_permutex2var_epi8(__m256i __A, __mmask32 __U, __m256i __I, __m256i __B)
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_setzero_si128(void)
Creates a 128-bit integer vector initialized to zero.
Definition: emmintrin.h:3996
static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_mask_multishift_epi64_epi8(__m256i __W, __mmask32 __M, __m256i __X, __m256i __Y)
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_undefined_si128(void)
Generates a 128-bit vector of [4 x i32] with unspecified content.
Definition: emmintrin.h:3606
static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_multishift_epi64_epi8(__m128i __X, __m128i __Y)
static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_mask2_permutex2var_epi8(__m256i __A, __m256i __I, __mmask32 __U, __m256i __B)
static __inline __m256i __DEFAULT_FN_ATTRS _mm256_setzero_si256(void)
Constructs a 256-bit integer vector initialized to zero.
Definition: avxintrin.h:4291
static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_permutex2var_epi8(__m256i __A, __m256i __I, __m256i __B)
unsigned short __mmask16
Definition: avx512fintrin.h:48
static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_mask_multishift_epi64_epi8(__m128i __W, __mmask16 __M, __m128i __X, __m128i __Y)
static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_mask_permutexvar_epi8(__m256i __W, __mmask32 __M, __m256i __A, __m256i __B)
static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_maskz_permutex2var_epi8(__mmask16 __U, __m128i __A, __m128i __I, __m128i __B)
static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_mask_permutex2var_epi8(__m128i __A, __mmask16 __U, __m128i __I, __m128i __B)
static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_maskz_multishift_epi64_epi8(__mmask32 __M, __m256i __X, __m256i __Y)