clang  8.0.0svn
avx512vlcdintrin.h
Go to the documentation of this file.
1 /*===---- avx512vlcdintrin.h - AVX512VL and AVX512CD intrinsics ------------===
2  *
3  * Permission is hereby granted, free of charge, to any person obtaining a copy
4  * of this software and associated documentation files (the "Software"), to deal
5  * in the Software without restriction, including without limitation the rights
6  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7  * copies of the Software, and to permit persons to whom the Software is
8  * furnished to do so, subject to the following conditions:
9  *
10  * The above copyright notice and this permission notice shall be included in
11  * all copies or substantial portions of the Software.
12  *
13  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19  * THE SOFTWARE.
20  *
21  *===-----------------------------------------------------------------------===
22  */
23 #ifndef __IMMINTRIN_H
24 #error "Never use <avx512vlcdintrin.h> directly; include <immintrin.h> instead."
25 #endif
26 
27 #ifndef __AVX512VLCDINTRIN_H
28 #define __AVX512VLCDINTRIN_H
29 
30 /* Define the default attributes for the functions in this file. */
31 #define __DEFAULT_FN_ATTRS128 __attribute__((__always_inline__, __nodebug__, __target__("avx512vl,avx512cd"), __min_vector_width__(128)))
32 #define __DEFAULT_FN_ATTRS256 __attribute__((__always_inline__, __nodebug__, __target__("avx512vl,avx512cd"), __min_vector_width__(256)))
33 
34 
35 static __inline__ __m128i __DEFAULT_FN_ATTRS128
37 {
38  return (__m128i) _mm_set1_epi64x((long long) __A);
39 }
40 
41 static __inline__ __m256i __DEFAULT_FN_ATTRS256
43 {
44  return (__m256i) _mm256_set1_epi64x((long long)__A);
45 }
46 
47 static __inline__ __m128i __DEFAULT_FN_ATTRS128
49 {
50  return (__m128i) _mm_set1_epi32((int)__A);
51 }
52 
53 static __inline__ __m256i __DEFAULT_FN_ATTRS256
55 {
56  return (__m256i) _mm256_set1_epi32((int)__A);
57 }
58 
59 
60 static __inline__ __m128i __DEFAULT_FN_ATTRS128
61 _mm_conflict_epi64 (__m128i __A)
62 {
63  return (__m128i) __builtin_ia32_vpconflictdi_128_mask ((__v2di) __A,
64  (__v2di) _mm_undefined_si128 (),
65  (__mmask8) -1);
66 }
67 
68 static __inline__ __m128i __DEFAULT_FN_ATTRS128
69 _mm_mask_conflict_epi64 (__m128i __W, __mmask8 __U, __m128i __A)
70 {
71  return (__m128i) __builtin_ia32_vpconflictdi_128_mask ((__v2di) __A,
72  (__v2di) __W,
73  (__mmask8) __U);
74 }
75 
76 static __inline__ __m128i __DEFAULT_FN_ATTRS128
78 {
79  return (__m128i) __builtin_ia32_vpconflictdi_128_mask ((__v2di) __A,
80  (__v2di)
82  (__mmask8) __U);
83 }
84 
85 static __inline__ __m256i __DEFAULT_FN_ATTRS256
86 _mm256_conflict_epi64 (__m256i __A)
87 {
88  return (__m256i) __builtin_ia32_vpconflictdi_256_mask ((__v4di) __A,
89  (__v4di) _mm256_undefined_si256 (),
90  (__mmask8) -1);
91 }
92 
93 static __inline__ __m256i __DEFAULT_FN_ATTRS256
94 _mm256_mask_conflict_epi64 (__m256i __W, __mmask8 __U, __m256i __A)
95 {
96  return (__m256i) __builtin_ia32_vpconflictdi_256_mask ((__v4di) __A,
97  (__v4di) __W,
98  (__mmask8) __U);
99 }
100 
101 static __inline__ __m256i __DEFAULT_FN_ATTRS256
103 {
104  return (__m256i) __builtin_ia32_vpconflictdi_256_mask ((__v4di) __A,
105  (__v4di) _mm256_setzero_si256 (),
106  (__mmask8) __U);
107 }
108 
109 static __inline__ __m128i __DEFAULT_FN_ATTRS128
110 _mm_conflict_epi32 (__m128i __A)
111 {
112  return (__m128i) __builtin_ia32_vpconflictsi_128_mask ((__v4si) __A,
113  (__v4si) _mm_undefined_si128 (),
114  (__mmask8) -1);
115 }
116 
117 static __inline__ __m128i __DEFAULT_FN_ATTRS128
118 _mm_mask_conflict_epi32 (__m128i __W, __mmask8 __U, __m128i __A)
119 {
120  return (__m128i) __builtin_ia32_vpconflictsi_128_mask ((__v4si) __A,
121  (__v4si) __W,
122  (__mmask8) __U);
123 }
124 
125 static __inline__ __m128i __DEFAULT_FN_ATTRS128
127 {
128  return (__m128i) __builtin_ia32_vpconflictsi_128_mask ((__v4si) __A,
129  (__v4si) _mm_setzero_si128 (),
130  (__mmask8) __U);
131 }
132 
133 static __inline__ __m256i __DEFAULT_FN_ATTRS256
135 {
136  return (__m256i) __builtin_ia32_vpconflictsi_256_mask ((__v8si) __A,
137  (__v8si) _mm256_undefined_si256 (),
138  (__mmask8) -1);
139 }
140 
141 static __inline__ __m256i __DEFAULT_FN_ATTRS256
142 _mm256_mask_conflict_epi32 (__m256i __W, __mmask8 __U, __m256i __A)
143 {
144  return (__m256i) __builtin_ia32_vpconflictsi_256_mask ((__v8si) __A,
145  (__v8si) __W,
146  (__mmask8) __U);
147 }
148 
149 static __inline__ __m256i __DEFAULT_FN_ATTRS256
151 {
152  return (__m256i) __builtin_ia32_vpconflictsi_256_mask ((__v8si) __A,
153  (__v8si)
155  (__mmask8) __U);
156 }
157 
158 static __inline__ __m128i __DEFAULT_FN_ATTRS128
159 _mm_lzcnt_epi32 (__m128i __A)
160 {
161  return (__m128i) __builtin_ia32_vplzcntd_128 ((__v4si) __A);
162 }
163 
164 static __inline__ __m128i __DEFAULT_FN_ATTRS128
165 _mm_mask_lzcnt_epi32 (__m128i __W, __mmask8 __U, __m128i __A)
166 {
167  return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,
168  (__v4si)_mm_lzcnt_epi32(__A),
169  (__v4si)__W);
170 }
171 
172 static __inline__ __m128i __DEFAULT_FN_ATTRS128
173 _mm_maskz_lzcnt_epi32 (__mmask8 __U, __m128i __A)
174 {
175  return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,
176  (__v4si)_mm_lzcnt_epi32(__A),
177  (__v4si)_mm_setzero_si128());
178 }
179 
180 static __inline__ __m256i __DEFAULT_FN_ATTRS256
181 _mm256_lzcnt_epi32 (__m256i __A)
182 {
183  return (__m256i) __builtin_ia32_vplzcntd_256 ((__v8si) __A);
184 }
185 
186 static __inline__ __m256i __DEFAULT_FN_ATTRS256
187 _mm256_mask_lzcnt_epi32 (__m256i __W, __mmask8 __U, __m256i __A)
188 {
189  return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
190  (__v8si)_mm256_lzcnt_epi32(__A),
191  (__v8si)__W);
192 }
193 
194 static __inline__ __m256i __DEFAULT_FN_ATTRS256
196 {
197  return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
198  (__v8si)_mm256_lzcnt_epi32(__A),
199  (__v8si)_mm256_setzero_si256());
200 }
201 
202 static __inline__ __m128i __DEFAULT_FN_ATTRS128
203 _mm_lzcnt_epi64 (__m128i __A)
204 {
205  return (__m128i) __builtin_ia32_vplzcntq_128 ((__v2di) __A);
206 }
207 
208 static __inline__ __m128i __DEFAULT_FN_ATTRS128
209 _mm_mask_lzcnt_epi64 (__m128i __W, __mmask8 __U, __m128i __A)
210 {
211  return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,
212  (__v2di)_mm_lzcnt_epi64(__A),
213  (__v2di)__W);
214 }
215 
216 static __inline__ __m128i __DEFAULT_FN_ATTRS128
217 _mm_maskz_lzcnt_epi64 (__mmask8 __U, __m128i __A)
218 {
219  return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,
220  (__v2di)_mm_lzcnt_epi64(__A),
221  (__v2di)_mm_setzero_si128());
222 }
223 
224 static __inline__ __m256i __DEFAULT_FN_ATTRS256
225 _mm256_lzcnt_epi64 (__m256i __A)
226 {
227  return (__m256i) __builtin_ia32_vplzcntq_256 ((__v4di) __A);
228 }
229 
230 static __inline__ __m256i __DEFAULT_FN_ATTRS256
231 _mm256_mask_lzcnt_epi64 (__m256i __W, __mmask8 __U, __m256i __A)
232 {
233  return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,
234  (__v4di)_mm256_lzcnt_epi64(__A),
235  (__v4di)__W);
236 }
237 
238 static __inline__ __m256i __DEFAULT_FN_ATTRS256
240 {
241  return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,
242  (__v4di)_mm256_lzcnt_epi64(__A),
243  (__v4di)_mm256_setzero_si256());
244 }
245 
246 #undef __DEFAULT_FN_ATTRS128
247 #undef __DEFAULT_FN_ATTRS256
248 
249 #endif /* __AVX512VLCDINTRIN_H */
#define __DEFAULT_FN_ATTRS256
static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_maskz_conflict_epi32(__mmask8 __U, __m256i __A)
static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_mask_lzcnt_epi64(__m256i __W, __mmask8 __U, __m256i __A)
unsigned char __mmask8
Definition: avx512fintrin.h:47
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_set1_epi64x(long long __q)
Initializes both values in a 128-bit integer vector with the specified 64-bit integer value...
Definition: emmintrin.h:3785
static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_maskz_lzcnt_epi32(__mmask8 __U, __m128i __A)
static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_maskz_conflict_epi64(__mmask8 __U, __m256i __A)
static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_conflict_epi32(__m256i __A)
static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_conflict_epi64(__m256i __A)
static __inline __m256i __DEFAULT_FN_ATTRS _mm256_set1_epi64x(long long __q)
Constructs a 256-bit integer vector of [4 x i64], with each of the 64-bit integral vector elements se...
Definition: avxintrin.h:4249
static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_mask_conflict_epi32(__m128i __W, __mmask8 __U, __m128i __A)
static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_broadcastmw_epi32(__mmask16 __A)
static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_mask_lzcnt_epi32(__m128i __W, __mmask8 __U, __m128i __A)
static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_lzcnt_epi32(__m128i __A)
static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_broadcastmb_epi64(__mmask8 __A)
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_mask_conflict_epi64(__m256i __W, __mmask8 __U, __m256i __A)
static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_maskz_lzcnt_epi64(__mmask8 __U, __m128i __A)
static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_broadcastmw_epi32(__mmask16 __A)
static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_conflict_epi32(__m128i __A)
static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_conflict_epi64(__m128i __A)
static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_mask_lzcnt_epi32(__m256i __W, __mmask8 __U, __m256i __A)
static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_mask_lzcnt_epi64(__m128i __W, __mmask8 __U, __m128i __A)
static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_maskz_conflict_epi64(__mmask8 __U, __m128i __A)
static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_lzcnt_epi64(__m128i __A)
static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_maskz_lzcnt_epi32(__mmask8 __U, __m256i __A)
static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_mask_conflict_epi64(__m128i __W, __mmask8 __U, __m128i __A)
static __inline__ __m128i __DEFAULT_FN_ATTRS128 _mm_maskz_conflict_epi32(__mmask8 __U, __m128i __A)
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_lzcnt_epi32(__m256i __A)
static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_set1_epi32(int __i)
Initializes all values in a 128-bit vector of [4 x i32] with the specified 32-bit value...
Definition: emmintrin.h:3823
static __inline __m256i __DEFAULT_FN_ATTRS _mm256_set1_epi32(int __i)
Constructs a 256-bit integer vector of [8 x i32], with each of the 32-bit integral vector elements se...
Definition: avxintrin.h:4192
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 __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_broadcastmb_epi64(__mmask8 __A)
unsigned short __mmask16
Definition: avx512fintrin.h:48
static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_mask_conflict_epi32(__m256i __W, __mmask8 __U, __m256i __A)
#define __DEFAULT_FN_ATTRS128
static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_maskz_lzcnt_epi64(__mmask8 __U, __m256i __A)
static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_lzcnt_epi64(__m256i __A)