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: xorb $0, %al
23 ; AVX-LABEL: trunc_v2i64_v2i1:
25 ; AVX-NEXT: vpsllq $63, %xmm0, %xmm0
26 ; AVX-NEXT: vmovmskpd %xmm0, %eax
27 ; AVX-NEXT: xorb $0, %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: andl $3, %eax
37 ; AVX512F-NEXT: xorb $0, %al
38 ; AVX512F-NEXT: setnp %al
39 ; AVX512F-NEXT: vzeroupper
42 ; AVX512BW-LABEL: trunc_v2i64_v2i1:
44 ; AVX512BW-NEXT: vpsllq $63, %xmm0, %xmm0
45 ; AVX512BW-NEXT: vptestmq %zmm0, %zmm0, %k0
46 ; AVX512BW-NEXT: kmovd %k0, %eax
47 ; AVX512BW-NEXT: andl $3, %eax
48 ; AVX512BW-NEXT: xorb $0, %al
49 ; AVX512BW-NEXT: setnp %al
50 ; AVX512BW-NEXT: vzeroupper
53 ; AVX512VL-LABEL: trunc_v2i64_v2i1:
55 ; AVX512VL-NEXT: vpsllq $63, %xmm0, %xmm0
56 ; AVX512VL-NEXT: vptestmq %xmm0, %xmm0, %k0
57 ; AVX512VL-NEXT: kmovd %k0, %eax
58 ; AVX512VL-NEXT: andl $3, %eax
59 ; AVX512VL-NEXT: xorb $0, %al
60 ; AVX512VL-NEXT: setnp %al
62 %a = trunc <2 x i64> %0 to <2 x i1>
63 %b = call i1 @llvm.experimental.vector.reduce.xor.v2i1(<2 x i1> %a)
67 define i1 @trunc_v4i32_v4i1(<4 x i32>) {
68 ; SSE-LABEL: trunc_v4i32_v4i1:
70 ; SSE-NEXT: pslld $31, %xmm0
71 ; SSE-NEXT: movmskps %xmm0, %eax
72 ; SSE-NEXT: xorb $0, %al
76 ; AVX-LABEL: trunc_v4i32_v4i1:
78 ; AVX-NEXT: vpslld $31, %xmm0, %xmm0
79 ; AVX-NEXT: vmovmskps %xmm0, %eax
80 ; AVX-NEXT: xorb $0, %al
84 ; AVX512F-LABEL: trunc_v4i32_v4i1:
86 ; AVX512F-NEXT: vpslld $31, %xmm0, %xmm0
87 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
88 ; AVX512F-NEXT: kmovw %k0, %eax
89 ; AVX512F-NEXT: andl $15, %eax
90 ; AVX512F-NEXT: xorb $0, %al
91 ; AVX512F-NEXT: setnp %al
92 ; AVX512F-NEXT: vzeroupper
95 ; AVX512BW-LABEL: trunc_v4i32_v4i1:
97 ; AVX512BW-NEXT: vpslld $31, %xmm0, %xmm0
98 ; AVX512BW-NEXT: vptestmd %zmm0, %zmm0, %k0
99 ; AVX512BW-NEXT: kmovd %k0, %eax
100 ; AVX512BW-NEXT: andl $15, %eax
101 ; AVX512BW-NEXT: xorb $0, %al
102 ; AVX512BW-NEXT: setnp %al
103 ; AVX512BW-NEXT: vzeroupper
104 ; AVX512BW-NEXT: retq
106 ; AVX512VL-LABEL: trunc_v4i32_v4i1:
108 ; AVX512VL-NEXT: vpslld $31, %xmm0, %xmm0
109 ; AVX512VL-NEXT: vptestmd %xmm0, %xmm0, %k0
110 ; AVX512VL-NEXT: kmovd %k0, %eax
111 ; AVX512VL-NEXT: andl $15, %eax
112 ; AVX512VL-NEXT: xorb $0, %al
113 ; AVX512VL-NEXT: setnp %al
114 ; AVX512VL-NEXT: retq
115 %a = trunc <4 x i32> %0 to <4 x i1>
116 %b = call i1 @llvm.experimental.vector.reduce.xor.v4i1(<4 x i1> %a)
120 define i1 @trunc_v8i16_v8i1(<8 x i8>) {
121 ; SSE2-LABEL: trunc_v8i16_v8i1:
123 ; SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
124 ; SSE2-NEXT: psllw $15, %xmm0
125 ; SSE2-NEXT: packsswb %xmm0, %xmm0
126 ; SSE2-NEXT: pmovmskb %xmm0, %eax
127 ; SSE2-NEXT: xorb $0, %al
128 ; SSE2-NEXT: setnp %al
131 ; SSE41-LABEL: trunc_v8i16_v8i1:
133 ; 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
134 ; SSE41-NEXT: psllw $15, %xmm0
135 ; SSE41-NEXT: packsswb %xmm0, %xmm0
136 ; SSE41-NEXT: pmovmskb %xmm0, %eax
137 ; SSE41-NEXT: xorb $0, %al
138 ; SSE41-NEXT: setnp %al
141 ; AVX-LABEL: trunc_v8i16_v8i1:
143 ; 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
144 ; AVX-NEXT: vpsllw $15, %xmm0, %xmm0
145 ; AVX-NEXT: vpacksswb %xmm0, %xmm0, %xmm0
146 ; AVX-NEXT: vpmovmskb %xmm0, %eax
147 ; AVX-NEXT: xorb $0, %al
148 ; AVX-NEXT: setnp %al
151 ; AVX512F-LABEL: trunc_v8i16_v8i1:
153 ; AVX512F-NEXT: vpmovsxbd %xmm0, %zmm0
154 ; AVX512F-NEXT: vpslld $31, %zmm0, %zmm0
155 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
156 ; AVX512F-NEXT: kmovw %k0, %eax
157 ; AVX512F-NEXT: xorb $0, %al
158 ; AVX512F-NEXT: setnp %al
159 ; AVX512F-NEXT: vzeroupper
162 ; AVX512BW-LABEL: trunc_v8i16_v8i1:
164 ; AVX512BW-NEXT: vpsllw $7, %xmm0, %xmm0
165 ; AVX512BW-NEXT: vpmovb2m %zmm0, %k0
166 ; AVX512BW-NEXT: kmovd %k0, %eax
167 ; AVX512BW-NEXT: xorb $0, %al
168 ; AVX512BW-NEXT: setnp %al
169 ; AVX512BW-NEXT: vzeroupper
170 ; AVX512BW-NEXT: retq
172 ; AVX512VL-LABEL: trunc_v8i16_v8i1:
174 ; AVX512VL-NEXT: vpsllw $7, %xmm0, %xmm0
175 ; AVX512VL-NEXT: vpmovb2m %xmm0, %k0
176 ; AVX512VL-NEXT: kmovd %k0, %eax
177 ; AVX512VL-NEXT: xorb $0, %al
178 ; AVX512VL-NEXT: setnp %al
179 ; AVX512VL-NEXT: retq
180 %a = trunc <8 x i8> %0 to <8 x i1>
181 %b = call i1 @llvm.experimental.vector.reduce.xor.v8i1(<8 x i1> %a)
185 define i1 @trunc_v16i8_v16i1(<16 x i8>) {
186 ; SSE-LABEL: trunc_v16i8_v16i1:
188 ; SSE-NEXT: psllw $7, %xmm0
189 ; SSE-NEXT: pmovmskb %xmm0, %eax
190 ; SSE-NEXT: movl %eax, %ecx
191 ; SSE-NEXT: shrl $8, %ecx
192 ; SSE-NEXT: xorb %al, %cl
193 ; SSE-NEXT: setnp %al
196 ; AVX-LABEL: trunc_v16i8_v16i1:
198 ; AVX-NEXT: vpsllw $7, %xmm0, %xmm0
199 ; AVX-NEXT: vpmovmskb %xmm0, %eax
200 ; AVX-NEXT: movl %eax, %ecx
201 ; AVX-NEXT: shrl $8, %ecx
202 ; AVX-NEXT: xorb %al, %cl
203 ; AVX-NEXT: setnp %al
206 ; AVX512-LABEL: trunc_v16i8_v16i1:
208 ; AVX512-NEXT: vpsllw $7, %xmm0, %xmm0
209 ; AVX512-NEXT: vpmovmskb %xmm0, %eax
210 ; AVX512-NEXT: movl %eax, %ecx
211 ; AVX512-NEXT: shrl $8, %ecx
212 ; AVX512-NEXT: xorb %al, %cl
213 ; AVX512-NEXT: setnp %al
215 %a = trunc <16 x i8> %0 to <16 x i1>
216 %b = call i1 @llvm.experimental.vector.reduce.xor.v16i1(<16 x i1> %a)
220 define i1 @trunc_v4i64_v4i1(<4 x i64>) {
221 ; SSE-LABEL: trunc_v4i64_v4i1:
223 ; SSE-NEXT: shufps {{.*#+}} xmm0 = xmm0[0,2],xmm1[0,2]
224 ; SSE-NEXT: pslld $31, %xmm0
225 ; SSE-NEXT: movmskps %xmm0, %eax
226 ; SSE-NEXT: xorb $0, %al
227 ; SSE-NEXT: setnp %al
230 ; AVX-LABEL: trunc_v4i64_v4i1:
232 ; AVX-NEXT: vextractf128 $1, %ymm0, %xmm1
233 ; AVX-NEXT: vshufps {{.*#+}} xmm0 = xmm0[0,2],xmm1[0,2]
234 ; AVX-NEXT: vpslld $31, %xmm0, %xmm0
235 ; AVX-NEXT: vmovmskps %xmm0, %eax
236 ; AVX-NEXT: xorb $0, %al
237 ; AVX-NEXT: setnp %al
238 ; AVX-NEXT: vzeroupper
241 ; AVX512F-LABEL: trunc_v4i64_v4i1:
243 ; AVX512F-NEXT: vpsllq $63, %ymm0, %ymm0
244 ; AVX512F-NEXT: vptestmq %zmm0, %zmm0, %k0
245 ; AVX512F-NEXT: kmovw %k0, %eax
246 ; AVX512F-NEXT: andl $15, %eax
247 ; AVX512F-NEXT: xorb $0, %al
248 ; AVX512F-NEXT: setnp %al
249 ; AVX512F-NEXT: vzeroupper
252 ; AVX512BW-LABEL: trunc_v4i64_v4i1:
254 ; AVX512BW-NEXT: vpsllq $63, %ymm0, %ymm0
255 ; AVX512BW-NEXT: vptestmq %zmm0, %zmm0, %k0
256 ; AVX512BW-NEXT: kmovd %k0, %eax
257 ; AVX512BW-NEXT: andl $15, %eax
258 ; AVX512BW-NEXT: xorb $0, %al
259 ; AVX512BW-NEXT: setnp %al
260 ; AVX512BW-NEXT: vzeroupper
261 ; AVX512BW-NEXT: retq
263 ; AVX512VL-LABEL: trunc_v4i64_v4i1:
265 ; AVX512VL-NEXT: vpsllq $63, %ymm0, %ymm0
266 ; AVX512VL-NEXT: vptestmq %ymm0, %ymm0, %k0
267 ; AVX512VL-NEXT: kmovd %k0, %eax
268 ; AVX512VL-NEXT: andl $15, %eax
269 ; AVX512VL-NEXT: xorb $0, %al
270 ; AVX512VL-NEXT: setnp %al
271 ; AVX512VL-NEXT: vzeroupper
272 ; AVX512VL-NEXT: retq
273 %a = trunc <4 x i64> %0 to <4 x i1>
274 %b = call i1 @llvm.experimental.vector.reduce.xor.v4i1(<4 x i1> %a)
278 define i1 @trunc_v8i32_v8i1(<8 x i32>) {
279 ; SSE2-LABEL: trunc_v8i32_v8i1:
281 ; SSE2-NEXT: pslld $16, %xmm1
282 ; SSE2-NEXT: psrad $16, %xmm1
283 ; SSE2-NEXT: pslld $16, %xmm0
284 ; SSE2-NEXT: psrad $16, %xmm0
285 ; SSE2-NEXT: packssdw %xmm1, %xmm0
286 ; SSE2-NEXT: psllw $15, %xmm0
287 ; SSE2-NEXT: packsswb %xmm0, %xmm0
288 ; SSE2-NEXT: pmovmskb %xmm0, %eax
289 ; SSE2-NEXT: xorb $0, %al
290 ; SSE2-NEXT: setnp %al
293 ; SSE41-LABEL: trunc_v8i32_v8i1:
295 ; SSE41-NEXT: movdqa {{.*#+}} xmm2 = [0,1,4,5,8,9,12,13,8,9,12,13,12,13,14,15]
296 ; SSE41-NEXT: pshufb %xmm2, %xmm1
297 ; SSE41-NEXT: pshufb %xmm2, %xmm0
298 ; SSE41-NEXT: punpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm1[0]
299 ; SSE41-NEXT: psllw $15, %xmm0
300 ; SSE41-NEXT: packsswb %xmm0, %xmm0
301 ; SSE41-NEXT: pmovmskb %xmm0, %eax
302 ; SSE41-NEXT: xorb $0, %al
303 ; SSE41-NEXT: setnp %al
306 ; AVX1-LABEL: trunc_v8i32_v8i1:
308 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
309 ; AVX1-NEXT: vmovdqa {{.*#+}} xmm2 = [0,1,4,5,8,9,12,13,8,9,12,13,12,13,14,15]
310 ; AVX1-NEXT: vpshufb %xmm2, %xmm1, %xmm1
311 ; AVX1-NEXT: vpshufb %xmm2, %xmm0, %xmm0
312 ; AVX1-NEXT: vpunpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm1[0]
313 ; AVX1-NEXT: vpsllw $15, %xmm0, %xmm0
314 ; AVX1-NEXT: vpacksswb %xmm0, %xmm0, %xmm0
315 ; AVX1-NEXT: vpmovmskb %xmm0, %eax
316 ; AVX1-NEXT: xorb $0, %al
317 ; AVX1-NEXT: setnp %al
318 ; AVX1-NEXT: vzeroupper
321 ; AVX2-LABEL: trunc_v8i32_v8i1:
323 ; AVX2-NEXT: vpshufb {{.*#+}} ymm0 = ymm0[0,1,4,5,8,9,12,13,8,9,12,13,12,13,14,15,16,17,20,21,24,25,28,29,24,25,28,29,28,29,30,31]
324 ; AVX2-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,2,2,3]
325 ; AVX2-NEXT: vpsllw $15, %xmm0, %xmm0
326 ; AVX2-NEXT: vpacksswb %xmm0, %xmm0, %xmm0
327 ; AVX2-NEXT: vpmovmskb %xmm0, %eax
328 ; AVX2-NEXT: xorb $0, %al
329 ; AVX2-NEXT: setnp %al
330 ; AVX2-NEXT: vzeroupper
333 ; AVX512F-LABEL: trunc_v8i32_v8i1:
335 ; AVX512F-NEXT: vpslld $31, %ymm0, %ymm0
336 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
337 ; AVX512F-NEXT: kmovw %k0, %eax
338 ; AVX512F-NEXT: xorb $0, %al
339 ; AVX512F-NEXT: setnp %al
340 ; AVX512F-NEXT: vzeroupper
343 ; AVX512BW-LABEL: trunc_v8i32_v8i1:
345 ; AVX512BW-NEXT: vpslld $31, %ymm0, %ymm0
346 ; AVX512BW-NEXT: vptestmd %zmm0, %zmm0, %k0
347 ; AVX512BW-NEXT: kmovd %k0, %eax
348 ; AVX512BW-NEXT: xorb $0, %al
349 ; AVX512BW-NEXT: setnp %al
350 ; AVX512BW-NEXT: vzeroupper
351 ; AVX512BW-NEXT: retq
353 ; AVX512VL-LABEL: trunc_v8i32_v8i1:
355 ; AVX512VL-NEXT: vpslld $31, %ymm0, %ymm0
356 ; AVX512VL-NEXT: vptestmd %ymm0, %ymm0, %k0
357 ; AVX512VL-NEXT: kmovd %k0, %eax
358 ; AVX512VL-NEXT: xorb $0, %al
359 ; AVX512VL-NEXT: setnp %al
360 ; AVX512VL-NEXT: vzeroupper
361 ; AVX512VL-NEXT: retq
362 %a = trunc <8 x i32> %0 to <8 x i1>
363 %b = call i1 @llvm.experimental.vector.reduce.xor.v8i1(<8 x i1> %a)
367 define i1 @trunc_v16i16_v16i1(<16 x i16>) {
368 ; SSE2-LABEL: trunc_v16i16_v16i1:
370 ; SSE2-NEXT: movdqa {{.*#+}} xmm2 = [255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0]
371 ; SSE2-NEXT: pand %xmm2, %xmm1
372 ; SSE2-NEXT: pand %xmm2, %xmm0
373 ; SSE2-NEXT: packuswb %xmm1, %xmm0
374 ; SSE2-NEXT: psllw $7, %xmm0
375 ; SSE2-NEXT: pmovmskb %xmm0, %eax
376 ; SSE2-NEXT: movl %eax, %ecx
377 ; SSE2-NEXT: shrl $8, %ecx
378 ; SSE2-NEXT: xorb %al, %cl
379 ; SSE2-NEXT: setnp %al
382 ; SSE41-LABEL: trunc_v16i16_v16i1:
384 ; SSE41-NEXT: movdqa {{.*#+}} xmm2 = <0,2,4,6,8,10,12,14,u,u,u,u,u,u,u,u>
385 ; SSE41-NEXT: pshufb %xmm2, %xmm1
386 ; SSE41-NEXT: pshufb %xmm2, %xmm0
387 ; SSE41-NEXT: punpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm1[0]
388 ; SSE41-NEXT: psllw $7, %xmm0
389 ; SSE41-NEXT: pmovmskb %xmm0, %eax
390 ; SSE41-NEXT: movl %eax, %ecx
391 ; SSE41-NEXT: shrl $8, %ecx
392 ; SSE41-NEXT: xorb %al, %cl
393 ; SSE41-NEXT: setnp %al
396 ; AVX1-LABEL: trunc_v16i16_v16i1:
398 ; AVX1-NEXT: vandps {{.*}}(%rip), %ymm0, %ymm0
399 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
400 ; AVX1-NEXT: vpackuswb %xmm1, %xmm0, %xmm0
401 ; AVX1-NEXT: vpsllw $7, %xmm0, %xmm0
402 ; AVX1-NEXT: vpmovmskb %xmm0, %eax
403 ; AVX1-NEXT: movl %eax, %ecx
404 ; AVX1-NEXT: shrl $8, %ecx
405 ; AVX1-NEXT: xorb %al, %cl
406 ; AVX1-NEXT: setnp %al
407 ; AVX1-NEXT: vzeroupper
410 ; AVX2-LABEL: trunc_v16i16_v16i1:
412 ; AVX2-NEXT: vpand {{.*}}(%rip), %ymm0, %ymm0
413 ; AVX2-NEXT: vextracti128 $1, %ymm0, %xmm1
414 ; AVX2-NEXT: vpackuswb %xmm1, %xmm0, %xmm0
415 ; AVX2-NEXT: vpsllw $7, %xmm0, %xmm0
416 ; AVX2-NEXT: vpmovmskb %xmm0, %eax
417 ; AVX2-NEXT: movl %eax, %ecx
418 ; AVX2-NEXT: shrl $8, %ecx
419 ; AVX2-NEXT: xorb %al, %cl
420 ; AVX2-NEXT: setnp %al
421 ; AVX2-NEXT: vzeroupper
424 ; AVX512F-LABEL: trunc_v16i16_v16i1:
426 ; AVX512F-NEXT: vpmovsxwd %ymm0, %zmm0
427 ; AVX512F-NEXT: vpslld $31, %zmm0, %zmm0
428 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
429 ; AVX512F-NEXT: kmovw %k0, %eax
430 ; AVX512F-NEXT: movl %eax, %ecx
431 ; AVX512F-NEXT: shrl $8, %ecx
432 ; AVX512F-NEXT: xorb %al, %cl
433 ; AVX512F-NEXT: setnp %al
434 ; AVX512F-NEXT: vzeroupper
437 ; AVX512BW-LABEL: trunc_v16i16_v16i1:
439 ; AVX512BW-NEXT: vpsllw $15, %ymm0, %ymm0
440 ; AVX512BW-NEXT: vpmovw2m %zmm0, %k0
441 ; AVX512BW-NEXT: kmovd %k0, %eax
442 ; AVX512BW-NEXT: movl %eax, %ecx
443 ; AVX512BW-NEXT: shrl $8, %ecx
444 ; AVX512BW-NEXT: xorb %al, %cl
445 ; AVX512BW-NEXT: setnp %al
446 ; AVX512BW-NEXT: vzeroupper
447 ; AVX512BW-NEXT: retq
449 ; AVX512VL-LABEL: trunc_v16i16_v16i1:
451 ; AVX512VL-NEXT: vpsllw $15, %ymm0, %ymm0
452 ; AVX512VL-NEXT: vpmovw2m %ymm0, %k0
453 ; AVX512VL-NEXT: kmovd %k0, %eax
454 ; AVX512VL-NEXT: movl %eax, %ecx
455 ; AVX512VL-NEXT: shrl $8, %ecx
456 ; AVX512VL-NEXT: xorb %al, %cl
457 ; AVX512VL-NEXT: setnp %al
458 ; AVX512VL-NEXT: vzeroupper
459 ; AVX512VL-NEXT: retq
460 %a = trunc <16 x i16> %0 to <16 x i1>
461 %b = call i1 @llvm.experimental.vector.reduce.xor.v16i1(<16 x i1> %a)
465 define i1 @trunc_v32i8_v32i1(<32 x i8>) {
466 ; SSE-LABEL: trunc_v32i8_v32i1:
468 ; SSE-NEXT: pxor %xmm1, %xmm0
469 ; SSE-NEXT: psllw $7, %xmm0
470 ; SSE-NEXT: pmovmskb %xmm0, %eax
471 ; SSE-NEXT: movl %eax, %ecx
472 ; SSE-NEXT: shrl $8, %ecx
473 ; SSE-NEXT: xorb %al, %cl
474 ; SSE-NEXT: setnp %al
477 ; AVX1-LABEL: trunc_v32i8_v32i1:
479 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
480 ; AVX1-NEXT: vpxor %xmm1, %xmm0, %xmm0
481 ; AVX1-NEXT: vpsllw $7, %xmm0, %xmm0
482 ; AVX1-NEXT: vpmovmskb %xmm0, %eax
483 ; AVX1-NEXT: movl %eax, %ecx
484 ; AVX1-NEXT: shrl $8, %ecx
485 ; AVX1-NEXT: xorb %al, %cl
486 ; AVX1-NEXT: setnp %al
487 ; AVX1-NEXT: vzeroupper
490 ; AVX2-LABEL: trunc_v32i8_v32i1:
492 ; AVX2-NEXT: vpsllw $7, %ymm0, %ymm0
493 ; AVX2-NEXT: vpmovmskb %ymm0, %eax
494 ; AVX2-NEXT: movl %eax, %ecx
495 ; AVX2-NEXT: shrl $16, %ecx
496 ; AVX2-NEXT: xorl %eax, %ecx
497 ; AVX2-NEXT: movl %ecx, %eax
498 ; AVX2-NEXT: shrl $8, %eax
499 ; AVX2-NEXT: xorb %cl, %al
500 ; AVX2-NEXT: setnp %al
501 ; AVX2-NEXT: vzeroupper
504 ; AVX512F-LABEL: trunc_v32i8_v32i1:
506 ; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm1
507 ; AVX512F-NEXT: vpxor %xmm1, %xmm0, %xmm0
508 ; AVX512F-NEXT: vpmovsxbd %xmm0, %zmm0
509 ; AVX512F-NEXT: vpslld $31, %zmm0, %zmm0
510 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
511 ; AVX512F-NEXT: kshiftrw $8, %k0, %k1
512 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
513 ; AVX512F-NEXT: kshiftrw $4, %k0, %k1
514 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
515 ; AVX512F-NEXT: kshiftrw $2, %k0, %k1
516 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
517 ; AVX512F-NEXT: kshiftrw $1, %k0, %k1
518 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
519 ; AVX512F-NEXT: kmovw %k0, %eax
520 ; AVX512F-NEXT: # kill: def $al killed $al killed $eax
521 ; AVX512F-NEXT: vzeroupper
524 ; AVX512BW-LABEL: trunc_v32i8_v32i1:
526 ; AVX512BW-NEXT: vpsllw $7, %ymm0, %ymm0
527 ; AVX512BW-NEXT: vpmovmskb %ymm0, %eax
528 ; AVX512BW-NEXT: movl %eax, %ecx
529 ; AVX512BW-NEXT: shrl $16, %ecx
530 ; AVX512BW-NEXT: xorl %eax, %ecx
531 ; AVX512BW-NEXT: movl %ecx, %eax
532 ; AVX512BW-NEXT: shrl $8, %eax
533 ; AVX512BW-NEXT: xorb %cl, %al
534 ; AVX512BW-NEXT: setnp %al
535 ; AVX512BW-NEXT: vzeroupper
536 ; AVX512BW-NEXT: retq
538 ; AVX512VL-LABEL: trunc_v32i8_v32i1:
540 ; AVX512VL-NEXT: vpsllw $7, %ymm0, %ymm0
541 ; AVX512VL-NEXT: vpmovmskb %ymm0, %eax
542 ; AVX512VL-NEXT: movl %eax, %ecx
543 ; AVX512VL-NEXT: shrl $16, %ecx
544 ; AVX512VL-NEXT: xorl %eax, %ecx
545 ; AVX512VL-NEXT: movl %ecx, %eax
546 ; AVX512VL-NEXT: shrl $8, %eax
547 ; AVX512VL-NEXT: xorb %cl, %al
548 ; AVX512VL-NEXT: setnp %al
549 ; AVX512VL-NEXT: vzeroupper
550 ; AVX512VL-NEXT: retq
551 %a = trunc <32 x i8> %0 to <32 x i1>
552 %b = call i1 @llvm.experimental.vector.reduce.xor.v32i1(<32 x i1> %a)
556 define i1 @trunc_v8i64_v8i1(<8 x i64>) {
557 ; SSE2-LABEL: trunc_v8i64_v8i1:
559 ; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[0,2,2,3]
560 ; SSE2-NEXT: pshuflw {{.*#+}} xmm1 = xmm1[0,2,2,3,4,5,6,7]
561 ; SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,2,2,3]
562 ; SSE2-NEXT: pshuflw {{.*#+}} xmm0 = xmm0[0,2,2,3,4,5,6,7]
563 ; SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
564 ; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm3[0,2,2,3]
565 ; SSE2-NEXT: pshuflw {{.*#+}} xmm1 = xmm1[0,1,0,2,4,5,6,7]
566 ; SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm2[0,2,2,3]
567 ; SSE2-NEXT: pshuflw {{.*#+}} xmm2 = xmm2[0,1,0,2,4,5,6,7]
568 ; SSE2-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
569 ; SSE2-NEXT: movsd {{.*#+}} xmm2 = xmm0[0],xmm2[1]
570 ; SSE2-NEXT: psllw $15, %xmm2
571 ; SSE2-NEXT: packsswb %xmm0, %xmm2
572 ; SSE2-NEXT: pmovmskb %xmm2, %eax
573 ; SSE2-NEXT: xorb $0, %al
574 ; SSE2-NEXT: setnp %al
577 ; SSE41-LABEL: trunc_v8i64_v8i1:
579 ; SSE41-NEXT: pxor %xmm4, %xmm4
580 ; SSE41-NEXT: pblendw {{.*#+}} xmm3 = xmm3[0],xmm4[1,2,3],xmm3[4],xmm4[5,6,7]
581 ; SSE41-NEXT: pblendw {{.*#+}} xmm2 = xmm2[0],xmm4[1,2,3],xmm2[4],xmm4[5,6,7]
582 ; SSE41-NEXT: packusdw %xmm3, %xmm2
583 ; SSE41-NEXT: pblendw {{.*#+}} xmm1 = xmm1[0],xmm4[1,2,3],xmm1[4],xmm4[5,6,7]
584 ; SSE41-NEXT: pblendw {{.*#+}} xmm0 = xmm0[0],xmm4[1,2,3],xmm0[4],xmm4[5,6,7]
585 ; SSE41-NEXT: packusdw %xmm1, %xmm0
586 ; SSE41-NEXT: packusdw %xmm2, %xmm0
587 ; SSE41-NEXT: psllw $15, %xmm0
588 ; SSE41-NEXT: packsswb %xmm0, %xmm0
589 ; SSE41-NEXT: pmovmskb %xmm0, %eax
590 ; SSE41-NEXT: xorb $0, %al
591 ; SSE41-NEXT: setnp %al
594 ; AVX1-LABEL: trunc_v8i64_v8i1:
596 ; AVX1-NEXT: vmovaps {{.*#+}} ymm2 = [65535,65535,65535,65535]
597 ; AVX1-NEXT: vandps %ymm2, %ymm1, %ymm1
598 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm3
599 ; AVX1-NEXT: vpackusdw %xmm3, %xmm1, %xmm1
600 ; AVX1-NEXT: vandps %ymm2, %ymm0, %ymm0
601 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2
602 ; AVX1-NEXT: vpackusdw %xmm2, %xmm0, %xmm0
603 ; AVX1-NEXT: vpackusdw %xmm1, %xmm0, %xmm0
604 ; AVX1-NEXT: vpsllw $15, %xmm0, %xmm0
605 ; AVX1-NEXT: vpacksswb %xmm0, %xmm0, %xmm0
606 ; AVX1-NEXT: vpmovmskb %xmm0, %eax
607 ; AVX1-NEXT: xorb $0, %al
608 ; AVX1-NEXT: setnp %al
609 ; AVX1-NEXT: vzeroupper
612 ; AVX2-LABEL: trunc_v8i64_v8i1:
614 ; AVX2-NEXT: vextractf128 $1, %ymm1, %xmm2
615 ; AVX2-NEXT: vshufps {{.*#+}} xmm1 = xmm1[0,2],xmm2[0,2]
616 ; AVX2-NEXT: vextractf128 $1, %ymm0, %xmm2
617 ; AVX2-NEXT: vshufps {{.*#+}} xmm0 = xmm0[0,2],xmm2[0,2]
618 ; AVX2-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
619 ; AVX2-NEXT: vpshufb {{.*#+}} ymm0 = ymm0[0,1,4,5,8,9,12,13,8,9,12,13,12,13,14,15,16,17,20,21,24,25,28,29,24,25,28,29,28,29,30,31]
620 ; AVX2-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,2,2,3]
621 ; AVX2-NEXT: vpsllw $15, %xmm0, %xmm0
622 ; AVX2-NEXT: vpacksswb %xmm0, %xmm0, %xmm0
623 ; AVX2-NEXT: vpmovmskb %xmm0, %eax
624 ; AVX2-NEXT: xorb $0, %al
625 ; AVX2-NEXT: setnp %al
626 ; AVX2-NEXT: vzeroupper
629 ; AVX512F-LABEL: trunc_v8i64_v8i1:
631 ; AVX512F-NEXT: vpsllq $63, %zmm0, %zmm0
632 ; AVX512F-NEXT: vptestmq %zmm0, %zmm0, %k0
633 ; AVX512F-NEXT: kmovw %k0, %eax
634 ; AVX512F-NEXT: xorb $0, %al
635 ; AVX512F-NEXT: setnp %al
636 ; AVX512F-NEXT: vzeroupper
639 ; AVX512BW-LABEL: trunc_v8i64_v8i1:
641 ; AVX512BW-NEXT: vpsllq $63, %zmm0, %zmm0
642 ; AVX512BW-NEXT: vptestmq %zmm0, %zmm0, %k0
643 ; AVX512BW-NEXT: kmovd %k0, %eax
644 ; AVX512BW-NEXT: xorb $0, %al
645 ; AVX512BW-NEXT: setnp %al
646 ; AVX512BW-NEXT: vzeroupper
647 ; AVX512BW-NEXT: retq
649 ; AVX512VL-LABEL: trunc_v8i64_v8i1:
651 ; AVX512VL-NEXT: vpsllq $63, %zmm0, %zmm0
652 ; AVX512VL-NEXT: vptestmq %zmm0, %zmm0, %k0
653 ; AVX512VL-NEXT: kmovd %k0, %eax
654 ; AVX512VL-NEXT: xorb $0, %al
655 ; AVX512VL-NEXT: setnp %al
656 ; AVX512VL-NEXT: vzeroupper
657 ; AVX512VL-NEXT: retq
658 %a = trunc <8 x i64> %0 to <8 x i1>
659 %b = call i1 @llvm.experimental.vector.reduce.xor.v8i1(<8 x i1> %a)
663 define i1 @trunc_v16i32_v16i1(<16 x i32>) {
664 ; SSE2-LABEL: trunc_v16i32_v16i1:
666 ; SSE2-NEXT: movdqa {{.*#+}} xmm4 = [255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0]
667 ; SSE2-NEXT: pand %xmm4, %xmm3
668 ; SSE2-NEXT: pand %xmm4, %xmm2
669 ; SSE2-NEXT: packuswb %xmm3, %xmm2
670 ; SSE2-NEXT: pand %xmm4, %xmm1
671 ; SSE2-NEXT: pand %xmm4, %xmm0
672 ; SSE2-NEXT: packuswb %xmm1, %xmm0
673 ; SSE2-NEXT: packuswb %xmm2, %xmm0
674 ; SSE2-NEXT: psllw $7, %xmm0
675 ; SSE2-NEXT: pmovmskb %xmm0, %eax
676 ; SSE2-NEXT: movl %eax, %ecx
677 ; SSE2-NEXT: shrl $8, %ecx
678 ; SSE2-NEXT: xorb %al, %cl
679 ; SSE2-NEXT: setnp %al
682 ; SSE41-LABEL: trunc_v16i32_v16i1:
684 ; SSE41-NEXT: movdqa {{.*#+}} xmm4 = [255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0]
685 ; SSE41-NEXT: pand %xmm4, %xmm3
686 ; SSE41-NEXT: pand %xmm4, %xmm2
687 ; SSE41-NEXT: packusdw %xmm3, %xmm2
688 ; SSE41-NEXT: pand %xmm4, %xmm1
689 ; SSE41-NEXT: pand %xmm4, %xmm0
690 ; SSE41-NEXT: packusdw %xmm1, %xmm0
691 ; SSE41-NEXT: packuswb %xmm2, %xmm0
692 ; SSE41-NEXT: psllw $7, %xmm0
693 ; SSE41-NEXT: pmovmskb %xmm0, %eax
694 ; SSE41-NEXT: movl %eax, %ecx
695 ; SSE41-NEXT: shrl $8, %ecx
696 ; SSE41-NEXT: xorb %al, %cl
697 ; SSE41-NEXT: setnp %al
700 ; AVX1-LABEL: trunc_v16i32_v16i1:
702 ; AVX1-NEXT: vmovaps {{.*#+}} ymm2 = [255,255,255,255,255,255,255,255]
703 ; AVX1-NEXT: vandps %ymm2, %ymm1, %ymm1
704 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm3
705 ; AVX1-NEXT: vpackusdw %xmm3, %xmm1, %xmm1
706 ; AVX1-NEXT: vandps %ymm2, %ymm0, %ymm0
707 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2
708 ; AVX1-NEXT: vpackusdw %xmm2, %xmm0, %xmm0
709 ; AVX1-NEXT: vpackuswb %xmm1, %xmm0, %xmm0
710 ; AVX1-NEXT: vpsllw $7, %xmm0, %xmm0
711 ; AVX1-NEXT: vpmovmskb %xmm0, %eax
712 ; AVX1-NEXT: movl %eax, %ecx
713 ; AVX1-NEXT: shrl $8, %ecx
714 ; AVX1-NEXT: xorb %al, %cl
715 ; AVX1-NEXT: setnp %al
716 ; AVX1-NEXT: vzeroupper
719 ; AVX2-LABEL: trunc_v16i32_v16i1:
721 ; AVX2-NEXT: vmovdqa {{.*#+}} ymm2 = [0,1,4,5,8,9,12,13,8,9,12,13,12,13,14,15,16,17,20,21,24,25,28,29,24,25,28,29,28,29,30,31]
722 ; AVX2-NEXT: vpshufb %ymm2, %ymm1, %ymm1
723 ; AVX2-NEXT: vpermq {{.*#+}} ymm1 = ymm1[0,2,2,3]
724 ; AVX2-NEXT: vmovdqa {{.*#+}} xmm3 = [255,255,255,255,255,255,255,255]
725 ; AVX2-NEXT: vpand %xmm3, %xmm1, %xmm1
726 ; AVX2-NEXT: vpshufb %ymm2, %ymm0, %ymm0
727 ; AVX2-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,2,2,3]
728 ; AVX2-NEXT: vpand %xmm3, %xmm0, %xmm0
729 ; AVX2-NEXT: vpackuswb %xmm1, %xmm0, %xmm0
730 ; AVX2-NEXT: vpsllw $7, %xmm0, %xmm0
731 ; AVX2-NEXT: vpmovmskb %xmm0, %eax
732 ; AVX2-NEXT: movl %eax, %ecx
733 ; AVX2-NEXT: shrl $8, %ecx
734 ; AVX2-NEXT: xorb %al, %cl
735 ; AVX2-NEXT: setnp %al
736 ; AVX2-NEXT: vzeroupper
739 ; AVX512F-LABEL: trunc_v16i32_v16i1:
741 ; AVX512F-NEXT: vpslld $31, %zmm0, %zmm0
742 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
743 ; AVX512F-NEXT: kmovw %k0, %eax
744 ; AVX512F-NEXT: movl %eax, %ecx
745 ; AVX512F-NEXT: shrl $8, %ecx
746 ; AVX512F-NEXT: xorb %al, %cl
747 ; AVX512F-NEXT: setnp %al
748 ; AVX512F-NEXT: vzeroupper
751 ; AVX512BW-LABEL: trunc_v16i32_v16i1:
753 ; AVX512BW-NEXT: vpslld $31, %zmm0, %zmm0
754 ; AVX512BW-NEXT: vptestmd %zmm0, %zmm0, %k0
755 ; AVX512BW-NEXT: kmovd %k0, %eax
756 ; AVX512BW-NEXT: movl %eax, %ecx
757 ; AVX512BW-NEXT: shrl $8, %ecx
758 ; AVX512BW-NEXT: xorb %al, %cl
759 ; AVX512BW-NEXT: setnp %al
760 ; AVX512BW-NEXT: vzeroupper
761 ; AVX512BW-NEXT: retq
763 ; AVX512VL-LABEL: trunc_v16i32_v16i1:
765 ; AVX512VL-NEXT: vpslld $31, %zmm0, %zmm0
766 ; AVX512VL-NEXT: vptestmd %zmm0, %zmm0, %k0
767 ; AVX512VL-NEXT: kmovd %k0, %eax
768 ; AVX512VL-NEXT: movl %eax, %ecx
769 ; AVX512VL-NEXT: shrl $8, %ecx
770 ; AVX512VL-NEXT: xorb %al, %cl
771 ; AVX512VL-NEXT: setnp %al
772 ; AVX512VL-NEXT: vzeroupper
773 ; AVX512VL-NEXT: retq
774 %a = trunc <16 x i32> %0 to <16 x i1>
775 %b = call i1 @llvm.experimental.vector.reduce.xor.v16i1(<16 x i1> %a)
779 define i1 @trunc_v32i16_v32i1(<32 x i16>) {
780 ; SSE2-LABEL: trunc_v32i16_v32i1:
782 ; SSE2-NEXT: movdqa {{.*#+}} xmm4 = [255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0]
783 ; SSE2-NEXT: pand %xmm4, %xmm3
784 ; SSE2-NEXT: pand %xmm4, %xmm2
785 ; SSE2-NEXT: packuswb %xmm3, %xmm2
786 ; SSE2-NEXT: pand %xmm4, %xmm1
787 ; SSE2-NEXT: pand %xmm4, %xmm0
788 ; SSE2-NEXT: packuswb %xmm1, %xmm0
789 ; SSE2-NEXT: pxor %xmm2, %xmm0
790 ; SSE2-NEXT: psllw $7, %xmm0
791 ; SSE2-NEXT: pmovmskb %xmm0, %eax
792 ; SSE2-NEXT: movl %eax, %ecx
793 ; SSE2-NEXT: shrl $8, %ecx
794 ; SSE2-NEXT: xorb %al, %cl
795 ; SSE2-NEXT: setnp %al
798 ; SSE41-LABEL: trunc_v32i16_v32i1:
800 ; SSE41-NEXT: movdqa {{.*#+}} xmm4 = <0,2,4,6,8,10,12,14,u,u,u,u,u,u,u,u>
801 ; SSE41-NEXT: pshufb %xmm4, %xmm3
802 ; SSE41-NEXT: pshufb %xmm4, %xmm2
803 ; SSE41-NEXT: punpcklqdq {{.*#+}} xmm2 = xmm2[0],xmm3[0]
804 ; SSE41-NEXT: pshufb %xmm4, %xmm1
805 ; SSE41-NEXT: pshufb %xmm4, %xmm0
806 ; SSE41-NEXT: punpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm1[0]
807 ; SSE41-NEXT: pxor %xmm2, %xmm0
808 ; SSE41-NEXT: psllw $7, %xmm0
809 ; SSE41-NEXT: pmovmskb %xmm0, %eax
810 ; SSE41-NEXT: movl %eax, %ecx
811 ; SSE41-NEXT: shrl $8, %ecx
812 ; SSE41-NEXT: xorb %al, %cl
813 ; SSE41-NEXT: setnp %al
816 ; AVX1-LABEL: trunc_v32i16_v32i1:
818 ; AVX1-NEXT: vxorps %ymm1, %ymm0, %ymm0
819 ; AVX1-NEXT: vandps {{.*}}(%rip), %ymm0, %ymm0
820 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
821 ; AVX1-NEXT: vpackuswb %xmm1, %xmm0, %xmm0
822 ; AVX1-NEXT: vpsllw $7, %xmm0, %xmm0
823 ; AVX1-NEXT: vpmovmskb %xmm0, %eax
824 ; AVX1-NEXT: movl %eax, %ecx
825 ; AVX1-NEXT: shrl $8, %ecx
826 ; AVX1-NEXT: xorb %al, %cl
827 ; AVX1-NEXT: setnp %al
828 ; AVX1-NEXT: vzeroupper
831 ; AVX2-LABEL: trunc_v32i16_v32i1:
833 ; AVX2-NEXT: vmovdqa {{.*#+}} ymm2 = [255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255]
834 ; AVX2-NEXT: vpand %ymm2, %ymm0, %ymm0
835 ; AVX2-NEXT: vpand %ymm2, %ymm1, %ymm1
836 ; AVX2-NEXT: vinserti128 $1, %xmm1, %ymm0, %ymm2
837 ; AVX2-NEXT: vextracti128 $1, %ymm0, %xmm0
838 ; AVX2-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1,2,3],ymm1[4,5,6,7]
839 ; AVX2-NEXT: vpackuswb %ymm0, %ymm2, %ymm0
840 ; AVX2-NEXT: vpsllw $7, %ymm0, %ymm0
841 ; AVX2-NEXT: vpmovmskb %ymm0, %eax
842 ; AVX2-NEXT: movl %eax, %ecx
843 ; AVX2-NEXT: shrl $16, %ecx
844 ; AVX2-NEXT: xorl %eax, %ecx
845 ; AVX2-NEXT: movl %ecx, %eax
846 ; AVX2-NEXT: shrl $8, %eax
847 ; AVX2-NEXT: xorb %cl, %al
848 ; AVX2-NEXT: setnp %al
849 ; AVX2-NEXT: vzeroupper
852 ; AVX512F-LABEL: trunc_v32i16_v32i1:
854 ; AVX512F-NEXT: vextracti64x4 $1, %zmm0, %ymm1
855 ; AVX512F-NEXT: vpxor %ymm1, %ymm0, %ymm0
856 ; AVX512F-NEXT: vpmovsxwd %ymm0, %zmm0
857 ; AVX512F-NEXT: vpslld $31, %zmm0, %zmm0
858 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
859 ; AVX512F-NEXT: kshiftrw $8, %k0, %k1
860 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
861 ; AVX512F-NEXT: kshiftrw $4, %k0, %k1
862 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
863 ; AVX512F-NEXT: kshiftrw $2, %k0, %k1
864 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
865 ; AVX512F-NEXT: kshiftrw $1, %k0, %k1
866 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
867 ; AVX512F-NEXT: kmovw %k0, %eax
868 ; AVX512F-NEXT: # kill: def $al killed $al killed $eax
869 ; AVX512F-NEXT: vzeroupper
872 ; AVX512BW-LABEL: trunc_v32i16_v32i1:
874 ; AVX512BW-NEXT: vpsllw $15, %zmm0, %zmm0
875 ; AVX512BW-NEXT: vpmovw2m %zmm0, %k0
876 ; AVX512BW-NEXT: kmovd %k0, %eax
877 ; AVX512BW-NEXT: movl %eax, %ecx
878 ; AVX512BW-NEXT: shrl $16, %ecx
879 ; AVX512BW-NEXT: xorl %eax, %ecx
880 ; AVX512BW-NEXT: movl %ecx, %eax
881 ; AVX512BW-NEXT: shrl $8, %eax
882 ; AVX512BW-NEXT: xorb %cl, %al
883 ; AVX512BW-NEXT: setnp %al
884 ; AVX512BW-NEXT: vzeroupper
885 ; AVX512BW-NEXT: retq
887 ; AVX512VL-LABEL: trunc_v32i16_v32i1:
889 ; AVX512VL-NEXT: vpsllw $15, %zmm0, %zmm0
890 ; AVX512VL-NEXT: vpmovw2m %zmm0, %k0
891 ; AVX512VL-NEXT: kmovd %k0, %eax
892 ; AVX512VL-NEXT: movl %eax, %ecx
893 ; AVX512VL-NEXT: shrl $16, %ecx
894 ; AVX512VL-NEXT: xorl %eax, %ecx
895 ; AVX512VL-NEXT: movl %ecx, %eax
896 ; AVX512VL-NEXT: shrl $8, %eax
897 ; AVX512VL-NEXT: xorb %cl, %al
898 ; AVX512VL-NEXT: setnp %al
899 ; AVX512VL-NEXT: vzeroupper
900 ; AVX512VL-NEXT: retq
901 %a = trunc <32 x i16> %0 to <32 x i1>
902 %b = call i1 @llvm.experimental.vector.reduce.xor.v32i1(<32 x i1> %a)
906 define i1 @trunc_v64i8_v64i1(<64 x i8>) {
907 ; SSE2-LABEL: trunc_v64i8_v64i1:
909 ; SSE2-NEXT: pxor %xmm3, %xmm1
910 ; SSE2-NEXT: pxor %xmm2, %xmm1
911 ; SSE2-NEXT: pxor %xmm0, %xmm1
912 ; SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm1[2,3,0,1]
913 ; SSE2-NEXT: pxor %xmm1, %xmm0
914 ; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
915 ; SSE2-NEXT: pxor %xmm0, %xmm1
916 ; SSE2-NEXT: movdqa %xmm1, %xmm0
917 ; SSE2-NEXT: psrld $16, %xmm0
918 ; SSE2-NEXT: pxor %xmm1, %xmm0
919 ; SSE2-NEXT: movdqa %xmm0, %xmm1
920 ; SSE2-NEXT: psrlw $8, %xmm1
921 ; SSE2-NEXT: pxor %xmm0, %xmm1
922 ; SSE2-NEXT: movd %xmm1, %eax
923 ; SSE2-NEXT: # kill: def $al killed $al killed $eax
926 ; SSE41-LABEL: trunc_v64i8_v64i1:
928 ; SSE41-NEXT: pxor %xmm3, %xmm1
929 ; SSE41-NEXT: pxor %xmm2, %xmm1
930 ; SSE41-NEXT: pxor %xmm0, %xmm1
931 ; SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm1[2,3,0,1]
932 ; SSE41-NEXT: pxor %xmm1, %xmm0
933 ; SSE41-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
934 ; SSE41-NEXT: pxor %xmm0, %xmm1
935 ; SSE41-NEXT: movdqa %xmm1, %xmm0
936 ; SSE41-NEXT: psrld $16, %xmm0
937 ; SSE41-NEXT: pxor %xmm1, %xmm0
938 ; SSE41-NEXT: movdqa %xmm0, %xmm1
939 ; SSE41-NEXT: psrlw $8, %xmm1
940 ; SSE41-NEXT: pxor %xmm0, %xmm1
941 ; SSE41-NEXT: pextrb $0, %xmm1, %eax
942 ; SSE41-NEXT: # kill: def $al killed $al killed $eax
945 ; AVX1-LABEL: trunc_v64i8_v64i1:
947 ; AVX1-NEXT: vxorps %ymm1, %ymm0, %ymm0
948 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
949 ; AVX1-NEXT: vxorps %xmm1, %xmm0, %xmm0
950 ; AVX1-NEXT: vpermilps {{.*#+}} xmm1 = xmm0[2,3,0,1]
951 ; AVX1-NEXT: vxorps %xmm1, %xmm0, %xmm0
952 ; AVX1-NEXT: vpermilps {{.*#+}} xmm1 = xmm0[1,1,2,3]
953 ; AVX1-NEXT: vxorps %xmm1, %xmm0, %xmm0
954 ; AVX1-NEXT: vpsrld $16, %xmm0, %xmm1
955 ; AVX1-NEXT: vpxor %xmm1, %xmm0, %xmm0
956 ; AVX1-NEXT: vpsrlw $8, %xmm0, %xmm1
957 ; AVX1-NEXT: vpxor %xmm1, %xmm0, %xmm0
958 ; AVX1-NEXT: vpextrb $0, %xmm0, %eax
959 ; AVX1-NEXT: # kill: def $al killed $al killed $eax
960 ; AVX1-NEXT: vzeroupper
963 ; AVX2-LABEL: trunc_v64i8_v64i1:
965 ; AVX2-NEXT: vpxor %ymm1, %ymm0, %ymm0
966 ; AVX2-NEXT: vextracti128 $1, %ymm0, %xmm1
967 ; AVX2-NEXT: vpxor %xmm1, %xmm0, %xmm0
968 ; AVX2-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
969 ; AVX2-NEXT: vpxor %xmm1, %xmm0, %xmm0
970 ; AVX2-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
971 ; AVX2-NEXT: vpxor %xmm1, %xmm0, %xmm0
972 ; AVX2-NEXT: vpsrld $16, %xmm0, %xmm1
973 ; AVX2-NEXT: vpxor %xmm1, %xmm0, %xmm0
974 ; AVX2-NEXT: vpsrlw $8, %xmm0, %xmm1
975 ; AVX2-NEXT: vpxor %xmm1, %xmm0, %xmm0
976 ; AVX2-NEXT: vpextrb $0, %xmm0, %eax
977 ; AVX2-NEXT: # kill: def $al killed $al killed $eax
978 ; AVX2-NEXT: vzeroupper
981 ; AVX512F-LABEL: trunc_v64i8_v64i1:
983 ; AVX512F-NEXT: vextracti64x4 $1, %zmm0, %ymm1
984 ; AVX512F-NEXT: vextracti128 $1, %ymm1, %xmm2
985 ; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm3
986 ; AVX512F-NEXT: vpxor %xmm2, %xmm3, %xmm2
987 ; AVX512F-NEXT: vpxor %xmm2, %xmm1, %xmm1
988 ; AVX512F-NEXT: vpxor %xmm1, %xmm0, %xmm0
989 ; AVX512F-NEXT: vpmovsxbd %xmm0, %zmm0
990 ; AVX512F-NEXT: vpslld $31, %zmm0, %zmm0
991 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
992 ; AVX512F-NEXT: kshiftrw $8, %k0, %k1
993 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
994 ; AVX512F-NEXT: kshiftrw $4, %k0, %k1
995 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
996 ; AVX512F-NEXT: kshiftrw $2, %k0, %k1
997 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
998 ; AVX512F-NEXT: kshiftrw $1, %k0, %k1
999 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
1000 ; AVX512F-NEXT: kmovw %k0, %eax
1001 ; AVX512F-NEXT: # kill: def $al killed $al killed $eax
1002 ; AVX512F-NEXT: vzeroupper
1003 ; AVX512F-NEXT: retq
1005 ; AVX512BW-LABEL: trunc_v64i8_v64i1:
1006 ; AVX512BW: # %bb.0:
1007 ; AVX512BW-NEXT: vpsllw $7, %zmm0, %zmm0
1008 ; AVX512BW-NEXT: vpmovb2m %zmm0, %k0
1009 ; AVX512BW-NEXT: kshiftrq $32, %k0, %k1
1010 ; AVX512BW-NEXT: kxorq %k1, %k0, %k0
1011 ; AVX512BW-NEXT: kshiftrq $16, %k0, %k1
1012 ; AVX512BW-NEXT: kxorq %k1, %k0, %k0
1013 ; AVX512BW-NEXT: kshiftrq $8, %k0, %k1
1014 ; AVX512BW-NEXT: kxorq %k1, %k0, %k0
1015 ; AVX512BW-NEXT: kshiftrq $4, %k0, %k1
1016 ; AVX512BW-NEXT: kxorq %k1, %k0, %k0
1017 ; AVX512BW-NEXT: kshiftrq $2, %k0, %k1
1018 ; AVX512BW-NEXT: kxorq %k1, %k0, %k0
1019 ; AVX512BW-NEXT: kshiftrq $1, %k0, %k1
1020 ; AVX512BW-NEXT: kxorq %k1, %k0, %k0
1021 ; AVX512BW-NEXT: kmovd %k0, %eax
1022 ; AVX512BW-NEXT: # kill: def $al killed $al killed $eax
1023 ; AVX512BW-NEXT: vzeroupper
1024 ; AVX512BW-NEXT: retq
1026 ; AVX512VL-LABEL: trunc_v64i8_v64i1:
1027 ; AVX512VL: # %bb.0:
1028 ; AVX512VL-NEXT: vpsllw $7, %zmm0, %zmm0
1029 ; AVX512VL-NEXT: vpmovb2m %zmm0, %k0
1030 ; AVX512VL-NEXT: kshiftrq $32, %k0, %k1
1031 ; AVX512VL-NEXT: kxorq %k1, %k0, %k0
1032 ; AVX512VL-NEXT: kshiftrq $16, %k0, %k1
1033 ; AVX512VL-NEXT: kxorq %k1, %k0, %k0
1034 ; AVX512VL-NEXT: kshiftrq $8, %k0, %k1
1035 ; AVX512VL-NEXT: kxorq %k1, %k0, %k0
1036 ; AVX512VL-NEXT: kshiftrq $4, %k0, %k1
1037 ; AVX512VL-NEXT: kxorq %k1, %k0, %k0
1038 ; AVX512VL-NEXT: kshiftrq $2, %k0, %k1
1039 ; AVX512VL-NEXT: kxorq %k1, %k0, %k0
1040 ; AVX512VL-NEXT: kshiftrq $1, %k0, %k1
1041 ; AVX512VL-NEXT: kxorq %k1, %k0, %k0
1042 ; AVX512VL-NEXT: kmovd %k0, %eax
1043 ; AVX512VL-NEXT: # kill: def $al killed $al killed $eax
1044 ; AVX512VL-NEXT: vzeroupper
1045 ; AVX512VL-NEXT: retq
1046 %a = trunc <64 x i8> %0 to <64 x i1>
1047 %b = call i1 @llvm.experimental.vector.reduce.xor.v64i1(<64 x i1> %a)
1055 define i1 @icmp_v2i64_v2i1(<2 x i64>) {
1056 ; SSE2-LABEL: icmp_v2i64_v2i1:
1058 ; SSE2-NEXT: pxor %xmm1, %xmm1
1059 ; SSE2-NEXT: pcmpeqd %xmm0, %xmm1
1060 ; SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm1[1,0,3,2]
1061 ; SSE2-NEXT: pand %xmm1, %xmm0
1062 ; SSE2-NEXT: movmskpd %xmm0, %eax
1063 ; SSE2-NEXT: xorb $0, %al
1064 ; SSE2-NEXT: setnp %al
1067 ; SSE41-LABEL: icmp_v2i64_v2i1:
1069 ; SSE41-NEXT: pxor %xmm1, %xmm1
1070 ; SSE41-NEXT: pcmpeqq %xmm0, %xmm1
1071 ; SSE41-NEXT: movmskpd %xmm1, %eax
1072 ; SSE41-NEXT: xorb $0, %al
1073 ; SSE41-NEXT: setnp %al
1076 ; AVX-LABEL: icmp_v2i64_v2i1:
1078 ; AVX-NEXT: vpxor %xmm1, %xmm1, %xmm1
1079 ; AVX-NEXT: vpcmpeqq %xmm1, %xmm0, %xmm0
1080 ; AVX-NEXT: vmovmskpd %xmm0, %eax
1081 ; AVX-NEXT: xorb $0, %al
1082 ; AVX-NEXT: setnp %al
1085 ; AVX512F-LABEL: icmp_v2i64_v2i1:
1087 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1088 ; AVX512F-NEXT: vptestnmq %zmm0, %zmm0, %k0
1089 ; AVX512F-NEXT: kmovw %k0, %eax
1090 ; AVX512F-NEXT: andl $3, %eax
1091 ; AVX512F-NEXT: xorb $0, %al
1092 ; AVX512F-NEXT: setnp %al
1093 ; AVX512F-NEXT: vzeroupper
1094 ; AVX512F-NEXT: retq
1096 ; AVX512BW-LABEL: icmp_v2i64_v2i1:
1097 ; AVX512BW: # %bb.0:
1098 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1099 ; AVX512BW-NEXT: vptestnmq %zmm0, %zmm0, %k0
1100 ; AVX512BW-NEXT: kmovd %k0, %eax
1101 ; AVX512BW-NEXT: andl $3, %eax
1102 ; AVX512BW-NEXT: xorb $0, %al
1103 ; AVX512BW-NEXT: setnp %al
1104 ; AVX512BW-NEXT: vzeroupper
1105 ; AVX512BW-NEXT: retq
1107 ; AVX512VL-LABEL: icmp_v2i64_v2i1:
1108 ; AVX512VL: # %bb.0:
1109 ; AVX512VL-NEXT: vptestnmq %xmm0, %xmm0, %k0
1110 ; AVX512VL-NEXT: kmovd %k0, %eax
1111 ; AVX512VL-NEXT: andl $3, %eax
1112 ; AVX512VL-NEXT: xorb $0, %al
1113 ; AVX512VL-NEXT: setnp %al
1114 ; AVX512VL-NEXT: retq
1115 %a = icmp eq <2 x i64> %0, zeroinitializer
1116 %b = call i1 @llvm.experimental.vector.reduce.xor.v2i1(<2 x i1> %a)
1120 define i1 @icmp_v4i32_v4i1(<4 x i32>) {
1121 ; SSE-LABEL: icmp_v4i32_v4i1:
1123 ; SSE-NEXT: pxor %xmm1, %xmm1
1124 ; SSE-NEXT: pcmpeqd %xmm0, %xmm1
1125 ; SSE-NEXT: movmskps %xmm1, %eax
1126 ; SSE-NEXT: xorb $0, %al
1127 ; SSE-NEXT: setnp %al
1130 ; AVX-LABEL: icmp_v4i32_v4i1:
1132 ; AVX-NEXT: vpxor %xmm1, %xmm1, %xmm1
1133 ; AVX-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
1134 ; AVX-NEXT: vmovmskps %xmm0, %eax
1135 ; AVX-NEXT: xorb $0, %al
1136 ; AVX-NEXT: setnp %al
1139 ; AVX512F-LABEL: icmp_v4i32_v4i1:
1141 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1142 ; AVX512F-NEXT: vptestnmd %zmm0, %zmm0, %k0
1143 ; AVX512F-NEXT: kmovw %k0, %eax
1144 ; AVX512F-NEXT: andl $15, %eax
1145 ; AVX512F-NEXT: xorb $0, %al
1146 ; AVX512F-NEXT: setnp %al
1147 ; AVX512F-NEXT: vzeroupper
1148 ; AVX512F-NEXT: retq
1150 ; AVX512BW-LABEL: icmp_v4i32_v4i1:
1151 ; AVX512BW: # %bb.0:
1152 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1153 ; AVX512BW-NEXT: vptestnmd %zmm0, %zmm0, %k0
1154 ; AVX512BW-NEXT: kmovd %k0, %eax
1155 ; AVX512BW-NEXT: andl $15, %eax
1156 ; AVX512BW-NEXT: xorb $0, %al
1157 ; AVX512BW-NEXT: setnp %al
1158 ; AVX512BW-NEXT: vzeroupper
1159 ; AVX512BW-NEXT: retq
1161 ; AVX512VL-LABEL: icmp_v4i32_v4i1:
1162 ; AVX512VL: # %bb.0:
1163 ; AVX512VL-NEXT: vptestnmd %xmm0, %xmm0, %k0
1164 ; AVX512VL-NEXT: kmovd %k0, %eax
1165 ; AVX512VL-NEXT: andl $15, %eax
1166 ; AVX512VL-NEXT: xorb $0, %al
1167 ; AVX512VL-NEXT: setnp %al
1168 ; AVX512VL-NEXT: retq
1169 %a = icmp eq <4 x i32> %0, zeroinitializer
1170 %b = call i1 @llvm.experimental.vector.reduce.xor.v4i1(<4 x i1> %a)
1174 define i1 @icmp_v8i16_v8i1(<8 x i8>) {
1175 ; SSE2-LABEL: icmp_v8i16_v8i1:
1177 ; SSE2-NEXT: pxor %xmm1, %xmm1
1178 ; SSE2-NEXT: pcmpeqb %xmm0, %xmm1
1179 ; SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3],xmm0[4],xmm1[4],xmm0[5],xmm1[5],xmm0[6],xmm1[6],xmm0[7],xmm1[7]
1180 ; SSE2-NEXT: packsswb %xmm0, %xmm0
1181 ; SSE2-NEXT: pmovmskb %xmm0, %eax
1182 ; SSE2-NEXT: xorb $0, %al
1183 ; SSE2-NEXT: setnp %al
1186 ; SSE41-LABEL: icmp_v8i16_v8i1:
1188 ; SSE41-NEXT: pxor %xmm1, %xmm1
1189 ; SSE41-NEXT: pcmpeqb %xmm0, %xmm1
1190 ; SSE41-NEXT: pmovsxbw %xmm1, %xmm0
1191 ; SSE41-NEXT: packsswb %xmm0, %xmm0
1192 ; SSE41-NEXT: pmovmskb %xmm0, %eax
1193 ; SSE41-NEXT: xorb $0, %al
1194 ; SSE41-NEXT: setnp %al
1197 ; AVX-LABEL: icmp_v8i16_v8i1:
1199 ; AVX-NEXT: vpxor %xmm1, %xmm1, %xmm1
1200 ; AVX-NEXT: vpcmpeqb %xmm1, %xmm0, %xmm0
1201 ; AVX-NEXT: vpmovsxbw %xmm0, %xmm0
1202 ; AVX-NEXT: vpacksswb %xmm0, %xmm0, %xmm0
1203 ; AVX-NEXT: vpmovmskb %xmm0, %eax
1204 ; AVX-NEXT: xorb $0, %al
1205 ; AVX-NEXT: setnp %al
1208 ; AVX512F-LABEL: icmp_v8i16_v8i1:
1210 ; AVX512F-NEXT: vpxor %xmm1, %xmm1, %xmm1
1211 ; AVX512F-NEXT: vpcmpeqb %xmm1, %xmm0, %xmm0
1212 ; AVX512F-NEXT: vpmovsxbd %xmm0, %zmm0
1213 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
1214 ; AVX512F-NEXT: kmovw %k0, %eax
1215 ; AVX512F-NEXT: xorb $0, %al
1216 ; AVX512F-NEXT: setnp %al
1217 ; AVX512F-NEXT: vzeroupper
1218 ; AVX512F-NEXT: retq
1220 ; AVX512BW-LABEL: icmp_v8i16_v8i1:
1221 ; AVX512BW: # %bb.0:
1222 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1223 ; AVX512BW-NEXT: vptestnmb %zmm0, %zmm0, %k0
1224 ; AVX512BW-NEXT: kmovd %k0, %eax
1225 ; AVX512BW-NEXT: xorb $0, %al
1226 ; AVX512BW-NEXT: setnp %al
1227 ; AVX512BW-NEXT: vzeroupper
1228 ; AVX512BW-NEXT: retq
1230 ; AVX512VL-LABEL: icmp_v8i16_v8i1:
1231 ; AVX512VL: # %bb.0:
1232 ; AVX512VL-NEXT: vptestnmb %xmm0, %xmm0, %k0
1233 ; AVX512VL-NEXT: kmovd %k0, %eax
1234 ; AVX512VL-NEXT: xorb $0, %al
1235 ; AVX512VL-NEXT: setnp %al
1236 ; AVX512VL-NEXT: retq
1237 %a = icmp eq <8 x i8> %0, zeroinitializer
1238 %b = call i1 @llvm.experimental.vector.reduce.xor.v8i1(<8 x i1> %a)
1242 define i1 @icmp_v16i8_v16i1(<16 x i8>) {
1243 ; SSE-LABEL: icmp_v16i8_v16i1:
1245 ; SSE-NEXT: pxor %xmm1, %xmm1
1246 ; SSE-NEXT: pcmpeqb %xmm0, %xmm1
1247 ; SSE-NEXT: pmovmskb %xmm1, %eax
1248 ; SSE-NEXT: movl %eax, %ecx
1249 ; SSE-NEXT: shrl $8, %ecx
1250 ; SSE-NEXT: xorb %al, %cl
1251 ; SSE-NEXT: setnp %al
1254 ; AVX-LABEL: icmp_v16i8_v16i1:
1256 ; AVX-NEXT: vpxor %xmm1, %xmm1, %xmm1
1257 ; AVX-NEXT: vpcmpeqb %xmm1, %xmm0, %xmm0
1258 ; AVX-NEXT: vpmovmskb %xmm0, %eax
1259 ; AVX-NEXT: movl %eax, %ecx
1260 ; AVX-NEXT: shrl $8, %ecx
1261 ; AVX-NEXT: xorb %al, %cl
1262 ; AVX-NEXT: setnp %al
1265 ; AVX512F-LABEL: icmp_v16i8_v16i1:
1267 ; AVX512F-NEXT: vpxor %xmm1, %xmm1, %xmm1
1268 ; AVX512F-NEXT: vpcmpeqb %xmm1, %xmm0, %xmm0
1269 ; AVX512F-NEXT: vpmovmskb %xmm0, %eax
1270 ; AVX512F-NEXT: movl %eax, %ecx
1271 ; AVX512F-NEXT: shrl $8, %ecx
1272 ; AVX512F-NEXT: xorb %al, %cl
1273 ; AVX512F-NEXT: setnp %al
1274 ; AVX512F-NEXT: retq
1276 ; AVX512BW-LABEL: icmp_v16i8_v16i1:
1277 ; AVX512BW: # %bb.0:
1278 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1279 ; AVX512BW-NEXT: vptestnmb %zmm0, %zmm0, %k0
1280 ; AVX512BW-NEXT: kmovd %k0, %eax
1281 ; AVX512BW-NEXT: movl %eax, %ecx
1282 ; AVX512BW-NEXT: shrl $8, %ecx
1283 ; AVX512BW-NEXT: xorb %al, %cl
1284 ; AVX512BW-NEXT: setnp %al
1285 ; AVX512BW-NEXT: vzeroupper
1286 ; AVX512BW-NEXT: retq
1288 ; AVX512VL-LABEL: icmp_v16i8_v16i1:
1289 ; AVX512VL: # %bb.0:
1290 ; AVX512VL-NEXT: vptestnmb %xmm0, %xmm0, %k0
1291 ; AVX512VL-NEXT: kmovd %k0, %eax
1292 ; AVX512VL-NEXT: movl %eax, %ecx
1293 ; AVX512VL-NEXT: shrl $8, %ecx
1294 ; AVX512VL-NEXT: xorb %al, %cl
1295 ; AVX512VL-NEXT: setnp %al
1296 ; AVX512VL-NEXT: retq
1297 %a = icmp eq <16 x i8> %0, zeroinitializer
1298 %b = call i1 @llvm.experimental.vector.reduce.xor.v16i1(<16 x i1> %a)
1302 define i1 @icmp_v4i64_v4i1(<4 x i64>) {
1303 ; SSE2-LABEL: icmp_v4i64_v4i1:
1305 ; SSE2-NEXT: pxor %xmm2, %xmm2
1306 ; SSE2-NEXT: pcmpeqd %xmm2, %xmm1
1307 ; SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm1[1,0,3,2]
1308 ; SSE2-NEXT: pand %xmm1, %xmm3
1309 ; SSE2-NEXT: pcmpeqd %xmm2, %xmm0
1310 ; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,0,3,2]
1311 ; SSE2-NEXT: pand %xmm0, %xmm1
1312 ; SSE2-NEXT: packssdw %xmm3, %xmm1
1313 ; SSE2-NEXT: movmskps %xmm1, %eax
1314 ; SSE2-NEXT: xorb $0, %al
1315 ; SSE2-NEXT: setnp %al
1318 ; SSE41-LABEL: icmp_v4i64_v4i1:
1320 ; SSE41-NEXT: pxor %xmm2, %xmm2
1321 ; SSE41-NEXT: pcmpeqq %xmm2, %xmm1
1322 ; SSE41-NEXT: pcmpeqq %xmm2, %xmm0
1323 ; SSE41-NEXT: packssdw %xmm1, %xmm0
1324 ; SSE41-NEXT: movmskps %xmm0, %eax
1325 ; SSE41-NEXT: xorb $0, %al
1326 ; SSE41-NEXT: setnp %al
1329 ; AVX1-LABEL: icmp_v4i64_v4i1:
1331 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
1332 ; AVX1-NEXT: vpxor %xmm2, %xmm2, %xmm2
1333 ; AVX1-NEXT: vpcmpeqq %xmm2, %xmm1, %xmm1
1334 ; AVX1-NEXT: vpcmpeqq %xmm2, %xmm0, %xmm0
1335 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
1336 ; AVX1-NEXT: vmovmskpd %ymm0, %eax
1337 ; AVX1-NEXT: xorb $0, %al
1338 ; AVX1-NEXT: setnp %al
1339 ; AVX1-NEXT: vzeroupper
1342 ; AVX2-LABEL: icmp_v4i64_v4i1:
1344 ; AVX2-NEXT: vpxor %xmm1, %xmm1, %xmm1
1345 ; AVX2-NEXT: vpcmpeqq %ymm1, %ymm0, %ymm0
1346 ; AVX2-NEXT: vmovmskpd %ymm0, %eax
1347 ; AVX2-NEXT: xorb $0, %al
1348 ; AVX2-NEXT: setnp %al
1349 ; AVX2-NEXT: vzeroupper
1352 ; AVX512F-LABEL: icmp_v4i64_v4i1:
1354 ; AVX512F-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
1355 ; AVX512F-NEXT: vptestnmq %zmm0, %zmm0, %k0
1356 ; AVX512F-NEXT: kmovw %k0, %eax
1357 ; AVX512F-NEXT: andl $15, %eax
1358 ; AVX512F-NEXT: xorb $0, %al
1359 ; AVX512F-NEXT: setnp %al
1360 ; AVX512F-NEXT: vzeroupper
1361 ; AVX512F-NEXT: retq
1363 ; AVX512BW-LABEL: icmp_v4i64_v4i1:
1364 ; AVX512BW: # %bb.0:
1365 ; AVX512BW-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
1366 ; AVX512BW-NEXT: vptestnmq %zmm0, %zmm0, %k0
1367 ; AVX512BW-NEXT: kmovd %k0, %eax
1368 ; AVX512BW-NEXT: andl $15, %eax
1369 ; AVX512BW-NEXT: xorb $0, %al
1370 ; AVX512BW-NEXT: setnp %al
1371 ; AVX512BW-NEXT: vzeroupper
1372 ; AVX512BW-NEXT: retq
1374 ; AVX512VL-LABEL: icmp_v4i64_v4i1:
1375 ; AVX512VL: # %bb.0:
1376 ; AVX512VL-NEXT: vptestnmq %ymm0, %ymm0, %k0
1377 ; AVX512VL-NEXT: kmovd %k0, %eax
1378 ; AVX512VL-NEXT: andl $15, %eax
1379 ; AVX512VL-NEXT: xorb $0, %al
1380 ; AVX512VL-NEXT: setnp %al
1381 ; AVX512VL-NEXT: vzeroupper
1382 ; AVX512VL-NEXT: retq
1383 %a = icmp eq <4 x i64> %0, zeroinitializer
1384 %b = call i1 @llvm.experimental.vector.reduce.xor.v4i1(<4 x i1> %a)
1388 define i1 @icmp_v8i32_v8i1(<8 x i32>) {
1389 ; SSE-LABEL: icmp_v8i32_v8i1:
1391 ; SSE-NEXT: pxor %xmm2, %xmm2
1392 ; SSE-NEXT: pcmpeqd %xmm2, %xmm1
1393 ; SSE-NEXT: pcmpeqd %xmm2, %xmm0
1394 ; SSE-NEXT: packssdw %xmm1, %xmm0
1395 ; SSE-NEXT: packsswb %xmm0, %xmm0
1396 ; SSE-NEXT: pmovmskb %xmm0, %eax
1397 ; SSE-NEXT: xorb $0, %al
1398 ; SSE-NEXT: setnp %al
1401 ; AVX1-LABEL: icmp_v8i32_v8i1:
1403 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
1404 ; AVX1-NEXT: vpxor %xmm2, %xmm2, %xmm2
1405 ; AVX1-NEXT: vpcmpeqd %xmm2, %xmm1, %xmm1
1406 ; AVX1-NEXT: vpcmpeqd %xmm2, %xmm0, %xmm0
1407 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
1408 ; AVX1-NEXT: vmovmskps %ymm0, %eax
1409 ; AVX1-NEXT: xorb $0, %al
1410 ; AVX1-NEXT: setnp %al
1411 ; AVX1-NEXT: vzeroupper
1414 ; AVX2-LABEL: icmp_v8i32_v8i1:
1416 ; AVX2-NEXT: vpxor %xmm1, %xmm1, %xmm1
1417 ; AVX2-NEXT: vpcmpeqd %ymm1, %ymm0, %ymm0
1418 ; AVX2-NEXT: vmovmskps %ymm0, %eax
1419 ; AVX2-NEXT: xorb $0, %al
1420 ; AVX2-NEXT: setnp %al
1421 ; AVX2-NEXT: vzeroupper
1424 ; AVX512F-LABEL: icmp_v8i32_v8i1:
1426 ; AVX512F-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
1427 ; AVX512F-NEXT: vptestnmd %zmm0, %zmm0, %k0
1428 ; AVX512F-NEXT: kmovw %k0, %eax
1429 ; AVX512F-NEXT: xorb $0, %al
1430 ; AVX512F-NEXT: setnp %al
1431 ; AVX512F-NEXT: vzeroupper
1432 ; AVX512F-NEXT: retq
1434 ; AVX512BW-LABEL: icmp_v8i32_v8i1:
1435 ; AVX512BW: # %bb.0:
1436 ; AVX512BW-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
1437 ; AVX512BW-NEXT: vptestnmd %zmm0, %zmm0, %k0
1438 ; AVX512BW-NEXT: kmovd %k0, %eax
1439 ; AVX512BW-NEXT: xorb $0, %al
1440 ; AVX512BW-NEXT: setnp %al
1441 ; AVX512BW-NEXT: vzeroupper
1442 ; AVX512BW-NEXT: retq
1444 ; AVX512VL-LABEL: icmp_v8i32_v8i1:
1445 ; AVX512VL: # %bb.0:
1446 ; AVX512VL-NEXT: vptestnmd %ymm0, %ymm0, %k0
1447 ; AVX512VL-NEXT: kmovd %k0, %eax
1448 ; AVX512VL-NEXT: xorb $0, %al
1449 ; AVX512VL-NEXT: setnp %al
1450 ; AVX512VL-NEXT: vzeroupper
1451 ; AVX512VL-NEXT: retq
1452 %a = icmp eq <8 x i32> %0, zeroinitializer
1453 %b = call i1 @llvm.experimental.vector.reduce.xor.v8i1(<8 x i1> %a)
1457 define i1 @icmp_v16i16_v16i1(<16 x i16>) {
1458 ; SSE-LABEL: icmp_v16i16_v16i1:
1460 ; SSE-NEXT: pxor %xmm2, %xmm2
1461 ; SSE-NEXT: pcmpeqw %xmm2, %xmm1
1462 ; SSE-NEXT: pcmpeqw %xmm2, %xmm0
1463 ; SSE-NEXT: packsswb %xmm1, %xmm0
1464 ; SSE-NEXT: pmovmskb %xmm0, %eax
1465 ; SSE-NEXT: movl %eax, %ecx
1466 ; SSE-NEXT: shrl $8, %ecx
1467 ; SSE-NEXT: xorb %al, %cl
1468 ; SSE-NEXT: setnp %al
1471 ; AVX1-LABEL: icmp_v16i16_v16i1:
1473 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
1474 ; AVX1-NEXT: vpxor %xmm2, %xmm2, %xmm2
1475 ; AVX1-NEXT: vpcmpeqw %xmm2, %xmm1, %xmm1
1476 ; AVX1-NEXT: vpcmpeqw %xmm2, %xmm0, %xmm0
1477 ; AVX1-NEXT: vpacksswb %xmm1, %xmm0, %xmm0
1478 ; AVX1-NEXT: vpmovmskb %xmm0, %eax
1479 ; AVX1-NEXT: movl %eax, %ecx
1480 ; AVX1-NEXT: shrl $8, %ecx
1481 ; AVX1-NEXT: xorb %al, %cl
1482 ; AVX1-NEXT: setnp %al
1483 ; AVX1-NEXT: vzeroupper
1486 ; AVX2-LABEL: icmp_v16i16_v16i1:
1488 ; AVX2-NEXT: vpxor %xmm1, %xmm1, %xmm1
1489 ; AVX2-NEXT: vpcmpeqw %ymm1, %ymm0, %ymm0
1490 ; AVX2-NEXT: vextracti128 $1, %ymm0, %xmm1
1491 ; AVX2-NEXT: vpacksswb %xmm1, %xmm0, %xmm0
1492 ; AVX2-NEXT: vpmovmskb %xmm0, %eax
1493 ; AVX2-NEXT: movl %eax, %ecx
1494 ; AVX2-NEXT: shrl $8, %ecx
1495 ; AVX2-NEXT: xorb %al, %cl
1496 ; AVX2-NEXT: setnp %al
1497 ; AVX2-NEXT: vzeroupper
1500 ; AVX512F-LABEL: icmp_v16i16_v16i1:
1502 ; AVX512F-NEXT: vpxor %xmm1, %xmm1, %xmm1
1503 ; AVX512F-NEXT: vpcmpeqw %ymm1, %ymm0, %ymm0
1504 ; AVX512F-NEXT: vpmovsxwd %ymm0, %zmm0
1505 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
1506 ; AVX512F-NEXT: kmovw %k0, %eax
1507 ; AVX512F-NEXT: movl %eax, %ecx
1508 ; AVX512F-NEXT: shrl $8, %ecx
1509 ; AVX512F-NEXT: xorb %al, %cl
1510 ; AVX512F-NEXT: setnp %al
1511 ; AVX512F-NEXT: vzeroupper
1512 ; AVX512F-NEXT: retq
1514 ; AVX512BW-LABEL: icmp_v16i16_v16i1:
1515 ; AVX512BW: # %bb.0:
1516 ; AVX512BW-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
1517 ; AVX512BW-NEXT: vptestnmw %zmm0, %zmm0, %k0
1518 ; AVX512BW-NEXT: kmovd %k0, %eax
1519 ; AVX512BW-NEXT: movl %eax, %ecx
1520 ; AVX512BW-NEXT: shrl $8, %ecx
1521 ; AVX512BW-NEXT: xorb %al, %cl
1522 ; AVX512BW-NEXT: setnp %al
1523 ; AVX512BW-NEXT: vzeroupper
1524 ; AVX512BW-NEXT: retq
1526 ; AVX512VL-LABEL: icmp_v16i16_v16i1:
1527 ; AVX512VL: # %bb.0:
1528 ; AVX512VL-NEXT: vptestnmw %ymm0, %ymm0, %k0
1529 ; AVX512VL-NEXT: kmovd %k0, %eax
1530 ; AVX512VL-NEXT: movl %eax, %ecx
1531 ; AVX512VL-NEXT: shrl $8, %ecx
1532 ; AVX512VL-NEXT: xorb %al, %cl
1533 ; AVX512VL-NEXT: setnp %al
1534 ; AVX512VL-NEXT: vzeroupper
1535 ; AVX512VL-NEXT: retq
1536 %a = icmp eq <16 x i16> %0, zeroinitializer
1537 %b = call i1 @llvm.experimental.vector.reduce.xor.v16i1(<16 x i1> %a)
1541 define i1 @icmp_v32i8_v32i1(<32 x i8>) {
1542 ; SSE-LABEL: icmp_v32i8_v32i1:
1544 ; SSE-NEXT: pxor %xmm2, %xmm2
1545 ; SSE-NEXT: pcmpeqb %xmm2, %xmm1
1546 ; SSE-NEXT: pcmpeqb %xmm2, %xmm0
1547 ; SSE-NEXT: pxor %xmm1, %xmm0
1548 ; SSE-NEXT: pmovmskb %xmm0, %eax
1549 ; SSE-NEXT: movl %eax, %ecx
1550 ; SSE-NEXT: shrl $8, %ecx
1551 ; SSE-NEXT: xorb %al, %cl
1552 ; SSE-NEXT: setnp %al
1555 ; AVX1-LABEL: icmp_v32i8_v32i1:
1557 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
1558 ; AVX1-NEXT: vpxor %xmm2, %xmm2, %xmm2
1559 ; AVX1-NEXT: vpcmpeqb %xmm2, %xmm1, %xmm1
1560 ; AVX1-NEXT: vpcmpeqb %xmm2, %xmm0, %xmm0
1561 ; AVX1-NEXT: vpxor %xmm1, %xmm0, %xmm0
1562 ; AVX1-NEXT: vpmovmskb %xmm0, %eax
1563 ; AVX1-NEXT: movl %eax, %ecx
1564 ; AVX1-NEXT: shrl $8, %ecx
1565 ; AVX1-NEXT: xorb %al, %cl
1566 ; AVX1-NEXT: setnp %al
1567 ; AVX1-NEXT: vzeroupper
1570 ; AVX2-LABEL: icmp_v32i8_v32i1:
1572 ; AVX2-NEXT: vpxor %xmm1, %xmm1, %xmm1
1573 ; AVX2-NEXT: vpcmpeqb %ymm1, %ymm0, %ymm0
1574 ; AVX2-NEXT: vpmovmskb %ymm0, %eax
1575 ; AVX2-NEXT: movl %eax, %ecx
1576 ; AVX2-NEXT: shrl $16, %ecx
1577 ; AVX2-NEXT: xorl %eax, %ecx
1578 ; AVX2-NEXT: movl %ecx, %eax
1579 ; AVX2-NEXT: shrl $8, %eax
1580 ; AVX2-NEXT: xorb %cl, %al
1581 ; AVX2-NEXT: setnp %al
1582 ; AVX2-NEXT: vzeroupper
1585 ; AVX512F-LABEL: icmp_v32i8_v32i1:
1587 ; AVX512F-NEXT: vpxor %xmm1, %xmm1, %xmm1
1588 ; AVX512F-NEXT: vpcmpeqb %ymm1, %ymm0, %ymm0
1589 ; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm1
1590 ; AVX512F-NEXT: vpxor %xmm1, %xmm0, %xmm0
1591 ; AVX512F-NEXT: vpmovsxbd %xmm0, %zmm0
1592 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
1593 ; AVX512F-NEXT: kshiftrw $8, %k0, %k1
1594 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
1595 ; AVX512F-NEXT: kshiftrw $4, %k0, %k1
1596 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
1597 ; AVX512F-NEXT: kshiftrw $2, %k0, %k1
1598 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
1599 ; AVX512F-NEXT: kshiftrw $1, %k0, %k1
1600 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
1601 ; AVX512F-NEXT: kmovw %k0, %eax
1602 ; AVX512F-NEXT: # kill: def $al killed $al killed $eax
1603 ; AVX512F-NEXT: vzeroupper
1604 ; AVX512F-NEXT: retq
1606 ; AVX512BW-LABEL: icmp_v32i8_v32i1:
1607 ; AVX512BW: # %bb.0:
1608 ; AVX512BW-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
1609 ; AVX512BW-NEXT: vptestnmb %zmm0, %zmm0, %k0
1610 ; AVX512BW-NEXT: kmovd %k0, %eax
1611 ; AVX512BW-NEXT: movl %eax, %ecx
1612 ; AVX512BW-NEXT: shrl $16, %ecx
1613 ; AVX512BW-NEXT: xorl %eax, %ecx
1614 ; AVX512BW-NEXT: movl %ecx, %eax
1615 ; AVX512BW-NEXT: shrl $8, %eax
1616 ; AVX512BW-NEXT: xorb %cl, %al
1617 ; AVX512BW-NEXT: setnp %al
1618 ; AVX512BW-NEXT: vzeroupper
1619 ; AVX512BW-NEXT: retq
1621 ; AVX512VL-LABEL: icmp_v32i8_v32i1:
1622 ; AVX512VL: # %bb.0:
1623 ; AVX512VL-NEXT: vptestnmb %ymm0, %ymm0, %k0
1624 ; AVX512VL-NEXT: kmovd %k0, %eax
1625 ; AVX512VL-NEXT: movl %eax, %ecx
1626 ; AVX512VL-NEXT: shrl $16, %ecx
1627 ; AVX512VL-NEXT: xorl %eax, %ecx
1628 ; AVX512VL-NEXT: movl %ecx, %eax
1629 ; AVX512VL-NEXT: shrl $8, %eax
1630 ; AVX512VL-NEXT: xorb %cl, %al
1631 ; AVX512VL-NEXT: setnp %al
1632 ; AVX512VL-NEXT: vzeroupper
1633 ; AVX512VL-NEXT: retq
1634 %a = icmp eq <32 x i8> %0, zeroinitializer
1635 %b = call i1 @llvm.experimental.vector.reduce.xor.v32i1(<32 x i1> %a)
1639 define i1 @icmp_v8i64_v8i1(<8 x i64>) {
1640 ; SSE2-LABEL: icmp_v8i64_v8i1:
1642 ; SSE2-NEXT: pxor %xmm4, %xmm4
1643 ; SSE2-NEXT: pcmpeqd %xmm4, %xmm3
1644 ; SSE2-NEXT: pshufd {{.*#+}} xmm5 = xmm3[1,0,3,2]
1645 ; SSE2-NEXT: pand %xmm3, %xmm5
1646 ; SSE2-NEXT: pcmpeqd %xmm4, %xmm2
1647 ; SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm2[1,0,3,2]
1648 ; SSE2-NEXT: pand %xmm2, %xmm3
1649 ; SSE2-NEXT: packssdw %xmm5, %xmm3
1650 ; SSE2-NEXT: pcmpeqd %xmm4, %xmm1
1651 ; SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm1[1,0,3,2]
1652 ; SSE2-NEXT: pand %xmm1, %xmm2
1653 ; SSE2-NEXT: pcmpeqd %xmm4, %xmm0
1654 ; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,0,3,2]
1655 ; SSE2-NEXT: pand %xmm0, %xmm1
1656 ; SSE2-NEXT: packssdw %xmm2, %xmm1
1657 ; SSE2-NEXT: packssdw %xmm3, %xmm1
1658 ; SSE2-NEXT: packsswb %xmm0, %xmm1
1659 ; SSE2-NEXT: pmovmskb %xmm1, %eax
1660 ; SSE2-NEXT: xorb $0, %al
1661 ; SSE2-NEXT: setnp %al
1664 ; SSE41-LABEL: icmp_v8i64_v8i1:
1666 ; SSE41-NEXT: pxor %xmm4, %xmm4
1667 ; SSE41-NEXT: pcmpeqq %xmm4, %xmm3
1668 ; SSE41-NEXT: pcmpeqq %xmm4, %xmm2
1669 ; SSE41-NEXT: packssdw %xmm3, %xmm2
1670 ; SSE41-NEXT: pcmpeqq %xmm4, %xmm1
1671 ; SSE41-NEXT: pcmpeqq %xmm4, %xmm0
1672 ; SSE41-NEXT: packssdw %xmm1, %xmm0
1673 ; SSE41-NEXT: packssdw %xmm2, %xmm0
1674 ; SSE41-NEXT: packsswb %xmm0, %xmm0
1675 ; SSE41-NEXT: pmovmskb %xmm0, %eax
1676 ; SSE41-NEXT: xorb $0, %al
1677 ; SSE41-NEXT: setnp %al
1680 ; AVX1-LABEL: icmp_v8i64_v8i1:
1682 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm2
1683 ; AVX1-NEXT: vpxor %xmm3, %xmm3, %xmm3
1684 ; AVX1-NEXT: vpcmpeqq %xmm3, %xmm2, %xmm2
1685 ; AVX1-NEXT: vpcmpeqq %xmm3, %xmm1, %xmm1
1686 ; AVX1-NEXT: vpackssdw %xmm2, %xmm1, %xmm1
1687 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2
1688 ; AVX1-NEXT: vpcmpeqq %xmm3, %xmm2, %xmm2
1689 ; AVX1-NEXT: vpcmpeqq %xmm3, %xmm0, %xmm0
1690 ; AVX1-NEXT: vpackssdw %xmm2, %xmm0, %xmm0
1691 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
1692 ; AVX1-NEXT: vmovmskps %ymm0, %eax
1693 ; AVX1-NEXT: xorb $0, %al
1694 ; AVX1-NEXT: setnp %al
1695 ; AVX1-NEXT: vzeroupper
1698 ; AVX2-LABEL: icmp_v8i64_v8i1:
1700 ; AVX2-NEXT: vpxor %xmm2, %xmm2, %xmm2
1701 ; AVX2-NEXT: vpcmpeqq %ymm2, %ymm1, %ymm1
1702 ; AVX2-NEXT: vpcmpeqq %ymm2, %ymm0, %ymm0
1703 ; AVX2-NEXT: vpackssdw %ymm1, %ymm0, %ymm0
1704 ; AVX2-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,2,1,3]
1705 ; AVX2-NEXT: vmovmskps %ymm0, %eax
1706 ; AVX2-NEXT: xorb $0, %al
1707 ; AVX2-NEXT: setnp %al
1708 ; AVX2-NEXT: vzeroupper
1711 ; AVX512F-LABEL: icmp_v8i64_v8i1:
1713 ; AVX512F-NEXT: vptestnmq %zmm0, %zmm0, %k0
1714 ; AVX512F-NEXT: kmovw %k0, %eax
1715 ; AVX512F-NEXT: xorb $0, %al
1716 ; AVX512F-NEXT: setnp %al
1717 ; AVX512F-NEXT: vzeroupper
1718 ; AVX512F-NEXT: retq
1720 ; AVX512BW-LABEL: icmp_v8i64_v8i1:
1721 ; AVX512BW: # %bb.0:
1722 ; AVX512BW-NEXT: vptestnmq %zmm0, %zmm0, %k0
1723 ; AVX512BW-NEXT: kmovd %k0, %eax
1724 ; AVX512BW-NEXT: xorb $0, %al
1725 ; AVX512BW-NEXT: setnp %al
1726 ; AVX512BW-NEXT: vzeroupper
1727 ; AVX512BW-NEXT: retq
1729 ; AVX512VL-LABEL: icmp_v8i64_v8i1:
1730 ; AVX512VL: # %bb.0:
1731 ; AVX512VL-NEXT: vptestnmq %zmm0, %zmm0, %k0
1732 ; AVX512VL-NEXT: kmovd %k0, %eax
1733 ; AVX512VL-NEXT: xorb $0, %al
1734 ; AVX512VL-NEXT: setnp %al
1735 ; AVX512VL-NEXT: vzeroupper
1736 ; AVX512VL-NEXT: retq
1737 %a = icmp eq <8 x i64> %0, zeroinitializer
1738 %b = call i1 @llvm.experimental.vector.reduce.xor.v8i1(<8 x i1> %a)
1742 define i1 @icmp_v16i32_v16i1(<16 x i32>) {
1743 ; SSE-LABEL: icmp_v16i32_v16i1:
1745 ; SSE-NEXT: pxor %xmm4, %xmm4
1746 ; SSE-NEXT: pcmpeqd %xmm4, %xmm3
1747 ; SSE-NEXT: pcmpeqd %xmm4, %xmm2
1748 ; SSE-NEXT: packssdw %xmm3, %xmm2
1749 ; SSE-NEXT: pcmpeqd %xmm4, %xmm1
1750 ; SSE-NEXT: pcmpeqd %xmm4, %xmm0
1751 ; SSE-NEXT: packssdw %xmm1, %xmm0
1752 ; SSE-NEXT: packsswb %xmm2, %xmm0
1753 ; SSE-NEXT: pmovmskb %xmm0, %eax
1754 ; SSE-NEXT: movl %eax, %ecx
1755 ; SSE-NEXT: shrl $8, %ecx
1756 ; SSE-NEXT: xorb %al, %cl
1757 ; SSE-NEXT: setnp %al
1760 ; AVX1-LABEL: icmp_v16i32_v16i1:
1762 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm2
1763 ; AVX1-NEXT: vpxor %xmm3, %xmm3, %xmm3
1764 ; AVX1-NEXT: vpcmpeqd %xmm3, %xmm2, %xmm2
1765 ; AVX1-NEXT: vpcmpeqd %xmm3, %xmm1, %xmm1
1766 ; AVX1-NEXT: vpackssdw %xmm2, %xmm1, %xmm1
1767 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2
1768 ; AVX1-NEXT: vpcmpeqd %xmm3, %xmm2, %xmm2
1769 ; AVX1-NEXT: vpcmpeqd %xmm3, %xmm0, %xmm0
1770 ; AVX1-NEXT: vpackssdw %xmm2, %xmm0, %xmm0
1771 ; AVX1-NEXT: vpacksswb %xmm1, %xmm0, %xmm0
1772 ; AVX1-NEXT: vpmovmskb %xmm0, %eax
1773 ; AVX1-NEXT: movl %eax, %ecx
1774 ; AVX1-NEXT: shrl $8, %ecx
1775 ; AVX1-NEXT: xorb %al, %cl
1776 ; AVX1-NEXT: setnp %al
1777 ; AVX1-NEXT: vzeroupper
1780 ; AVX2-LABEL: icmp_v16i32_v16i1:
1782 ; AVX2-NEXT: vpxor %xmm2, %xmm2, %xmm2
1783 ; AVX2-NEXT: vpcmpeqd %ymm2, %ymm1, %ymm1
1784 ; AVX2-NEXT: vpcmpeqd %ymm2, %ymm0, %ymm0
1785 ; AVX2-NEXT: vpackssdw %ymm1, %ymm0, %ymm0
1786 ; AVX2-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,2,1,3]
1787 ; AVX2-NEXT: vextracti128 $1, %ymm0, %xmm1
1788 ; AVX2-NEXT: vpacksswb %xmm1, %xmm0, %xmm0
1789 ; AVX2-NEXT: vpmovmskb %xmm0, %eax
1790 ; AVX2-NEXT: movl %eax, %ecx
1791 ; AVX2-NEXT: shrl $8, %ecx
1792 ; AVX2-NEXT: xorb %al, %cl
1793 ; AVX2-NEXT: setnp %al
1794 ; AVX2-NEXT: vzeroupper
1797 ; AVX512F-LABEL: icmp_v16i32_v16i1:
1799 ; AVX512F-NEXT: vptestnmd %zmm0, %zmm0, %k0
1800 ; AVX512F-NEXT: kmovw %k0, %eax
1801 ; AVX512F-NEXT: movl %eax, %ecx
1802 ; AVX512F-NEXT: shrl $8, %ecx
1803 ; AVX512F-NEXT: xorb %al, %cl
1804 ; AVX512F-NEXT: setnp %al
1805 ; AVX512F-NEXT: vzeroupper
1806 ; AVX512F-NEXT: retq
1808 ; AVX512BW-LABEL: icmp_v16i32_v16i1:
1809 ; AVX512BW: # %bb.0:
1810 ; AVX512BW-NEXT: vptestnmd %zmm0, %zmm0, %k0
1811 ; AVX512BW-NEXT: kmovd %k0, %eax
1812 ; AVX512BW-NEXT: movl %eax, %ecx
1813 ; AVX512BW-NEXT: shrl $8, %ecx
1814 ; AVX512BW-NEXT: xorb %al, %cl
1815 ; AVX512BW-NEXT: setnp %al
1816 ; AVX512BW-NEXT: vzeroupper
1817 ; AVX512BW-NEXT: retq
1819 ; AVX512VL-LABEL: icmp_v16i32_v16i1:
1820 ; AVX512VL: # %bb.0:
1821 ; AVX512VL-NEXT: vptestnmd %zmm0, %zmm0, %k0
1822 ; AVX512VL-NEXT: kmovd %k0, %eax
1823 ; AVX512VL-NEXT: movl %eax, %ecx
1824 ; AVX512VL-NEXT: shrl $8, %ecx
1825 ; AVX512VL-NEXT: xorb %al, %cl
1826 ; AVX512VL-NEXT: setnp %al
1827 ; AVX512VL-NEXT: vzeroupper
1828 ; AVX512VL-NEXT: retq
1829 %a = icmp eq <16 x i32> %0, zeroinitializer
1830 %b = call i1 @llvm.experimental.vector.reduce.xor.v16i1(<16 x i1> %a)
1834 define i1 @icmp_v32i16_v32i1(<32 x i16>) {
1835 ; SSE-LABEL: icmp_v32i16_v32i1:
1837 ; SSE-NEXT: pxor %xmm4, %xmm4
1838 ; SSE-NEXT: pcmpeqw %xmm4, %xmm1
1839 ; SSE-NEXT: pcmpeqw %xmm4, %xmm0
1840 ; SSE-NEXT: packsswb %xmm1, %xmm0
1841 ; SSE-NEXT: pcmpeqw %xmm4, %xmm3
1842 ; SSE-NEXT: pcmpeqw %xmm4, %xmm2
1843 ; SSE-NEXT: packsswb %xmm3, %xmm2
1844 ; SSE-NEXT: pxor %xmm0, %xmm2
1845 ; SSE-NEXT: pmovmskb %xmm2, %eax
1846 ; SSE-NEXT: movl %eax, %ecx
1847 ; SSE-NEXT: shrl $8, %ecx
1848 ; SSE-NEXT: xorb %al, %cl
1849 ; SSE-NEXT: setnp %al
1852 ; AVX1-LABEL: icmp_v32i16_v32i1:
1854 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm2
1855 ; AVX1-NEXT: vpxor %xmm3, %xmm3, %xmm3
1856 ; AVX1-NEXT: vpcmpeqw %xmm3, %xmm2, %xmm2
1857 ; AVX1-NEXT: vpcmpeqw %xmm3, %xmm1, %xmm1
1858 ; AVX1-NEXT: vpacksswb %xmm2, %xmm1, %xmm1
1859 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2
1860 ; AVX1-NEXT: vpcmpeqw %xmm3, %xmm2, %xmm2
1861 ; AVX1-NEXT: vpcmpeqw %xmm3, %xmm0, %xmm0
1862 ; AVX1-NEXT: vpacksswb %xmm2, %xmm0, %xmm0
1863 ; AVX1-NEXT: vpxor %xmm1, %xmm0, %xmm0
1864 ; AVX1-NEXT: vpsllw $7, %xmm0, %xmm0
1865 ; AVX1-NEXT: vpmovmskb %xmm0, %eax
1866 ; AVX1-NEXT: movl %eax, %ecx
1867 ; AVX1-NEXT: shrl $8, %ecx
1868 ; AVX1-NEXT: xorb %al, %cl
1869 ; AVX1-NEXT: setnp %al
1870 ; AVX1-NEXT: vzeroupper
1873 ; AVX2-LABEL: icmp_v32i16_v32i1:
1875 ; AVX2-NEXT: vpxor %xmm2, %xmm2, %xmm2
1876 ; AVX2-NEXT: vpcmpeqw %ymm2, %ymm1, %ymm1
1877 ; AVX2-NEXT: vpcmpeqw %ymm2, %ymm0, %ymm0
1878 ; AVX2-NEXT: vpacksswb %ymm1, %ymm0, %ymm0
1879 ; AVX2-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,2,1,3]
1880 ; AVX2-NEXT: vpmovmskb %ymm0, %eax
1881 ; AVX2-NEXT: movl %eax, %ecx
1882 ; AVX2-NEXT: shrl $16, %ecx
1883 ; AVX2-NEXT: xorl %eax, %ecx
1884 ; AVX2-NEXT: movl %ecx, %eax
1885 ; AVX2-NEXT: shrl $8, %eax
1886 ; AVX2-NEXT: xorb %cl, %al
1887 ; AVX2-NEXT: setnp %al
1888 ; AVX2-NEXT: vzeroupper
1891 ; AVX512F-LABEL: icmp_v32i16_v32i1:
1893 ; AVX512F-NEXT: vextracti64x4 $1, %zmm0, %ymm1
1894 ; AVX512F-NEXT: vpxor %xmm2, %xmm2, %xmm2
1895 ; AVX512F-NEXT: vpcmpeqw %ymm2, %ymm1, %ymm1
1896 ; AVX512F-NEXT: vpcmpeqw %ymm2, %ymm0, %ymm0
1897 ; AVX512F-NEXT: vpxor %ymm1, %ymm0, %ymm0
1898 ; AVX512F-NEXT: vpmovsxwd %ymm0, %zmm0
1899 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
1900 ; AVX512F-NEXT: kshiftrw $8, %k0, %k1
1901 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
1902 ; AVX512F-NEXT: kshiftrw $4, %k0, %k1
1903 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
1904 ; AVX512F-NEXT: kshiftrw $2, %k0, %k1
1905 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
1906 ; AVX512F-NEXT: kshiftrw $1, %k0, %k1
1907 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
1908 ; AVX512F-NEXT: kmovw %k0, %eax
1909 ; AVX512F-NEXT: # kill: def $al killed $al killed $eax
1910 ; AVX512F-NEXT: vzeroupper
1911 ; AVX512F-NEXT: retq
1913 ; AVX512BW-LABEL: icmp_v32i16_v32i1:
1914 ; AVX512BW: # %bb.0:
1915 ; AVX512BW-NEXT: vptestnmw %zmm0, %zmm0, %k0
1916 ; AVX512BW-NEXT: kmovd %k0, %eax
1917 ; AVX512BW-NEXT: movl %eax, %ecx
1918 ; AVX512BW-NEXT: shrl $16, %ecx
1919 ; AVX512BW-NEXT: xorl %eax, %ecx
1920 ; AVX512BW-NEXT: movl %ecx, %eax
1921 ; AVX512BW-NEXT: shrl $8, %eax
1922 ; AVX512BW-NEXT: xorb %cl, %al
1923 ; AVX512BW-NEXT: setnp %al
1924 ; AVX512BW-NEXT: vzeroupper
1925 ; AVX512BW-NEXT: retq
1927 ; AVX512VL-LABEL: icmp_v32i16_v32i1:
1928 ; AVX512VL: # %bb.0:
1929 ; AVX512VL-NEXT: vptestnmw %zmm0, %zmm0, %k0
1930 ; AVX512VL-NEXT: kmovd %k0, %eax
1931 ; AVX512VL-NEXT: movl %eax, %ecx
1932 ; AVX512VL-NEXT: shrl $16, %ecx
1933 ; AVX512VL-NEXT: xorl %eax, %ecx
1934 ; AVX512VL-NEXT: movl %ecx, %eax
1935 ; AVX512VL-NEXT: shrl $8, %eax
1936 ; AVX512VL-NEXT: xorb %cl, %al
1937 ; AVX512VL-NEXT: setnp %al
1938 ; AVX512VL-NEXT: vzeroupper
1939 ; AVX512VL-NEXT: retq
1940 %a = icmp eq <32 x i16> %0, zeroinitializer
1941 %b = call i1 @llvm.experimental.vector.reduce.xor.v32i1(<32 x i1> %a)
1945 define i1 @icmp_v64i8_v64i1(<64 x i8>) {
1946 ; SSE2-LABEL: icmp_v64i8_v64i1:
1948 ; SSE2-NEXT: pxor %xmm4, %xmm4
1949 ; SSE2-NEXT: pcmpeqb %xmm4, %xmm2
1950 ; SSE2-NEXT: pcmpeqb %xmm4, %xmm0
1951 ; SSE2-NEXT: pcmpeqb %xmm4, %xmm3
1952 ; SSE2-NEXT: pcmpeqb %xmm4, %xmm1
1953 ; SSE2-NEXT: pxor %xmm3, %xmm1
1954 ; SSE2-NEXT: pxor %xmm2, %xmm1
1955 ; SSE2-NEXT: pxor %xmm0, %xmm1
1956 ; SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm1[2,3,0,1]
1957 ; SSE2-NEXT: pxor %xmm1, %xmm0
1958 ; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
1959 ; SSE2-NEXT: pxor %xmm0, %xmm1
1960 ; SSE2-NEXT: movdqa %xmm1, %xmm0
1961 ; SSE2-NEXT: psrld $16, %xmm0
1962 ; SSE2-NEXT: pxor %xmm1, %xmm0
1963 ; SSE2-NEXT: movdqa %xmm0, %xmm1
1964 ; SSE2-NEXT: psrlw $8, %xmm1
1965 ; SSE2-NEXT: pxor %xmm0, %xmm1
1966 ; SSE2-NEXT: movd %xmm1, %eax
1967 ; SSE2-NEXT: # kill: def $al killed $al killed $eax
1970 ; SSE41-LABEL: icmp_v64i8_v64i1:
1972 ; SSE41-NEXT: pxor %xmm4, %xmm4
1973 ; SSE41-NEXT: pcmpeqb %xmm4, %xmm2
1974 ; SSE41-NEXT: pcmpeqb %xmm4, %xmm0
1975 ; SSE41-NEXT: pcmpeqb %xmm4, %xmm3
1976 ; SSE41-NEXT: pcmpeqb %xmm4, %xmm1
1977 ; SSE41-NEXT: pxor %xmm3, %xmm1
1978 ; SSE41-NEXT: pxor %xmm2, %xmm1
1979 ; SSE41-NEXT: pxor %xmm0, %xmm1
1980 ; SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm1[2,3,0,1]
1981 ; SSE41-NEXT: pxor %xmm1, %xmm0
1982 ; SSE41-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
1983 ; SSE41-NEXT: pxor %xmm0, %xmm1
1984 ; SSE41-NEXT: movdqa %xmm1, %xmm0
1985 ; SSE41-NEXT: psrld $16, %xmm0
1986 ; SSE41-NEXT: pxor %xmm1, %xmm0
1987 ; SSE41-NEXT: movdqa %xmm0, %xmm1
1988 ; SSE41-NEXT: psrlw $8, %xmm1
1989 ; SSE41-NEXT: pxor %xmm0, %xmm1
1990 ; SSE41-NEXT: pextrb $0, %xmm1, %eax
1991 ; SSE41-NEXT: # kill: def $al killed $al killed $eax
1994 ; AVX1-LABEL: icmp_v64i8_v64i1:
1996 ; AVX1-NEXT: vpxor %xmm2, %xmm2, %xmm2
1997 ; AVX1-NEXT: vpcmpeqb %xmm2, %xmm1, %xmm3
1998 ; AVX1-NEXT: vpcmpeqb %xmm2, %xmm0, %xmm4
1999 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm1
2000 ; AVX1-NEXT: vpcmpeqb %xmm2, %xmm1, %xmm1
2001 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm0
2002 ; AVX1-NEXT: vpcmpeqb %xmm2, %xmm0, %xmm0
2003 ; AVX1-NEXT: vpxor %xmm1, %xmm0, %xmm0
2004 ; AVX1-NEXT: vpxor %xmm0, %xmm3, %xmm0
2005 ; AVX1-NEXT: vpxor %xmm0, %xmm4, %xmm0
2006 ; AVX1-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
2007 ; AVX1-NEXT: vpxor %xmm1, %xmm0, %xmm0
2008 ; AVX1-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
2009 ; AVX1-NEXT: vpxor %xmm1, %xmm0, %xmm0
2010 ; AVX1-NEXT: vpsrld $16, %xmm0, %xmm1
2011 ; AVX1-NEXT: vpxor %xmm1, %xmm0, %xmm0
2012 ; AVX1-NEXT: vpsrlw $8, %xmm0, %xmm1
2013 ; AVX1-NEXT: vpxor %xmm1, %xmm0, %xmm0
2014 ; AVX1-NEXT: vpextrb $0, %xmm0, %eax
2015 ; AVX1-NEXT: # kill: def $al killed $al killed $eax
2016 ; AVX1-NEXT: vzeroupper
2019 ; AVX2-LABEL: icmp_v64i8_v64i1:
2021 ; AVX2-NEXT: vpxor %xmm2, %xmm2, %xmm2
2022 ; AVX2-NEXT: vpcmpeqb %ymm2, %ymm1, %ymm1
2023 ; AVX2-NEXT: vpcmpeqb %ymm2, %ymm0, %ymm0
2024 ; AVX2-NEXT: vpxor %ymm1, %ymm0, %ymm0
2025 ; AVX2-NEXT: vextracti128 $1, %ymm0, %xmm1
2026 ; AVX2-NEXT: vpxor %xmm1, %xmm0, %xmm0
2027 ; AVX2-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
2028 ; AVX2-NEXT: vpxor %xmm1, %xmm0, %xmm0
2029 ; AVX2-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
2030 ; AVX2-NEXT: vpxor %xmm1, %xmm0, %xmm0
2031 ; AVX2-NEXT: vpsrld $16, %xmm0, %xmm1
2032 ; AVX2-NEXT: vpxor %xmm1, %xmm0, %xmm0
2033 ; AVX2-NEXT: vpsrlw $8, %xmm0, %xmm1
2034 ; AVX2-NEXT: vpxor %xmm1, %xmm0, %xmm0
2035 ; AVX2-NEXT: vpextrb $0, %xmm0, %eax
2036 ; AVX2-NEXT: # kill: def $al killed $al killed $eax
2037 ; AVX2-NEXT: vzeroupper
2040 ; AVX512F-LABEL: icmp_v64i8_v64i1:
2042 ; AVX512F-NEXT: vextracti64x4 $1, %zmm0, %ymm1
2043 ; AVX512F-NEXT: vpxor %xmm2, %xmm2, %xmm2
2044 ; AVX512F-NEXT: vpcmpeqb %ymm2, %ymm1, %ymm1
2045 ; AVX512F-NEXT: vpcmpeqb %ymm2, %ymm0, %ymm0
2046 ; AVX512F-NEXT: vextracti128 $1, %ymm1, %xmm2
2047 ; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm3
2048 ; AVX512F-NEXT: vpxor %xmm2, %xmm3, %xmm2
2049 ; AVX512F-NEXT: vpxor %xmm2, %xmm1, %xmm1
2050 ; AVX512F-NEXT: vpxor %xmm1, %xmm0, %xmm0
2051 ; AVX512F-NEXT: vpmovsxbd %xmm0, %zmm0
2052 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
2053 ; AVX512F-NEXT: kshiftrw $8, %k0, %k1
2054 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
2055 ; AVX512F-NEXT: kshiftrw $4, %k0, %k1
2056 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
2057 ; AVX512F-NEXT: kshiftrw $2, %k0, %k1
2058 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
2059 ; AVX512F-NEXT: kshiftrw $1, %k0, %k1
2060 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
2061 ; AVX512F-NEXT: kmovw %k0, %eax
2062 ; AVX512F-NEXT: # kill: def $al killed $al killed $eax
2063 ; AVX512F-NEXT: vzeroupper
2064 ; AVX512F-NEXT: retq
2066 ; AVX512BW-LABEL: icmp_v64i8_v64i1:
2067 ; AVX512BW: # %bb.0:
2068 ; AVX512BW-NEXT: vptestnmb %zmm0, %zmm0, %k0
2069 ; AVX512BW-NEXT: kshiftrq $32, %k0, %k1
2070 ; AVX512BW-NEXT: kxorq %k1, %k0, %k0
2071 ; AVX512BW-NEXT: kshiftrq $16, %k0, %k1
2072 ; AVX512BW-NEXT: kxorq %k1, %k0, %k0
2073 ; AVX512BW-NEXT: kshiftrq $8, %k0, %k1
2074 ; AVX512BW-NEXT: kxorq %k1, %k0, %k0
2075 ; AVX512BW-NEXT: kshiftrq $4, %k0, %k1
2076 ; AVX512BW-NEXT: kxorq %k1, %k0, %k0
2077 ; AVX512BW-NEXT: kshiftrq $2, %k0, %k1
2078 ; AVX512BW-NEXT: kxorq %k1, %k0, %k0
2079 ; AVX512BW-NEXT: kshiftrq $1, %k0, %k1
2080 ; AVX512BW-NEXT: kxorq %k1, %k0, %k0
2081 ; AVX512BW-NEXT: kmovd %k0, %eax
2082 ; AVX512BW-NEXT: # kill: def $al killed $al killed $eax
2083 ; AVX512BW-NEXT: vzeroupper
2084 ; AVX512BW-NEXT: retq
2086 ; AVX512VL-LABEL: icmp_v64i8_v64i1:
2087 ; AVX512VL: # %bb.0:
2088 ; AVX512VL-NEXT: vptestnmb %zmm0, %zmm0, %k0
2089 ; AVX512VL-NEXT: kshiftrq $32, %k0, %k1
2090 ; AVX512VL-NEXT: kxorq %k1, %k0, %k0
2091 ; AVX512VL-NEXT: kshiftrq $16, %k0, %k1
2092 ; AVX512VL-NEXT: kxorq %k1, %k0, %k0
2093 ; AVX512VL-NEXT: kshiftrq $8, %k0, %k1
2094 ; AVX512VL-NEXT: kxorq %k1, %k0, %k0
2095 ; AVX512VL-NEXT: kshiftrq $4, %k0, %k1
2096 ; AVX512VL-NEXT: kxorq %k1, %k0, %k0
2097 ; AVX512VL-NEXT: kshiftrq $2, %k0, %k1
2098 ; AVX512VL-NEXT: kxorq %k1, %k0, %k0
2099 ; AVX512VL-NEXT: kshiftrq $1, %k0, %k1
2100 ; AVX512VL-NEXT: kxorq %k1, %k0, %k0
2101 ; AVX512VL-NEXT: kmovd %k0, %eax
2102 ; AVX512VL-NEXT: # kill: def $al killed $al killed $eax
2103 ; AVX512VL-NEXT: vzeroupper
2104 ; AVX512VL-NEXT: retq
2105 %a = icmp eq <64 x i8> %0, zeroinitializer
2106 %b = call i1 @llvm.experimental.vector.reduce.xor.v64i1(<64 x i1> %a)
2110 declare i1 @llvm.experimental.vector.reduce.xor.v2i1(<2 x i1>)
2111 declare i1 @llvm.experimental.vector.reduce.xor.v4i1(<4 x i1>)
2112 declare i1 @llvm.experimental.vector.reduce.xor.v8i1(<8 x i1>)
2113 declare i1 @llvm.experimental.vector.reduce.xor.v16i1(<16 x i1>)
2114 declare i1 @llvm.experimental.vector.reduce.xor.v32i1(<32 x i1>)
2115 declare i1 @llvm.experimental.vector.reduce.xor.v64i1(<64 x i1>)