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: cmpb $3, %al
23 ; AVX-LABEL: trunc_v2i64_v2i1:
25 ; AVX-NEXT: vpsllq $63, %xmm0, %xmm0
26 ; AVX-NEXT: vmovmskpd %xmm0, %eax
27 ; AVX-NEXT: cmpb $3, %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: andb $3, %al
37 ; AVX512F-NEXT: cmpb $3, %al
38 ; AVX512F-NEXT: sete %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: andb $3, %al
48 ; AVX512BW-NEXT: cmpb $3, %al
49 ; AVX512BW-NEXT: sete %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: andb $3, %al
59 ; AVX512VL-NEXT: cmpb $3, %al
60 ; AVX512VL-NEXT: sete %al
62 %a = trunc <2 x i64> %0 to <2 x i1>
63 %b = call i1 @llvm.experimental.vector.reduce.and.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: cmpb $15, %al
76 ; AVX-LABEL: trunc_v4i32_v4i1:
78 ; AVX-NEXT: vpslld $31, %xmm0, %xmm0
79 ; AVX-NEXT: vmovmskps %xmm0, %eax
80 ; AVX-NEXT: cmpb $15, %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: andb $15, %al
90 ; AVX512F-NEXT: cmpb $15, %al
91 ; AVX512F-NEXT: sete %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: andb $15, %al
101 ; AVX512BW-NEXT: cmpb $15, %al
102 ; AVX512BW-NEXT: sete %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: andb $15, %al
112 ; AVX512VL-NEXT: cmpb $15, %al
113 ; AVX512VL-NEXT: sete %al
114 ; AVX512VL-NEXT: retq
115 %a = trunc <4 x i32> %0 to <4 x i1>
116 %b = call i1 @llvm.experimental.vector.reduce.and.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: cmpb $-1, %al
128 ; SSE2-NEXT: sete %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: cmpb $-1, %al
138 ; SSE41-NEXT: sete %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: cmpb $-1, %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: cmpb $-1, %al
158 ; AVX512F-NEXT: sete %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: cmpb $-1, %al
168 ; AVX512BW-NEXT: sete %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: cmpb $-1, %al
178 ; AVX512VL-NEXT: sete %al
179 ; AVX512VL-NEXT: retq
180 %a = trunc <8 x i8> %0 to <8 x i1>
181 %b = call i1 @llvm.experimental.vector.reduce.and.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: cmpw $-1, %ax
194 ; AVX-LABEL: trunc_v16i8_v16i1:
196 ; AVX-NEXT: vpsllw $7, %xmm0, %xmm0
197 ; AVX-NEXT: vpmovmskb %xmm0, %eax
198 ; AVX-NEXT: cmpw $-1, %ax
202 ; AVX512-LABEL: trunc_v16i8_v16i1:
204 ; AVX512-NEXT: vpsllw $7, %xmm0, %xmm0
205 ; AVX512-NEXT: vpmovmskb %xmm0, %eax
206 ; AVX512-NEXT: cmpw $-1, %ax
207 ; AVX512-NEXT: sete %al
209 %a = trunc <16 x i8> %0 to <16 x i1>
210 %b = call i1 @llvm.experimental.vector.reduce.and.v16i1(<16 x i1> %a)
214 define i1 @trunc_v4i64_v4i1(<4 x i64>) {
215 ; SSE-LABEL: trunc_v4i64_v4i1:
217 ; SSE-NEXT: shufps {{.*#+}} xmm0 = xmm0[0,2],xmm1[0,2]
218 ; SSE-NEXT: pslld $31, %xmm0
219 ; SSE-NEXT: movmskps %xmm0, %eax
220 ; SSE-NEXT: cmpb $15, %al
224 ; AVX-LABEL: trunc_v4i64_v4i1:
226 ; AVX-NEXT: vextractf128 $1, %ymm0, %xmm1
227 ; AVX-NEXT: vshufps {{.*#+}} xmm0 = xmm0[0,2],xmm1[0,2]
228 ; AVX-NEXT: vpslld $31, %xmm0, %xmm0
229 ; AVX-NEXT: vmovmskps %xmm0, %eax
230 ; AVX-NEXT: cmpb $15, %al
232 ; AVX-NEXT: vzeroupper
235 ; AVX512F-LABEL: trunc_v4i64_v4i1:
237 ; AVX512F-NEXT: vpsllq $63, %ymm0, %ymm0
238 ; AVX512F-NEXT: vptestmq %zmm0, %zmm0, %k0
239 ; AVX512F-NEXT: kmovw %k0, %eax
240 ; AVX512F-NEXT: andb $15, %al
241 ; AVX512F-NEXT: cmpb $15, %al
242 ; AVX512F-NEXT: sete %al
243 ; AVX512F-NEXT: vzeroupper
246 ; AVX512BW-LABEL: trunc_v4i64_v4i1:
248 ; AVX512BW-NEXT: vpsllq $63, %ymm0, %ymm0
249 ; AVX512BW-NEXT: vptestmq %zmm0, %zmm0, %k0
250 ; AVX512BW-NEXT: kmovd %k0, %eax
251 ; AVX512BW-NEXT: andb $15, %al
252 ; AVX512BW-NEXT: cmpb $15, %al
253 ; AVX512BW-NEXT: sete %al
254 ; AVX512BW-NEXT: vzeroupper
255 ; AVX512BW-NEXT: retq
257 ; AVX512VL-LABEL: trunc_v4i64_v4i1:
259 ; AVX512VL-NEXT: vpsllq $63, %ymm0, %ymm0
260 ; AVX512VL-NEXT: vptestmq %ymm0, %ymm0, %k0
261 ; AVX512VL-NEXT: kmovd %k0, %eax
262 ; AVX512VL-NEXT: andb $15, %al
263 ; AVX512VL-NEXT: cmpb $15, %al
264 ; AVX512VL-NEXT: sete %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.experimental.vector.reduce.and.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: cmpb $-1, %al
284 ; SSE2-NEXT: sete %al
287 ; SSE41-LABEL: trunc_v8i32_v8i1:
289 ; SSE41-NEXT: movdqa {{.*#+}} xmm2 = [0,1,4,5,8,9,12,13,8,9,12,13,12,13,14,15]
290 ; SSE41-NEXT: pshufb %xmm2, %xmm1
291 ; SSE41-NEXT: pshufb %xmm2, %xmm0
292 ; SSE41-NEXT: punpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm1[0]
293 ; SSE41-NEXT: psllw $15, %xmm0
294 ; SSE41-NEXT: packsswb %xmm0, %xmm0
295 ; SSE41-NEXT: pmovmskb %xmm0, %eax
296 ; SSE41-NEXT: cmpb $-1, %al
297 ; SSE41-NEXT: sete %al
300 ; AVX1-LABEL: trunc_v8i32_v8i1:
302 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
303 ; AVX1-NEXT: vmovdqa {{.*#+}} xmm2 = [0,1,4,5,8,9,12,13,8,9,12,13,12,13,14,15]
304 ; AVX1-NEXT: vpshufb %xmm2, %xmm1, %xmm1
305 ; AVX1-NEXT: vpshufb %xmm2, %xmm0, %xmm0
306 ; AVX1-NEXT: vpunpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm1[0]
307 ; AVX1-NEXT: vpsllw $15, %xmm0, %xmm0
308 ; AVX1-NEXT: vpacksswb %xmm0, %xmm0, %xmm0
309 ; AVX1-NEXT: vpmovmskb %xmm0, %eax
310 ; AVX1-NEXT: cmpb $-1, %al
311 ; AVX1-NEXT: sete %al
312 ; AVX1-NEXT: vzeroupper
315 ; AVX2-LABEL: trunc_v8i32_v8i1:
317 ; 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]
318 ; AVX2-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,2,2,3]
319 ; AVX2-NEXT: vpsllw $15, %xmm0, %xmm0
320 ; AVX2-NEXT: vpacksswb %xmm0, %xmm0, %xmm0
321 ; AVX2-NEXT: vpmovmskb %xmm0, %eax
322 ; AVX2-NEXT: cmpb $-1, %al
323 ; AVX2-NEXT: sete %al
324 ; AVX2-NEXT: vzeroupper
327 ; AVX512F-LABEL: trunc_v8i32_v8i1:
329 ; AVX512F-NEXT: vpslld $31, %ymm0, %ymm0
330 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
331 ; AVX512F-NEXT: kmovw %k0, %eax
332 ; AVX512F-NEXT: cmpb $-1, %al
333 ; AVX512F-NEXT: sete %al
334 ; AVX512F-NEXT: vzeroupper
337 ; AVX512BW-LABEL: trunc_v8i32_v8i1:
339 ; AVX512BW-NEXT: vpslld $31, %ymm0, %ymm0
340 ; AVX512BW-NEXT: vptestmd %zmm0, %zmm0, %k0
341 ; AVX512BW-NEXT: kmovd %k0, %eax
342 ; AVX512BW-NEXT: cmpb $-1, %al
343 ; AVX512BW-NEXT: sete %al
344 ; AVX512BW-NEXT: vzeroupper
345 ; AVX512BW-NEXT: retq
347 ; AVX512VL-LABEL: trunc_v8i32_v8i1:
349 ; AVX512VL-NEXT: vpslld $31, %ymm0, %ymm0
350 ; AVX512VL-NEXT: vptestmd %ymm0, %ymm0, %k0
351 ; AVX512VL-NEXT: kmovd %k0, %eax
352 ; AVX512VL-NEXT: cmpb $-1, %al
353 ; AVX512VL-NEXT: sete %al
354 ; AVX512VL-NEXT: vzeroupper
355 ; AVX512VL-NEXT: retq
356 %a = trunc <8 x i32> %0 to <8 x i1>
357 %b = call i1 @llvm.experimental.vector.reduce.and.v8i1(<8 x i1> %a)
361 define i1 @trunc_v16i16_v16i1(<16 x i16>) {
362 ; SSE2-LABEL: trunc_v16i16_v16i1:
364 ; SSE2-NEXT: movdqa {{.*#+}} xmm2 = [255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0]
365 ; SSE2-NEXT: pand %xmm2, %xmm1
366 ; SSE2-NEXT: pand %xmm2, %xmm0
367 ; SSE2-NEXT: packuswb %xmm1, %xmm0
368 ; SSE2-NEXT: psllw $7, %xmm0
369 ; SSE2-NEXT: pmovmskb %xmm0, %eax
370 ; SSE2-NEXT: cmpw $-1, %ax
371 ; SSE2-NEXT: sete %al
374 ; SSE41-LABEL: trunc_v16i16_v16i1:
376 ; SSE41-NEXT: movdqa {{.*#+}} xmm2 = <0,2,4,6,8,10,12,14,u,u,u,u,u,u,u,u>
377 ; SSE41-NEXT: pshufb %xmm2, %xmm1
378 ; SSE41-NEXT: pshufb %xmm2, %xmm0
379 ; SSE41-NEXT: punpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm1[0]
380 ; SSE41-NEXT: psllw $7, %xmm0
381 ; SSE41-NEXT: pmovmskb %xmm0, %eax
382 ; SSE41-NEXT: cmpw $-1, %ax
383 ; SSE41-NEXT: sete %al
386 ; AVX1-LABEL: trunc_v16i16_v16i1:
388 ; AVX1-NEXT: vandps {{.*}}(%rip), %ymm0, %ymm0
389 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
390 ; AVX1-NEXT: vpackuswb %xmm1, %xmm0, %xmm0
391 ; AVX1-NEXT: vpsllw $7, %xmm0, %xmm0
392 ; AVX1-NEXT: vpmovmskb %xmm0, %eax
393 ; AVX1-NEXT: cmpw $-1, %ax
394 ; AVX1-NEXT: sete %al
395 ; AVX1-NEXT: vzeroupper
398 ; AVX2-LABEL: trunc_v16i16_v16i1:
400 ; AVX2-NEXT: vpand {{.*}}(%rip), %ymm0, %ymm0
401 ; AVX2-NEXT: vextracti128 $1, %ymm0, %xmm1
402 ; AVX2-NEXT: vpackuswb %xmm1, %xmm0, %xmm0
403 ; AVX2-NEXT: vpsllw $7, %xmm0, %xmm0
404 ; AVX2-NEXT: vpmovmskb %xmm0, %eax
405 ; AVX2-NEXT: cmpw $-1, %ax
406 ; AVX2-NEXT: sete %al
407 ; AVX2-NEXT: vzeroupper
410 ; AVX512F-LABEL: trunc_v16i16_v16i1:
412 ; AVX512F-NEXT: vpmovsxwd %ymm0, %zmm0
413 ; AVX512F-NEXT: vpslld $31, %zmm0, %zmm0
414 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
415 ; AVX512F-NEXT: kortestw %k0, %k0
416 ; AVX512F-NEXT: setb %al
417 ; AVX512F-NEXT: vzeroupper
420 ; AVX512BW-LABEL: trunc_v16i16_v16i1:
422 ; AVX512BW-NEXT: vpsllw $15, %ymm0, %ymm0
423 ; AVX512BW-NEXT: vpmovw2m %zmm0, %k0
424 ; AVX512BW-NEXT: kortestw %k0, %k0
425 ; AVX512BW-NEXT: setb %al
426 ; AVX512BW-NEXT: vzeroupper
427 ; AVX512BW-NEXT: retq
429 ; AVX512VL-LABEL: trunc_v16i16_v16i1:
431 ; AVX512VL-NEXT: vpsllw $15, %ymm0, %ymm0
432 ; AVX512VL-NEXT: vpmovw2m %ymm0, %k0
433 ; AVX512VL-NEXT: kortestw %k0, %k0
434 ; AVX512VL-NEXT: setb %al
435 ; AVX512VL-NEXT: vzeroupper
436 ; AVX512VL-NEXT: retq
437 %a = trunc <16 x i16> %0 to <16 x i1>
438 %b = call i1 @llvm.experimental.vector.reduce.and.v16i1(<16 x i1> %a)
442 define i1 @trunc_v32i8_v32i1(<32 x i8>) {
443 ; SSE-LABEL: trunc_v32i8_v32i1:
445 ; SSE-NEXT: pand %xmm1, %xmm0
446 ; SSE-NEXT: psllw $7, %xmm0
447 ; SSE-NEXT: pmovmskb %xmm0, %eax
448 ; SSE-NEXT: cmpw $-1, %ax
452 ; AVX1-LABEL: trunc_v32i8_v32i1:
454 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
455 ; AVX1-NEXT: vpand %xmm1, %xmm0, %xmm0
456 ; AVX1-NEXT: vpsllw $7, %xmm0, %xmm0
457 ; AVX1-NEXT: vpmovmskb %xmm0, %eax
458 ; AVX1-NEXT: cmpw $-1, %ax
459 ; AVX1-NEXT: sete %al
460 ; AVX1-NEXT: vzeroupper
463 ; AVX2-LABEL: trunc_v32i8_v32i1:
465 ; AVX2-NEXT: vpsllw $7, %ymm0, %ymm0
466 ; AVX2-NEXT: vpmovmskb %ymm0, %eax
467 ; AVX2-NEXT: cmpl $-1, %eax
468 ; AVX2-NEXT: sete %al
469 ; AVX2-NEXT: vzeroupper
472 ; AVX512F-LABEL: trunc_v32i8_v32i1:
474 ; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm1
475 ; AVX512F-NEXT: vpand %xmm1, %xmm0, %xmm0
476 ; AVX512F-NEXT: vpmovsxbd %xmm0, %zmm0
477 ; AVX512F-NEXT: vpslld $31, %zmm0, %zmm0
478 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
479 ; AVX512F-NEXT: kshiftrw $8, %k0, %k1
480 ; AVX512F-NEXT: kandw %k1, %k0, %k0
481 ; AVX512F-NEXT: kshiftrw $4, %k0, %k1
482 ; AVX512F-NEXT: kandw %k1, %k0, %k0
483 ; AVX512F-NEXT: kshiftrw $2, %k0, %k1
484 ; AVX512F-NEXT: kandw %k1, %k0, %k0
485 ; AVX512F-NEXT: kshiftrw $1, %k0, %k1
486 ; AVX512F-NEXT: kandw %k1, %k0, %k0
487 ; AVX512F-NEXT: kmovw %k0, %eax
488 ; AVX512F-NEXT: # kill: def $al killed $al killed $eax
489 ; AVX512F-NEXT: vzeroupper
492 ; AVX512BW-LABEL: trunc_v32i8_v32i1:
494 ; AVX512BW-NEXT: vpsllw $7, %ymm0, %ymm0
495 ; AVX512BW-NEXT: vpmovmskb %ymm0, %eax
496 ; AVX512BW-NEXT: cmpl $-1, %eax
497 ; AVX512BW-NEXT: sete %al
498 ; AVX512BW-NEXT: vzeroupper
499 ; AVX512BW-NEXT: retq
501 ; AVX512VL-LABEL: trunc_v32i8_v32i1:
503 ; AVX512VL-NEXT: vpsllw $7, %ymm0, %ymm0
504 ; AVX512VL-NEXT: vpmovmskb %ymm0, %eax
505 ; AVX512VL-NEXT: cmpl $-1, %eax
506 ; AVX512VL-NEXT: sete %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.experimental.vector.reduce.and.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 %xmm0, %xmm2
530 ; SSE2-NEXT: pmovmskb %xmm2, %eax
531 ; SSE2-NEXT: cmpb $-1, %al
532 ; SSE2-NEXT: sete %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: cmpb $-1, %al
549 ; SSE41-NEXT: sete %al
552 ; AVX1-LABEL: trunc_v8i64_v8i1:
554 ; AVX1-NEXT: vmovaps {{.*#+}} ymm2 = [65535,65535,65535,65535]
555 ; AVX1-NEXT: vandps %ymm2, %ymm1, %ymm1
556 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm3
557 ; AVX1-NEXT: vpackusdw %xmm3, %xmm1, %xmm1
558 ; AVX1-NEXT: vandps %ymm2, %ymm0, %ymm0
559 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2
560 ; AVX1-NEXT: vpackusdw %xmm2, %xmm0, %xmm0
561 ; AVX1-NEXT: vpackusdw %xmm1, %xmm0, %xmm0
562 ; AVX1-NEXT: vpsllw $15, %xmm0, %xmm0
563 ; AVX1-NEXT: vpacksswb %xmm0, %xmm0, %xmm0
564 ; AVX1-NEXT: vpmovmskb %xmm0, %eax
565 ; AVX1-NEXT: cmpb $-1, %al
566 ; AVX1-NEXT: sete %al
567 ; AVX1-NEXT: vzeroupper
570 ; AVX2-LABEL: trunc_v8i64_v8i1:
572 ; AVX2-NEXT: vextractf128 $1, %ymm1, %xmm2
573 ; AVX2-NEXT: vshufps {{.*#+}} xmm1 = xmm1[0,2],xmm2[0,2]
574 ; AVX2-NEXT: vextractf128 $1, %ymm0, %xmm2
575 ; AVX2-NEXT: vshufps {{.*#+}} xmm0 = xmm0[0,2],xmm2[0,2]
576 ; AVX2-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
577 ; 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]
578 ; AVX2-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,2,2,3]
579 ; AVX2-NEXT: vpsllw $15, %xmm0, %xmm0
580 ; AVX2-NEXT: vpacksswb %xmm0, %xmm0, %xmm0
581 ; AVX2-NEXT: vpmovmskb %xmm0, %eax
582 ; AVX2-NEXT: cmpb $-1, %al
583 ; AVX2-NEXT: sete %al
584 ; AVX2-NEXT: vzeroupper
587 ; AVX512F-LABEL: trunc_v8i64_v8i1:
589 ; AVX512F-NEXT: vpsllq $63, %zmm0, %zmm0
590 ; AVX512F-NEXT: vptestmq %zmm0, %zmm0, %k0
591 ; AVX512F-NEXT: kmovw %k0, %eax
592 ; AVX512F-NEXT: cmpb $-1, %al
593 ; AVX512F-NEXT: sete %al
594 ; AVX512F-NEXT: vzeroupper
597 ; AVX512BW-LABEL: trunc_v8i64_v8i1:
599 ; AVX512BW-NEXT: vpsllq $63, %zmm0, %zmm0
600 ; AVX512BW-NEXT: vptestmq %zmm0, %zmm0, %k0
601 ; AVX512BW-NEXT: kmovd %k0, %eax
602 ; AVX512BW-NEXT: cmpb $-1, %al
603 ; AVX512BW-NEXT: sete %al
604 ; AVX512BW-NEXT: vzeroupper
605 ; AVX512BW-NEXT: retq
607 ; AVX512VL-LABEL: trunc_v8i64_v8i1:
609 ; AVX512VL-NEXT: vpsllq $63, %zmm0, %zmm0
610 ; AVX512VL-NEXT: vptestmq %zmm0, %zmm0, %k0
611 ; AVX512VL-NEXT: kmovd %k0, %eax
612 ; AVX512VL-NEXT: cmpb $-1, %al
613 ; AVX512VL-NEXT: sete %al
614 ; AVX512VL-NEXT: vzeroupper
615 ; AVX512VL-NEXT: retq
616 %a = trunc <8 x i64> %0 to <8 x i1>
617 %b = call i1 @llvm.experimental.vector.reduce.and.v8i1(<8 x i1> %a)
621 define i1 @trunc_v16i32_v16i1(<16 x i32>) {
622 ; SSE2-LABEL: trunc_v16i32_v16i1:
624 ; SSE2-NEXT: movdqa {{.*#+}} xmm4 = [255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0]
625 ; SSE2-NEXT: pand %xmm4, %xmm3
626 ; SSE2-NEXT: pand %xmm4, %xmm2
627 ; SSE2-NEXT: packuswb %xmm3, %xmm2
628 ; SSE2-NEXT: pand %xmm4, %xmm1
629 ; SSE2-NEXT: pand %xmm4, %xmm0
630 ; SSE2-NEXT: packuswb %xmm1, %xmm0
631 ; SSE2-NEXT: packuswb %xmm2, %xmm0
632 ; SSE2-NEXT: psllw $7, %xmm0
633 ; SSE2-NEXT: pmovmskb %xmm0, %eax
634 ; SSE2-NEXT: cmpw $-1, %ax
635 ; SSE2-NEXT: sete %al
638 ; SSE41-LABEL: trunc_v16i32_v16i1:
640 ; SSE41-NEXT: movdqa {{.*#+}} xmm4 = [255,0,0,0,255,0,0,0,255,0,0,0,255,0,0,0]
641 ; SSE41-NEXT: pand %xmm4, %xmm3
642 ; SSE41-NEXT: pand %xmm4, %xmm2
643 ; SSE41-NEXT: packusdw %xmm3, %xmm2
644 ; SSE41-NEXT: pand %xmm4, %xmm1
645 ; SSE41-NEXT: pand %xmm4, %xmm0
646 ; SSE41-NEXT: packusdw %xmm1, %xmm0
647 ; SSE41-NEXT: packuswb %xmm2, %xmm0
648 ; SSE41-NEXT: psllw $7, %xmm0
649 ; SSE41-NEXT: pmovmskb %xmm0, %eax
650 ; SSE41-NEXT: cmpw $-1, %ax
651 ; SSE41-NEXT: sete %al
654 ; AVX1-LABEL: trunc_v16i32_v16i1:
656 ; AVX1-NEXT: vmovaps {{.*#+}} ymm2 = [255,255,255,255,255,255,255,255]
657 ; AVX1-NEXT: vandps %ymm2, %ymm1, %ymm1
658 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm3
659 ; AVX1-NEXT: vpackusdw %xmm3, %xmm1, %xmm1
660 ; AVX1-NEXT: vandps %ymm2, %ymm0, %ymm0
661 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2
662 ; AVX1-NEXT: vpackusdw %xmm2, %xmm0, %xmm0
663 ; AVX1-NEXT: vpackuswb %xmm1, %xmm0, %xmm0
664 ; AVX1-NEXT: vpsllw $7, %xmm0, %xmm0
665 ; AVX1-NEXT: vpmovmskb %xmm0, %eax
666 ; AVX1-NEXT: cmpw $-1, %ax
667 ; AVX1-NEXT: sete %al
668 ; AVX1-NEXT: vzeroupper
671 ; AVX2-LABEL: trunc_v16i32_v16i1:
673 ; 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]
674 ; AVX2-NEXT: vpshufb %ymm2, %ymm1, %ymm1
675 ; AVX2-NEXT: vpermq {{.*#+}} ymm1 = ymm1[0,2,2,3]
676 ; AVX2-NEXT: vmovdqa {{.*#+}} xmm3 = [255,255,255,255,255,255,255,255]
677 ; AVX2-NEXT: vpand %xmm3, %xmm1, %xmm1
678 ; AVX2-NEXT: vpshufb %ymm2, %ymm0, %ymm0
679 ; AVX2-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,2,2,3]
680 ; AVX2-NEXT: vpand %xmm3, %xmm0, %xmm0
681 ; AVX2-NEXT: vpackuswb %xmm1, %xmm0, %xmm0
682 ; AVX2-NEXT: vpsllw $7, %xmm0, %xmm0
683 ; AVX2-NEXT: vpmovmskb %xmm0, %eax
684 ; AVX2-NEXT: cmpw $-1, %ax
685 ; AVX2-NEXT: sete %al
686 ; AVX2-NEXT: vzeroupper
689 ; AVX512-LABEL: trunc_v16i32_v16i1:
691 ; AVX512-NEXT: vpslld $31, %zmm0, %zmm0
692 ; AVX512-NEXT: vptestmd %zmm0, %zmm0, %k0
693 ; AVX512-NEXT: kortestw %k0, %k0
694 ; AVX512-NEXT: setb %al
695 ; AVX512-NEXT: vzeroupper
697 %a = trunc <16 x i32> %0 to <16 x i1>
698 %b = call i1 @llvm.experimental.vector.reduce.and.v16i1(<16 x i1> %a)
702 define i1 @trunc_v32i16_v32i1(<32 x i16>) {
703 ; SSE2-LABEL: trunc_v32i16_v32i1:
705 ; SSE2-NEXT: movdqa {{.*#+}} xmm4 = [255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0]
706 ; SSE2-NEXT: pand %xmm4, %xmm3
707 ; SSE2-NEXT: pand %xmm4, %xmm2
708 ; SSE2-NEXT: packuswb %xmm3, %xmm2
709 ; SSE2-NEXT: pand %xmm4, %xmm1
710 ; SSE2-NEXT: pand %xmm4, %xmm0
711 ; SSE2-NEXT: packuswb %xmm1, %xmm0
712 ; SSE2-NEXT: pand %xmm2, %xmm0
713 ; SSE2-NEXT: psllw $7, %xmm0
714 ; SSE2-NEXT: pmovmskb %xmm0, %eax
715 ; SSE2-NEXT: cmpw $-1, %ax
716 ; SSE2-NEXT: sete %al
719 ; SSE41-LABEL: trunc_v32i16_v32i1:
721 ; SSE41-NEXT: movdqa {{.*#+}} xmm4 = <0,2,4,6,8,10,12,14,u,u,u,u,u,u,u,u>
722 ; SSE41-NEXT: pshufb %xmm4, %xmm3
723 ; SSE41-NEXT: pshufb %xmm4, %xmm2
724 ; SSE41-NEXT: punpcklqdq {{.*#+}} xmm2 = xmm2[0],xmm3[0]
725 ; SSE41-NEXT: pshufb %xmm4, %xmm1
726 ; SSE41-NEXT: pshufb %xmm4, %xmm0
727 ; SSE41-NEXT: punpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm1[0]
728 ; SSE41-NEXT: pand %xmm2, %xmm0
729 ; SSE41-NEXT: psllw $7, %xmm0
730 ; SSE41-NEXT: pmovmskb %xmm0, %eax
731 ; SSE41-NEXT: cmpw $-1, %ax
732 ; SSE41-NEXT: sete %al
735 ; AVX1-LABEL: trunc_v32i16_v32i1:
737 ; AVX1-NEXT: vandps %ymm1, %ymm0, %ymm0
738 ; AVX1-NEXT: vandps {{.*}}(%rip), %ymm0, %ymm0
739 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
740 ; AVX1-NEXT: vpackuswb %xmm1, %xmm0, %xmm0
741 ; AVX1-NEXT: vpsllw $7, %xmm0, %xmm0
742 ; AVX1-NEXT: vpmovmskb %xmm0, %eax
743 ; AVX1-NEXT: cmpw $-1, %ax
744 ; AVX1-NEXT: sete %al
745 ; AVX1-NEXT: vzeroupper
748 ; AVX2-LABEL: trunc_v32i16_v32i1:
750 ; AVX2-NEXT: vmovdqa {{.*#+}} ymm2 = [255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255]
751 ; AVX2-NEXT: vpand %ymm2, %ymm0, %ymm0
752 ; AVX2-NEXT: vpand %ymm2, %ymm1, %ymm1
753 ; AVX2-NEXT: vinserti128 $1, %xmm1, %ymm0, %ymm2
754 ; AVX2-NEXT: vextracti128 $1, %ymm0, %xmm0
755 ; AVX2-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1,2,3],ymm1[4,5,6,7]
756 ; AVX2-NEXT: vpackuswb %ymm0, %ymm2, %ymm0
757 ; AVX2-NEXT: vpsllw $7, %ymm0, %ymm0
758 ; AVX2-NEXT: vpmovmskb %ymm0, %eax
759 ; AVX2-NEXT: cmpl $-1, %eax
760 ; AVX2-NEXT: sete %al
761 ; AVX2-NEXT: vzeroupper
764 ; AVX512F-LABEL: trunc_v32i16_v32i1:
766 ; AVX512F-NEXT: vextracti64x4 $1, %zmm0, %ymm1
767 ; AVX512F-NEXT: vpand %ymm1, %ymm0, %ymm0
768 ; AVX512F-NEXT: vpmovsxwd %ymm0, %zmm0
769 ; AVX512F-NEXT: vpslld $31, %zmm0, %zmm0
770 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
771 ; AVX512F-NEXT: kshiftrw $8, %k0, %k1
772 ; AVX512F-NEXT: kandw %k1, %k0, %k0
773 ; AVX512F-NEXT: kshiftrw $4, %k0, %k1
774 ; AVX512F-NEXT: kandw %k1, %k0, %k0
775 ; AVX512F-NEXT: kshiftrw $2, %k0, %k1
776 ; AVX512F-NEXT: kandw %k1, %k0, %k0
777 ; AVX512F-NEXT: kshiftrw $1, %k0, %k1
778 ; AVX512F-NEXT: kandw %k1, %k0, %k0
779 ; AVX512F-NEXT: kmovw %k0, %eax
780 ; AVX512F-NEXT: # kill: def $al killed $al killed $eax
781 ; AVX512F-NEXT: vzeroupper
784 ; AVX512BW-LABEL: trunc_v32i16_v32i1:
786 ; AVX512BW-NEXT: vpsllw $15, %zmm0, %zmm0
787 ; AVX512BW-NEXT: vpmovw2m %zmm0, %k0
788 ; AVX512BW-NEXT: kortestd %k0, %k0
789 ; AVX512BW-NEXT: setb %al
790 ; AVX512BW-NEXT: vzeroupper
791 ; AVX512BW-NEXT: retq
793 ; AVX512VL-LABEL: trunc_v32i16_v32i1:
795 ; AVX512VL-NEXT: vpsllw $15, %zmm0, %zmm0
796 ; AVX512VL-NEXT: vpmovw2m %zmm0, %k0
797 ; AVX512VL-NEXT: kortestd %k0, %k0
798 ; AVX512VL-NEXT: setb %al
799 ; AVX512VL-NEXT: vzeroupper
800 ; AVX512VL-NEXT: retq
801 %a = trunc <32 x i16> %0 to <32 x i1>
802 %b = call i1 @llvm.experimental.vector.reduce.and.v32i1(<32 x i1> %a)
806 define i1 @trunc_v64i8_v64i1(<64 x i8>) {
807 ; SSE-LABEL: trunc_v64i8_v64i1:
809 ; SSE-NEXT: pand %xmm3, %xmm1
810 ; SSE-NEXT: pand %xmm2, %xmm1
811 ; SSE-NEXT: pand %xmm0, %xmm1
812 ; SSE-NEXT: psllw $7, %xmm1
813 ; SSE-NEXT: pmovmskb %xmm1, %eax
814 ; SSE-NEXT: cmpw $-1, %ax
818 ; AVX1-LABEL: trunc_v64i8_v64i1:
820 ; AVX1-NEXT: vandps %ymm1, %ymm0, %ymm0
821 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
822 ; AVX1-NEXT: vandps %xmm1, %xmm0, %xmm0
823 ; AVX1-NEXT: vpsllw $7, %xmm0, %xmm0
824 ; AVX1-NEXT: vpmovmskb %xmm0, %eax
825 ; AVX1-NEXT: cmpw $-1, %ax
826 ; AVX1-NEXT: sete %al
827 ; AVX1-NEXT: vzeroupper
830 ; AVX2-LABEL: trunc_v64i8_v64i1:
832 ; AVX2-NEXT: vpand %ymm1, %ymm0, %ymm0
833 ; AVX2-NEXT: vpsllw $7, %ymm0, %ymm0
834 ; AVX2-NEXT: vpmovmskb %ymm0, %eax
835 ; AVX2-NEXT: cmpl $-1, %eax
836 ; AVX2-NEXT: sete %al
837 ; AVX2-NEXT: vzeroupper
840 ; AVX512F-LABEL: trunc_v64i8_v64i1:
842 ; AVX512F-NEXT: vextracti64x4 $1, %zmm0, %ymm1
843 ; AVX512F-NEXT: vextracti128 $1, %ymm1, %xmm2
844 ; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm3
845 ; AVX512F-NEXT: vpand %xmm2, %xmm3, %xmm2
846 ; AVX512F-NEXT: vpand %xmm2, %xmm1, %xmm1
847 ; AVX512F-NEXT: vpand %xmm1, %xmm0, %xmm0
848 ; AVX512F-NEXT: vpmovsxbd %xmm0, %zmm0
849 ; AVX512F-NEXT: vpslld $31, %zmm0, %zmm0
850 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
851 ; AVX512F-NEXT: kshiftrw $8, %k0, %k1
852 ; AVX512F-NEXT: kandw %k1, %k0, %k0
853 ; AVX512F-NEXT: kshiftrw $4, %k0, %k1
854 ; AVX512F-NEXT: kandw %k1, %k0, %k0
855 ; AVX512F-NEXT: kshiftrw $2, %k0, %k1
856 ; AVX512F-NEXT: kandw %k1, %k0, %k0
857 ; AVX512F-NEXT: kshiftrw $1, %k0, %k1
858 ; AVX512F-NEXT: kandw %k1, %k0, %k0
859 ; AVX512F-NEXT: kmovw %k0, %eax
860 ; AVX512F-NEXT: # kill: def $al killed $al killed $eax
861 ; AVX512F-NEXT: vzeroupper
864 ; AVX512BW-LABEL: trunc_v64i8_v64i1:
866 ; AVX512BW-NEXT: vpsllw $7, %zmm0, %zmm0
867 ; AVX512BW-NEXT: vpmovb2m %zmm0, %k0
868 ; AVX512BW-NEXT: kortestq %k0, %k0
869 ; AVX512BW-NEXT: setb %al
870 ; AVX512BW-NEXT: vzeroupper
871 ; AVX512BW-NEXT: retq
873 ; AVX512VL-LABEL: trunc_v64i8_v64i1:
875 ; AVX512VL-NEXT: vpsllw $7, %zmm0, %zmm0
876 ; AVX512VL-NEXT: vpmovb2m %zmm0, %k0
877 ; AVX512VL-NEXT: kortestq %k0, %k0
878 ; AVX512VL-NEXT: setb %al
879 ; AVX512VL-NEXT: vzeroupper
880 ; AVX512VL-NEXT: retq
881 %a = trunc <64 x i8> %0 to <64 x i1>
882 %b = call i1 @llvm.experimental.vector.reduce.and.v64i1(<64 x i1> %a)
890 define i1 @icmp_v2i64_v2i1(<2 x i64>) {
891 ; SSE2-LABEL: icmp_v2i64_v2i1:
893 ; SSE2-NEXT: pxor %xmm1, %xmm1
894 ; SSE2-NEXT: pcmpeqd %xmm0, %xmm1
895 ; SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm1[1,0,3,2]
896 ; SSE2-NEXT: pand %xmm1, %xmm0
897 ; SSE2-NEXT: movmskpd %xmm0, %eax
898 ; SSE2-NEXT: cmpb $3, %al
899 ; SSE2-NEXT: sete %al
902 ; SSE41-LABEL: icmp_v2i64_v2i1:
904 ; SSE41-NEXT: pxor %xmm1, %xmm1
905 ; SSE41-NEXT: pcmpeqq %xmm0, %xmm1
906 ; SSE41-NEXT: movmskpd %xmm1, %eax
907 ; SSE41-NEXT: cmpb $3, %al
908 ; SSE41-NEXT: sete %al
911 ; AVX-LABEL: icmp_v2i64_v2i1:
913 ; AVX-NEXT: vpxor %xmm1, %xmm1, %xmm1
914 ; AVX-NEXT: vpcmpeqq %xmm1, %xmm0, %xmm0
915 ; AVX-NEXT: vmovmskpd %xmm0, %eax
916 ; AVX-NEXT: cmpb $3, %al
920 ; AVX512F-LABEL: icmp_v2i64_v2i1:
922 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
923 ; AVX512F-NEXT: vptestnmq %zmm0, %zmm0, %k0
924 ; AVX512F-NEXT: kmovw %k0, %eax
925 ; AVX512F-NEXT: andb $3, %al
926 ; AVX512F-NEXT: cmpb $3, %al
927 ; AVX512F-NEXT: sete %al
928 ; AVX512F-NEXT: vzeroupper
931 ; AVX512BW-LABEL: icmp_v2i64_v2i1:
933 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
934 ; AVX512BW-NEXT: vptestnmq %zmm0, %zmm0, %k0
935 ; AVX512BW-NEXT: kmovd %k0, %eax
936 ; AVX512BW-NEXT: andb $3, %al
937 ; AVX512BW-NEXT: cmpb $3, %al
938 ; AVX512BW-NEXT: sete %al
939 ; AVX512BW-NEXT: vzeroupper
940 ; AVX512BW-NEXT: retq
942 ; AVX512VL-LABEL: icmp_v2i64_v2i1:
944 ; AVX512VL-NEXT: vptestnmq %xmm0, %xmm0, %k0
945 ; AVX512VL-NEXT: kmovd %k0, %eax
946 ; AVX512VL-NEXT: andb $3, %al
947 ; AVX512VL-NEXT: cmpb $3, %al
948 ; AVX512VL-NEXT: sete %al
949 ; AVX512VL-NEXT: retq
950 %a = icmp eq <2 x i64> %0, zeroinitializer
951 %b = call i1 @llvm.experimental.vector.reduce.and.v2i1(<2 x i1> %a)
955 define i1 @icmp_v4i32_v4i1(<4 x i32>) {
956 ; SSE-LABEL: icmp_v4i32_v4i1:
958 ; SSE-NEXT: pxor %xmm1, %xmm1
959 ; SSE-NEXT: pcmpeqd %xmm0, %xmm1
960 ; SSE-NEXT: movmskps %xmm1, %eax
961 ; SSE-NEXT: cmpb $15, %al
965 ; AVX-LABEL: icmp_v4i32_v4i1:
967 ; AVX-NEXT: vpxor %xmm1, %xmm1, %xmm1
968 ; AVX-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
969 ; AVX-NEXT: vmovmskps %xmm0, %eax
970 ; AVX-NEXT: cmpb $15, %al
974 ; AVX512F-LABEL: icmp_v4i32_v4i1:
976 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
977 ; AVX512F-NEXT: vptestnmd %zmm0, %zmm0, %k0
978 ; AVX512F-NEXT: kmovw %k0, %eax
979 ; AVX512F-NEXT: andb $15, %al
980 ; AVX512F-NEXT: cmpb $15, %al
981 ; AVX512F-NEXT: sete %al
982 ; AVX512F-NEXT: vzeroupper
985 ; AVX512BW-LABEL: icmp_v4i32_v4i1:
987 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
988 ; AVX512BW-NEXT: vptestnmd %zmm0, %zmm0, %k0
989 ; AVX512BW-NEXT: kmovd %k0, %eax
990 ; AVX512BW-NEXT: andb $15, %al
991 ; AVX512BW-NEXT: cmpb $15, %al
992 ; AVX512BW-NEXT: sete %al
993 ; AVX512BW-NEXT: vzeroupper
994 ; AVX512BW-NEXT: retq
996 ; AVX512VL-LABEL: icmp_v4i32_v4i1:
998 ; AVX512VL-NEXT: vptestnmd %xmm0, %xmm0, %k0
999 ; AVX512VL-NEXT: kmovd %k0, %eax
1000 ; AVX512VL-NEXT: andb $15, %al
1001 ; AVX512VL-NEXT: cmpb $15, %al
1002 ; AVX512VL-NEXT: sete %al
1003 ; AVX512VL-NEXT: retq
1004 %a = icmp eq <4 x i32> %0, zeroinitializer
1005 %b = call i1 @llvm.experimental.vector.reduce.and.v4i1(<4 x i1> %a)
1009 define i1 @icmp_v8i16_v8i1(<8 x i8>) {
1010 ; SSE2-LABEL: icmp_v8i16_v8i1:
1012 ; SSE2-NEXT: pxor %xmm1, %xmm1
1013 ; SSE2-NEXT: pcmpeqb %xmm0, %xmm1
1014 ; 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]
1015 ; SSE2-NEXT: packsswb %xmm0, %xmm0
1016 ; SSE2-NEXT: pmovmskb %xmm0, %eax
1017 ; SSE2-NEXT: cmpb $-1, %al
1018 ; SSE2-NEXT: sete %al
1021 ; SSE41-LABEL: icmp_v8i16_v8i1:
1023 ; SSE41-NEXT: pxor %xmm1, %xmm1
1024 ; SSE41-NEXT: pcmpeqb %xmm0, %xmm1
1025 ; SSE41-NEXT: pmovsxbw %xmm1, %xmm0
1026 ; SSE41-NEXT: packsswb %xmm0, %xmm0
1027 ; SSE41-NEXT: pmovmskb %xmm0, %eax
1028 ; SSE41-NEXT: cmpb $-1, %al
1029 ; SSE41-NEXT: sete %al
1032 ; AVX-LABEL: icmp_v8i16_v8i1:
1034 ; AVX-NEXT: vpxor %xmm1, %xmm1, %xmm1
1035 ; AVX-NEXT: vpcmpeqb %xmm1, %xmm0, %xmm0
1036 ; AVX-NEXT: vpmovsxbw %xmm0, %xmm0
1037 ; AVX-NEXT: vpacksswb %xmm0, %xmm0, %xmm0
1038 ; AVX-NEXT: vpmovmskb %xmm0, %eax
1039 ; AVX-NEXT: cmpb $-1, %al
1040 ; AVX-NEXT: sete %al
1043 ; AVX512F-LABEL: icmp_v8i16_v8i1:
1045 ; AVX512F-NEXT: vpxor %xmm1, %xmm1, %xmm1
1046 ; AVX512F-NEXT: vpcmpeqb %xmm1, %xmm0, %xmm0
1047 ; AVX512F-NEXT: vpmovsxbd %xmm0, %zmm0
1048 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
1049 ; AVX512F-NEXT: kmovw %k0, %eax
1050 ; AVX512F-NEXT: cmpb $-1, %al
1051 ; AVX512F-NEXT: sete %al
1052 ; AVX512F-NEXT: vzeroupper
1053 ; AVX512F-NEXT: retq
1055 ; AVX512BW-LABEL: icmp_v8i16_v8i1:
1056 ; AVX512BW: # %bb.0:
1057 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1058 ; AVX512BW-NEXT: vptestnmb %zmm0, %zmm0, %k0
1059 ; AVX512BW-NEXT: kmovd %k0, %eax
1060 ; AVX512BW-NEXT: cmpb $-1, %al
1061 ; AVX512BW-NEXT: sete %al
1062 ; AVX512BW-NEXT: vzeroupper
1063 ; AVX512BW-NEXT: retq
1065 ; AVX512VL-LABEL: icmp_v8i16_v8i1:
1066 ; AVX512VL: # %bb.0:
1067 ; AVX512VL-NEXT: vptestnmb %xmm0, %xmm0, %k0
1068 ; AVX512VL-NEXT: kmovd %k0, %eax
1069 ; AVX512VL-NEXT: cmpb $-1, %al
1070 ; AVX512VL-NEXT: sete %al
1071 ; AVX512VL-NEXT: retq
1072 %a = icmp eq <8 x i8> %0, zeroinitializer
1073 %b = call i1 @llvm.experimental.vector.reduce.and.v8i1(<8 x i1> %a)
1077 define i1 @icmp_v16i8_v16i1(<16 x i8>) {
1078 ; SSE-LABEL: icmp_v16i8_v16i1:
1080 ; SSE-NEXT: pxor %xmm1, %xmm1
1081 ; SSE-NEXT: pcmpeqb %xmm0, %xmm1
1082 ; SSE-NEXT: pmovmskb %xmm1, %eax
1083 ; SSE-NEXT: cmpw $-1, %ax
1084 ; SSE-NEXT: sete %al
1087 ; AVX-LABEL: icmp_v16i8_v16i1:
1089 ; AVX-NEXT: vpxor %xmm1, %xmm1, %xmm1
1090 ; AVX-NEXT: vpcmpeqb %xmm1, %xmm0, %xmm0
1091 ; AVX-NEXT: vpmovmskb %xmm0, %eax
1092 ; AVX-NEXT: cmpw $-1, %ax
1093 ; AVX-NEXT: sete %al
1096 ; AVX512F-LABEL: icmp_v16i8_v16i1:
1098 ; AVX512F-NEXT: vpxor %xmm1, %xmm1, %xmm1
1099 ; AVX512F-NEXT: vpcmpeqb %xmm1, %xmm0, %xmm0
1100 ; AVX512F-NEXT: vpmovmskb %xmm0, %eax
1101 ; AVX512F-NEXT: cmpw $-1, %ax
1102 ; AVX512F-NEXT: sete %al
1103 ; AVX512F-NEXT: retq
1105 ; AVX512BW-LABEL: icmp_v16i8_v16i1:
1106 ; AVX512BW: # %bb.0:
1107 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1108 ; AVX512BW-NEXT: vptestnmb %zmm0, %zmm0, %k0
1109 ; AVX512BW-NEXT: kortestw %k0, %k0
1110 ; AVX512BW-NEXT: setb %al
1111 ; AVX512BW-NEXT: vzeroupper
1112 ; AVX512BW-NEXT: retq
1114 ; AVX512VL-LABEL: icmp_v16i8_v16i1:
1115 ; AVX512VL: # %bb.0:
1116 ; AVX512VL-NEXT: vptestnmb %xmm0, %xmm0, %k0
1117 ; AVX512VL-NEXT: kortestw %k0, %k0
1118 ; AVX512VL-NEXT: setb %al
1119 ; AVX512VL-NEXT: retq
1120 %a = icmp eq <16 x i8> %0, zeroinitializer
1121 %b = call i1 @llvm.experimental.vector.reduce.and.v16i1(<16 x i1> %a)
1125 define i1 @icmp_v4i64_v4i1(<4 x i64>) {
1126 ; SSE2-LABEL: icmp_v4i64_v4i1:
1128 ; SSE2-NEXT: pxor %xmm2, %xmm2
1129 ; SSE2-NEXT: pcmpeqd %xmm2, %xmm1
1130 ; SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm1[1,0,3,2]
1131 ; SSE2-NEXT: pand %xmm1, %xmm3
1132 ; SSE2-NEXT: pcmpeqd %xmm2, %xmm0
1133 ; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,0,3,2]
1134 ; SSE2-NEXT: pand %xmm0, %xmm1
1135 ; SSE2-NEXT: packssdw %xmm3, %xmm1
1136 ; SSE2-NEXT: movmskps %xmm1, %eax
1137 ; SSE2-NEXT: cmpb $15, %al
1138 ; SSE2-NEXT: sete %al
1141 ; SSE41-LABEL: icmp_v4i64_v4i1:
1143 ; SSE41-NEXT: pxor %xmm2, %xmm2
1144 ; SSE41-NEXT: pcmpeqq %xmm2, %xmm1
1145 ; SSE41-NEXT: pcmpeqq %xmm2, %xmm0
1146 ; SSE41-NEXT: packssdw %xmm1, %xmm0
1147 ; SSE41-NEXT: movmskps %xmm0, %eax
1148 ; SSE41-NEXT: cmpb $15, %al
1149 ; SSE41-NEXT: sete %al
1152 ; AVX1-LABEL: icmp_v4i64_v4i1:
1154 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
1155 ; AVX1-NEXT: vpxor %xmm2, %xmm2, %xmm2
1156 ; AVX1-NEXT: vpcmpeqq %xmm2, %xmm1, %xmm1
1157 ; AVX1-NEXT: vpcmpeqq %xmm2, %xmm0, %xmm0
1158 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
1159 ; AVX1-NEXT: vmovmskpd %ymm0, %eax
1160 ; AVX1-NEXT: cmpb $15, %al
1161 ; AVX1-NEXT: sete %al
1162 ; AVX1-NEXT: vzeroupper
1165 ; AVX2-LABEL: icmp_v4i64_v4i1:
1167 ; AVX2-NEXT: vpxor %xmm1, %xmm1, %xmm1
1168 ; AVX2-NEXT: vpcmpeqq %ymm1, %ymm0, %ymm0
1169 ; AVX2-NEXT: vmovmskpd %ymm0, %eax
1170 ; AVX2-NEXT: cmpb $15, %al
1171 ; AVX2-NEXT: sete %al
1172 ; AVX2-NEXT: vzeroupper
1175 ; AVX512F-LABEL: icmp_v4i64_v4i1:
1177 ; AVX512F-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
1178 ; AVX512F-NEXT: vptestnmq %zmm0, %zmm0, %k0
1179 ; AVX512F-NEXT: kmovw %k0, %eax
1180 ; AVX512F-NEXT: andb $15, %al
1181 ; AVX512F-NEXT: cmpb $15, %al
1182 ; AVX512F-NEXT: sete %al
1183 ; AVX512F-NEXT: vzeroupper
1184 ; AVX512F-NEXT: retq
1186 ; AVX512BW-LABEL: icmp_v4i64_v4i1:
1187 ; AVX512BW: # %bb.0:
1188 ; AVX512BW-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
1189 ; AVX512BW-NEXT: vptestnmq %zmm0, %zmm0, %k0
1190 ; AVX512BW-NEXT: kmovd %k0, %eax
1191 ; AVX512BW-NEXT: andb $15, %al
1192 ; AVX512BW-NEXT: cmpb $15, %al
1193 ; AVX512BW-NEXT: sete %al
1194 ; AVX512BW-NEXT: vzeroupper
1195 ; AVX512BW-NEXT: retq
1197 ; AVX512VL-LABEL: icmp_v4i64_v4i1:
1198 ; AVX512VL: # %bb.0:
1199 ; AVX512VL-NEXT: vptestnmq %ymm0, %ymm0, %k0
1200 ; AVX512VL-NEXT: kmovd %k0, %eax
1201 ; AVX512VL-NEXT: andb $15, %al
1202 ; AVX512VL-NEXT: cmpb $15, %al
1203 ; AVX512VL-NEXT: sete %al
1204 ; AVX512VL-NEXT: vzeroupper
1205 ; AVX512VL-NEXT: retq
1206 %a = icmp eq <4 x i64> %0, zeroinitializer
1207 %b = call i1 @llvm.experimental.vector.reduce.and.v4i1(<4 x i1> %a)
1211 define i1 @icmp_v8i32_v8i1(<8 x i32>) {
1212 ; SSE-LABEL: icmp_v8i32_v8i1:
1214 ; SSE-NEXT: pxor %xmm2, %xmm2
1215 ; SSE-NEXT: pcmpeqd %xmm2, %xmm1
1216 ; SSE-NEXT: pcmpeqd %xmm2, %xmm0
1217 ; SSE-NEXT: packssdw %xmm1, %xmm0
1218 ; SSE-NEXT: packsswb %xmm0, %xmm0
1219 ; SSE-NEXT: pmovmskb %xmm0, %eax
1220 ; SSE-NEXT: cmpb $-1, %al
1221 ; SSE-NEXT: sete %al
1224 ; AVX1-LABEL: icmp_v8i32_v8i1:
1226 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
1227 ; AVX1-NEXT: vpxor %xmm2, %xmm2, %xmm2
1228 ; AVX1-NEXT: vpcmpeqd %xmm2, %xmm1, %xmm1
1229 ; AVX1-NEXT: vpcmpeqd %xmm2, %xmm0, %xmm0
1230 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
1231 ; AVX1-NEXT: vmovmskps %ymm0, %eax
1232 ; AVX1-NEXT: cmpb $-1, %al
1233 ; AVX1-NEXT: sete %al
1234 ; AVX1-NEXT: vzeroupper
1237 ; AVX2-LABEL: icmp_v8i32_v8i1:
1239 ; AVX2-NEXT: vpxor %xmm1, %xmm1, %xmm1
1240 ; AVX2-NEXT: vpcmpeqd %ymm1, %ymm0, %ymm0
1241 ; AVX2-NEXT: vmovmskps %ymm0, %eax
1242 ; AVX2-NEXT: cmpb $-1, %al
1243 ; AVX2-NEXT: sete %al
1244 ; AVX2-NEXT: vzeroupper
1247 ; AVX512F-LABEL: icmp_v8i32_v8i1:
1249 ; AVX512F-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
1250 ; AVX512F-NEXT: vptestnmd %zmm0, %zmm0, %k0
1251 ; AVX512F-NEXT: kmovw %k0, %eax
1252 ; AVX512F-NEXT: cmpb $-1, %al
1253 ; AVX512F-NEXT: sete %al
1254 ; AVX512F-NEXT: vzeroupper
1255 ; AVX512F-NEXT: retq
1257 ; AVX512BW-LABEL: icmp_v8i32_v8i1:
1258 ; AVX512BW: # %bb.0:
1259 ; AVX512BW-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
1260 ; AVX512BW-NEXT: vptestnmd %zmm0, %zmm0, %k0
1261 ; AVX512BW-NEXT: kmovd %k0, %eax
1262 ; AVX512BW-NEXT: cmpb $-1, %al
1263 ; AVX512BW-NEXT: sete %al
1264 ; AVX512BW-NEXT: vzeroupper
1265 ; AVX512BW-NEXT: retq
1267 ; AVX512VL-LABEL: icmp_v8i32_v8i1:
1268 ; AVX512VL: # %bb.0:
1269 ; AVX512VL-NEXT: vptestnmd %ymm0, %ymm0, %k0
1270 ; AVX512VL-NEXT: kmovd %k0, %eax
1271 ; AVX512VL-NEXT: cmpb $-1, %al
1272 ; AVX512VL-NEXT: sete %al
1273 ; AVX512VL-NEXT: vzeroupper
1274 ; AVX512VL-NEXT: retq
1275 %a = icmp eq <8 x i32> %0, zeroinitializer
1276 %b = call i1 @llvm.experimental.vector.reduce.and.v8i1(<8 x i1> %a)
1280 define i1 @icmp_v16i16_v16i1(<16 x i16>) {
1281 ; SSE-LABEL: icmp_v16i16_v16i1:
1283 ; SSE-NEXT: pxor %xmm2, %xmm2
1284 ; SSE-NEXT: pcmpeqw %xmm2, %xmm1
1285 ; SSE-NEXT: pcmpeqw %xmm2, %xmm0
1286 ; SSE-NEXT: packsswb %xmm1, %xmm0
1287 ; SSE-NEXT: pmovmskb %xmm0, %eax
1288 ; SSE-NEXT: cmpw $-1, %ax
1289 ; SSE-NEXT: sete %al
1292 ; AVX1-LABEL: icmp_v16i16_v16i1:
1294 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
1295 ; AVX1-NEXT: vpxor %xmm2, %xmm2, %xmm2
1296 ; AVX1-NEXT: vpcmpeqw %xmm2, %xmm1, %xmm1
1297 ; AVX1-NEXT: vpcmpeqw %xmm2, %xmm0, %xmm0
1298 ; AVX1-NEXT: vpacksswb %xmm1, %xmm0, %xmm0
1299 ; AVX1-NEXT: vpmovmskb %xmm0, %eax
1300 ; AVX1-NEXT: cmpw $-1, %ax
1301 ; AVX1-NEXT: sete %al
1302 ; AVX1-NEXT: vzeroupper
1305 ; AVX2-LABEL: icmp_v16i16_v16i1:
1307 ; AVX2-NEXT: vpxor %xmm1, %xmm1, %xmm1
1308 ; AVX2-NEXT: vpcmpeqw %ymm1, %ymm0, %ymm0
1309 ; AVX2-NEXT: vextracti128 $1, %ymm0, %xmm1
1310 ; AVX2-NEXT: vpacksswb %xmm1, %xmm0, %xmm0
1311 ; AVX2-NEXT: vpmovmskb %xmm0, %eax
1312 ; AVX2-NEXT: cmpw $-1, %ax
1313 ; AVX2-NEXT: sete %al
1314 ; AVX2-NEXT: vzeroupper
1317 ; AVX512F-LABEL: icmp_v16i16_v16i1:
1319 ; AVX512F-NEXT: vpxor %xmm1, %xmm1, %xmm1
1320 ; AVX512F-NEXT: vpcmpeqw %ymm1, %ymm0, %ymm0
1321 ; AVX512F-NEXT: vpmovsxwd %ymm0, %zmm0
1322 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
1323 ; AVX512F-NEXT: kortestw %k0, %k0
1324 ; AVX512F-NEXT: setb %al
1325 ; AVX512F-NEXT: vzeroupper
1326 ; AVX512F-NEXT: retq
1328 ; AVX512BW-LABEL: icmp_v16i16_v16i1:
1329 ; AVX512BW: # %bb.0:
1330 ; AVX512BW-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
1331 ; AVX512BW-NEXT: vptestnmw %zmm0, %zmm0, %k0
1332 ; AVX512BW-NEXT: kortestw %k0, %k0
1333 ; AVX512BW-NEXT: setb %al
1334 ; AVX512BW-NEXT: vzeroupper
1335 ; AVX512BW-NEXT: retq
1337 ; AVX512VL-LABEL: icmp_v16i16_v16i1:
1338 ; AVX512VL: # %bb.0:
1339 ; AVX512VL-NEXT: vptestnmw %ymm0, %ymm0, %k0
1340 ; AVX512VL-NEXT: kortestw %k0, %k0
1341 ; AVX512VL-NEXT: setb %al
1342 ; AVX512VL-NEXT: vzeroupper
1343 ; AVX512VL-NEXT: retq
1344 %a = icmp eq <16 x i16> %0, zeroinitializer
1345 %b = call i1 @llvm.experimental.vector.reduce.and.v16i1(<16 x i1> %a)
1349 define i1 @icmp_v32i8_v32i1(<32 x i8>) {
1350 ; SSE-LABEL: icmp_v32i8_v32i1:
1352 ; SSE-NEXT: por %xmm1, %xmm0
1353 ; SSE-NEXT: pxor %xmm1, %xmm1
1354 ; SSE-NEXT: pcmpeqb %xmm0, %xmm1
1355 ; SSE-NEXT: pmovmskb %xmm1, %eax
1356 ; SSE-NEXT: cmpw $-1, %ax
1357 ; SSE-NEXT: sete %al
1360 ; AVX1-LABEL: icmp_v32i8_v32i1:
1362 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
1363 ; AVX1-NEXT: vpxor %xmm2, %xmm2, %xmm2
1364 ; AVX1-NEXT: vpcmpeqb %xmm2, %xmm1, %xmm1
1365 ; AVX1-NEXT: vpcmpeqb %xmm2, %xmm0, %xmm0
1366 ; AVX1-NEXT: vpand %xmm1, %xmm0, %xmm0
1367 ; AVX1-NEXT: vpmovmskb %xmm0, %eax
1368 ; AVX1-NEXT: cmpw $-1, %ax
1369 ; AVX1-NEXT: sete %al
1370 ; AVX1-NEXT: vzeroupper
1373 ; AVX2-LABEL: icmp_v32i8_v32i1:
1375 ; AVX2-NEXT: vpxor %xmm1, %xmm1, %xmm1
1376 ; AVX2-NEXT: vpcmpeqb %ymm1, %ymm0, %ymm0
1377 ; AVX2-NEXT: vpmovmskb %ymm0, %eax
1378 ; AVX2-NEXT: cmpl $-1, %eax
1379 ; AVX2-NEXT: sete %al
1380 ; AVX2-NEXT: vzeroupper
1383 ; AVX512F-LABEL: icmp_v32i8_v32i1:
1385 ; AVX512F-NEXT: vpxor %xmm1, %xmm1, %xmm1
1386 ; AVX512F-NEXT: vpcmpeqb %ymm1, %ymm0, %ymm0
1387 ; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm1
1388 ; AVX512F-NEXT: vpand %xmm1, %xmm0, %xmm0
1389 ; AVX512F-NEXT: vpmovsxbd %xmm0, %zmm0
1390 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
1391 ; AVX512F-NEXT: kshiftrw $8, %k0, %k1
1392 ; AVX512F-NEXT: kandw %k1, %k0, %k0
1393 ; AVX512F-NEXT: kshiftrw $4, %k0, %k1
1394 ; AVX512F-NEXT: kandw %k1, %k0, %k0
1395 ; AVX512F-NEXT: kshiftrw $2, %k0, %k1
1396 ; AVX512F-NEXT: kandw %k1, %k0, %k0
1397 ; AVX512F-NEXT: kshiftrw $1, %k0, %k1
1398 ; AVX512F-NEXT: kandw %k1, %k0, %k0
1399 ; AVX512F-NEXT: kmovw %k0, %eax
1400 ; AVX512F-NEXT: # kill: def $al killed $al killed $eax
1401 ; AVX512F-NEXT: vzeroupper
1402 ; AVX512F-NEXT: retq
1404 ; AVX512BW-LABEL: icmp_v32i8_v32i1:
1405 ; AVX512BW: # %bb.0:
1406 ; AVX512BW-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
1407 ; AVX512BW-NEXT: vptestnmb %zmm0, %zmm0, %k0
1408 ; AVX512BW-NEXT: kortestd %k0, %k0
1409 ; AVX512BW-NEXT: setb %al
1410 ; AVX512BW-NEXT: vzeroupper
1411 ; AVX512BW-NEXT: retq
1413 ; AVX512VL-LABEL: icmp_v32i8_v32i1:
1414 ; AVX512VL: # %bb.0:
1415 ; AVX512VL-NEXT: vptestnmb %ymm0, %ymm0, %k0
1416 ; AVX512VL-NEXT: kortestd %k0, %k0
1417 ; AVX512VL-NEXT: setb %al
1418 ; AVX512VL-NEXT: vzeroupper
1419 ; AVX512VL-NEXT: retq
1420 %a = icmp eq <32 x i8> %0, zeroinitializer
1421 %b = call i1 @llvm.experimental.vector.reduce.and.v32i1(<32 x i1> %a)
1425 define i1 @icmp_v8i64_v8i1(<8 x i64>) {
1426 ; SSE2-LABEL: icmp_v8i64_v8i1:
1428 ; SSE2-NEXT: pxor %xmm4, %xmm4
1429 ; SSE2-NEXT: pcmpeqd %xmm4, %xmm3
1430 ; SSE2-NEXT: pshufd {{.*#+}} xmm5 = xmm3[1,0,3,2]
1431 ; SSE2-NEXT: pand %xmm3, %xmm5
1432 ; SSE2-NEXT: pcmpeqd %xmm4, %xmm2
1433 ; SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm2[1,0,3,2]
1434 ; SSE2-NEXT: pand %xmm2, %xmm3
1435 ; SSE2-NEXT: packssdw %xmm5, %xmm3
1436 ; SSE2-NEXT: pcmpeqd %xmm4, %xmm1
1437 ; SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm1[1,0,3,2]
1438 ; SSE2-NEXT: pand %xmm1, %xmm2
1439 ; SSE2-NEXT: pcmpeqd %xmm4, %xmm0
1440 ; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,0,3,2]
1441 ; SSE2-NEXT: pand %xmm0, %xmm1
1442 ; SSE2-NEXT: packssdw %xmm2, %xmm1
1443 ; SSE2-NEXT: packssdw %xmm3, %xmm1
1444 ; SSE2-NEXT: packsswb %xmm0, %xmm1
1445 ; SSE2-NEXT: pmovmskb %xmm1, %eax
1446 ; SSE2-NEXT: cmpb $-1, %al
1447 ; SSE2-NEXT: sete %al
1450 ; SSE41-LABEL: icmp_v8i64_v8i1:
1452 ; SSE41-NEXT: pxor %xmm4, %xmm4
1453 ; SSE41-NEXT: pcmpeqq %xmm4, %xmm3
1454 ; SSE41-NEXT: pcmpeqq %xmm4, %xmm2
1455 ; SSE41-NEXT: packssdw %xmm3, %xmm2
1456 ; SSE41-NEXT: pcmpeqq %xmm4, %xmm1
1457 ; SSE41-NEXT: pcmpeqq %xmm4, %xmm0
1458 ; SSE41-NEXT: packssdw %xmm1, %xmm0
1459 ; SSE41-NEXT: packssdw %xmm2, %xmm0
1460 ; SSE41-NEXT: packsswb %xmm0, %xmm0
1461 ; SSE41-NEXT: pmovmskb %xmm0, %eax
1462 ; SSE41-NEXT: cmpb $-1, %al
1463 ; SSE41-NEXT: sete %al
1466 ; AVX1-LABEL: icmp_v8i64_v8i1:
1468 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm2
1469 ; AVX1-NEXT: vpxor %xmm3, %xmm3, %xmm3
1470 ; AVX1-NEXT: vpcmpeqq %xmm3, %xmm2, %xmm2
1471 ; AVX1-NEXT: vpcmpeqq %xmm3, %xmm1, %xmm1
1472 ; AVX1-NEXT: vpackssdw %xmm2, %xmm1, %xmm1
1473 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2
1474 ; AVX1-NEXT: vpcmpeqq %xmm3, %xmm2, %xmm2
1475 ; AVX1-NEXT: vpcmpeqq %xmm3, %xmm0, %xmm0
1476 ; AVX1-NEXT: vpackssdw %xmm2, %xmm0, %xmm0
1477 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
1478 ; AVX1-NEXT: vmovmskps %ymm0, %eax
1479 ; AVX1-NEXT: cmpb $-1, %al
1480 ; AVX1-NEXT: sete %al
1481 ; AVX1-NEXT: vzeroupper
1484 ; AVX2-LABEL: icmp_v8i64_v8i1:
1486 ; AVX2-NEXT: vpxor %xmm2, %xmm2, %xmm2
1487 ; AVX2-NEXT: vpcmpeqq %ymm2, %ymm1, %ymm1
1488 ; AVX2-NEXT: vpcmpeqq %ymm2, %ymm0, %ymm0
1489 ; AVX2-NEXT: vpackssdw %ymm1, %ymm0, %ymm0
1490 ; AVX2-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,2,1,3]
1491 ; AVX2-NEXT: vmovmskps %ymm0, %eax
1492 ; AVX2-NEXT: cmpb $-1, %al
1493 ; AVX2-NEXT: sete %al
1494 ; AVX2-NEXT: vzeroupper
1497 ; AVX512F-LABEL: icmp_v8i64_v8i1:
1499 ; AVX512F-NEXT: vptestnmq %zmm0, %zmm0, %k0
1500 ; AVX512F-NEXT: kmovw %k0, %eax
1501 ; AVX512F-NEXT: cmpb $-1, %al
1502 ; AVX512F-NEXT: sete %al
1503 ; AVX512F-NEXT: vzeroupper
1504 ; AVX512F-NEXT: retq
1506 ; AVX512BW-LABEL: icmp_v8i64_v8i1:
1507 ; AVX512BW: # %bb.0:
1508 ; AVX512BW-NEXT: vptestnmq %zmm0, %zmm0, %k0
1509 ; AVX512BW-NEXT: kmovd %k0, %eax
1510 ; AVX512BW-NEXT: cmpb $-1, %al
1511 ; AVX512BW-NEXT: sete %al
1512 ; AVX512BW-NEXT: vzeroupper
1513 ; AVX512BW-NEXT: retq
1515 ; AVX512VL-LABEL: icmp_v8i64_v8i1:
1516 ; AVX512VL: # %bb.0:
1517 ; AVX512VL-NEXT: vptestnmq %zmm0, %zmm0, %k0
1518 ; AVX512VL-NEXT: kmovd %k0, %eax
1519 ; AVX512VL-NEXT: cmpb $-1, %al
1520 ; AVX512VL-NEXT: sete %al
1521 ; AVX512VL-NEXT: vzeroupper
1522 ; AVX512VL-NEXT: retq
1523 %a = icmp eq <8 x i64> %0, zeroinitializer
1524 %b = call i1 @llvm.experimental.vector.reduce.and.v8i1(<8 x i1> %a)
1528 define i1 @icmp_v16i32_v16i1(<16 x i32>) {
1529 ; SSE-LABEL: icmp_v16i32_v16i1:
1531 ; SSE-NEXT: pxor %xmm4, %xmm4
1532 ; SSE-NEXT: pcmpeqd %xmm4, %xmm3
1533 ; SSE-NEXT: pcmpeqd %xmm4, %xmm2
1534 ; SSE-NEXT: packssdw %xmm3, %xmm2
1535 ; SSE-NEXT: pcmpeqd %xmm4, %xmm1
1536 ; SSE-NEXT: pcmpeqd %xmm4, %xmm0
1537 ; SSE-NEXT: packssdw %xmm1, %xmm0
1538 ; SSE-NEXT: packsswb %xmm2, %xmm0
1539 ; SSE-NEXT: pmovmskb %xmm0, %eax
1540 ; SSE-NEXT: cmpw $-1, %ax
1541 ; SSE-NEXT: sete %al
1544 ; AVX1-LABEL: icmp_v16i32_v16i1:
1546 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm2
1547 ; AVX1-NEXT: vpxor %xmm3, %xmm3, %xmm3
1548 ; AVX1-NEXT: vpcmpeqd %xmm3, %xmm2, %xmm2
1549 ; AVX1-NEXT: vpcmpeqd %xmm3, %xmm1, %xmm1
1550 ; AVX1-NEXT: vpackssdw %xmm2, %xmm1, %xmm1
1551 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2
1552 ; AVX1-NEXT: vpcmpeqd %xmm3, %xmm2, %xmm2
1553 ; AVX1-NEXT: vpcmpeqd %xmm3, %xmm0, %xmm0
1554 ; AVX1-NEXT: vpackssdw %xmm2, %xmm0, %xmm0
1555 ; AVX1-NEXT: vpacksswb %xmm1, %xmm0, %xmm0
1556 ; AVX1-NEXT: vpmovmskb %xmm0, %eax
1557 ; AVX1-NEXT: cmpw $-1, %ax
1558 ; AVX1-NEXT: sete %al
1559 ; AVX1-NEXT: vzeroupper
1562 ; AVX2-LABEL: icmp_v16i32_v16i1:
1564 ; AVX2-NEXT: vpxor %xmm2, %xmm2, %xmm2
1565 ; AVX2-NEXT: vpcmpeqd %ymm2, %ymm1, %ymm1
1566 ; AVX2-NEXT: vpcmpeqd %ymm2, %ymm0, %ymm0
1567 ; AVX2-NEXT: vpackssdw %ymm1, %ymm0, %ymm0
1568 ; AVX2-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,2,1,3]
1569 ; AVX2-NEXT: vextracti128 $1, %ymm0, %xmm1
1570 ; AVX2-NEXT: vpacksswb %xmm1, %xmm0, %xmm0
1571 ; AVX2-NEXT: vpmovmskb %xmm0, %eax
1572 ; AVX2-NEXT: cmpw $-1, %ax
1573 ; AVX2-NEXT: sete %al
1574 ; AVX2-NEXT: vzeroupper
1577 ; AVX512-LABEL: icmp_v16i32_v16i1:
1579 ; AVX512-NEXT: vptestnmd %zmm0, %zmm0, %k0
1580 ; AVX512-NEXT: kortestw %k0, %k0
1581 ; AVX512-NEXT: setb %al
1582 ; AVX512-NEXT: vzeroupper
1584 %a = icmp eq <16 x i32> %0, zeroinitializer
1585 %b = call i1 @llvm.experimental.vector.reduce.and.v16i1(<16 x i1> %a)
1589 define i1 @icmp_v32i16_v32i1(<32 x i16>) {
1590 ; SSE-LABEL: icmp_v32i16_v32i1:
1592 ; SSE-NEXT: pxor %xmm4, %xmm4
1593 ; SSE-NEXT: pcmpeqw %xmm4, %xmm1
1594 ; SSE-NEXT: pcmpeqw %xmm4, %xmm0
1595 ; SSE-NEXT: packsswb %xmm1, %xmm0
1596 ; SSE-NEXT: pcmpeqw %xmm4, %xmm3
1597 ; SSE-NEXT: pcmpeqw %xmm4, %xmm2
1598 ; SSE-NEXT: packsswb %xmm3, %xmm2
1599 ; SSE-NEXT: pand %xmm0, %xmm2
1600 ; SSE-NEXT: pmovmskb %xmm2, %eax
1601 ; SSE-NEXT: cmpw $-1, %ax
1602 ; SSE-NEXT: sete %al
1605 ; AVX1-LABEL: icmp_v32i16_v32i1:
1607 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm2
1608 ; AVX1-NEXT: vpxor %xmm3, %xmm3, %xmm3
1609 ; AVX1-NEXT: vpcmpeqw %xmm3, %xmm2, %xmm2
1610 ; AVX1-NEXT: vpcmpeqw %xmm3, %xmm1, %xmm1
1611 ; AVX1-NEXT: vpacksswb %xmm2, %xmm1, %xmm1
1612 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2
1613 ; AVX1-NEXT: vpcmpeqw %xmm3, %xmm2, %xmm2
1614 ; AVX1-NEXT: vpcmpeqw %xmm3, %xmm0, %xmm0
1615 ; AVX1-NEXT: vpacksswb %xmm2, %xmm0, %xmm0
1616 ; AVX1-NEXT: vpand %xmm1, %xmm0, %xmm0
1617 ; AVX1-NEXT: vpsllw $7, %xmm0, %xmm0
1618 ; AVX1-NEXT: vpmovmskb %xmm0, %eax
1619 ; AVX1-NEXT: cmpw $-1, %ax
1620 ; AVX1-NEXT: sete %al
1621 ; AVX1-NEXT: vzeroupper
1624 ; AVX2-LABEL: icmp_v32i16_v32i1:
1626 ; AVX2-NEXT: vpxor %xmm2, %xmm2, %xmm2
1627 ; AVX2-NEXT: vpcmpeqw %ymm2, %ymm1, %ymm1
1628 ; AVX2-NEXT: vpcmpeqw %ymm2, %ymm0, %ymm0
1629 ; AVX2-NEXT: vpacksswb %ymm1, %ymm0, %ymm0
1630 ; AVX2-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,2,1,3]
1631 ; AVX2-NEXT: vpmovmskb %ymm0, %eax
1632 ; AVX2-NEXT: cmpl $-1, %eax
1633 ; AVX2-NEXT: sete %al
1634 ; AVX2-NEXT: vzeroupper
1637 ; AVX512F-LABEL: icmp_v32i16_v32i1:
1639 ; AVX512F-NEXT: vextracti64x4 $1, %zmm0, %ymm1
1640 ; AVX512F-NEXT: vpor %ymm1, %ymm0, %ymm0
1641 ; AVX512F-NEXT: vpxor %xmm1, %xmm1, %xmm1
1642 ; AVX512F-NEXT: vpcmpeqw %ymm1, %ymm0, %ymm0
1643 ; AVX512F-NEXT: vpmovsxwd %ymm0, %zmm0
1644 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
1645 ; AVX512F-NEXT: kshiftrw $8, %k0, %k1
1646 ; AVX512F-NEXT: kandw %k1, %k0, %k0
1647 ; AVX512F-NEXT: kshiftrw $4, %k0, %k1
1648 ; AVX512F-NEXT: kandw %k1, %k0, %k0
1649 ; AVX512F-NEXT: kshiftrw $2, %k0, %k1
1650 ; AVX512F-NEXT: kandw %k1, %k0, %k0
1651 ; AVX512F-NEXT: kshiftrw $1, %k0, %k1
1652 ; AVX512F-NEXT: kandw %k1, %k0, %k0
1653 ; AVX512F-NEXT: kmovw %k0, %eax
1654 ; AVX512F-NEXT: # kill: def $al killed $al killed $eax
1655 ; AVX512F-NEXT: vzeroupper
1656 ; AVX512F-NEXT: retq
1658 ; AVX512BW-LABEL: icmp_v32i16_v32i1:
1659 ; AVX512BW: # %bb.0:
1660 ; AVX512BW-NEXT: vptestnmw %zmm0, %zmm0, %k0
1661 ; AVX512BW-NEXT: kortestd %k0, %k0
1662 ; AVX512BW-NEXT: setb %al
1663 ; AVX512BW-NEXT: vzeroupper
1664 ; AVX512BW-NEXT: retq
1666 ; AVX512VL-LABEL: icmp_v32i16_v32i1:
1667 ; AVX512VL: # %bb.0:
1668 ; AVX512VL-NEXT: vptestnmw %zmm0, %zmm0, %k0
1669 ; AVX512VL-NEXT: kortestd %k0, %k0
1670 ; AVX512VL-NEXT: setb %al
1671 ; AVX512VL-NEXT: vzeroupper
1672 ; AVX512VL-NEXT: retq
1673 %a = icmp eq <32 x i16> %0, zeroinitializer
1674 %b = call i1 @llvm.experimental.vector.reduce.and.v32i1(<32 x i1> %a)
1678 define i1 @icmp_v64i8_v64i1(<64 x i8>) {
1679 ; SSE-LABEL: icmp_v64i8_v64i1:
1681 ; SSE-NEXT: por %xmm3, %xmm1
1682 ; SSE-NEXT: pxor %xmm3, %xmm3
1683 ; SSE-NEXT: por %xmm2, %xmm1
1684 ; SSE-NEXT: por %xmm0, %xmm1
1685 ; SSE-NEXT: pcmpeqb %xmm3, %xmm1
1686 ; SSE-NEXT: pmovmskb %xmm1, %eax
1687 ; SSE-NEXT: cmpw $-1, %ax
1688 ; SSE-NEXT: sete %al
1691 ; AVX1-LABEL: icmp_v64i8_v64i1:
1693 ; AVX1-NEXT: vorps %ymm1, %ymm0, %ymm0
1694 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
1695 ; AVX1-NEXT: vpxor %xmm2, %xmm2, %xmm2
1696 ; AVX1-NEXT: vpcmpeqb %xmm2, %xmm1, %xmm1
1697 ; AVX1-NEXT: vpcmpeqb %xmm2, %xmm0, %xmm0
1698 ; AVX1-NEXT: vpand %xmm1, %xmm0, %xmm0
1699 ; AVX1-NEXT: vpsllw $7, %xmm0, %xmm0
1700 ; AVX1-NEXT: vpmovmskb %xmm0, %eax
1701 ; AVX1-NEXT: cmpw $-1, %ax
1702 ; AVX1-NEXT: sete %al
1703 ; AVX1-NEXT: vzeroupper
1706 ; AVX2-LABEL: icmp_v64i8_v64i1:
1708 ; AVX2-NEXT: vpor %ymm1, %ymm0, %ymm0
1709 ; AVX2-NEXT: vpxor %xmm1, %xmm1, %xmm1
1710 ; AVX2-NEXT: vpcmpeqb %ymm1, %ymm0, %ymm0
1711 ; AVX2-NEXT: vpmovmskb %ymm0, %eax
1712 ; AVX2-NEXT: cmpl $-1, %eax
1713 ; AVX2-NEXT: sete %al
1714 ; AVX2-NEXT: vzeroupper
1717 ; AVX512F-LABEL: icmp_v64i8_v64i1:
1719 ; AVX512F-NEXT: vextracti64x4 $1, %zmm0, %ymm1
1720 ; AVX512F-NEXT: vpxor %xmm2, %xmm2, %xmm2
1721 ; AVX512F-NEXT: vpcmpeqb %ymm2, %ymm1, %ymm1
1722 ; AVX512F-NEXT: vpcmpeqb %ymm2, %ymm0, %ymm0
1723 ; AVX512F-NEXT: vextracti128 $1, %ymm1, %xmm2
1724 ; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm3
1725 ; AVX512F-NEXT: vpand %xmm2, %xmm3, %xmm2
1726 ; AVX512F-NEXT: vpand %xmm2, %xmm1, %xmm1
1727 ; AVX512F-NEXT: vpand %xmm1, %xmm0, %xmm0
1728 ; AVX512F-NEXT: vpmovsxbd %xmm0, %zmm0
1729 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
1730 ; AVX512F-NEXT: kshiftrw $8, %k0, %k1
1731 ; AVX512F-NEXT: kandw %k1, %k0, %k0
1732 ; AVX512F-NEXT: kshiftrw $4, %k0, %k1
1733 ; AVX512F-NEXT: kandw %k1, %k0, %k0
1734 ; AVX512F-NEXT: kshiftrw $2, %k0, %k1
1735 ; AVX512F-NEXT: kandw %k1, %k0, %k0
1736 ; AVX512F-NEXT: kshiftrw $1, %k0, %k1
1737 ; AVX512F-NEXT: kandw %k1, %k0, %k0
1738 ; AVX512F-NEXT: kmovw %k0, %eax
1739 ; AVX512F-NEXT: # kill: def $al killed $al killed $eax
1740 ; AVX512F-NEXT: vzeroupper
1741 ; AVX512F-NEXT: retq
1743 ; AVX512BW-LABEL: icmp_v64i8_v64i1:
1744 ; AVX512BW: # %bb.0:
1745 ; AVX512BW-NEXT: vptestnmb %zmm0, %zmm0, %k0
1746 ; AVX512BW-NEXT: kortestq %k0, %k0
1747 ; AVX512BW-NEXT: setb %al
1748 ; AVX512BW-NEXT: vzeroupper
1749 ; AVX512BW-NEXT: retq
1751 ; AVX512VL-LABEL: icmp_v64i8_v64i1:
1752 ; AVX512VL: # %bb.0:
1753 ; AVX512VL-NEXT: vptestnmb %zmm0, %zmm0, %k0
1754 ; AVX512VL-NEXT: kortestq %k0, %k0
1755 ; AVX512VL-NEXT: setb %al
1756 ; AVX512VL-NEXT: vzeroupper
1757 ; AVX512VL-NEXT: retq
1758 %a = icmp eq <64 x i8> %0, zeroinitializer
1759 %b = call i1 @llvm.experimental.vector.reduce.and.v64i1(<64 x i1> %a)
1763 declare i1 @llvm.experimental.vector.reduce.and.v2i1(<2 x i1>)
1764 declare i1 @llvm.experimental.vector.reduce.and.v4i1(<4 x i1>)
1765 declare i1 @llvm.experimental.vector.reduce.and.v8i1(<8 x i1>)
1766 declare i1 @llvm.experimental.vector.reduce.and.v16i1(<16 x i1>)
1767 declare i1 @llvm.experimental.vector.reduce.and.v32i1(<32 x i1>)
1768 declare i1 @llvm.experimental.vector.reduce.and.v64i1(<64 x i1>)