clang  9.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 ((__v2di) __A);
64 }
65 
66 static __inline__ __m128i __DEFAULT_FN_ATTRS128
67 _mm_mask_conflict_epi64 (__m128i __W, __mmask8 __U, __m128i __A)
68 {
69  return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,
70  (__v2di)_mm_conflict_epi64(__A),
71  (__v2di)__W);
72 }
73 
74 static __inline__ __m128i __DEFAULT_FN_ATTRS128
76 {
77  return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,
78  (__v2di)_mm_conflict_epi64(__A),
79  (__v2di)_mm_setzero_si128());
80 }
81 
82 static __inline__ __m256i __DEFAULT_FN_ATTRS256
83 _mm256_conflict_epi64 (__m256i __A)
84 {
85  return (__m256i) __builtin_ia32_vpconflictdi_256 ((__v4di) __A);
86 }
87 
88 static __inline__ __m256i __DEFAULT_FN_ATTRS256
89 _mm256_mask_conflict_epi64 (__m256i __W, __mmask8 __U, __m256i __A)
90 {
91  return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,
92  (__v4di)_mm256_conflict_epi64(__A),
93  (__v4di)__W);
94 }
95 
96 static __inline__ __m256i __DEFAULT_FN_ATTRS256
98 {
99  return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,
100  (__v4di)_mm256_conflict_epi64(__A),
101  (__v4di)_mm256_setzero_si256());
102 }
103 
104 static __inline__ __m128i __DEFAULT_FN_ATTRS128
105 _mm_conflict_epi32 (__m128i __A)
106 {
107  return (__m128i) __builtin_ia32_vpconflictsi_128 ((__v4si) __A);
108 }
109 
110 static __inline__ __m128i __DEFAULT_FN_ATTRS128
111 _mm_mask_conflict_epi32 (__m128i __W, __mmask8 __U, __m128i __A)
112 {
113  return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,
114  (__v4si)_mm_conflict_epi32(__A),
115  (__v4si)__W);
116 }
117 
118 static __inline__ __m128i __DEFAULT_FN_ATTRS128
120 {
121  return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,
122  (__v4si)_mm_conflict_epi32(__A),
123  (__v4si)_mm_setzero_si128());
124 }
125 
126 static __inline__ __m256i __DEFAULT_FN_ATTRS256
128 {
129  return (__m256i) __builtin_ia32_vpconflictsi_256 ((__v8si) __A);
130 }
131 
132 static __inline__ __m256i __DEFAULT_FN_ATTRS256
133 _mm256_mask_conflict_epi32 (__m256i __W, __mmask8 __U, __m256i __A)
134 {
135  return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
136  (__v8si)_mm256_conflict_epi32(__A),
137  (__v8si)__W);
138 }
139 
140 static __inline__ __m256i __DEFAULT_FN_ATTRS256
142 {
143  return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
144  (__v8si)_mm256_conflict_epi32(__A),
145  (__v8si)_mm256_setzero_si256());
146 }
147 
148 static __inline__ __m128i __DEFAULT_FN_ATTRS128
149 _mm_lzcnt_epi32 (__m128i __A)
150 {
151  return (__m128i) __builtin_ia32_vplzcntd_128 ((__v4si) __A);
152 }
153 
154 static __inline__ __m128i __DEFAULT_FN_ATTRS128
155 _mm_mask_lzcnt_epi32 (__m128i __W, __mmask8 __U, __m128i __A)
156 {
157  return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,
158  (__v4si)_mm_lzcnt_epi32(__A),
159  (__v4si)__W);
160 }
161 
162 static __inline__ __m128i __DEFAULT_FN_ATTRS128
163 _mm_maskz_lzcnt_epi32 (__mmask8 __U, __m128i __A)
164 {
165  return (__m128i)__builtin_ia32_selectd_128((__mmask8)__U,
166  (__v4si)_mm_lzcnt_epi32(__A),
167  (__v4si)_mm_setzero_si128());
168 }
169 
170 static __inline__ __m256i __DEFAULT_FN_ATTRS256
171 _mm256_lzcnt_epi32 (__m256i __A)
172 {
173  return (__m256i) __builtin_ia32_vplzcntd_256 ((__v8si) __A);
174 }
175 
176 static __inline__ __m256i __DEFAULT_FN_ATTRS256
177 _mm256_mask_lzcnt_epi32 (__m256i __W, __mmask8 __U, __m256i __A)
178 {
179  return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
180  (__v8si)_mm256_lzcnt_epi32(__A),
181  (__v8si)__W);
182 }
183 
184 static __inline__ __m256i __DEFAULT_FN_ATTRS256
186 {
187  return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
188  (__v8si)_mm256_lzcnt_epi32(__A),
189  (__v8si)_mm256_setzero_si256());
190 }
191 
192 static __inline__ __m128i __DEFAULT_FN_ATTRS128
193 _mm_lzcnt_epi64 (__m128i __A)
194 {
195  return (__m128i) __builtin_ia32_vplzcntq_128 ((__v2di) __A);
196 }
197 
198 static __inline__ __m128i __DEFAULT_FN_ATTRS128
199 _mm_mask_lzcnt_epi64 (__m128i __W, __mmask8 __U, __m128i __A)
200 {
201  return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,
202  (__v2di)_mm_lzcnt_epi64(__A),
203  (__v2di)__W);
204 }
205 
206 static __inline__ __m128i __DEFAULT_FN_ATTRS128
207 _mm_maskz_lzcnt_epi64 (__mmask8 __U, __m128i __A)
208 {
209  return (__m128i)__builtin_ia32_selectq_128((__mmask8)__U,
210  (__v2di)_mm_lzcnt_epi64(__A),
211  (__v2di)_mm_setzero_si128());
212 }
213 
214 static __inline__ __m256i __DEFAULT_FN_ATTRS256
215 _mm256_lzcnt_epi64 (__m256i __A)
216 {
217  return (__m256i) __builtin_ia32_vplzcntq_256 ((__v4di) __A);
218 }
219 
220 static __inline__ __m256i __DEFAULT_FN_ATTRS256
221 _mm256_mask_lzcnt_epi64 (__m256i __W, __mmask8 __U, __m256i __A)
222 {
223  return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,
224  (__v4di)_mm256_lzcnt_epi64(__A),
225  (__v4di)__W);
226 }
227 
228 static __inline__ __m256i __DEFAULT_FN_ATTRS256
230 {
231  return (__m256i)__builtin_ia32_selectq_256((__mmask8)__U,
232  (__v4di)_mm256_lzcnt_epi64(__A),
233  (__v4di)_mm256_setzero_si256());
234 }
235 
236 #undef __DEFAULT_FN_ATTRS128
237 #undef __DEFAULT_FN_ATTRS256
238 
239 #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:51
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:3788
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:4253
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_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:3999
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:3826
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:4196
static __inline __m256i __DEFAULT_FN_ATTRS _mm256_setzero_si256(void)
Constructs a 256-bit integer vector initialized to zero.
Definition: avxintrin.h:4295
static __inline__ __m256i __DEFAULT_FN_ATTRS256 _mm256_broadcastmb_epi64(__mmask8 __A)
unsigned short __mmask16
Definition: avx512fintrin.h:52
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)