1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse2 | FileCheck %s --check-prefixes=SSE,SSE2
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse4.1 | FileCheck %s --check-prefixes=SSE,SSE41
4 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck %s --check-prefixes=AVX,AVX1
5 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx2 | FileCheck %s --check-prefixes=AVX,AVX2
6 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f | FileCheck %s --check-prefixes=AVX512,AVX512F
7 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+avx512bw | FileCheck %s --check-prefixes=AVX512,AVX512BW
8 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+avx512bw,+avx512vl | FileCheck %s --check-prefixes=AVX512,AVX512VL
14 define i1 @trunc_v2i64_v2i1(<2 x i64>) {
15 ; SSE-LABEL: trunc_v2i64_v2i1:
17 ; SSE-NEXT: psllq $63, %xmm0
18 ; SSE-NEXT: movmskpd %xmm0, %eax
19 ; SSE-NEXT: testb %al, %al
23 ; AVX-LABEL: trunc_v2i64_v2i1:
25 ; AVX-NEXT: vpsllq $63, %xmm0, %xmm0
26 ; AVX-NEXT: vmovmskpd %xmm0, %eax
27 ; AVX-NEXT: testb %al, %al
31 ; AVX512F-LABEL: trunc_v2i64_v2i1:
33 ; AVX512F-NEXT: vpsllq $63, %xmm0, %xmm0
34 ; AVX512F-NEXT: vptestmq %zmm0, %zmm0, %k0
35 ; AVX512F-NEXT: kmovw %k0, %eax
36 ; AVX512F-NEXT: testb $3, %al
37 ; AVX512F-NEXT: setnp %al
38 ; AVX512F-NEXT: vzeroupper
41 ; AVX512BW-LABEL: trunc_v2i64_v2i1:
43 ; AVX512BW-NEXT: vpsllq $63, %xmm0, %xmm0
44 ; AVX512BW-NEXT: vptestmq %zmm0, %zmm0, %k0
45 ; AVX512BW-NEXT: kmovd %k0, %eax
46 ; AVX512BW-NEXT: testb $3, %al
47 ; AVX512BW-NEXT: setnp %al
48 ; AVX512BW-NEXT: vzeroupper
51 ; AVX512VL-LABEL: trunc_v2i64_v2i1:
53 ; AVX512VL-NEXT: vpsllq $63, %xmm0, %xmm0
54 ; AVX512VL-NEXT: vptestmq %xmm0, %xmm0, %k0
55 ; AVX512VL-NEXT: kmovd %k0, %eax
56 ; AVX512VL-NEXT: testb $3, %al
57 ; AVX512VL-NEXT: setnp %al
59 %a = trunc <2 x i64> %0 to <2 x i1>
60 %b = call i1 @llvm.vector.reduce.xor.v2i1(<2 x i1> %a)
64 define i1 @trunc_v4i32_v4i1(<4 x i32>) {
65 ; SSE-LABEL: trunc_v4i32_v4i1:
67 ; SSE-NEXT: pslld $31, %xmm0
68 ; SSE-NEXT: movmskps %xmm0, %eax
69 ; SSE-NEXT: testb %al, %al
73 ; AVX-LABEL: trunc_v4i32_v4i1:
75 ; AVX-NEXT: vpslld $31, %xmm0, %xmm0
76 ; AVX-NEXT: vmovmskps %xmm0, %eax
77 ; AVX-NEXT: testb %al, %al
81 ; AVX512F-LABEL: trunc_v4i32_v4i1:
83 ; AVX512F-NEXT: vpslld $31, %xmm0, %xmm0
84 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
85 ; AVX512F-NEXT: kmovw %k0, %eax
86 ; AVX512F-NEXT: testb $15, %al
87 ; AVX512F-NEXT: setnp %al
88 ; AVX512F-NEXT: vzeroupper
91 ; AVX512BW-LABEL: trunc_v4i32_v4i1:
93 ; AVX512BW-NEXT: vpslld $31, %xmm0, %xmm0
94 ; AVX512BW-NEXT: vptestmd %zmm0, %zmm0, %k0
95 ; AVX512BW-NEXT: kmovd %k0, %eax
96 ; AVX512BW-NEXT: testb $15, %al
97 ; AVX512BW-NEXT: setnp %al
98 ; AVX512BW-NEXT: vzeroupper
101 ; AVX512VL-LABEL: trunc_v4i32_v4i1:
103 ; AVX512VL-NEXT: vpslld $31, %xmm0, %xmm0
104 ; AVX512VL-NEXT: vptestmd %xmm0, %xmm0, %k0
105 ; AVX512VL-NEXT: kmovd %k0, %eax
106 ; AVX512VL-NEXT: testb $15, %al
107 ; AVX512VL-NEXT: setnp %al
108 ; AVX512VL-NEXT: retq
109 %a = trunc <4 x i32> %0 to <4 x i1>
110 %b = call i1 @llvm.vector.reduce.xor.v4i1(<4 x i1> %a)
114 define i1 @trunc_v8i16_v8i1(<8 x i8>) {
115 ; SSE2-LABEL: trunc_v8i16_v8i1:
117 ; SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
118 ; SSE2-NEXT: psllw $15, %xmm0
119 ; SSE2-NEXT: packsswb %xmm0, %xmm0
120 ; SSE2-NEXT: pmovmskb %xmm0, %eax
121 ; SSE2-NEXT: testb %al, %al
122 ; SSE2-NEXT: setnp %al
125 ; SSE41-LABEL: trunc_v8i16_v8i1:
127 ; SSE41-NEXT: pmovzxbw {{.*#+}} xmm0 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero,xmm0[4],zero,xmm0[5],zero,xmm0[6],zero,xmm0[7],zero
128 ; SSE41-NEXT: psllw $15, %xmm0
129 ; SSE41-NEXT: packsswb %xmm0, %xmm0
130 ; SSE41-NEXT: pmovmskb %xmm0, %eax
131 ; SSE41-NEXT: testb %al, %al
132 ; SSE41-NEXT: setnp %al
135 ; AVX-LABEL: trunc_v8i16_v8i1:
137 ; AVX-NEXT: vpmovzxbw {{.*#+}} xmm0 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero,xmm0[4],zero,xmm0[5],zero,xmm0[6],zero,xmm0[7],zero
138 ; AVX-NEXT: vpsllw $15, %xmm0, %xmm0
139 ; AVX-NEXT: vpacksswb %xmm0, %xmm0, %xmm0
140 ; AVX-NEXT: vpmovmskb %xmm0, %eax
141 ; AVX-NEXT: testb %al, %al
142 ; AVX-NEXT: setnp %al
145 ; AVX512F-LABEL: trunc_v8i16_v8i1:
147 ; AVX512F-NEXT: vpmovsxbd %xmm0, %zmm0
148 ; AVX512F-NEXT: vpslld $31, %zmm0, %zmm0
149 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
150 ; AVX512F-NEXT: kmovw %k0, %eax
151 ; AVX512F-NEXT: testb %al, %al
152 ; AVX512F-NEXT: setnp %al
153 ; AVX512F-NEXT: vzeroupper
156 ; AVX512BW-LABEL: trunc_v8i16_v8i1:
158 ; AVX512BW-NEXT: vpsllw $7, %xmm0, %xmm0
159 ; AVX512BW-NEXT: vpmovb2m %zmm0, %k0
160 ; AVX512BW-NEXT: kmovd %k0, %eax
161 ; AVX512BW-NEXT: testb %al, %al
162 ; AVX512BW-NEXT: setnp %al
163 ; AVX512BW-NEXT: vzeroupper
164 ; AVX512BW-NEXT: retq
166 ; AVX512VL-LABEL: trunc_v8i16_v8i1:
168 ; AVX512VL-NEXT: vpsllw $7, %xmm0, %xmm0
169 ; AVX512VL-NEXT: vpmovb2m %xmm0, %k0
170 ; AVX512VL-NEXT: kmovd %k0, %eax
171 ; AVX512VL-NEXT: testb %al, %al
172 ; AVX512VL-NEXT: setnp %al
173 ; AVX512VL-NEXT: retq
174 %a = trunc <8 x i8> %0 to <8 x i1>
175 %b = call i1 @llvm.vector.reduce.xor.v8i1(<8 x i1> %a)
179 define i1 @trunc_v16i8_v16i1(<16 x i8>) {
180 ; SSE-LABEL: trunc_v16i8_v16i1:
182 ; SSE-NEXT: psllw $7, %xmm0
183 ; SSE-NEXT: pmovmskb %xmm0, %eax
184 ; SSE-NEXT: xorb %ah, %al
185 ; SSE-NEXT: setnp %al
188 ; AVX-LABEL: trunc_v16i8_v16i1:
190 ; AVX-NEXT: vpsllw $7, %xmm0, %xmm0
191 ; AVX-NEXT: vpmovmskb %xmm0, %eax
192 ; AVX-NEXT: xorb %ah, %al
193 ; AVX-NEXT: setnp %al
196 ; AVX512-LABEL: trunc_v16i8_v16i1:
198 ; AVX512-NEXT: vpsllw $7, %xmm0, %xmm0
199 ; AVX512-NEXT: vpmovmskb %xmm0, %eax
200 ; AVX512-NEXT: xorb %ah, %al
201 ; AVX512-NEXT: setnp %al
203 %a = trunc <16 x i8> %0 to <16 x i1>
204 %b = call i1 @llvm.vector.reduce.xor.v16i1(<16 x i1> %a)
208 define i1 @trunc_v4i64_v4i1(<4 x i64>) {
209 ; SSE-LABEL: trunc_v4i64_v4i1:
211 ; SSE-NEXT: shufps {{.*#+}} xmm0 = xmm0[0,2],xmm1[0,2]
212 ; SSE-NEXT: pslld $31, %xmm0
213 ; SSE-NEXT: movmskps %xmm0, %eax
214 ; SSE-NEXT: testb %al, %al
215 ; SSE-NEXT: setnp %al
218 ; AVX1-LABEL: trunc_v4i64_v4i1:
220 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
221 ; AVX1-NEXT: vshufps {{.*#+}} xmm0 = xmm0[0,2],xmm1[0,2]
222 ; AVX1-NEXT: vpslld $31, %xmm0, %xmm0
223 ; AVX1-NEXT: vmovmskps %xmm0, %eax
224 ; AVX1-NEXT: testb %al, %al
225 ; AVX1-NEXT: setnp %al
226 ; AVX1-NEXT: vzeroupper
229 ; AVX2-LABEL: trunc_v4i64_v4i1:
231 ; AVX2-NEXT: vpsllq $63, %ymm0, %ymm0
232 ; AVX2-NEXT: vmovmskpd %ymm0, %eax
233 ; AVX2-NEXT: testb %al, %al
234 ; AVX2-NEXT: setnp %al
235 ; AVX2-NEXT: vzeroupper
238 ; AVX512F-LABEL: trunc_v4i64_v4i1:
240 ; AVX512F-NEXT: vpsllq $63, %ymm0, %ymm0
241 ; AVX512F-NEXT: vptestmq %zmm0, %zmm0, %k0
242 ; AVX512F-NEXT: kmovw %k0, %eax
243 ; AVX512F-NEXT: testb $15, %al
244 ; AVX512F-NEXT: setnp %al
245 ; AVX512F-NEXT: vzeroupper
248 ; AVX512BW-LABEL: trunc_v4i64_v4i1:
250 ; AVX512BW-NEXT: vpsllq $63, %ymm0, %ymm0
251 ; AVX512BW-NEXT: vptestmq %zmm0, %zmm0, %k0
252 ; AVX512BW-NEXT: kmovd %k0, %eax
253 ; AVX512BW-NEXT: testb $15, %al
254 ; AVX512BW-NEXT: setnp %al
255 ; AVX512BW-NEXT: vzeroupper
256 ; AVX512BW-NEXT: retq
258 ; AVX512VL-LABEL: trunc_v4i64_v4i1:
260 ; AVX512VL-NEXT: vpsllq $63, %ymm0, %ymm0
261 ; AVX512VL-NEXT: vptestmq %ymm0, %ymm0, %k0
262 ; AVX512VL-NEXT: kmovd %k0, %eax
263 ; AVX512VL-NEXT: testb $15, %al
264 ; AVX512VL-NEXT: setnp %al
265 ; AVX512VL-NEXT: vzeroupper
266 ; AVX512VL-NEXT: retq
267 %a = trunc <4 x i64> %0 to <4 x i1>
268 %b = call i1 @llvm.vector.reduce.xor.v4i1(<4 x i1> %a)
272 define i1 @trunc_v8i32_v8i1(<8 x i32>) {
273 ; SSE2-LABEL: trunc_v8i32_v8i1:
275 ; SSE2-NEXT: pslld $16, %xmm1
276 ; SSE2-NEXT: psrad $16, %xmm1
277 ; SSE2-NEXT: pslld $16, %xmm0
278 ; SSE2-NEXT: psrad $16, %xmm0
279 ; SSE2-NEXT: packssdw %xmm1, %xmm0
280 ; SSE2-NEXT: psllw $15, %xmm0
281 ; SSE2-NEXT: packsswb %xmm0, %xmm0
282 ; SSE2-NEXT: pmovmskb %xmm0, %eax
283 ; SSE2-NEXT: testb %al, %al
284 ; SSE2-NEXT: setnp %al
287 ; SSE41-LABEL: trunc_v8i32_v8i1:
289 ; SSE41-NEXT: pxor %xmm2, %xmm2
290 ; SSE41-NEXT: pblendw {{.*#+}} xmm1 = xmm1[0],xmm2[1],xmm1[2],xmm2[3],xmm1[4],xmm2[5],xmm1[6],xmm2[7]
291 ; SSE41-NEXT: pblendw {{.*#+}} xmm0 = xmm0[0],xmm2[1],xmm0[2],xmm2[3],xmm0[4],xmm2[5],xmm0[6],xmm2[7]
292 ; SSE41-NEXT: packusdw %xmm1, %xmm0
293 ; SSE41-NEXT: psllw $15, %xmm0
294 ; SSE41-NEXT: packsswb %xmm0, %xmm0
295 ; SSE41-NEXT: pmovmskb %xmm0, %eax
296 ; SSE41-NEXT: testb %al, %al
297 ; SSE41-NEXT: setnp %al
300 ; AVX1-LABEL: trunc_v8i32_v8i1:
302 ; AVX1-NEXT: vpslld $31, %xmm0, %xmm1
303 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm0
304 ; AVX1-NEXT: vpslld $31, %xmm0, %xmm0
305 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
306 ; AVX1-NEXT: vmovmskps %ymm0, %eax
307 ; AVX1-NEXT: testb %al, %al
308 ; AVX1-NEXT: setnp %al
309 ; AVX1-NEXT: vzeroupper
312 ; AVX2-LABEL: trunc_v8i32_v8i1:
314 ; AVX2-NEXT: vpslld $31, %ymm0, %ymm0
315 ; AVX2-NEXT: vmovmskps %ymm0, %eax
316 ; AVX2-NEXT: testb %al, %al
317 ; AVX2-NEXT: setnp %al
318 ; AVX2-NEXT: vzeroupper
321 ; AVX512F-LABEL: trunc_v8i32_v8i1:
323 ; AVX512F-NEXT: vpslld $31, %ymm0, %ymm0
324 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
325 ; AVX512F-NEXT: kmovw %k0, %eax
326 ; AVX512F-NEXT: testb %al, %al
327 ; AVX512F-NEXT: setnp %al
328 ; AVX512F-NEXT: vzeroupper
331 ; AVX512BW-LABEL: trunc_v8i32_v8i1:
333 ; AVX512BW-NEXT: vpslld $31, %ymm0, %ymm0
334 ; AVX512BW-NEXT: vptestmd %zmm0, %zmm0, %k0
335 ; AVX512BW-NEXT: kmovd %k0, %eax
336 ; AVX512BW-NEXT: testb %al, %al
337 ; AVX512BW-NEXT: setnp %al
338 ; AVX512BW-NEXT: vzeroupper
339 ; AVX512BW-NEXT: retq
341 ; AVX512VL-LABEL: trunc_v8i32_v8i1:
343 ; AVX512VL-NEXT: vpslld $31, %ymm0, %ymm0
344 ; AVX512VL-NEXT: vptestmd %ymm0, %ymm0, %k0
345 ; AVX512VL-NEXT: kmovd %k0, %eax
346 ; AVX512VL-NEXT: testb %al, %al
347 ; AVX512VL-NEXT: setnp %al
348 ; AVX512VL-NEXT: vzeroupper
349 ; AVX512VL-NEXT: retq
350 %a = trunc <8 x i32> %0 to <8 x i1>
351 %b = call i1 @llvm.vector.reduce.xor.v8i1(<8 x i1> %a)
355 define i1 @trunc_v16i16_v16i1(<16 x i16>) {
356 ; SSE-LABEL: trunc_v16i16_v16i1:
358 ; SSE-NEXT: movdqa {{.*#+}} xmm2 = [255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0]
359 ; SSE-NEXT: pand %xmm2, %xmm1
360 ; SSE-NEXT: pand %xmm2, %xmm0
361 ; SSE-NEXT: packuswb %xmm1, %xmm0
362 ; SSE-NEXT: psllw $7, %xmm0
363 ; SSE-NEXT: pmovmskb %xmm0, %eax
364 ; SSE-NEXT: xorb %ah, %al
365 ; SSE-NEXT: setnp %al
368 ; AVX1-LABEL: trunc_v16i16_v16i1:
370 ; AVX1-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0, %ymm0
371 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
372 ; AVX1-NEXT: vpackuswb %xmm1, %xmm0, %xmm0
373 ; AVX1-NEXT: vpsllw $7, %xmm0, %xmm0
374 ; AVX1-NEXT: vpmovmskb %xmm0, %eax
375 ; AVX1-NEXT: xorb %ah, %al
376 ; AVX1-NEXT: setnp %al
377 ; AVX1-NEXT: vzeroupper
380 ; AVX2-LABEL: trunc_v16i16_v16i1:
382 ; AVX2-NEXT: vpand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0, %ymm0
383 ; AVX2-NEXT: vextracti128 $1, %ymm0, %xmm1
384 ; AVX2-NEXT: vpackuswb %xmm1, %xmm0, %xmm0
385 ; AVX2-NEXT: vpsllw $7, %xmm0, %xmm0
386 ; AVX2-NEXT: vpmovmskb %xmm0, %eax
387 ; AVX2-NEXT: xorb %ah, %al
388 ; AVX2-NEXT: setnp %al
389 ; AVX2-NEXT: vzeroupper
392 ; AVX512F-LABEL: trunc_v16i16_v16i1:
394 ; AVX512F-NEXT: vpmovsxwd %ymm0, %zmm0
395 ; AVX512F-NEXT: vpslld $31, %zmm0, %zmm0
396 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
397 ; AVX512F-NEXT: kmovw %k0, %eax
398 ; AVX512F-NEXT: movl %eax, %ecx
399 ; AVX512F-NEXT: shrl $8, %ecx
400 ; AVX512F-NEXT: xorb %al, %cl
401 ; AVX512F-NEXT: setnp %al
402 ; AVX512F-NEXT: vzeroupper
405 ; AVX512BW-LABEL: trunc_v16i16_v16i1:
407 ; AVX512BW-NEXT: vpsllw $15, %ymm0, %ymm0
408 ; AVX512BW-NEXT: vpmovw2m %zmm0, %k0
409 ; AVX512BW-NEXT: kmovd %k0, %eax
410 ; AVX512BW-NEXT: movl %eax, %ecx
411 ; AVX512BW-NEXT: shrl $8, %ecx
412 ; AVX512BW-NEXT: xorb %al, %cl
413 ; AVX512BW-NEXT: setnp %al
414 ; AVX512BW-NEXT: vzeroupper
415 ; AVX512BW-NEXT: retq
417 ; AVX512VL-LABEL: trunc_v16i16_v16i1:
419 ; AVX512VL-NEXT: vpsllw $15, %ymm0, %ymm0
420 ; AVX512VL-NEXT: vpmovw2m %ymm0, %k0
421 ; AVX512VL-NEXT: kmovd %k0, %eax
422 ; AVX512VL-NEXT: movl %eax, %ecx
423 ; AVX512VL-NEXT: shrl $8, %ecx
424 ; AVX512VL-NEXT: xorb %al, %cl
425 ; AVX512VL-NEXT: setnp %al
426 ; AVX512VL-NEXT: vzeroupper
427 ; AVX512VL-NEXT: retq
428 %a = trunc <16 x i16> %0 to <16 x i1>
429 %b = call i1 @llvm.vector.reduce.xor.v16i1(<16 x i1> %a)
433 define i1 @trunc_v32i8_v32i1(<32 x i8>) {
434 ; SSE-LABEL: trunc_v32i8_v32i1:
436 ; SSE-NEXT: pxor %xmm1, %xmm0
437 ; SSE-NEXT: psllw $7, %xmm0
438 ; SSE-NEXT: pmovmskb %xmm0, %eax
439 ; SSE-NEXT: xorb %ah, %al
440 ; SSE-NEXT: setnp %al
443 ; AVX1-LABEL: trunc_v32i8_v32i1:
445 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
446 ; AVX1-NEXT: vpxor %xmm1, %xmm0, %xmm0
447 ; AVX1-NEXT: vpsllw $7, %xmm0, %xmm0
448 ; AVX1-NEXT: vpmovmskb %xmm0, %eax
449 ; AVX1-NEXT: xorb %ah, %al
450 ; AVX1-NEXT: setnp %al
451 ; AVX1-NEXT: vzeroupper
454 ; AVX2-LABEL: trunc_v32i8_v32i1:
456 ; AVX2-NEXT: vpsllw $7, %ymm0, %ymm0
457 ; AVX2-NEXT: vpmovmskb %ymm0, %eax
458 ; AVX2-NEXT: movl %eax, %ecx
459 ; AVX2-NEXT: shrl $16, %ecx
460 ; AVX2-NEXT: xorl %eax, %ecx
461 ; AVX2-NEXT: xorb %ch, %cl
462 ; AVX2-NEXT: setnp %al
463 ; AVX2-NEXT: vzeroupper
466 ; AVX512F-LABEL: trunc_v32i8_v32i1:
468 ; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm1
469 ; AVX512F-NEXT: vpxor %xmm1, %xmm0, %xmm0
470 ; AVX512F-NEXT: vpmovsxbd %xmm0, %zmm0
471 ; AVX512F-NEXT: vpslld $31, %zmm0, %zmm0
472 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
473 ; AVX512F-NEXT: kshiftrw $8, %k0, %k1
474 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
475 ; AVX512F-NEXT: kshiftrw $4, %k0, %k1
476 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
477 ; AVX512F-NEXT: kshiftrw $2, %k0, %k1
478 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
479 ; AVX512F-NEXT: kshiftrw $1, %k0, %k1
480 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
481 ; AVX512F-NEXT: kmovw %k0, %eax
482 ; AVX512F-NEXT: # kill: def $al killed $al killed $eax
483 ; AVX512F-NEXT: vzeroupper
486 ; AVX512BW-LABEL: trunc_v32i8_v32i1:
488 ; AVX512BW-NEXT: vpsllw $7, %ymm0, %ymm0
489 ; AVX512BW-NEXT: vpmovmskb %ymm0, %eax
490 ; AVX512BW-NEXT: movl %eax, %ecx
491 ; AVX512BW-NEXT: shrl $16, %ecx
492 ; AVX512BW-NEXT: xorl %eax, %ecx
493 ; AVX512BW-NEXT: xorb %ch, %cl
494 ; AVX512BW-NEXT: setnp %al
495 ; AVX512BW-NEXT: vzeroupper
496 ; AVX512BW-NEXT: retq
498 ; AVX512VL-LABEL: trunc_v32i8_v32i1:
500 ; AVX512VL-NEXT: vpsllw $7, %ymm0, %ymm0
501 ; AVX512VL-NEXT: vpmovmskb %ymm0, %eax
502 ; AVX512VL-NEXT: movl %eax, %ecx
503 ; AVX512VL-NEXT: shrl $16, %ecx
504 ; AVX512VL-NEXT: xorl %eax, %ecx
505 ; AVX512VL-NEXT: xorb %ch, %cl
506 ; AVX512VL-NEXT: setnp %al
507 ; AVX512VL-NEXT: vzeroupper
508 ; AVX512VL-NEXT: retq
509 %a = trunc <32 x i8> %0 to <32 x i1>
510 %b = call i1 @llvm.vector.reduce.xor.v32i1(<32 x i1> %a)
514 define i1 @trunc_v8i64_v8i1(<8 x i64>) {
515 ; SSE2-LABEL: trunc_v8i64_v8i1:
517 ; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[0,2,2,3]
518 ; SSE2-NEXT: pshuflw {{.*#+}} xmm1 = xmm1[0,2,2,3,4,5,6,7]
519 ; SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,2,2,3]
520 ; SSE2-NEXT: pshuflw {{.*#+}} xmm0 = xmm0[0,2,2,3,4,5,6,7]
521 ; SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
522 ; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm3[0,2,2,3]
523 ; SSE2-NEXT: pshuflw {{.*#+}} xmm1 = xmm1[0,1,0,2,4,5,6,7]
524 ; SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm2[0,2,2,3]
525 ; SSE2-NEXT: pshuflw {{.*#+}} xmm2 = xmm2[0,1,0,2,4,5,6,7]
526 ; SSE2-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
527 ; SSE2-NEXT: movsd {{.*#+}} xmm2 = xmm0[0],xmm2[1]
528 ; SSE2-NEXT: psllw $15, %xmm2
529 ; SSE2-NEXT: packsswb %xmm2, %xmm2
530 ; SSE2-NEXT: pmovmskb %xmm2, %eax
531 ; SSE2-NEXT: testb %al, %al
532 ; SSE2-NEXT: setnp %al
535 ; SSE41-LABEL: trunc_v8i64_v8i1:
537 ; SSE41-NEXT: pxor %xmm4, %xmm4
538 ; SSE41-NEXT: pblendw {{.*#+}} xmm3 = xmm3[0],xmm4[1,2,3],xmm3[4],xmm4[5,6,7]
539 ; SSE41-NEXT: pblendw {{.*#+}} xmm2 = xmm2[0],xmm4[1,2,3],xmm2[4],xmm4[5,6,7]
540 ; SSE41-NEXT: packusdw %xmm3, %xmm2
541 ; SSE41-NEXT: pblendw {{.*#+}} xmm1 = xmm1[0],xmm4[1,2,3],xmm1[4],xmm4[5,6,7]
542 ; SSE41-NEXT: pblendw {{.*#+}} xmm0 = xmm0[0],xmm4[1,2,3],xmm0[4],xmm4[5,6,7]
543 ; SSE41-NEXT: packusdw %xmm1, %xmm0
544 ; SSE41-NEXT: packusdw %xmm2, %xmm0
545 ; SSE41-NEXT: psllw $15, %xmm0
546 ; SSE41-NEXT: packsswb %xmm0, %xmm0
547 ; SSE41-NEXT: pmovmskb %xmm0, %eax
548 ; SSE41-NEXT: testb %al, %al
549 ; SSE41-NEXT: setnp %al
552 ; AVX1-LABEL: trunc_v8i64_v8i1:
554 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm2
555 ; AVX1-NEXT: vshufps {{.*#+}} xmm1 = xmm1[0,2],xmm2[0,2]
556 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2
557 ; AVX1-NEXT: vshufps {{.*#+}} xmm0 = xmm0[0,2],xmm2[0,2]
558 ; AVX1-NEXT: vpslld $31, %xmm0, %xmm0
559 ; AVX1-NEXT: vpslld $31, %xmm1, %xmm1
560 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
561 ; AVX1-NEXT: vmovmskps %ymm0, %eax
562 ; AVX1-NEXT: testb %al, %al
563 ; AVX1-NEXT: setnp %al
564 ; AVX1-NEXT: vzeroupper
567 ; AVX2-LABEL: trunc_v8i64_v8i1:
569 ; AVX2-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm0[2,3],ymm1[2,3]
570 ; AVX2-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
571 ; AVX2-NEXT: vshufps {{.*#+}} ymm0 = ymm0[0,2],ymm2[0,2],ymm0[4,6],ymm2[4,6]
572 ; AVX2-NEXT: vpslld $31, %ymm0, %ymm0
573 ; AVX2-NEXT: vmovmskps %ymm0, %eax
574 ; AVX2-NEXT: testb %al, %al
575 ; AVX2-NEXT: setnp %al
576 ; AVX2-NEXT: vzeroupper
579 ; AVX512F-LABEL: trunc_v8i64_v8i1:
581 ; AVX512F-NEXT: vpsllq $63, %zmm0, %zmm0
582 ; AVX512F-NEXT: vptestmq %zmm0, %zmm0, %k0
583 ; AVX512F-NEXT: kmovw %k0, %eax
584 ; AVX512F-NEXT: testb %al, %al
585 ; AVX512F-NEXT: setnp %al
586 ; AVX512F-NEXT: vzeroupper
589 ; AVX512BW-LABEL: trunc_v8i64_v8i1:
591 ; AVX512BW-NEXT: vpsllq $63, %zmm0, %zmm0
592 ; AVX512BW-NEXT: vptestmq %zmm0, %zmm0, %k0
593 ; AVX512BW-NEXT: kmovd %k0, %eax
594 ; AVX512BW-NEXT: testb %al, %al
595 ; AVX512BW-NEXT: setnp %al
596 ; AVX512BW-NEXT: vzeroupper
597 ; AVX512BW-NEXT: retq
599 ; AVX512VL-LABEL: trunc_v8i64_v8i1:
601 ; AVX512VL-NEXT: vpsllq $63, %zmm0, %zmm0
602 ; AVX512VL-NEXT: vptestmq %zmm0, %zmm0, %k0
603 ; AVX512VL-NEXT: kmovd %k0, %eax
604 ; AVX512VL-NEXT: testb %al, %al
605 ; AVX512VL-NEXT: setnp %al
606 ; AVX512VL-NEXT: vzeroupper
607 ; AVX512VL-NEXT: retq
608 %a = trunc <8 x i64> %0 to <8 x i1>
609 %b = call i1 @llvm.vector.reduce.xor.v8i1(<8 x i1> %a)
613 define i1 @trunc_v16i32_v16i1(<16 x i32>) {
614 ; SSE2-LABEL: trunc_v16i32_v16i1:
616 ; SSE2-NEXT: movdqa {{.*#+}} xmm4 = [255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0]
617 ; SSE2-NEXT: pand %xmm4, %xmm3
618 ; SSE2-NEXT: pand %xmm4, %xmm2
619 ; SSE2-NEXT: packuswb %xmm3, %xmm2
620 ; SSE2-NEXT: pand %xmm4, %xmm1
621 ; SSE2-NEXT: pand %xmm4, %xmm0
622 ; SSE2-NEXT: packuswb %xmm1, %xmm0
623 ; SSE2-NEXT: packuswb %xmm2, %xmm0
624 ; SSE2-NEXT: psllw $7, %xmm0
625 ; SSE2-NEXT: pmovmskb %xmm0, %eax
626 ; SSE2-NEXT: xorb %ah, %al
627 ; SSE2-NEXT: setnp %al
630 ; SSE41-LABEL: trunc_v16i32_v16i1:
632 ; SSE41-NEXT: movdqa {{.*#+}} xmm4 = [255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0]
633 ; SSE41-NEXT: pand %xmm4, %xmm3
634 ; SSE41-NEXT: pand %xmm4, %xmm2
635 ; SSE41-NEXT: packusdw %xmm3, %xmm2
636 ; SSE41-NEXT: pand %xmm4, %xmm1
637 ; SSE41-NEXT: pand %xmm4, %xmm0
638 ; SSE41-NEXT: packusdw %xmm1, %xmm0
639 ; SSE41-NEXT: packuswb %xmm2, %xmm0
640 ; SSE41-NEXT: psllw $7, %xmm0
641 ; SSE41-NEXT: pmovmskb %xmm0, %eax
642 ; SSE41-NEXT: xorb %ah, %al
643 ; SSE41-NEXT: setnp %al
646 ; AVX1-LABEL: trunc_v16i32_v16i1:
648 ; AVX1-NEXT: vmovaps {{.*#+}} ymm2 = [255,255,255,255,255,255,255,255]
649 ; AVX1-NEXT: vandps %ymm2, %ymm1, %ymm1
650 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm3
651 ; AVX1-NEXT: vpackusdw %xmm3, %xmm1, %xmm1
652 ; AVX1-NEXT: vandps %ymm2, %ymm0, %ymm0
653 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2
654 ; AVX1-NEXT: vpackusdw %xmm2, %xmm0, %xmm0
655 ; AVX1-NEXT: vpackuswb %xmm1, %xmm0, %xmm0
656 ; AVX1-NEXT: vpsllw $7, %xmm0, %xmm0
657 ; AVX1-NEXT: vpmovmskb %xmm0, %eax
658 ; AVX1-NEXT: xorb %ah, %al
659 ; AVX1-NEXT: setnp %al
660 ; AVX1-NEXT: vzeroupper
663 ; AVX2-LABEL: trunc_v16i32_v16i1:
665 ; AVX2-NEXT: vpbroadcastd {{.*#+}} ymm2 = [255,255,255,255,255,255,255,255]
666 ; AVX2-NEXT: vpand %ymm2, %ymm1, %ymm1
667 ; AVX2-NEXT: vpand %ymm2, %ymm0, %ymm0
668 ; AVX2-NEXT: vpackusdw %ymm1, %ymm0, %ymm0
669 ; AVX2-NEXT: vextracti128 $1, %ymm0, %xmm1
670 ; AVX2-NEXT: vpackuswb %xmm1, %xmm0, %xmm0
671 ; AVX2-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[0,2,1,3]
672 ; AVX2-NEXT: vpsllw $7, %xmm0, %xmm0
673 ; AVX2-NEXT: vpmovmskb %xmm0, %eax
674 ; AVX2-NEXT: xorb %ah, %al
675 ; AVX2-NEXT: setnp %al
676 ; AVX2-NEXT: vzeroupper
679 ; AVX512F-LABEL: trunc_v16i32_v16i1:
681 ; AVX512F-NEXT: vpslld $31, %zmm0, %zmm0
682 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
683 ; AVX512F-NEXT: kmovw %k0, %eax
684 ; AVX512F-NEXT: movl %eax, %ecx
685 ; AVX512F-NEXT: shrl $8, %ecx
686 ; AVX512F-NEXT: xorb %al, %cl
687 ; AVX512F-NEXT: setnp %al
688 ; AVX512F-NEXT: vzeroupper
691 ; AVX512BW-LABEL: trunc_v16i32_v16i1:
693 ; AVX512BW-NEXT: vpslld $31, %zmm0, %zmm0
694 ; AVX512BW-NEXT: vptestmd %zmm0, %zmm0, %k0
695 ; AVX512BW-NEXT: kmovd %k0, %eax
696 ; AVX512BW-NEXT: movl %eax, %ecx
697 ; AVX512BW-NEXT: shrl $8, %ecx
698 ; AVX512BW-NEXT: xorb %al, %cl
699 ; AVX512BW-NEXT: setnp %al
700 ; AVX512BW-NEXT: vzeroupper
701 ; AVX512BW-NEXT: retq
703 ; AVX512VL-LABEL: trunc_v16i32_v16i1:
705 ; AVX512VL-NEXT: vpslld $31, %zmm0, %zmm0
706 ; AVX512VL-NEXT: vptestmd %zmm0, %zmm0, %k0
707 ; AVX512VL-NEXT: kmovd %k0, %eax
708 ; AVX512VL-NEXT: movl %eax, %ecx
709 ; AVX512VL-NEXT: shrl $8, %ecx
710 ; AVX512VL-NEXT: xorb %al, %cl
711 ; AVX512VL-NEXT: setnp %al
712 ; AVX512VL-NEXT: vzeroupper
713 ; AVX512VL-NEXT: retq
714 %a = trunc <16 x i32> %0 to <16 x i1>
715 %b = call i1 @llvm.vector.reduce.xor.v16i1(<16 x i1> %a)
719 define i1 @trunc_v32i16_v32i1(<32 x i16>) {
720 ; SSE-LABEL: trunc_v32i16_v32i1:
722 ; SSE-NEXT: movdqa {{.*#+}} xmm4 = [255,255,255,255,255,255,255,255]
723 ; SSE-NEXT: pand %xmm4, %xmm3
724 ; SSE-NEXT: pand %xmm4, %xmm2
725 ; SSE-NEXT: packuswb %xmm3, %xmm2
726 ; SSE-NEXT: pand %xmm4, %xmm1
727 ; SSE-NEXT: pand %xmm4, %xmm0
728 ; SSE-NEXT: packuswb %xmm1, %xmm0
729 ; SSE-NEXT: pxor %xmm2, %xmm0
730 ; SSE-NEXT: psllw $7, %xmm0
731 ; SSE-NEXT: pmovmskb %xmm0, %eax
732 ; SSE-NEXT: xorb %ah, %al
733 ; SSE-NEXT: setnp %al
736 ; AVX1-LABEL: trunc_v32i16_v32i1:
738 ; AVX1-NEXT: vxorps %ymm1, %ymm0, %ymm0
739 ; AVX1-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0, %ymm0
740 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
741 ; AVX1-NEXT: vpackuswb %xmm1, %xmm0, %xmm0
742 ; AVX1-NEXT: vpsllw $7, %xmm0, %xmm0
743 ; AVX1-NEXT: vpmovmskb %xmm0, %eax
744 ; AVX1-NEXT: xorb %ah, %al
745 ; AVX1-NEXT: setnp %al
746 ; AVX1-NEXT: vzeroupper
749 ; AVX2-LABEL: trunc_v32i16_v32i1:
751 ; AVX2-NEXT: vpbroadcastw {{.*#+}} ymm2 = [255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255]
752 ; AVX2-NEXT: vpand %ymm2, %ymm1, %ymm1
753 ; AVX2-NEXT: vpand %ymm2, %ymm0, %ymm0
754 ; AVX2-NEXT: vpackuswb %ymm1, %ymm0, %ymm0
755 ; AVX2-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,2,1,3]
756 ; AVX2-NEXT: vpsllw $7, %ymm0, %ymm0
757 ; AVX2-NEXT: vpmovmskb %ymm0, %eax
758 ; AVX2-NEXT: movl %eax, %ecx
759 ; AVX2-NEXT: shrl $16, %ecx
760 ; AVX2-NEXT: xorl %eax, %ecx
761 ; AVX2-NEXT: xorb %ch, %cl
762 ; AVX2-NEXT: setnp %al
763 ; AVX2-NEXT: vzeroupper
766 ; AVX512F-LABEL: trunc_v32i16_v32i1:
768 ; AVX512F-NEXT: vextracti64x4 $1, %zmm0, %ymm1
769 ; AVX512F-NEXT: vpxor %ymm1, %ymm0, %ymm0
770 ; AVX512F-NEXT: vpmovsxwd %ymm0, %zmm0
771 ; AVX512F-NEXT: vpslld $31, %zmm0, %zmm0
772 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
773 ; AVX512F-NEXT: kshiftrw $8, %k0, %k1
774 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
775 ; AVX512F-NEXT: kshiftrw $4, %k0, %k1
776 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
777 ; AVX512F-NEXT: kshiftrw $2, %k0, %k1
778 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
779 ; AVX512F-NEXT: kshiftrw $1, %k0, %k1
780 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
781 ; AVX512F-NEXT: kmovw %k0, %eax
782 ; AVX512F-NEXT: # kill: def $al killed $al killed $eax
783 ; AVX512F-NEXT: vzeroupper
786 ; AVX512BW-LABEL: trunc_v32i16_v32i1:
788 ; AVX512BW-NEXT: vpsllw $15, %zmm0, %zmm0
789 ; AVX512BW-NEXT: vpmovw2m %zmm0, %k0
790 ; AVX512BW-NEXT: kmovd %k0, %eax
791 ; AVX512BW-NEXT: movl %eax, %ecx
792 ; AVX512BW-NEXT: shrl $16, %ecx
793 ; AVX512BW-NEXT: xorl %eax, %ecx
794 ; AVX512BW-NEXT: xorb %ch, %cl
795 ; AVX512BW-NEXT: setnp %al
796 ; AVX512BW-NEXT: vzeroupper
797 ; AVX512BW-NEXT: retq
799 ; AVX512VL-LABEL: trunc_v32i16_v32i1:
801 ; AVX512VL-NEXT: vpsllw $15, %zmm0, %zmm0
802 ; AVX512VL-NEXT: vpmovw2m %zmm0, %k0
803 ; AVX512VL-NEXT: kmovd %k0, %eax
804 ; AVX512VL-NEXT: movl %eax, %ecx
805 ; AVX512VL-NEXT: shrl $16, %ecx
806 ; AVX512VL-NEXT: xorl %eax, %ecx
807 ; AVX512VL-NEXT: xorb %ch, %cl
808 ; AVX512VL-NEXT: setnp %al
809 ; AVX512VL-NEXT: vzeroupper
810 ; AVX512VL-NEXT: retq
811 %a = trunc <32 x i16> %0 to <32 x i1>
812 %b = call i1 @llvm.vector.reduce.xor.v32i1(<32 x i1> %a)
816 define i1 @trunc_v64i8_v64i1(<64 x i8>) {
817 ; SSE-LABEL: trunc_v64i8_v64i1:
819 ; SSE-NEXT: pxor %xmm3, %xmm1
820 ; SSE-NEXT: pxor %xmm2, %xmm1
821 ; SSE-NEXT: pxor %xmm0, %xmm1
822 ; SSE-NEXT: psllw $7, %xmm1
823 ; SSE-NEXT: pmovmskb %xmm1, %eax
824 ; SSE-NEXT: xorb %ah, %al
825 ; SSE-NEXT: setnp %al
828 ; AVX1-LABEL: trunc_v64i8_v64i1:
830 ; AVX1-NEXT: vxorps %ymm1, %ymm0, %ymm0
831 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
832 ; AVX1-NEXT: vxorps %xmm1, %xmm0, %xmm0
833 ; AVX1-NEXT: vpsllw $7, %xmm0, %xmm0
834 ; AVX1-NEXT: vpmovmskb %xmm0, %eax
835 ; AVX1-NEXT: xorb %ah, %al
836 ; AVX1-NEXT: setnp %al
837 ; AVX1-NEXT: vzeroupper
840 ; AVX2-LABEL: trunc_v64i8_v64i1:
842 ; AVX2-NEXT: vpxor %ymm1, %ymm0, %ymm0
843 ; AVX2-NEXT: vpsllw $7, %ymm0, %ymm0
844 ; AVX2-NEXT: vpmovmskb %ymm0, %eax
845 ; AVX2-NEXT: movl %eax, %ecx
846 ; AVX2-NEXT: shrl $16, %ecx
847 ; AVX2-NEXT: xorl %eax, %ecx
848 ; AVX2-NEXT: xorb %ch, %cl
849 ; AVX2-NEXT: setnp %al
850 ; AVX2-NEXT: vzeroupper
853 ; AVX512F-LABEL: trunc_v64i8_v64i1:
855 ; AVX512F-NEXT: vextracti64x4 $1, %zmm0, %ymm1
856 ; AVX512F-NEXT: vextracti128 $1, %ymm1, %xmm2
857 ; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm3
858 ; AVX512F-NEXT: vpxor %xmm2, %xmm3, %xmm2
859 ; AVX512F-NEXT: vpxor %xmm2, %xmm1, %xmm1
860 ; AVX512F-NEXT: vpxor %xmm1, %xmm0, %xmm0
861 ; AVX512F-NEXT: vpmovsxbd %xmm0, %zmm0
862 ; AVX512F-NEXT: vpslld $31, %zmm0, %zmm0
863 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
864 ; AVX512F-NEXT: kshiftrw $8, %k0, %k1
865 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
866 ; AVX512F-NEXT: kshiftrw $4, %k0, %k1
867 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
868 ; AVX512F-NEXT: kshiftrw $2, %k0, %k1
869 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
870 ; AVX512F-NEXT: kshiftrw $1, %k0, %k1
871 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
872 ; AVX512F-NEXT: kmovw %k0, %eax
873 ; AVX512F-NEXT: # kill: def $al killed $al killed $eax
874 ; AVX512F-NEXT: vzeroupper
877 ; AVX512BW-LABEL: trunc_v64i8_v64i1:
879 ; AVX512BW-NEXT: vpsllw $7, %zmm0, %zmm0
880 ; AVX512BW-NEXT: vpmovb2m %zmm0, %k0
881 ; AVX512BW-NEXT: kmovq %k0, %rax
882 ; AVX512BW-NEXT: movq %rax, %rcx
883 ; AVX512BW-NEXT: shrq $32, %rcx
884 ; AVX512BW-NEXT: xorl %eax, %ecx
885 ; AVX512BW-NEXT: movl %ecx, %eax
886 ; AVX512BW-NEXT: shrl $16, %eax
887 ; AVX512BW-NEXT: xorl %ecx, %eax
888 ; AVX512BW-NEXT: xorb %ah, %al
889 ; AVX512BW-NEXT: setnp %al
890 ; AVX512BW-NEXT: vzeroupper
891 ; AVX512BW-NEXT: retq
893 ; AVX512VL-LABEL: trunc_v64i8_v64i1:
895 ; AVX512VL-NEXT: vpsllw $7, %zmm0, %zmm0
896 ; AVX512VL-NEXT: vpmovb2m %zmm0, %k0
897 ; AVX512VL-NEXT: kmovq %k0, %rax
898 ; AVX512VL-NEXT: movq %rax, %rcx
899 ; AVX512VL-NEXT: shrq $32, %rcx
900 ; AVX512VL-NEXT: xorl %eax, %ecx
901 ; AVX512VL-NEXT: movl %ecx, %eax
902 ; AVX512VL-NEXT: shrl $16, %eax
903 ; AVX512VL-NEXT: xorl %ecx, %eax
904 ; AVX512VL-NEXT: xorb %ah, %al
905 ; AVX512VL-NEXT: setnp %al
906 ; AVX512VL-NEXT: vzeroupper
907 ; AVX512VL-NEXT: retq
908 %a = trunc <64 x i8> %0 to <64 x i1>
909 %b = call i1 @llvm.vector.reduce.xor.v64i1(<64 x i1> %a)
917 define i1 @icmp_v2i64_v2i1(<2 x i64>) {
918 ; SSE2-LABEL: icmp_v2i64_v2i1:
920 ; SSE2-NEXT: pxor %xmm1, %xmm1
921 ; SSE2-NEXT: pcmpeqd %xmm0, %xmm1
922 ; SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm1[1,0,3,2]
923 ; SSE2-NEXT: pand %xmm1, %xmm0
924 ; SSE2-NEXT: movmskpd %xmm0, %eax
925 ; SSE2-NEXT: testb %al, %al
926 ; SSE2-NEXT: setnp %al
929 ; SSE41-LABEL: icmp_v2i64_v2i1:
931 ; SSE41-NEXT: pxor %xmm1, %xmm1
932 ; SSE41-NEXT: pcmpeqq %xmm0, %xmm1
933 ; SSE41-NEXT: movmskpd %xmm1, %eax
934 ; SSE41-NEXT: testb %al, %al
935 ; SSE41-NEXT: setnp %al
938 ; AVX-LABEL: icmp_v2i64_v2i1:
940 ; AVX-NEXT: vpxor %xmm1, %xmm1, %xmm1
941 ; AVX-NEXT: vpcmpeqq %xmm1, %xmm0, %xmm0
942 ; AVX-NEXT: vmovmskpd %xmm0, %eax
943 ; AVX-NEXT: testb %al, %al
944 ; AVX-NEXT: setnp %al
947 ; AVX512F-LABEL: icmp_v2i64_v2i1:
949 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
950 ; AVX512F-NEXT: vptestnmq %zmm0, %zmm0, %k0
951 ; AVX512F-NEXT: kmovw %k0, %eax
952 ; AVX512F-NEXT: testb $3, %al
953 ; AVX512F-NEXT: setnp %al
954 ; AVX512F-NEXT: vzeroupper
957 ; AVX512BW-LABEL: icmp_v2i64_v2i1:
959 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
960 ; AVX512BW-NEXT: vptestnmq %zmm0, %zmm0, %k0
961 ; AVX512BW-NEXT: kmovd %k0, %eax
962 ; AVX512BW-NEXT: testb $3, %al
963 ; AVX512BW-NEXT: setnp %al
964 ; AVX512BW-NEXT: vzeroupper
965 ; AVX512BW-NEXT: retq
967 ; AVX512VL-LABEL: icmp_v2i64_v2i1:
969 ; AVX512VL-NEXT: vptestnmq %xmm0, %xmm0, %k0
970 ; AVX512VL-NEXT: kmovd %k0, %eax
971 ; AVX512VL-NEXT: testb $3, %al
972 ; AVX512VL-NEXT: setnp %al
973 ; AVX512VL-NEXT: retq
974 %a = icmp eq <2 x i64> %0, zeroinitializer
975 %b = call i1 @llvm.vector.reduce.xor.v2i1(<2 x i1> %a)
979 define i1 @icmp_v4i32_v4i1(<4 x i32>) {
980 ; SSE-LABEL: icmp_v4i32_v4i1:
982 ; SSE-NEXT: pxor %xmm1, %xmm1
983 ; SSE-NEXT: pcmpeqd %xmm0, %xmm1
984 ; SSE-NEXT: movmskps %xmm1, %eax
985 ; SSE-NEXT: testb %al, %al
986 ; SSE-NEXT: setnp %al
989 ; AVX-LABEL: icmp_v4i32_v4i1:
991 ; AVX-NEXT: vpxor %xmm1, %xmm1, %xmm1
992 ; AVX-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
993 ; AVX-NEXT: vmovmskps %xmm0, %eax
994 ; AVX-NEXT: testb %al, %al
995 ; AVX-NEXT: setnp %al
998 ; AVX512F-LABEL: icmp_v4i32_v4i1:
1000 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1001 ; AVX512F-NEXT: vptestnmd %zmm0, %zmm0, %k0
1002 ; AVX512F-NEXT: kmovw %k0, %eax
1003 ; AVX512F-NEXT: testb $15, %al
1004 ; AVX512F-NEXT: setnp %al
1005 ; AVX512F-NEXT: vzeroupper
1006 ; AVX512F-NEXT: retq
1008 ; AVX512BW-LABEL: icmp_v4i32_v4i1:
1009 ; AVX512BW: # %bb.0:
1010 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1011 ; AVX512BW-NEXT: vptestnmd %zmm0, %zmm0, %k0
1012 ; AVX512BW-NEXT: kmovd %k0, %eax
1013 ; AVX512BW-NEXT: testb $15, %al
1014 ; AVX512BW-NEXT: setnp %al
1015 ; AVX512BW-NEXT: vzeroupper
1016 ; AVX512BW-NEXT: retq
1018 ; AVX512VL-LABEL: icmp_v4i32_v4i1:
1019 ; AVX512VL: # %bb.0:
1020 ; AVX512VL-NEXT: vptestnmd %xmm0, %xmm0, %k0
1021 ; AVX512VL-NEXT: kmovd %k0, %eax
1022 ; AVX512VL-NEXT: testb $15, %al
1023 ; AVX512VL-NEXT: setnp %al
1024 ; AVX512VL-NEXT: retq
1025 %a = icmp eq <4 x i32> %0, zeroinitializer
1026 %b = call i1 @llvm.vector.reduce.xor.v4i1(<4 x i1> %a)
1030 define i1 @icmp_v8i16_v8i1(<8 x i8>) {
1031 ; SSE-LABEL: icmp_v8i16_v8i1:
1033 ; SSE-NEXT: pxor %xmm1, %xmm1
1034 ; SSE-NEXT: pcmpeqb %xmm0, %xmm1
1035 ; SSE-NEXT: pmovmskb %xmm1, %eax
1036 ; SSE-NEXT: testb %al, %al
1037 ; SSE-NEXT: setnp %al
1040 ; AVX-LABEL: icmp_v8i16_v8i1:
1042 ; AVX-NEXT: vpxor %xmm1, %xmm1, %xmm1
1043 ; AVX-NEXT: vpcmpeqb %xmm1, %xmm0, %xmm0
1044 ; AVX-NEXT: vpmovmskb %xmm0, %eax
1045 ; AVX-NEXT: testb %al, %al
1046 ; AVX-NEXT: setnp %al
1049 ; AVX512F-LABEL: icmp_v8i16_v8i1:
1051 ; AVX512F-NEXT: vpxor %xmm1, %xmm1, %xmm1
1052 ; AVX512F-NEXT: vpcmpeqb %xmm1, %xmm0, %xmm0
1053 ; AVX512F-NEXT: vpmovsxbd %xmm0, %zmm0
1054 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
1055 ; AVX512F-NEXT: kmovw %k0, %eax
1056 ; AVX512F-NEXT: testb %al, %al
1057 ; AVX512F-NEXT: setnp %al
1058 ; AVX512F-NEXT: vzeroupper
1059 ; AVX512F-NEXT: retq
1061 ; AVX512BW-LABEL: icmp_v8i16_v8i1:
1062 ; AVX512BW: # %bb.0:
1063 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1064 ; AVX512BW-NEXT: vptestnmb %zmm0, %zmm0, %k0
1065 ; AVX512BW-NEXT: kmovd %k0, %eax
1066 ; AVX512BW-NEXT: testb %al, %al
1067 ; AVX512BW-NEXT: setnp %al
1068 ; AVX512BW-NEXT: vzeroupper
1069 ; AVX512BW-NEXT: retq
1071 ; AVX512VL-LABEL: icmp_v8i16_v8i1:
1072 ; AVX512VL: # %bb.0:
1073 ; AVX512VL-NEXT: vptestnmb %xmm0, %xmm0, %k0
1074 ; AVX512VL-NEXT: kmovd %k0, %eax
1075 ; AVX512VL-NEXT: testb %al, %al
1076 ; AVX512VL-NEXT: setnp %al
1077 ; AVX512VL-NEXT: retq
1078 %a = icmp eq <8 x i8> %0, zeroinitializer
1079 %b = call i1 @llvm.vector.reduce.xor.v8i1(<8 x i1> %a)
1083 define i1 @icmp_v16i8_v16i1(<16 x i8>) {
1084 ; SSE-LABEL: icmp_v16i8_v16i1:
1086 ; SSE-NEXT: pxor %xmm1, %xmm1
1087 ; SSE-NEXT: pcmpeqb %xmm0, %xmm1
1088 ; SSE-NEXT: pmovmskb %xmm1, %eax
1089 ; SSE-NEXT: xorb %ah, %al
1090 ; SSE-NEXT: setnp %al
1093 ; AVX-LABEL: icmp_v16i8_v16i1:
1095 ; AVX-NEXT: vpxor %xmm1, %xmm1, %xmm1
1096 ; AVX-NEXT: vpcmpeqb %xmm1, %xmm0, %xmm0
1097 ; AVX-NEXT: vpmovmskb %xmm0, %eax
1098 ; AVX-NEXT: xorb %ah, %al
1099 ; AVX-NEXT: setnp %al
1102 ; AVX512F-LABEL: icmp_v16i8_v16i1:
1104 ; AVX512F-NEXT: vpxor %xmm1, %xmm1, %xmm1
1105 ; AVX512F-NEXT: vpcmpeqb %xmm1, %xmm0, %xmm0
1106 ; AVX512F-NEXT: vpmovmskb %xmm0, %eax
1107 ; AVX512F-NEXT: xorb %ah, %al
1108 ; AVX512F-NEXT: setnp %al
1109 ; AVX512F-NEXT: retq
1111 ; AVX512BW-LABEL: icmp_v16i8_v16i1:
1112 ; AVX512BW: # %bb.0:
1113 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1114 ; AVX512BW-NEXT: vptestnmb %zmm0, %zmm0, %k0
1115 ; AVX512BW-NEXT: kmovd %k0, %eax
1116 ; AVX512BW-NEXT: movl %eax, %ecx
1117 ; AVX512BW-NEXT: shrl $8, %ecx
1118 ; AVX512BW-NEXT: xorb %al, %cl
1119 ; AVX512BW-NEXT: setnp %al
1120 ; AVX512BW-NEXT: vzeroupper
1121 ; AVX512BW-NEXT: retq
1123 ; AVX512VL-LABEL: icmp_v16i8_v16i1:
1124 ; AVX512VL: # %bb.0:
1125 ; AVX512VL-NEXT: vptestnmb %xmm0, %xmm0, %k0
1126 ; AVX512VL-NEXT: kmovd %k0, %eax
1127 ; AVX512VL-NEXT: movl %eax, %ecx
1128 ; AVX512VL-NEXT: shrl $8, %ecx
1129 ; AVX512VL-NEXT: xorb %al, %cl
1130 ; AVX512VL-NEXT: setnp %al
1131 ; AVX512VL-NEXT: retq
1132 %a = icmp eq <16 x i8> %0, zeroinitializer
1133 %b = call i1 @llvm.vector.reduce.xor.v16i1(<16 x i1> %a)
1137 define i1 @icmp_v4i64_v4i1(<4 x i64>) {
1138 ; SSE2-LABEL: icmp_v4i64_v4i1:
1140 ; SSE2-NEXT: pxor %xmm2, %xmm2
1141 ; SSE2-NEXT: pcmpeqd %xmm2, %xmm1
1142 ; SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm1[1,0,3,2]
1143 ; SSE2-NEXT: pand %xmm1, %xmm3
1144 ; SSE2-NEXT: pcmpeqd %xmm2, %xmm0
1145 ; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,0,3,2]
1146 ; SSE2-NEXT: pand %xmm0, %xmm1
1147 ; SSE2-NEXT: packssdw %xmm3, %xmm1
1148 ; SSE2-NEXT: movmskps %xmm1, %eax
1149 ; SSE2-NEXT: testb %al, %al
1150 ; SSE2-NEXT: setnp %al
1153 ; SSE41-LABEL: icmp_v4i64_v4i1:
1155 ; SSE41-NEXT: pxor %xmm2, %xmm2
1156 ; SSE41-NEXT: pcmpeqq %xmm2, %xmm1
1157 ; SSE41-NEXT: pcmpeqq %xmm2, %xmm0
1158 ; SSE41-NEXT: packssdw %xmm1, %xmm0
1159 ; SSE41-NEXT: movmskps %xmm0, %eax
1160 ; SSE41-NEXT: testb %al, %al
1161 ; SSE41-NEXT: setnp %al
1164 ; AVX1-LABEL: icmp_v4i64_v4i1:
1166 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
1167 ; AVX1-NEXT: vpxor %xmm2, %xmm2, %xmm2
1168 ; AVX1-NEXT: vpcmpeqq %xmm2, %xmm1, %xmm1
1169 ; AVX1-NEXT: vpcmpeqq %xmm2, %xmm0, %xmm0
1170 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
1171 ; AVX1-NEXT: vmovmskpd %ymm0, %eax
1172 ; AVX1-NEXT: testb %al, %al
1173 ; AVX1-NEXT: setnp %al
1174 ; AVX1-NEXT: vzeroupper
1177 ; AVX2-LABEL: icmp_v4i64_v4i1:
1179 ; AVX2-NEXT: vpxor %xmm1, %xmm1, %xmm1
1180 ; AVX2-NEXT: vpcmpeqq %ymm1, %ymm0, %ymm0
1181 ; AVX2-NEXT: vmovmskpd %ymm0, %eax
1182 ; AVX2-NEXT: testb %al, %al
1183 ; AVX2-NEXT: setnp %al
1184 ; AVX2-NEXT: vzeroupper
1187 ; AVX512F-LABEL: icmp_v4i64_v4i1:
1189 ; AVX512F-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
1190 ; AVX512F-NEXT: vptestnmq %zmm0, %zmm0, %k0
1191 ; AVX512F-NEXT: kmovw %k0, %eax
1192 ; AVX512F-NEXT: testb $15, %al
1193 ; AVX512F-NEXT: setnp %al
1194 ; AVX512F-NEXT: vzeroupper
1195 ; AVX512F-NEXT: retq
1197 ; AVX512BW-LABEL: icmp_v4i64_v4i1:
1198 ; AVX512BW: # %bb.0:
1199 ; AVX512BW-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
1200 ; AVX512BW-NEXT: vptestnmq %zmm0, %zmm0, %k0
1201 ; AVX512BW-NEXT: kmovd %k0, %eax
1202 ; AVX512BW-NEXT: testb $15, %al
1203 ; AVX512BW-NEXT: setnp %al
1204 ; AVX512BW-NEXT: vzeroupper
1205 ; AVX512BW-NEXT: retq
1207 ; AVX512VL-LABEL: icmp_v4i64_v4i1:
1208 ; AVX512VL: # %bb.0:
1209 ; AVX512VL-NEXT: vptestnmq %ymm0, %ymm0, %k0
1210 ; AVX512VL-NEXT: kmovd %k0, %eax
1211 ; AVX512VL-NEXT: testb $15, %al
1212 ; AVX512VL-NEXT: setnp %al
1213 ; AVX512VL-NEXT: vzeroupper
1214 ; AVX512VL-NEXT: retq
1215 %a = icmp eq <4 x i64> %0, zeroinitializer
1216 %b = call i1 @llvm.vector.reduce.xor.v4i1(<4 x i1> %a)
1220 define i1 @icmp_v8i32_v8i1(<8 x i32>) {
1221 ; SSE-LABEL: icmp_v8i32_v8i1:
1223 ; SSE-NEXT: pxor %xmm2, %xmm2
1224 ; SSE-NEXT: pcmpeqd %xmm2, %xmm1
1225 ; SSE-NEXT: pcmpeqd %xmm2, %xmm0
1226 ; SSE-NEXT: packssdw %xmm1, %xmm0
1227 ; SSE-NEXT: packsswb %xmm0, %xmm0
1228 ; SSE-NEXT: pmovmskb %xmm0, %eax
1229 ; SSE-NEXT: testb %al, %al
1230 ; SSE-NEXT: setnp %al
1233 ; AVX1-LABEL: icmp_v8i32_v8i1:
1235 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
1236 ; AVX1-NEXT: vpxor %xmm2, %xmm2, %xmm2
1237 ; AVX1-NEXT: vpcmpeqd %xmm2, %xmm1, %xmm1
1238 ; AVX1-NEXT: vpcmpeqd %xmm2, %xmm0, %xmm0
1239 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
1240 ; AVX1-NEXT: vmovmskps %ymm0, %eax
1241 ; AVX1-NEXT: testb %al, %al
1242 ; AVX1-NEXT: setnp %al
1243 ; AVX1-NEXT: vzeroupper
1246 ; AVX2-LABEL: icmp_v8i32_v8i1:
1248 ; AVX2-NEXT: vpxor %xmm1, %xmm1, %xmm1
1249 ; AVX2-NEXT: vpcmpeqd %ymm1, %ymm0, %ymm0
1250 ; AVX2-NEXT: vmovmskps %ymm0, %eax
1251 ; AVX2-NEXT: testb %al, %al
1252 ; AVX2-NEXT: setnp %al
1253 ; AVX2-NEXT: vzeroupper
1256 ; AVX512F-LABEL: icmp_v8i32_v8i1:
1258 ; AVX512F-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
1259 ; AVX512F-NEXT: vptestnmd %zmm0, %zmm0, %k0
1260 ; AVX512F-NEXT: kmovw %k0, %eax
1261 ; AVX512F-NEXT: testb %al, %al
1262 ; AVX512F-NEXT: setnp %al
1263 ; AVX512F-NEXT: vzeroupper
1264 ; AVX512F-NEXT: retq
1266 ; AVX512BW-LABEL: icmp_v8i32_v8i1:
1267 ; AVX512BW: # %bb.0:
1268 ; AVX512BW-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
1269 ; AVX512BW-NEXT: vptestnmd %zmm0, %zmm0, %k0
1270 ; AVX512BW-NEXT: kmovd %k0, %eax
1271 ; AVX512BW-NEXT: testb %al, %al
1272 ; AVX512BW-NEXT: setnp %al
1273 ; AVX512BW-NEXT: vzeroupper
1274 ; AVX512BW-NEXT: retq
1276 ; AVX512VL-LABEL: icmp_v8i32_v8i1:
1277 ; AVX512VL: # %bb.0:
1278 ; AVX512VL-NEXT: vptestnmd %ymm0, %ymm0, %k0
1279 ; AVX512VL-NEXT: kmovd %k0, %eax
1280 ; AVX512VL-NEXT: testb %al, %al
1281 ; AVX512VL-NEXT: setnp %al
1282 ; AVX512VL-NEXT: vzeroupper
1283 ; AVX512VL-NEXT: retq
1284 %a = icmp eq <8 x i32> %0, zeroinitializer
1285 %b = call i1 @llvm.vector.reduce.xor.v8i1(<8 x i1> %a)
1289 define i1 @icmp_v16i16_v16i1(<16 x i16>) {
1290 ; SSE-LABEL: icmp_v16i16_v16i1:
1292 ; SSE-NEXT: pxor %xmm2, %xmm2
1293 ; SSE-NEXT: pcmpeqw %xmm2, %xmm1
1294 ; SSE-NEXT: pcmpeqw %xmm2, %xmm0
1295 ; SSE-NEXT: packsswb %xmm1, %xmm0
1296 ; SSE-NEXT: pmovmskb %xmm0, %eax
1297 ; SSE-NEXT: xorb %ah, %al
1298 ; SSE-NEXT: setnp %al
1301 ; AVX1-LABEL: icmp_v16i16_v16i1:
1303 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
1304 ; AVX1-NEXT: vpxor %xmm2, %xmm2, %xmm2
1305 ; AVX1-NEXT: vpcmpeqw %xmm2, %xmm1, %xmm1
1306 ; AVX1-NEXT: vpcmpeqw %xmm2, %xmm0, %xmm0
1307 ; AVX1-NEXT: vpacksswb %xmm1, %xmm0, %xmm0
1308 ; AVX1-NEXT: vpmovmskb %xmm0, %eax
1309 ; AVX1-NEXT: xorb %ah, %al
1310 ; AVX1-NEXT: setnp %al
1311 ; AVX1-NEXT: vzeroupper
1314 ; AVX2-LABEL: icmp_v16i16_v16i1:
1316 ; AVX2-NEXT: vpxor %xmm1, %xmm1, %xmm1
1317 ; AVX2-NEXT: vpcmpeqw %ymm1, %ymm0, %ymm0
1318 ; AVX2-NEXT: vextracti128 $1, %ymm0, %xmm1
1319 ; AVX2-NEXT: vpacksswb %xmm1, %xmm0, %xmm0
1320 ; AVX2-NEXT: vpmovmskb %xmm0, %eax
1321 ; AVX2-NEXT: xorb %ah, %al
1322 ; AVX2-NEXT: setnp %al
1323 ; AVX2-NEXT: vzeroupper
1326 ; AVX512F-LABEL: icmp_v16i16_v16i1:
1328 ; AVX512F-NEXT: vpxor %xmm1, %xmm1, %xmm1
1329 ; AVX512F-NEXT: vpcmpeqw %ymm1, %ymm0, %ymm0
1330 ; AVX512F-NEXT: vpmovsxwd %ymm0, %zmm0
1331 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
1332 ; AVX512F-NEXT: kmovw %k0, %eax
1333 ; AVX512F-NEXT: movl %eax, %ecx
1334 ; AVX512F-NEXT: shrl $8, %ecx
1335 ; AVX512F-NEXT: xorb %al, %cl
1336 ; AVX512F-NEXT: setnp %al
1337 ; AVX512F-NEXT: vzeroupper
1338 ; AVX512F-NEXT: retq
1340 ; AVX512BW-LABEL: icmp_v16i16_v16i1:
1341 ; AVX512BW: # %bb.0:
1342 ; AVX512BW-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
1343 ; AVX512BW-NEXT: vptestnmw %zmm0, %zmm0, %k0
1344 ; AVX512BW-NEXT: kmovd %k0, %eax
1345 ; AVX512BW-NEXT: movl %eax, %ecx
1346 ; AVX512BW-NEXT: shrl $8, %ecx
1347 ; AVX512BW-NEXT: xorb %al, %cl
1348 ; AVX512BW-NEXT: setnp %al
1349 ; AVX512BW-NEXT: vzeroupper
1350 ; AVX512BW-NEXT: retq
1352 ; AVX512VL-LABEL: icmp_v16i16_v16i1:
1353 ; AVX512VL: # %bb.0:
1354 ; AVX512VL-NEXT: vptestnmw %ymm0, %ymm0, %k0
1355 ; AVX512VL-NEXT: kmovd %k0, %eax
1356 ; AVX512VL-NEXT: movl %eax, %ecx
1357 ; AVX512VL-NEXT: shrl $8, %ecx
1358 ; AVX512VL-NEXT: xorb %al, %cl
1359 ; AVX512VL-NEXT: setnp %al
1360 ; AVX512VL-NEXT: vzeroupper
1361 ; AVX512VL-NEXT: retq
1362 %a = icmp eq <16 x i16> %0, zeroinitializer
1363 %b = call i1 @llvm.vector.reduce.xor.v16i1(<16 x i1> %a)
1367 define i1 @icmp_v32i8_v32i1(<32 x i8>) {
1368 ; SSE-LABEL: icmp_v32i8_v32i1:
1370 ; SSE-NEXT: pxor %xmm2, %xmm2
1371 ; SSE-NEXT: pcmpeqb %xmm2, %xmm1
1372 ; SSE-NEXT: pcmpeqb %xmm2, %xmm0
1373 ; SSE-NEXT: pxor %xmm1, %xmm0
1374 ; SSE-NEXT: pmovmskb %xmm0, %eax
1375 ; SSE-NEXT: xorb %ah, %al
1376 ; SSE-NEXT: setnp %al
1379 ; AVX1-LABEL: icmp_v32i8_v32i1:
1381 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
1382 ; AVX1-NEXT: vpxor %xmm2, %xmm2, %xmm2
1383 ; AVX1-NEXT: vpcmpeqb %xmm2, %xmm1, %xmm1
1384 ; AVX1-NEXT: vpcmpeqb %xmm2, %xmm0, %xmm0
1385 ; AVX1-NEXT: vpxor %xmm1, %xmm0, %xmm0
1386 ; AVX1-NEXT: vpmovmskb %xmm0, %eax
1387 ; AVX1-NEXT: xorb %ah, %al
1388 ; AVX1-NEXT: setnp %al
1389 ; AVX1-NEXT: vzeroupper
1392 ; AVX2-LABEL: icmp_v32i8_v32i1:
1394 ; AVX2-NEXT: vpxor %xmm1, %xmm1, %xmm1
1395 ; AVX2-NEXT: vpcmpeqb %ymm1, %ymm0, %ymm0
1396 ; AVX2-NEXT: vpmovmskb %ymm0, %eax
1397 ; AVX2-NEXT: movl %eax, %ecx
1398 ; AVX2-NEXT: shrl $16, %ecx
1399 ; AVX2-NEXT: xorl %eax, %ecx
1400 ; AVX2-NEXT: xorb %ch, %cl
1401 ; AVX2-NEXT: setnp %al
1402 ; AVX2-NEXT: vzeroupper
1405 ; AVX512F-LABEL: icmp_v32i8_v32i1:
1407 ; AVX512F-NEXT: vpxor %xmm1, %xmm1, %xmm1
1408 ; AVX512F-NEXT: vpcmpeqb %ymm1, %ymm0, %ymm0
1409 ; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm1
1410 ; AVX512F-NEXT: vpxor %xmm1, %xmm0, %xmm0
1411 ; AVX512F-NEXT: vpmovsxbd %xmm0, %zmm0
1412 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
1413 ; AVX512F-NEXT: kshiftrw $8, %k0, %k1
1414 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
1415 ; AVX512F-NEXT: kshiftrw $4, %k0, %k1
1416 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
1417 ; AVX512F-NEXT: kshiftrw $2, %k0, %k1
1418 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
1419 ; AVX512F-NEXT: kshiftrw $1, %k0, %k1
1420 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
1421 ; AVX512F-NEXT: kmovw %k0, %eax
1422 ; AVX512F-NEXT: # kill: def $al killed $al killed $eax
1423 ; AVX512F-NEXT: vzeroupper
1424 ; AVX512F-NEXT: retq
1426 ; AVX512BW-LABEL: icmp_v32i8_v32i1:
1427 ; AVX512BW: # %bb.0:
1428 ; AVX512BW-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
1429 ; AVX512BW-NEXT: vptestnmb %zmm0, %zmm0, %k0
1430 ; AVX512BW-NEXT: kmovd %k0, %eax
1431 ; AVX512BW-NEXT: movl %eax, %ecx
1432 ; AVX512BW-NEXT: shrl $16, %ecx
1433 ; AVX512BW-NEXT: xorl %eax, %ecx
1434 ; AVX512BW-NEXT: xorb %ch, %cl
1435 ; AVX512BW-NEXT: setnp %al
1436 ; AVX512BW-NEXT: vzeroupper
1437 ; AVX512BW-NEXT: retq
1439 ; AVX512VL-LABEL: icmp_v32i8_v32i1:
1440 ; AVX512VL: # %bb.0:
1441 ; AVX512VL-NEXT: vptestnmb %ymm0, %ymm0, %k0
1442 ; AVX512VL-NEXT: kmovd %k0, %eax
1443 ; AVX512VL-NEXT: movl %eax, %ecx
1444 ; AVX512VL-NEXT: shrl $16, %ecx
1445 ; AVX512VL-NEXT: xorl %eax, %ecx
1446 ; AVX512VL-NEXT: xorb %ch, %cl
1447 ; AVX512VL-NEXT: setnp %al
1448 ; AVX512VL-NEXT: vzeroupper
1449 ; AVX512VL-NEXT: retq
1450 %a = icmp eq <32 x i8> %0, zeroinitializer
1451 %b = call i1 @llvm.vector.reduce.xor.v32i1(<32 x i1> %a)
1455 define i1 @icmp_v8i64_v8i1(<8 x i64>) {
1456 ; SSE2-LABEL: icmp_v8i64_v8i1:
1458 ; SSE2-NEXT: pxor %xmm4, %xmm4
1459 ; SSE2-NEXT: pcmpeqd %xmm4, %xmm3
1460 ; SSE2-NEXT: pshufd {{.*#+}} xmm5 = xmm3[1,0,3,2]
1461 ; SSE2-NEXT: pand %xmm3, %xmm5
1462 ; SSE2-NEXT: pcmpeqd %xmm4, %xmm2
1463 ; SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm2[1,0,3,2]
1464 ; SSE2-NEXT: pand %xmm2, %xmm3
1465 ; SSE2-NEXT: packssdw %xmm5, %xmm3
1466 ; SSE2-NEXT: pcmpeqd %xmm4, %xmm1
1467 ; SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm1[1,0,3,2]
1468 ; SSE2-NEXT: pand %xmm1, %xmm2
1469 ; SSE2-NEXT: pcmpeqd %xmm4, %xmm0
1470 ; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,0,3,2]
1471 ; SSE2-NEXT: pand %xmm0, %xmm1
1472 ; SSE2-NEXT: packssdw %xmm2, %xmm1
1473 ; SSE2-NEXT: packssdw %xmm3, %xmm1
1474 ; SSE2-NEXT: packsswb %xmm1, %xmm1
1475 ; SSE2-NEXT: pmovmskb %xmm1, %eax
1476 ; SSE2-NEXT: testb %al, %al
1477 ; SSE2-NEXT: setnp %al
1480 ; SSE41-LABEL: icmp_v8i64_v8i1:
1482 ; SSE41-NEXT: pxor %xmm4, %xmm4
1483 ; SSE41-NEXT: pcmpeqq %xmm4, %xmm3
1484 ; SSE41-NEXT: pcmpeqq %xmm4, %xmm2
1485 ; SSE41-NEXT: packssdw %xmm3, %xmm2
1486 ; SSE41-NEXT: pcmpeqq %xmm4, %xmm1
1487 ; SSE41-NEXT: pcmpeqq %xmm4, %xmm0
1488 ; SSE41-NEXT: packssdw %xmm1, %xmm0
1489 ; SSE41-NEXT: packssdw %xmm2, %xmm0
1490 ; SSE41-NEXT: packsswb %xmm0, %xmm0
1491 ; SSE41-NEXT: pmovmskb %xmm0, %eax
1492 ; SSE41-NEXT: testb %al, %al
1493 ; SSE41-NEXT: setnp %al
1496 ; AVX1-LABEL: icmp_v8i64_v8i1:
1498 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm2
1499 ; AVX1-NEXT: vpxor %xmm3, %xmm3, %xmm3
1500 ; AVX1-NEXT: vpcmpeqq %xmm3, %xmm2, %xmm2
1501 ; AVX1-NEXT: vpcmpeqq %xmm3, %xmm1, %xmm1
1502 ; AVX1-NEXT: vpackssdw %xmm2, %xmm1, %xmm1
1503 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2
1504 ; AVX1-NEXT: vpcmpeqq %xmm3, %xmm2, %xmm2
1505 ; AVX1-NEXT: vpcmpeqq %xmm3, %xmm0, %xmm0
1506 ; AVX1-NEXT: vpackssdw %xmm2, %xmm0, %xmm0
1507 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
1508 ; AVX1-NEXT: vmovmskps %ymm0, %eax
1509 ; AVX1-NEXT: testb %al, %al
1510 ; AVX1-NEXT: setnp %al
1511 ; AVX1-NEXT: vzeroupper
1514 ; AVX2-LABEL: icmp_v8i64_v8i1:
1516 ; AVX2-NEXT: vpxor %xmm2, %xmm2, %xmm2
1517 ; AVX2-NEXT: vpcmpeqq %ymm2, %ymm1, %ymm1
1518 ; AVX2-NEXT: vpcmpeqq %ymm2, %ymm0, %ymm0
1519 ; AVX2-NEXT: vpackssdw %ymm1, %ymm0, %ymm0
1520 ; AVX2-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,2,1,3]
1521 ; AVX2-NEXT: vmovmskps %ymm0, %eax
1522 ; AVX2-NEXT: testb %al, %al
1523 ; AVX2-NEXT: setnp %al
1524 ; AVX2-NEXT: vzeroupper
1527 ; AVX512F-LABEL: icmp_v8i64_v8i1:
1529 ; AVX512F-NEXT: vptestnmq %zmm0, %zmm0, %k0
1530 ; AVX512F-NEXT: kmovw %k0, %eax
1531 ; AVX512F-NEXT: testb %al, %al
1532 ; AVX512F-NEXT: setnp %al
1533 ; AVX512F-NEXT: vzeroupper
1534 ; AVX512F-NEXT: retq
1536 ; AVX512BW-LABEL: icmp_v8i64_v8i1:
1537 ; AVX512BW: # %bb.0:
1538 ; AVX512BW-NEXT: vptestnmq %zmm0, %zmm0, %k0
1539 ; AVX512BW-NEXT: kmovd %k0, %eax
1540 ; AVX512BW-NEXT: testb %al, %al
1541 ; AVX512BW-NEXT: setnp %al
1542 ; AVX512BW-NEXT: vzeroupper
1543 ; AVX512BW-NEXT: retq
1545 ; AVX512VL-LABEL: icmp_v8i64_v8i1:
1546 ; AVX512VL: # %bb.0:
1547 ; AVX512VL-NEXT: vptestnmq %zmm0, %zmm0, %k0
1548 ; AVX512VL-NEXT: kmovd %k0, %eax
1549 ; AVX512VL-NEXT: testb %al, %al
1550 ; AVX512VL-NEXT: setnp %al
1551 ; AVX512VL-NEXT: vzeroupper
1552 ; AVX512VL-NEXT: retq
1553 %a = icmp eq <8 x i64> %0, zeroinitializer
1554 %b = call i1 @llvm.vector.reduce.xor.v8i1(<8 x i1> %a)
1558 define i1 @icmp_v16i32_v16i1(<16 x i32>) {
1559 ; SSE-LABEL: icmp_v16i32_v16i1:
1561 ; SSE-NEXT: pxor %xmm4, %xmm4
1562 ; SSE-NEXT: pcmpeqd %xmm4, %xmm3
1563 ; SSE-NEXT: pcmpeqd %xmm4, %xmm2
1564 ; SSE-NEXT: packssdw %xmm3, %xmm2
1565 ; SSE-NEXT: pcmpeqd %xmm4, %xmm1
1566 ; SSE-NEXT: pcmpeqd %xmm4, %xmm0
1567 ; SSE-NEXT: packssdw %xmm1, %xmm0
1568 ; SSE-NEXT: packsswb %xmm2, %xmm0
1569 ; SSE-NEXT: pmovmskb %xmm0, %eax
1570 ; SSE-NEXT: xorb %ah, %al
1571 ; SSE-NEXT: setnp %al
1574 ; AVX1-LABEL: icmp_v16i32_v16i1:
1576 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm2
1577 ; AVX1-NEXT: vpxor %xmm3, %xmm3, %xmm3
1578 ; AVX1-NEXT: vpcmpeqd %xmm3, %xmm2, %xmm2
1579 ; AVX1-NEXT: vpcmpeqd %xmm3, %xmm1, %xmm1
1580 ; AVX1-NEXT: vpackssdw %xmm2, %xmm1, %xmm1
1581 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2
1582 ; AVX1-NEXT: vpcmpeqd %xmm3, %xmm2, %xmm2
1583 ; AVX1-NEXT: vpcmpeqd %xmm3, %xmm0, %xmm0
1584 ; AVX1-NEXT: vpackssdw %xmm2, %xmm0, %xmm0
1585 ; AVX1-NEXT: vpacksswb %xmm1, %xmm0, %xmm0
1586 ; AVX1-NEXT: vpmovmskb %xmm0, %eax
1587 ; AVX1-NEXT: xorb %ah, %al
1588 ; AVX1-NEXT: setnp %al
1589 ; AVX1-NEXT: vzeroupper
1592 ; AVX2-LABEL: icmp_v16i32_v16i1:
1594 ; AVX2-NEXT: vpxor %xmm2, %xmm2, %xmm2
1595 ; AVX2-NEXT: vpcmpeqd %ymm2, %ymm1, %ymm1
1596 ; AVX2-NEXT: vpcmpeqd %ymm2, %ymm0, %ymm0
1597 ; AVX2-NEXT: vpackssdw %ymm1, %ymm0, %ymm0
1598 ; AVX2-NEXT: vextracti128 $1, %ymm0, %xmm1
1599 ; AVX2-NEXT: vpacksswb %xmm1, %xmm0, %xmm0
1600 ; AVX2-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[0,2,1,3]
1601 ; AVX2-NEXT: vpmovmskb %xmm0, %eax
1602 ; AVX2-NEXT: xorb %ah, %al
1603 ; AVX2-NEXT: setnp %al
1604 ; AVX2-NEXT: vzeroupper
1607 ; AVX512F-LABEL: icmp_v16i32_v16i1:
1609 ; AVX512F-NEXT: vptestnmd %zmm0, %zmm0, %k0
1610 ; AVX512F-NEXT: kmovw %k0, %eax
1611 ; AVX512F-NEXT: movl %eax, %ecx
1612 ; AVX512F-NEXT: shrl $8, %ecx
1613 ; AVX512F-NEXT: xorb %al, %cl
1614 ; AVX512F-NEXT: setnp %al
1615 ; AVX512F-NEXT: vzeroupper
1616 ; AVX512F-NEXT: retq
1618 ; AVX512BW-LABEL: icmp_v16i32_v16i1:
1619 ; AVX512BW: # %bb.0:
1620 ; AVX512BW-NEXT: vptestnmd %zmm0, %zmm0, %k0
1621 ; AVX512BW-NEXT: kmovd %k0, %eax
1622 ; AVX512BW-NEXT: movl %eax, %ecx
1623 ; AVX512BW-NEXT: shrl $8, %ecx
1624 ; AVX512BW-NEXT: xorb %al, %cl
1625 ; AVX512BW-NEXT: setnp %al
1626 ; AVX512BW-NEXT: vzeroupper
1627 ; AVX512BW-NEXT: retq
1629 ; AVX512VL-LABEL: icmp_v16i32_v16i1:
1630 ; AVX512VL: # %bb.0:
1631 ; AVX512VL-NEXT: vptestnmd %zmm0, %zmm0, %k0
1632 ; AVX512VL-NEXT: kmovd %k0, %eax
1633 ; AVX512VL-NEXT: movl %eax, %ecx
1634 ; AVX512VL-NEXT: shrl $8, %ecx
1635 ; AVX512VL-NEXT: xorb %al, %cl
1636 ; AVX512VL-NEXT: setnp %al
1637 ; AVX512VL-NEXT: vzeroupper
1638 ; AVX512VL-NEXT: retq
1639 %a = icmp eq <16 x i32> %0, zeroinitializer
1640 %b = call i1 @llvm.vector.reduce.xor.v16i1(<16 x i1> %a)
1644 define i1 @icmp_v32i16_v32i1(<32 x i16>) {
1645 ; SSE-LABEL: icmp_v32i16_v32i1:
1647 ; SSE-NEXT: pxor %xmm4, %xmm4
1648 ; SSE-NEXT: pcmpeqw %xmm4, %xmm1
1649 ; SSE-NEXT: pcmpeqw %xmm4, %xmm0
1650 ; SSE-NEXT: packsswb %xmm1, %xmm0
1651 ; SSE-NEXT: pcmpeqw %xmm4, %xmm3
1652 ; SSE-NEXT: pcmpeqw %xmm4, %xmm2
1653 ; SSE-NEXT: packsswb %xmm3, %xmm2
1654 ; SSE-NEXT: pxor %xmm0, %xmm2
1655 ; SSE-NEXT: pmovmskb %xmm2, %eax
1656 ; SSE-NEXT: xorb %ah, %al
1657 ; SSE-NEXT: setnp %al
1660 ; AVX1-LABEL: icmp_v32i16_v32i1:
1662 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm2
1663 ; AVX1-NEXT: vpxor %xmm3, %xmm3, %xmm3
1664 ; AVX1-NEXT: vpcmpeqw %xmm3, %xmm2, %xmm2
1665 ; AVX1-NEXT: vpcmpeqw %xmm3, %xmm1, %xmm1
1666 ; AVX1-NEXT: vpacksswb %xmm2, %xmm1, %xmm1
1667 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2
1668 ; AVX1-NEXT: vpcmpeqw %xmm3, %xmm2, %xmm2
1669 ; AVX1-NEXT: vpcmpeqw %xmm3, %xmm0, %xmm0
1670 ; AVX1-NEXT: vpacksswb %xmm2, %xmm0, %xmm0
1671 ; AVX1-NEXT: vpxor %xmm1, %xmm0, %xmm0
1672 ; AVX1-NEXT: vpmovmskb %xmm0, %eax
1673 ; AVX1-NEXT: xorb %ah, %al
1674 ; AVX1-NEXT: setnp %al
1675 ; AVX1-NEXT: vzeroupper
1678 ; AVX2-LABEL: icmp_v32i16_v32i1:
1680 ; AVX2-NEXT: vpxor %xmm2, %xmm2, %xmm2
1681 ; AVX2-NEXT: vpcmpeqw %ymm2, %ymm1, %ymm1
1682 ; AVX2-NEXT: vpcmpeqw %ymm2, %ymm0, %ymm0
1683 ; AVX2-NEXT: vpacksswb %ymm1, %ymm0, %ymm0
1684 ; AVX2-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,2,1,3]
1685 ; AVX2-NEXT: vpmovmskb %ymm0, %eax
1686 ; AVX2-NEXT: movl %eax, %ecx
1687 ; AVX2-NEXT: shrl $16, %ecx
1688 ; AVX2-NEXT: xorl %eax, %ecx
1689 ; AVX2-NEXT: xorb %ch, %cl
1690 ; AVX2-NEXT: setnp %al
1691 ; AVX2-NEXT: vzeroupper
1694 ; AVX512F-LABEL: icmp_v32i16_v32i1:
1696 ; AVX512F-NEXT: vextracti64x4 $1, %zmm0, %ymm1
1697 ; AVX512F-NEXT: vpxor %xmm2, %xmm2, %xmm2
1698 ; AVX512F-NEXT: vpcmpeqw %ymm2, %ymm1, %ymm1
1699 ; AVX512F-NEXT: vpcmpeqw %ymm2, %ymm0, %ymm0
1700 ; AVX512F-NEXT: vpxor %ymm1, %ymm0, %ymm0
1701 ; AVX512F-NEXT: vpmovsxwd %ymm0, %zmm0
1702 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
1703 ; AVX512F-NEXT: kshiftrw $8, %k0, %k1
1704 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
1705 ; AVX512F-NEXT: kshiftrw $4, %k0, %k1
1706 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
1707 ; AVX512F-NEXT: kshiftrw $2, %k0, %k1
1708 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
1709 ; AVX512F-NEXT: kshiftrw $1, %k0, %k1
1710 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
1711 ; AVX512F-NEXT: kmovw %k0, %eax
1712 ; AVX512F-NEXT: # kill: def $al killed $al killed $eax
1713 ; AVX512F-NEXT: vzeroupper
1714 ; AVX512F-NEXT: retq
1716 ; AVX512BW-LABEL: icmp_v32i16_v32i1:
1717 ; AVX512BW: # %bb.0:
1718 ; AVX512BW-NEXT: vptestnmw %zmm0, %zmm0, %k0
1719 ; AVX512BW-NEXT: kmovd %k0, %eax
1720 ; AVX512BW-NEXT: movl %eax, %ecx
1721 ; AVX512BW-NEXT: shrl $16, %ecx
1722 ; AVX512BW-NEXT: xorl %eax, %ecx
1723 ; AVX512BW-NEXT: xorb %ch, %cl
1724 ; AVX512BW-NEXT: setnp %al
1725 ; AVX512BW-NEXT: vzeroupper
1726 ; AVX512BW-NEXT: retq
1728 ; AVX512VL-LABEL: icmp_v32i16_v32i1:
1729 ; AVX512VL: # %bb.0:
1730 ; AVX512VL-NEXT: vptestnmw %zmm0, %zmm0, %k0
1731 ; AVX512VL-NEXT: kmovd %k0, %eax
1732 ; AVX512VL-NEXT: movl %eax, %ecx
1733 ; AVX512VL-NEXT: shrl $16, %ecx
1734 ; AVX512VL-NEXT: xorl %eax, %ecx
1735 ; AVX512VL-NEXT: xorb %ch, %cl
1736 ; AVX512VL-NEXT: setnp %al
1737 ; AVX512VL-NEXT: vzeroupper
1738 ; AVX512VL-NEXT: retq
1739 %a = icmp eq <32 x i16> %0, zeroinitializer
1740 %b = call i1 @llvm.vector.reduce.xor.v32i1(<32 x i1> %a)
1744 define i1 @icmp_v64i8_v64i1(<64 x i8>) {
1745 ; SSE-LABEL: icmp_v64i8_v64i1:
1747 ; SSE-NEXT: pxor %xmm4, %xmm4
1748 ; SSE-NEXT: pcmpeqb %xmm4, %xmm2
1749 ; SSE-NEXT: pcmpeqb %xmm4, %xmm0
1750 ; SSE-NEXT: pcmpeqb %xmm4, %xmm3
1751 ; SSE-NEXT: pcmpeqb %xmm4, %xmm1
1752 ; SSE-NEXT: pxor %xmm3, %xmm1
1753 ; SSE-NEXT: pxor %xmm2, %xmm1
1754 ; SSE-NEXT: pxor %xmm0, %xmm1
1755 ; SSE-NEXT: pmovmskb %xmm1, %eax
1756 ; SSE-NEXT: xorb %ah, %al
1757 ; SSE-NEXT: setnp %al
1760 ; AVX1-LABEL: icmp_v64i8_v64i1:
1762 ; AVX1-NEXT: vpxor %xmm2, %xmm2, %xmm2
1763 ; AVX1-NEXT: vpcmpeqb %xmm2, %xmm1, %xmm3
1764 ; AVX1-NEXT: vpcmpeqb %xmm2, %xmm0, %xmm4
1765 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm1
1766 ; AVX1-NEXT: vpcmpeqb %xmm2, %xmm1, %xmm1
1767 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm0
1768 ; AVX1-NEXT: vpcmpeqb %xmm2, %xmm0, %xmm0
1769 ; AVX1-NEXT: vpxor %xmm1, %xmm0, %xmm0
1770 ; AVX1-NEXT: vpxor %xmm0, %xmm3, %xmm0
1771 ; AVX1-NEXT: vpxor %xmm0, %xmm4, %xmm0
1772 ; AVX1-NEXT: vpmovmskb %xmm0, %eax
1773 ; AVX1-NEXT: xorb %ah, %al
1774 ; AVX1-NEXT: setnp %al
1775 ; AVX1-NEXT: vzeroupper
1778 ; AVX2-LABEL: icmp_v64i8_v64i1:
1780 ; AVX2-NEXT: vpxor %xmm2, %xmm2, %xmm2
1781 ; AVX2-NEXT: vpcmpeqb %ymm2, %ymm1, %ymm1
1782 ; AVX2-NEXT: vpcmpeqb %ymm2, %ymm0, %ymm0
1783 ; AVX2-NEXT: vpxor %ymm1, %ymm0, %ymm0
1784 ; AVX2-NEXT: vpmovmskb %ymm0, %eax
1785 ; AVX2-NEXT: movl %eax, %ecx
1786 ; AVX2-NEXT: shrl $16, %ecx
1787 ; AVX2-NEXT: xorl %eax, %ecx
1788 ; AVX2-NEXT: xorb %ch, %cl
1789 ; AVX2-NEXT: setnp %al
1790 ; AVX2-NEXT: vzeroupper
1793 ; AVX512F-LABEL: icmp_v64i8_v64i1:
1795 ; AVX512F-NEXT: vextracti64x4 $1, %zmm0, %ymm1
1796 ; AVX512F-NEXT: vpxor %xmm2, %xmm2, %xmm2
1797 ; AVX512F-NEXT: vpcmpeqb %ymm2, %ymm1, %ymm1
1798 ; AVX512F-NEXT: vpcmpeqb %ymm2, %ymm0, %ymm0
1799 ; AVX512F-NEXT: vextracti128 $1, %ymm1, %xmm2
1800 ; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm3
1801 ; AVX512F-NEXT: vpxor %xmm2, %xmm3, %xmm2
1802 ; AVX512F-NEXT: vpxor %xmm2, %xmm1, %xmm1
1803 ; AVX512F-NEXT: vpxor %xmm1, %xmm0, %xmm0
1804 ; AVX512F-NEXT: vpmovsxbd %xmm0, %zmm0
1805 ; AVX512F-NEXT: vpslld $31, %zmm0, %zmm0
1806 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
1807 ; AVX512F-NEXT: kshiftrw $8, %k0, %k1
1808 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
1809 ; AVX512F-NEXT: kshiftrw $4, %k0, %k1
1810 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
1811 ; AVX512F-NEXT: kshiftrw $2, %k0, %k1
1812 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
1813 ; AVX512F-NEXT: kshiftrw $1, %k0, %k1
1814 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
1815 ; AVX512F-NEXT: kmovw %k0, %eax
1816 ; AVX512F-NEXT: # kill: def $al killed $al killed $eax
1817 ; AVX512F-NEXT: vzeroupper
1818 ; AVX512F-NEXT: retq
1820 ; AVX512BW-LABEL: icmp_v64i8_v64i1:
1821 ; AVX512BW: # %bb.0:
1822 ; AVX512BW-NEXT: vptestnmb %zmm0, %zmm0, %k0
1823 ; AVX512BW-NEXT: kmovq %k0, %rax
1824 ; AVX512BW-NEXT: movq %rax, %rcx
1825 ; AVX512BW-NEXT: shrq $32, %rcx
1826 ; AVX512BW-NEXT: xorl %eax, %ecx
1827 ; AVX512BW-NEXT: movl %ecx, %eax
1828 ; AVX512BW-NEXT: shrl $16, %eax
1829 ; AVX512BW-NEXT: xorl %ecx, %eax
1830 ; AVX512BW-NEXT: xorb %ah, %al
1831 ; AVX512BW-NEXT: setnp %al
1832 ; AVX512BW-NEXT: vzeroupper
1833 ; AVX512BW-NEXT: retq
1835 ; AVX512VL-LABEL: icmp_v64i8_v64i1:
1836 ; AVX512VL: # %bb.0:
1837 ; AVX512VL-NEXT: vptestnmb %zmm0, %zmm0, %k0
1838 ; AVX512VL-NEXT: kmovq %k0, %rax
1839 ; AVX512VL-NEXT: movq %rax, %rcx
1840 ; AVX512VL-NEXT: shrq $32, %rcx
1841 ; AVX512VL-NEXT: xorl %eax, %ecx
1842 ; AVX512VL-NEXT: movl %ecx, %eax
1843 ; AVX512VL-NEXT: shrl $16, %eax
1844 ; AVX512VL-NEXT: xorl %ecx, %eax
1845 ; AVX512VL-NEXT: xorb %ah, %al
1846 ; AVX512VL-NEXT: setnp %al
1847 ; AVX512VL-NEXT: vzeroupper
1848 ; AVX512VL-NEXT: retq
1849 %a = icmp eq <64 x i8> %0, zeroinitializer
1850 %b = call i1 @llvm.vector.reduce.xor.v64i1(<64 x i1> %a)
1854 declare i1 @llvm.vector.reduce.xor.v2i1(<2 x i1>)
1855 declare i1 @llvm.vector.reduce.xor.v4i1(<4 x i1>)
1856 declare i1 @llvm.vector.reduce.xor.v8i1(<8 x i1>)
1857 declare i1 @llvm.vector.reduce.xor.v16i1(<16 x i1>)
1858 declare i1 @llvm.vector.reduce.xor.v32i1(<32 x i1>)
1859 declare i1 @llvm.vector.reduce.xor.v64i1(<64 x i1>)