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 ; SSE-LABEL: trunc_v64i8_v64i1:
909 ; SSE-NEXT: pxor %xmm3, %xmm1
910 ; SSE-NEXT: pxor %xmm2, %xmm1
911 ; SSE-NEXT: pxor %xmm0, %xmm1
912 ; SSE-NEXT: psllw $7, %xmm1
913 ; SSE-NEXT: pmovmskb %xmm1, %eax
914 ; SSE-NEXT: movl %eax, %ecx
915 ; SSE-NEXT: shrl $8, %ecx
916 ; SSE-NEXT: xorb %al, %cl
917 ; SSE-NEXT: setnp %al
920 ; AVX1-LABEL: trunc_v64i8_v64i1:
922 ; AVX1-NEXT: vxorps %ymm1, %ymm0, %ymm0
923 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
924 ; AVX1-NEXT: vxorps %xmm1, %xmm0, %xmm0
925 ; AVX1-NEXT: vpsllw $7, %xmm0, %xmm0
926 ; AVX1-NEXT: vpmovmskb %xmm0, %eax
927 ; AVX1-NEXT: movl %eax, %ecx
928 ; AVX1-NEXT: shrl $8, %ecx
929 ; AVX1-NEXT: xorb %al, %cl
930 ; AVX1-NEXT: setnp %al
931 ; AVX1-NEXT: vzeroupper
934 ; AVX2-LABEL: trunc_v64i8_v64i1:
936 ; AVX2-NEXT: vpxor %ymm1, %ymm0, %ymm0
937 ; AVX2-NEXT: vpsllw $7, %ymm0, %ymm0
938 ; AVX2-NEXT: vpmovmskb %ymm0, %eax
939 ; AVX2-NEXT: movl %eax, %ecx
940 ; AVX2-NEXT: shrl $16, %ecx
941 ; AVX2-NEXT: xorl %eax, %ecx
942 ; AVX2-NEXT: movl %ecx, %eax
943 ; AVX2-NEXT: shrl $8, %eax
944 ; AVX2-NEXT: xorb %cl, %al
945 ; AVX2-NEXT: setnp %al
946 ; AVX2-NEXT: vzeroupper
949 ; AVX512F-LABEL: trunc_v64i8_v64i1:
951 ; AVX512F-NEXT: vextracti64x4 $1, %zmm0, %ymm1
952 ; AVX512F-NEXT: vextracti128 $1, %ymm1, %xmm2
953 ; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm3
954 ; AVX512F-NEXT: vpxor %xmm2, %xmm3, %xmm2
955 ; AVX512F-NEXT: vpxor %xmm2, %xmm1, %xmm1
956 ; AVX512F-NEXT: vpxor %xmm1, %xmm0, %xmm0
957 ; AVX512F-NEXT: vpmovsxbd %xmm0, %zmm0
958 ; AVX512F-NEXT: vpslld $31, %zmm0, %zmm0
959 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
960 ; AVX512F-NEXT: kshiftrw $8, %k0, %k1
961 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
962 ; AVX512F-NEXT: kshiftrw $4, %k0, %k1
963 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
964 ; AVX512F-NEXT: kshiftrw $2, %k0, %k1
965 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
966 ; AVX512F-NEXT: kshiftrw $1, %k0, %k1
967 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
968 ; AVX512F-NEXT: kmovw %k0, %eax
969 ; AVX512F-NEXT: # kill: def $al killed $al killed $eax
970 ; AVX512F-NEXT: vzeroupper
973 ; AVX512BW-LABEL: trunc_v64i8_v64i1:
975 ; AVX512BW-NEXT: vpsllw $7, %zmm0, %zmm0
976 ; AVX512BW-NEXT: vpmovb2m %zmm0, %k0
977 ; AVX512BW-NEXT: kmovq %k0, %rax
978 ; AVX512BW-NEXT: movq %rax, %rcx
979 ; AVX512BW-NEXT: shrq $32, %rcx
980 ; AVX512BW-NEXT: xorl %eax, %ecx
981 ; AVX512BW-NEXT: movl %ecx, %eax
982 ; AVX512BW-NEXT: shrl $16, %eax
983 ; AVX512BW-NEXT: xorl %ecx, %eax
984 ; AVX512BW-NEXT: movl %eax, %ecx
985 ; AVX512BW-NEXT: shrl $8, %ecx
986 ; AVX512BW-NEXT: xorb %al, %cl
987 ; AVX512BW-NEXT: setnp %al
988 ; AVX512BW-NEXT: vzeroupper
989 ; AVX512BW-NEXT: retq
991 ; AVX512VL-LABEL: trunc_v64i8_v64i1:
993 ; AVX512VL-NEXT: vpsllw $7, %zmm0, %zmm0
994 ; AVX512VL-NEXT: vpmovb2m %zmm0, %k0
995 ; AVX512VL-NEXT: kmovq %k0, %rax
996 ; AVX512VL-NEXT: movq %rax, %rcx
997 ; AVX512VL-NEXT: shrq $32, %rcx
998 ; AVX512VL-NEXT: xorl %eax, %ecx
999 ; AVX512VL-NEXT: movl %ecx, %eax
1000 ; AVX512VL-NEXT: shrl $16, %eax
1001 ; AVX512VL-NEXT: xorl %ecx, %eax
1002 ; AVX512VL-NEXT: movl %eax, %ecx
1003 ; AVX512VL-NEXT: shrl $8, %ecx
1004 ; AVX512VL-NEXT: xorb %al, %cl
1005 ; AVX512VL-NEXT: setnp %al
1006 ; AVX512VL-NEXT: vzeroupper
1007 ; AVX512VL-NEXT: retq
1008 %a = trunc <64 x i8> %0 to <64 x i1>
1009 %b = call i1 @llvm.experimental.vector.reduce.xor.v64i1(<64 x i1> %a)
1017 define i1 @icmp_v2i64_v2i1(<2 x i64>) {
1018 ; SSE2-LABEL: icmp_v2i64_v2i1:
1020 ; SSE2-NEXT: pxor %xmm1, %xmm1
1021 ; SSE2-NEXT: pcmpeqd %xmm0, %xmm1
1022 ; SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm1[1,0,3,2]
1023 ; SSE2-NEXT: pand %xmm1, %xmm0
1024 ; SSE2-NEXT: movmskpd %xmm0, %eax
1025 ; SSE2-NEXT: xorb $0, %al
1026 ; SSE2-NEXT: setnp %al
1029 ; SSE41-LABEL: icmp_v2i64_v2i1:
1031 ; SSE41-NEXT: pxor %xmm1, %xmm1
1032 ; SSE41-NEXT: pcmpeqq %xmm0, %xmm1
1033 ; SSE41-NEXT: movmskpd %xmm1, %eax
1034 ; SSE41-NEXT: xorb $0, %al
1035 ; SSE41-NEXT: setnp %al
1038 ; AVX-LABEL: icmp_v2i64_v2i1:
1040 ; AVX-NEXT: vpxor %xmm1, %xmm1, %xmm1
1041 ; AVX-NEXT: vpcmpeqq %xmm1, %xmm0, %xmm0
1042 ; AVX-NEXT: vmovmskpd %xmm0, %eax
1043 ; AVX-NEXT: xorb $0, %al
1044 ; AVX-NEXT: setnp %al
1047 ; AVX512F-LABEL: icmp_v2i64_v2i1:
1049 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1050 ; AVX512F-NEXT: vptestnmq %zmm0, %zmm0, %k0
1051 ; AVX512F-NEXT: kmovw %k0, %eax
1052 ; AVX512F-NEXT: andl $3, %eax
1053 ; AVX512F-NEXT: xorb $0, %al
1054 ; AVX512F-NEXT: setnp %al
1055 ; AVX512F-NEXT: vzeroupper
1056 ; AVX512F-NEXT: retq
1058 ; AVX512BW-LABEL: icmp_v2i64_v2i1:
1059 ; AVX512BW: # %bb.0:
1060 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1061 ; AVX512BW-NEXT: vptestnmq %zmm0, %zmm0, %k0
1062 ; AVX512BW-NEXT: kmovd %k0, %eax
1063 ; AVX512BW-NEXT: andl $3, %eax
1064 ; AVX512BW-NEXT: xorb $0, %al
1065 ; AVX512BW-NEXT: setnp %al
1066 ; AVX512BW-NEXT: vzeroupper
1067 ; AVX512BW-NEXT: retq
1069 ; AVX512VL-LABEL: icmp_v2i64_v2i1:
1070 ; AVX512VL: # %bb.0:
1071 ; AVX512VL-NEXT: vptestnmq %xmm0, %xmm0, %k0
1072 ; AVX512VL-NEXT: kmovd %k0, %eax
1073 ; AVX512VL-NEXT: andl $3, %eax
1074 ; AVX512VL-NEXT: xorb $0, %al
1075 ; AVX512VL-NEXT: setnp %al
1076 ; AVX512VL-NEXT: retq
1077 %a = icmp eq <2 x i64> %0, zeroinitializer
1078 %b = call i1 @llvm.experimental.vector.reduce.xor.v2i1(<2 x i1> %a)
1082 define i1 @icmp_v4i32_v4i1(<4 x i32>) {
1083 ; SSE-LABEL: icmp_v4i32_v4i1:
1085 ; SSE-NEXT: pxor %xmm1, %xmm1
1086 ; SSE-NEXT: pcmpeqd %xmm0, %xmm1
1087 ; SSE-NEXT: movmskps %xmm1, %eax
1088 ; SSE-NEXT: xorb $0, %al
1089 ; SSE-NEXT: setnp %al
1092 ; AVX-LABEL: icmp_v4i32_v4i1:
1094 ; AVX-NEXT: vpxor %xmm1, %xmm1, %xmm1
1095 ; AVX-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
1096 ; AVX-NEXT: vmovmskps %xmm0, %eax
1097 ; AVX-NEXT: xorb $0, %al
1098 ; AVX-NEXT: setnp %al
1101 ; AVX512F-LABEL: icmp_v4i32_v4i1:
1103 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1104 ; AVX512F-NEXT: vptestnmd %zmm0, %zmm0, %k0
1105 ; AVX512F-NEXT: kmovw %k0, %eax
1106 ; AVX512F-NEXT: andl $15, %eax
1107 ; AVX512F-NEXT: xorb $0, %al
1108 ; AVX512F-NEXT: setnp %al
1109 ; AVX512F-NEXT: vzeroupper
1110 ; AVX512F-NEXT: retq
1112 ; AVX512BW-LABEL: icmp_v4i32_v4i1:
1113 ; AVX512BW: # %bb.0:
1114 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1115 ; AVX512BW-NEXT: vptestnmd %zmm0, %zmm0, %k0
1116 ; AVX512BW-NEXT: kmovd %k0, %eax
1117 ; AVX512BW-NEXT: andl $15, %eax
1118 ; AVX512BW-NEXT: xorb $0, %al
1119 ; AVX512BW-NEXT: setnp %al
1120 ; AVX512BW-NEXT: vzeroupper
1121 ; AVX512BW-NEXT: retq
1123 ; AVX512VL-LABEL: icmp_v4i32_v4i1:
1124 ; AVX512VL: # %bb.0:
1125 ; AVX512VL-NEXT: vptestnmd %xmm0, %xmm0, %k0
1126 ; AVX512VL-NEXT: kmovd %k0, %eax
1127 ; AVX512VL-NEXT: andl $15, %eax
1128 ; AVX512VL-NEXT: xorb $0, %al
1129 ; AVX512VL-NEXT: setnp %al
1130 ; AVX512VL-NEXT: retq
1131 %a = icmp eq <4 x i32> %0, zeroinitializer
1132 %b = call i1 @llvm.experimental.vector.reduce.xor.v4i1(<4 x i1> %a)
1136 define i1 @icmp_v8i16_v8i1(<8 x i8>) {
1137 ; SSE2-LABEL: icmp_v8i16_v8i1:
1139 ; SSE2-NEXT: pxor %xmm1, %xmm1
1140 ; SSE2-NEXT: pcmpeqb %xmm0, %xmm1
1141 ; 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]
1142 ; SSE2-NEXT: packsswb %xmm0, %xmm0
1143 ; SSE2-NEXT: pmovmskb %xmm0, %eax
1144 ; SSE2-NEXT: xorb $0, %al
1145 ; SSE2-NEXT: setnp %al
1148 ; SSE41-LABEL: icmp_v8i16_v8i1:
1150 ; SSE41-NEXT: pxor %xmm1, %xmm1
1151 ; SSE41-NEXT: pcmpeqb %xmm0, %xmm1
1152 ; SSE41-NEXT: pmovsxbw %xmm1, %xmm0
1153 ; SSE41-NEXT: packsswb %xmm0, %xmm0
1154 ; SSE41-NEXT: pmovmskb %xmm0, %eax
1155 ; SSE41-NEXT: xorb $0, %al
1156 ; SSE41-NEXT: setnp %al
1159 ; AVX-LABEL: icmp_v8i16_v8i1:
1161 ; AVX-NEXT: vpxor %xmm1, %xmm1, %xmm1
1162 ; AVX-NEXT: vpcmpeqb %xmm1, %xmm0, %xmm0
1163 ; AVX-NEXT: vpmovsxbw %xmm0, %xmm0
1164 ; AVX-NEXT: vpacksswb %xmm0, %xmm0, %xmm0
1165 ; AVX-NEXT: vpmovmskb %xmm0, %eax
1166 ; AVX-NEXT: xorb $0, %al
1167 ; AVX-NEXT: setnp %al
1170 ; AVX512F-LABEL: icmp_v8i16_v8i1:
1172 ; AVX512F-NEXT: vpxor %xmm1, %xmm1, %xmm1
1173 ; AVX512F-NEXT: vpcmpeqb %xmm1, %xmm0, %xmm0
1174 ; AVX512F-NEXT: vpmovsxbd %xmm0, %zmm0
1175 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
1176 ; AVX512F-NEXT: kmovw %k0, %eax
1177 ; AVX512F-NEXT: xorb $0, %al
1178 ; AVX512F-NEXT: setnp %al
1179 ; AVX512F-NEXT: vzeroupper
1180 ; AVX512F-NEXT: retq
1182 ; AVX512BW-LABEL: icmp_v8i16_v8i1:
1183 ; AVX512BW: # %bb.0:
1184 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1185 ; AVX512BW-NEXT: vptestnmb %zmm0, %zmm0, %k0
1186 ; AVX512BW-NEXT: kmovd %k0, %eax
1187 ; AVX512BW-NEXT: xorb $0, %al
1188 ; AVX512BW-NEXT: setnp %al
1189 ; AVX512BW-NEXT: vzeroupper
1190 ; AVX512BW-NEXT: retq
1192 ; AVX512VL-LABEL: icmp_v8i16_v8i1:
1193 ; AVX512VL: # %bb.0:
1194 ; AVX512VL-NEXT: vptestnmb %xmm0, %xmm0, %k0
1195 ; AVX512VL-NEXT: kmovd %k0, %eax
1196 ; AVX512VL-NEXT: xorb $0, %al
1197 ; AVX512VL-NEXT: setnp %al
1198 ; AVX512VL-NEXT: retq
1199 %a = icmp eq <8 x i8> %0, zeroinitializer
1200 %b = call i1 @llvm.experimental.vector.reduce.xor.v8i1(<8 x i1> %a)
1204 define i1 @icmp_v16i8_v16i1(<16 x i8>) {
1205 ; SSE-LABEL: icmp_v16i8_v16i1:
1207 ; SSE-NEXT: pxor %xmm1, %xmm1
1208 ; SSE-NEXT: pcmpeqb %xmm0, %xmm1
1209 ; SSE-NEXT: pmovmskb %xmm1, %eax
1210 ; SSE-NEXT: movl %eax, %ecx
1211 ; SSE-NEXT: shrl $8, %ecx
1212 ; SSE-NEXT: xorb %al, %cl
1213 ; SSE-NEXT: setnp %al
1216 ; AVX-LABEL: icmp_v16i8_v16i1:
1218 ; AVX-NEXT: vpxor %xmm1, %xmm1, %xmm1
1219 ; AVX-NEXT: vpcmpeqb %xmm1, %xmm0, %xmm0
1220 ; AVX-NEXT: vpmovmskb %xmm0, %eax
1221 ; AVX-NEXT: movl %eax, %ecx
1222 ; AVX-NEXT: shrl $8, %ecx
1223 ; AVX-NEXT: xorb %al, %cl
1224 ; AVX-NEXT: setnp %al
1227 ; AVX512F-LABEL: icmp_v16i8_v16i1:
1229 ; AVX512F-NEXT: vpxor %xmm1, %xmm1, %xmm1
1230 ; AVX512F-NEXT: vpcmpeqb %xmm1, %xmm0, %xmm0
1231 ; AVX512F-NEXT: vpmovmskb %xmm0, %eax
1232 ; AVX512F-NEXT: movl %eax, %ecx
1233 ; AVX512F-NEXT: shrl $8, %ecx
1234 ; AVX512F-NEXT: xorb %al, %cl
1235 ; AVX512F-NEXT: setnp %al
1236 ; AVX512F-NEXT: retq
1238 ; AVX512BW-LABEL: icmp_v16i8_v16i1:
1239 ; AVX512BW: # %bb.0:
1240 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1241 ; AVX512BW-NEXT: vptestnmb %zmm0, %zmm0, %k0
1242 ; AVX512BW-NEXT: kmovd %k0, %eax
1243 ; AVX512BW-NEXT: movl %eax, %ecx
1244 ; AVX512BW-NEXT: shrl $8, %ecx
1245 ; AVX512BW-NEXT: xorb %al, %cl
1246 ; AVX512BW-NEXT: setnp %al
1247 ; AVX512BW-NEXT: vzeroupper
1248 ; AVX512BW-NEXT: retq
1250 ; AVX512VL-LABEL: icmp_v16i8_v16i1:
1251 ; AVX512VL: # %bb.0:
1252 ; AVX512VL-NEXT: vptestnmb %xmm0, %xmm0, %k0
1253 ; AVX512VL-NEXT: kmovd %k0, %eax
1254 ; AVX512VL-NEXT: movl %eax, %ecx
1255 ; AVX512VL-NEXT: shrl $8, %ecx
1256 ; AVX512VL-NEXT: xorb %al, %cl
1257 ; AVX512VL-NEXT: setnp %al
1258 ; AVX512VL-NEXT: retq
1259 %a = icmp eq <16 x i8> %0, zeroinitializer
1260 %b = call i1 @llvm.experimental.vector.reduce.xor.v16i1(<16 x i1> %a)
1264 define i1 @icmp_v4i64_v4i1(<4 x i64>) {
1265 ; SSE2-LABEL: icmp_v4i64_v4i1:
1267 ; SSE2-NEXT: pxor %xmm2, %xmm2
1268 ; SSE2-NEXT: pcmpeqd %xmm2, %xmm1
1269 ; SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm1[1,0,3,2]
1270 ; SSE2-NEXT: pand %xmm1, %xmm3
1271 ; SSE2-NEXT: pcmpeqd %xmm2, %xmm0
1272 ; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,0,3,2]
1273 ; SSE2-NEXT: pand %xmm0, %xmm1
1274 ; SSE2-NEXT: packssdw %xmm3, %xmm1
1275 ; SSE2-NEXT: movmskps %xmm1, %eax
1276 ; SSE2-NEXT: xorb $0, %al
1277 ; SSE2-NEXT: setnp %al
1280 ; SSE41-LABEL: icmp_v4i64_v4i1:
1282 ; SSE41-NEXT: pxor %xmm2, %xmm2
1283 ; SSE41-NEXT: pcmpeqq %xmm2, %xmm1
1284 ; SSE41-NEXT: pcmpeqq %xmm2, %xmm0
1285 ; SSE41-NEXT: packssdw %xmm1, %xmm0
1286 ; SSE41-NEXT: movmskps %xmm0, %eax
1287 ; SSE41-NEXT: xorb $0, %al
1288 ; SSE41-NEXT: setnp %al
1291 ; AVX1-LABEL: icmp_v4i64_v4i1:
1293 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
1294 ; AVX1-NEXT: vpxor %xmm2, %xmm2, %xmm2
1295 ; AVX1-NEXT: vpcmpeqq %xmm2, %xmm1, %xmm1
1296 ; AVX1-NEXT: vpcmpeqq %xmm2, %xmm0, %xmm0
1297 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
1298 ; AVX1-NEXT: vmovmskpd %ymm0, %eax
1299 ; AVX1-NEXT: xorb $0, %al
1300 ; AVX1-NEXT: setnp %al
1301 ; AVX1-NEXT: vzeroupper
1304 ; AVX2-LABEL: icmp_v4i64_v4i1:
1306 ; AVX2-NEXT: vpxor %xmm1, %xmm1, %xmm1
1307 ; AVX2-NEXT: vpcmpeqq %ymm1, %ymm0, %ymm0
1308 ; AVX2-NEXT: vmovmskpd %ymm0, %eax
1309 ; AVX2-NEXT: xorb $0, %al
1310 ; AVX2-NEXT: setnp %al
1311 ; AVX2-NEXT: vzeroupper
1314 ; AVX512F-LABEL: icmp_v4i64_v4i1:
1316 ; AVX512F-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
1317 ; AVX512F-NEXT: vptestnmq %zmm0, %zmm0, %k0
1318 ; AVX512F-NEXT: kmovw %k0, %eax
1319 ; AVX512F-NEXT: andl $15, %eax
1320 ; AVX512F-NEXT: xorb $0, %al
1321 ; AVX512F-NEXT: setnp %al
1322 ; AVX512F-NEXT: vzeroupper
1323 ; AVX512F-NEXT: retq
1325 ; AVX512BW-LABEL: icmp_v4i64_v4i1:
1326 ; AVX512BW: # %bb.0:
1327 ; AVX512BW-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
1328 ; AVX512BW-NEXT: vptestnmq %zmm0, %zmm0, %k0
1329 ; AVX512BW-NEXT: kmovd %k0, %eax
1330 ; AVX512BW-NEXT: andl $15, %eax
1331 ; AVX512BW-NEXT: xorb $0, %al
1332 ; AVX512BW-NEXT: setnp %al
1333 ; AVX512BW-NEXT: vzeroupper
1334 ; AVX512BW-NEXT: retq
1336 ; AVX512VL-LABEL: icmp_v4i64_v4i1:
1337 ; AVX512VL: # %bb.0:
1338 ; AVX512VL-NEXT: vptestnmq %ymm0, %ymm0, %k0
1339 ; AVX512VL-NEXT: kmovd %k0, %eax
1340 ; AVX512VL-NEXT: andl $15, %eax
1341 ; AVX512VL-NEXT: xorb $0, %al
1342 ; AVX512VL-NEXT: setnp %al
1343 ; AVX512VL-NEXT: vzeroupper
1344 ; AVX512VL-NEXT: retq
1345 %a = icmp eq <4 x i64> %0, zeroinitializer
1346 %b = call i1 @llvm.experimental.vector.reduce.xor.v4i1(<4 x i1> %a)
1350 define i1 @icmp_v8i32_v8i1(<8 x i32>) {
1351 ; SSE-LABEL: icmp_v8i32_v8i1:
1353 ; SSE-NEXT: pxor %xmm2, %xmm2
1354 ; SSE-NEXT: pcmpeqd %xmm2, %xmm1
1355 ; SSE-NEXT: pcmpeqd %xmm2, %xmm0
1356 ; SSE-NEXT: packssdw %xmm1, %xmm0
1357 ; SSE-NEXT: packsswb %xmm0, %xmm0
1358 ; SSE-NEXT: pmovmskb %xmm0, %eax
1359 ; SSE-NEXT: xorb $0, %al
1360 ; SSE-NEXT: setnp %al
1363 ; AVX1-LABEL: icmp_v8i32_v8i1:
1365 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
1366 ; AVX1-NEXT: vpxor %xmm2, %xmm2, %xmm2
1367 ; AVX1-NEXT: vpcmpeqd %xmm2, %xmm1, %xmm1
1368 ; AVX1-NEXT: vpcmpeqd %xmm2, %xmm0, %xmm0
1369 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
1370 ; AVX1-NEXT: vmovmskps %ymm0, %eax
1371 ; AVX1-NEXT: xorb $0, %al
1372 ; AVX1-NEXT: setnp %al
1373 ; AVX1-NEXT: vzeroupper
1376 ; AVX2-LABEL: icmp_v8i32_v8i1:
1378 ; AVX2-NEXT: vpxor %xmm1, %xmm1, %xmm1
1379 ; AVX2-NEXT: vpcmpeqd %ymm1, %ymm0, %ymm0
1380 ; AVX2-NEXT: vmovmskps %ymm0, %eax
1381 ; AVX2-NEXT: xorb $0, %al
1382 ; AVX2-NEXT: setnp %al
1383 ; AVX2-NEXT: vzeroupper
1386 ; AVX512F-LABEL: icmp_v8i32_v8i1:
1388 ; AVX512F-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
1389 ; AVX512F-NEXT: vptestnmd %zmm0, %zmm0, %k0
1390 ; AVX512F-NEXT: kmovw %k0, %eax
1391 ; AVX512F-NEXT: xorb $0, %al
1392 ; AVX512F-NEXT: setnp %al
1393 ; AVX512F-NEXT: vzeroupper
1394 ; AVX512F-NEXT: retq
1396 ; AVX512BW-LABEL: icmp_v8i32_v8i1:
1397 ; AVX512BW: # %bb.0:
1398 ; AVX512BW-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
1399 ; AVX512BW-NEXT: vptestnmd %zmm0, %zmm0, %k0
1400 ; AVX512BW-NEXT: kmovd %k0, %eax
1401 ; AVX512BW-NEXT: xorb $0, %al
1402 ; AVX512BW-NEXT: setnp %al
1403 ; AVX512BW-NEXT: vzeroupper
1404 ; AVX512BW-NEXT: retq
1406 ; AVX512VL-LABEL: icmp_v8i32_v8i1:
1407 ; AVX512VL: # %bb.0:
1408 ; AVX512VL-NEXT: vptestnmd %ymm0, %ymm0, %k0
1409 ; AVX512VL-NEXT: kmovd %k0, %eax
1410 ; AVX512VL-NEXT: xorb $0, %al
1411 ; AVX512VL-NEXT: setnp %al
1412 ; AVX512VL-NEXT: vzeroupper
1413 ; AVX512VL-NEXT: retq
1414 %a = icmp eq <8 x i32> %0, zeroinitializer
1415 %b = call i1 @llvm.experimental.vector.reduce.xor.v8i1(<8 x i1> %a)
1419 define i1 @icmp_v16i16_v16i1(<16 x i16>) {
1420 ; SSE-LABEL: icmp_v16i16_v16i1:
1422 ; SSE-NEXT: pxor %xmm2, %xmm2
1423 ; SSE-NEXT: pcmpeqw %xmm2, %xmm1
1424 ; SSE-NEXT: pcmpeqw %xmm2, %xmm0
1425 ; SSE-NEXT: packsswb %xmm1, %xmm0
1426 ; SSE-NEXT: pmovmskb %xmm0, %eax
1427 ; SSE-NEXT: movl %eax, %ecx
1428 ; SSE-NEXT: shrl $8, %ecx
1429 ; SSE-NEXT: xorb %al, %cl
1430 ; SSE-NEXT: setnp %al
1433 ; AVX1-LABEL: icmp_v16i16_v16i1:
1435 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
1436 ; AVX1-NEXT: vpxor %xmm2, %xmm2, %xmm2
1437 ; AVX1-NEXT: vpcmpeqw %xmm2, %xmm1, %xmm1
1438 ; AVX1-NEXT: vpcmpeqw %xmm2, %xmm0, %xmm0
1439 ; AVX1-NEXT: vpacksswb %xmm1, %xmm0, %xmm0
1440 ; AVX1-NEXT: vpmovmskb %xmm0, %eax
1441 ; AVX1-NEXT: movl %eax, %ecx
1442 ; AVX1-NEXT: shrl $8, %ecx
1443 ; AVX1-NEXT: xorb %al, %cl
1444 ; AVX1-NEXT: setnp %al
1445 ; AVX1-NEXT: vzeroupper
1448 ; AVX2-LABEL: icmp_v16i16_v16i1:
1450 ; AVX2-NEXT: vpxor %xmm1, %xmm1, %xmm1
1451 ; AVX2-NEXT: vpcmpeqw %ymm1, %ymm0, %ymm0
1452 ; AVX2-NEXT: vextracti128 $1, %ymm0, %xmm1
1453 ; AVX2-NEXT: vpacksswb %xmm1, %xmm0, %xmm0
1454 ; AVX2-NEXT: vpmovmskb %xmm0, %eax
1455 ; AVX2-NEXT: movl %eax, %ecx
1456 ; AVX2-NEXT: shrl $8, %ecx
1457 ; AVX2-NEXT: xorb %al, %cl
1458 ; AVX2-NEXT: setnp %al
1459 ; AVX2-NEXT: vzeroupper
1462 ; AVX512F-LABEL: icmp_v16i16_v16i1:
1464 ; AVX512F-NEXT: vpxor %xmm1, %xmm1, %xmm1
1465 ; AVX512F-NEXT: vpcmpeqw %ymm1, %ymm0, %ymm0
1466 ; AVX512F-NEXT: vpmovsxwd %ymm0, %zmm0
1467 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
1468 ; AVX512F-NEXT: kmovw %k0, %eax
1469 ; AVX512F-NEXT: movl %eax, %ecx
1470 ; AVX512F-NEXT: shrl $8, %ecx
1471 ; AVX512F-NEXT: xorb %al, %cl
1472 ; AVX512F-NEXT: setnp %al
1473 ; AVX512F-NEXT: vzeroupper
1474 ; AVX512F-NEXT: retq
1476 ; AVX512BW-LABEL: icmp_v16i16_v16i1:
1477 ; AVX512BW: # %bb.0:
1478 ; AVX512BW-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
1479 ; AVX512BW-NEXT: vptestnmw %zmm0, %zmm0, %k0
1480 ; AVX512BW-NEXT: kmovd %k0, %eax
1481 ; AVX512BW-NEXT: movl %eax, %ecx
1482 ; AVX512BW-NEXT: shrl $8, %ecx
1483 ; AVX512BW-NEXT: xorb %al, %cl
1484 ; AVX512BW-NEXT: setnp %al
1485 ; AVX512BW-NEXT: vzeroupper
1486 ; AVX512BW-NEXT: retq
1488 ; AVX512VL-LABEL: icmp_v16i16_v16i1:
1489 ; AVX512VL: # %bb.0:
1490 ; AVX512VL-NEXT: vptestnmw %ymm0, %ymm0, %k0
1491 ; AVX512VL-NEXT: kmovd %k0, %eax
1492 ; AVX512VL-NEXT: movl %eax, %ecx
1493 ; AVX512VL-NEXT: shrl $8, %ecx
1494 ; AVX512VL-NEXT: xorb %al, %cl
1495 ; AVX512VL-NEXT: setnp %al
1496 ; AVX512VL-NEXT: vzeroupper
1497 ; AVX512VL-NEXT: retq
1498 %a = icmp eq <16 x i16> %0, zeroinitializer
1499 %b = call i1 @llvm.experimental.vector.reduce.xor.v16i1(<16 x i1> %a)
1503 define i1 @icmp_v32i8_v32i1(<32 x i8>) {
1504 ; SSE-LABEL: icmp_v32i8_v32i1:
1506 ; SSE-NEXT: pxor %xmm2, %xmm2
1507 ; SSE-NEXT: pcmpeqb %xmm2, %xmm1
1508 ; SSE-NEXT: pcmpeqb %xmm2, %xmm0
1509 ; SSE-NEXT: pxor %xmm1, %xmm0
1510 ; SSE-NEXT: pmovmskb %xmm0, %eax
1511 ; SSE-NEXT: movl %eax, %ecx
1512 ; SSE-NEXT: shrl $8, %ecx
1513 ; SSE-NEXT: xorb %al, %cl
1514 ; SSE-NEXT: setnp %al
1517 ; AVX1-LABEL: icmp_v32i8_v32i1:
1519 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
1520 ; AVX1-NEXT: vpxor %xmm2, %xmm2, %xmm2
1521 ; AVX1-NEXT: vpcmpeqb %xmm2, %xmm1, %xmm1
1522 ; AVX1-NEXT: vpcmpeqb %xmm2, %xmm0, %xmm0
1523 ; AVX1-NEXT: vpxor %xmm1, %xmm0, %xmm0
1524 ; AVX1-NEXT: vpmovmskb %xmm0, %eax
1525 ; AVX1-NEXT: movl %eax, %ecx
1526 ; AVX1-NEXT: shrl $8, %ecx
1527 ; AVX1-NEXT: xorb %al, %cl
1528 ; AVX1-NEXT: setnp %al
1529 ; AVX1-NEXT: vzeroupper
1532 ; AVX2-LABEL: icmp_v32i8_v32i1:
1534 ; AVX2-NEXT: vpxor %xmm1, %xmm1, %xmm1
1535 ; AVX2-NEXT: vpcmpeqb %ymm1, %ymm0, %ymm0
1536 ; AVX2-NEXT: vpmovmskb %ymm0, %eax
1537 ; AVX2-NEXT: movl %eax, %ecx
1538 ; AVX2-NEXT: shrl $16, %ecx
1539 ; AVX2-NEXT: xorl %eax, %ecx
1540 ; AVX2-NEXT: movl %ecx, %eax
1541 ; AVX2-NEXT: shrl $8, %eax
1542 ; AVX2-NEXT: xorb %cl, %al
1543 ; AVX2-NEXT: setnp %al
1544 ; AVX2-NEXT: vzeroupper
1547 ; AVX512F-LABEL: icmp_v32i8_v32i1:
1549 ; AVX512F-NEXT: vpxor %xmm1, %xmm1, %xmm1
1550 ; AVX512F-NEXT: vpcmpeqb %ymm1, %ymm0, %ymm0
1551 ; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm1
1552 ; AVX512F-NEXT: vpxor %xmm1, %xmm0, %xmm0
1553 ; AVX512F-NEXT: vpmovsxbd %xmm0, %zmm0
1554 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
1555 ; AVX512F-NEXT: kshiftrw $8, %k0, %k1
1556 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
1557 ; AVX512F-NEXT: kshiftrw $4, %k0, %k1
1558 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
1559 ; AVX512F-NEXT: kshiftrw $2, %k0, %k1
1560 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
1561 ; AVX512F-NEXT: kshiftrw $1, %k0, %k1
1562 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
1563 ; AVX512F-NEXT: kmovw %k0, %eax
1564 ; AVX512F-NEXT: # kill: def $al killed $al killed $eax
1565 ; AVX512F-NEXT: vzeroupper
1566 ; AVX512F-NEXT: retq
1568 ; AVX512BW-LABEL: icmp_v32i8_v32i1:
1569 ; AVX512BW: # %bb.0:
1570 ; AVX512BW-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
1571 ; AVX512BW-NEXT: vptestnmb %zmm0, %zmm0, %k0
1572 ; AVX512BW-NEXT: kmovd %k0, %eax
1573 ; AVX512BW-NEXT: movl %eax, %ecx
1574 ; AVX512BW-NEXT: shrl $16, %ecx
1575 ; AVX512BW-NEXT: xorl %eax, %ecx
1576 ; AVX512BW-NEXT: movl %ecx, %eax
1577 ; AVX512BW-NEXT: shrl $8, %eax
1578 ; AVX512BW-NEXT: xorb %cl, %al
1579 ; AVX512BW-NEXT: setnp %al
1580 ; AVX512BW-NEXT: vzeroupper
1581 ; AVX512BW-NEXT: retq
1583 ; AVX512VL-LABEL: icmp_v32i8_v32i1:
1584 ; AVX512VL: # %bb.0:
1585 ; AVX512VL-NEXT: vptestnmb %ymm0, %ymm0, %k0
1586 ; AVX512VL-NEXT: kmovd %k0, %eax
1587 ; AVX512VL-NEXT: movl %eax, %ecx
1588 ; AVX512VL-NEXT: shrl $16, %ecx
1589 ; AVX512VL-NEXT: xorl %eax, %ecx
1590 ; AVX512VL-NEXT: movl %ecx, %eax
1591 ; AVX512VL-NEXT: shrl $8, %eax
1592 ; AVX512VL-NEXT: xorb %cl, %al
1593 ; AVX512VL-NEXT: setnp %al
1594 ; AVX512VL-NEXT: vzeroupper
1595 ; AVX512VL-NEXT: retq
1596 %a = icmp eq <32 x i8> %0, zeroinitializer
1597 %b = call i1 @llvm.experimental.vector.reduce.xor.v32i1(<32 x i1> %a)
1601 define i1 @icmp_v8i64_v8i1(<8 x i64>) {
1602 ; SSE2-LABEL: icmp_v8i64_v8i1:
1604 ; SSE2-NEXT: pxor %xmm4, %xmm4
1605 ; SSE2-NEXT: pcmpeqd %xmm4, %xmm3
1606 ; SSE2-NEXT: pshufd {{.*#+}} xmm5 = xmm3[1,0,3,2]
1607 ; SSE2-NEXT: pand %xmm3, %xmm5
1608 ; SSE2-NEXT: pcmpeqd %xmm4, %xmm2
1609 ; SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm2[1,0,3,2]
1610 ; SSE2-NEXT: pand %xmm2, %xmm3
1611 ; SSE2-NEXT: packssdw %xmm5, %xmm3
1612 ; SSE2-NEXT: pcmpeqd %xmm4, %xmm1
1613 ; SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm1[1,0,3,2]
1614 ; SSE2-NEXT: pand %xmm1, %xmm2
1615 ; SSE2-NEXT: pcmpeqd %xmm4, %xmm0
1616 ; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,0,3,2]
1617 ; SSE2-NEXT: pand %xmm0, %xmm1
1618 ; SSE2-NEXT: packssdw %xmm2, %xmm1
1619 ; SSE2-NEXT: packssdw %xmm3, %xmm1
1620 ; SSE2-NEXT: packsswb %xmm0, %xmm1
1621 ; SSE2-NEXT: pmovmskb %xmm1, %eax
1622 ; SSE2-NEXT: xorb $0, %al
1623 ; SSE2-NEXT: setnp %al
1626 ; SSE41-LABEL: icmp_v8i64_v8i1:
1628 ; SSE41-NEXT: pxor %xmm4, %xmm4
1629 ; SSE41-NEXT: pcmpeqq %xmm4, %xmm3
1630 ; SSE41-NEXT: pcmpeqq %xmm4, %xmm2
1631 ; SSE41-NEXT: packssdw %xmm3, %xmm2
1632 ; SSE41-NEXT: pcmpeqq %xmm4, %xmm1
1633 ; SSE41-NEXT: pcmpeqq %xmm4, %xmm0
1634 ; SSE41-NEXT: packssdw %xmm1, %xmm0
1635 ; SSE41-NEXT: packssdw %xmm2, %xmm0
1636 ; SSE41-NEXT: packsswb %xmm0, %xmm0
1637 ; SSE41-NEXT: pmovmskb %xmm0, %eax
1638 ; SSE41-NEXT: xorb $0, %al
1639 ; SSE41-NEXT: setnp %al
1642 ; AVX1-LABEL: icmp_v8i64_v8i1:
1644 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm2
1645 ; AVX1-NEXT: vpxor %xmm3, %xmm3, %xmm3
1646 ; AVX1-NEXT: vpcmpeqq %xmm3, %xmm2, %xmm2
1647 ; AVX1-NEXT: vpcmpeqq %xmm3, %xmm1, %xmm1
1648 ; AVX1-NEXT: vpackssdw %xmm2, %xmm1, %xmm1
1649 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2
1650 ; AVX1-NEXT: vpcmpeqq %xmm3, %xmm2, %xmm2
1651 ; AVX1-NEXT: vpcmpeqq %xmm3, %xmm0, %xmm0
1652 ; AVX1-NEXT: vpackssdw %xmm2, %xmm0, %xmm0
1653 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
1654 ; AVX1-NEXT: vmovmskps %ymm0, %eax
1655 ; AVX1-NEXT: xorb $0, %al
1656 ; AVX1-NEXT: setnp %al
1657 ; AVX1-NEXT: vzeroupper
1660 ; AVX2-LABEL: icmp_v8i64_v8i1:
1662 ; AVX2-NEXT: vpxor %xmm2, %xmm2, %xmm2
1663 ; AVX2-NEXT: vpcmpeqq %ymm2, %ymm1, %ymm1
1664 ; AVX2-NEXT: vpcmpeqq %ymm2, %ymm0, %ymm0
1665 ; AVX2-NEXT: vpackssdw %ymm1, %ymm0, %ymm0
1666 ; AVX2-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,2,1,3]
1667 ; AVX2-NEXT: vmovmskps %ymm0, %eax
1668 ; AVX2-NEXT: xorb $0, %al
1669 ; AVX2-NEXT: setnp %al
1670 ; AVX2-NEXT: vzeroupper
1673 ; AVX512F-LABEL: icmp_v8i64_v8i1:
1675 ; AVX512F-NEXT: vptestnmq %zmm0, %zmm0, %k0
1676 ; AVX512F-NEXT: kmovw %k0, %eax
1677 ; AVX512F-NEXT: xorb $0, %al
1678 ; AVX512F-NEXT: setnp %al
1679 ; AVX512F-NEXT: vzeroupper
1680 ; AVX512F-NEXT: retq
1682 ; AVX512BW-LABEL: icmp_v8i64_v8i1:
1683 ; AVX512BW: # %bb.0:
1684 ; AVX512BW-NEXT: vptestnmq %zmm0, %zmm0, %k0
1685 ; AVX512BW-NEXT: kmovd %k0, %eax
1686 ; AVX512BW-NEXT: xorb $0, %al
1687 ; AVX512BW-NEXT: setnp %al
1688 ; AVX512BW-NEXT: vzeroupper
1689 ; AVX512BW-NEXT: retq
1691 ; AVX512VL-LABEL: icmp_v8i64_v8i1:
1692 ; AVX512VL: # %bb.0:
1693 ; AVX512VL-NEXT: vptestnmq %zmm0, %zmm0, %k0
1694 ; AVX512VL-NEXT: kmovd %k0, %eax
1695 ; AVX512VL-NEXT: xorb $0, %al
1696 ; AVX512VL-NEXT: setnp %al
1697 ; AVX512VL-NEXT: vzeroupper
1698 ; AVX512VL-NEXT: retq
1699 %a = icmp eq <8 x i64> %0, zeroinitializer
1700 %b = call i1 @llvm.experimental.vector.reduce.xor.v8i1(<8 x i1> %a)
1704 define i1 @icmp_v16i32_v16i1(<16 x i32>) {
1705 ; SSE-LABEL: icmp_v16i32_v16i1:
1707 ; SSE-NEXT: pxor %xmm4, %xmm4
1708 ; SSE-NEXT: pcmpeqd %xmm4, %xmm3
1709 ; SSE-NEXT: pcmpeqd %xmm4, %xmm2
1710 ; SSE-NEXT: packssdw %xmm3, %xmm2
1711 ; SSE-NEXT: pcmpeqd %xmm4, %xmm1
1712 ; SSE-NEXT: pcmpeqd %xmm4, %xmm0
1713 ; SSE-NEXT: packssdw %xmm1, %xmm0
1714 ; SSE-NEXT: packsswb %xmm2, %xmm0
1715 ; SSE-NEXT: pmovmskb %xmm0, %eax
1716 ; SSE-NEXT: movl %eax, %ecx
1717 ; SSE-NEXT: shrl $8, %ecx
1718 ; SSE-NEXT: xorb %al, %cl
1719 ; SSE-NEXT: setnp %al
1722 ; AVX1-LABEL: icmp_v16i32_v16i1:
1724 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm2
1725 ; AVX1-NEXT: vpxor %xmm3, %xmm3, %xmm3
1726 ; AVX1-NEXT: vpcmpeqd %xmm3, %xmm2, %xmm2
1727 ; AVX1-NEXT: vpcmpeqd %xmm3, %xmm1, %xmm1
1728 ; AVX1-NEXT: vpackssdw %xmm2, %xmm1, %xmm1
1729 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2
1730 ; AVX1-NEXT: vpcmpeqd %xmm3, %xmm2, %xmm2
1731 ; AVX1-NEXT: vpcmpeqd %xmm3, %xmm0, %xmm0
1732 ; AVX1-NEXT: vpackssdw %xmm2, %xmm0, %xmm0
1733 ; AVX1-NEXT: vpacksswb %xmm1, %xmm0, %xmm0
1734 ; AVX1-NEXT: vpmovmskb %xmm0, %eax
1735 ; AVX1-NEXT: movl %eax, %ecx
1736 ; AVX1-NEXT: shrl $8, %ecx
1737 ; AVX1-NEXT: xorb %al, %cl
1738 ; AVX1-NEXT: setnp %al
1739 ; AVX1-NEXT: vzeroupper
1742 ; AVX2-LABEL: icmp_v16i32_v16i1:
1744 ; AVX2-NEXT: vpxor %xmm2, %xmm2, %xmm2
1745 ; AVX2-NEXT: vpcmpeqd %ymm2, %ymm1, %ymm1
1746 ; AVX2-NEXT: vpcmpeqd %ymm2, %ymm0, %ymm0
1747 ; AVX2-NEXT: vpackssdw %ymm1, %ymm0, %ymm0
1748 ; AVX2-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,2,1,3]
1749 ; AVX2-NEXT: vextracti128 $1, %ymm0, %xmm1
1750 ; AVX2-NEXT: vpacksswb %xmm1, %xmm0, %xmm0
1751 ; AVX2-NEXT: vpmovmskb %xmm0, %eax
1752 ; AVX2-NEXT: movl %eax, %ecx
1753 ; AVX2-NEXT: shrl $8, %ecx
1754 ; AVX2-NEXT: xorb %al, %cl
1755 ; AVX2-NEXT: setnp %al
1756 ; AVX2-NEXT: vzeroupper
1759 ; AVX512F-LABEL: icmp_v16i32_v16i1:
1761 ; AVX512F-NEXT: vptestnmd %zmm0, %zmm0, %k0
1762 ; AVX512F-NEXT: kmovw %k0, %eax
1763 ; AVX512F-NEXT: movl %eax, %ecx
1764 ; AVX512F-NEXT: shrl $8, %ecx
1765 ; AVX512F-NEXT: xorb %al, %cl
1766 ; AVX512F-NEXT: setnp %al
1767 ; AVX512F-NEXT: vzeroupper
1768 ; AVX512F-NEXT: retq
1770 ; AVX512BW-LABEL: icmp_v16i32_v16i1:
1771 ; AVX512BW: # %bb.0:
1772 ; AVX512BW-NEXT: vptestnmd %zmm0, %zmm0, %k0
1773 ; AVX512BW-NEXT: kmovd %k0, %eax
1774 ; AVX512BW-NEXT: movl %eax, %ecx
1775 ; AVX512BW-NEXT: shrl $8, %ecx
1776 ; AVX512BW-NEXT: xorb %al, %cl
1777 ; AVX512BW-NEXT: setnp %al
1778 ; AVX512BW-NEXT: vzeroupper
1779 ; AVX512BW-NEXT: retq
1781 ; AVX512VL-LABEL: icmp_v16i32_v16i1:
1782 ; AVX512VL: # %bb.0:
1783 ; AVX512VL-NEXT: vptestnmd %zmm0, %zmm0, %k0
1784 ; AVX512VL-NEXT: kmovd %k0, %eax
1785 ; AVX512VL-NEXT: movl %eax, %ecx
1786 ; AVX512VL-NEXT: shrl $8, %ecx
1787 ; AVX512VL-NEXT: xorb %al, %cl
1788 ; AVX512VL-NEXT: setnp %al
1789 ; AVX512VL-NEXT: vzeroupper
1790 ; AVX512VL-NEXT: retq
1791 %a = icmp eq <16 x i32> %0, zeroinitializer
1792 %b = call i1 @llvm.experimental.vector.reduce.xor.v16i1(<16 x i1> %a)
1796 define i1 @icmp_v32i16_v32i1(<32 x i16>) {
1797 ; SSE-LABEL: icmp_v32i16_v32i1:
1799 ; SSE-NEXT: pxor %xmm4, %xmm4
1800 ; SSE-NEXT: pcmpeqw %xmm4, %xmm1
1801 ; SSE-NEXT: pcmpeqw %xmm4, %xmm0
1802 ; SSE-NEXT: packsswb %xmm1, %xmm0
1803 ; SSE-NEXT: pcmpeqw %xmm4, %xmm3
1804 ; SSE-NEXT: pcmpeqw %xmm4, %xmm2
1805 ; SSE-NEXT: packsswb %xmm3, %xmm2
1806 ; SSE-NEXT: pxor %xmm0, %xmm2
1807 ; SSE-NEXT: pmovmskb %xmm2, %eax
1808 ; SSE-NEXT: movl %eax, %ecx
1809 ; SSE-NEXT: shrl $8, %ecx
1810 ; SSE-NEXT: xorb %al, %cl
1811 ; SSE-NEXT: setnp %al
1814 ; AVX1-LABEL: icmp_v32i16_v32i1:
1816 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm2
1817 ; AVX1-NEXT: vpxor %xmm3, %xmm3, %xmm3
1818 ; AVX1-NEXT: vpcmpeqw %xmm3, %xmm2, %xmm2
1819 ; AVX1-NEXT: vpcmpeqw %xmm3, %xmm1, %xmm1
1820 ; AVX1-NEXT: vpacksswb %xmm2, %xmm1, %xmm1
1821 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2
1822 ; AVX1-NEXT: vpcmpeqw %xmm3, %xmm2, %xmm2
1823 ; AVX1-NEXT: vpcmpeqw %xmm3, %xmm0, %xmm0
1824 ; AVX1-NEXT: vpacksswb %xmm2, %xmm0, %xmm0
1825 ; AVX1-NEXT: vpxor %xmm1, %xmm0, %xmm0
1826 ; AVX1-NEXT: vpsllw $7, %xmm0, %xmm0
1827 ; AVX1-NEXT: vpmovmskb %xmm0, %eax
1828 ; AVX1-NEXT: movl %eax, %ecx
1829 ; AVX1-NEXT: shrl $8, %ecx
1830 ; AVX1-NEXT: xorb %al, %cl
1831 ; AVX1-NEXT: setnp %al
1832 ; AVX1-NEXT: vzeroupper
1835 ; AVX2-LABEL: icmp_v32i16_v32i1:
1837 ; AVX2-NEXT: vpxor %xmm2, %xmm2, %xmm2
1838 ; AVX2-NEXT: vpcmpeqw %ymm2, %ymm1, %ymm1
1839 ; AVX2-NEXT: vpcmpeqw %ymm2, %ymm0, %ymm0
1840 ; AVX2-NEXT: vpacksswb %ymm1, %ymm0, %ymm0
1841 ; AVX2-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,2,1,3]
1842 ; AVX2-NEXT: vpmovmskb %ymm0, %eax
1843 ; AVX2-NEXT: movl %eax, %ecx
1844 ; AVX2-NEXT: shrl $16, %ecx
1845 ; AVX2-NEXT: xorl %eax, %ecx
1846 ; AVX2-NEXT: movl %ecx, %eax
1847 ; AVX2-NEXT: shrl $8, %eax
1848 ; AVX2-NEXT: xorb %cl, %al
1849 ; AVX2-NEXT: setnp %al
1850 ; AVX2-NEXT: vzeroupper
1853 ; AVX512F-LABEL: icmp_v32i16_v32i1:
1855 ; AVX512F-NEXT: vextracti64x4 $1, %zmm0, %ymm1
1856 ; AVX512F-NEXT: vpxor %xmm2, %xmm2, %xmm2
1857 ; AVX512F-NEXT: vpcmpeqw %ymm2, %ymm1, %ymm1
1858 ; AVX512F-NEXT: vpcmpeqw %ymm2, %ymm0, %ymm0
1859 ; AVX512F-NEXT: vpxor %ymm1, %ymm0, %ymm0
1860 ; AVX512F-NEXT: vpmovsxwd %ymm0, %zmm0
1861 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
1862 ; AVX512F-NEXT: kshiftrw $8, %k0, %k1
1863 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
1864 ; AVX512F-NEXT: kshiftrw $4, %k0, %k1
1865 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
1866 ; AVX512F-NEXT: kshiftrw $2, %k0, %k1
1867 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
1868 ; AVX512F-NEXT: kshiftrw $1, %k0, %k1
1869 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
1870 ; AVX512F-NEXT: kmovw %k0, %eax
1871 ; AVX512F-NEXT: # kill: def $al killed $al killed $eax
1872 ; AVX512F-NEXT: vzeroupper
1873 ; AVX512F-NEXT: retq
1875 ; AVX512BW-LABEL: icmp_v32i16_v32i1:
1876 ; AVX512BW: # %bb.0:
1877 ; AVX512BW-NEXT: vptestnmw %zmm0, %zmm0, %k0
1878 ; AVX512BW-NEXT: kmovd %k0, %eax
1879 ; AVX512BW-NEXT: movl %eax, %ecx
1880 ; AVX512BW-NEXT: shrl $16, %ecx
1881 ; AVX512BW-NEXT: xorl %eax, %ecx
1882 ; AVX512BW-NEXT: movl %ecx, %eax
1883 ; AVX512BW-NEXT: shrl $8, %eax
1884 ; AVX512BW-NEXT: xorb %cl, %al
1885 ; AVX512BW-NEXT: setnp %al
1886 ; AVX512BW-NEXT: vzeroupper
1887 ; AVX512BW-NEXT: retq
1889 ; AVX512VL-LABEL: icmp_v32i16_v32i1:
1890 ; AVX512VL: # %bb.0:
1891 ; AVX512VL-NEXT: vptestnmw %zmm0, %zmm0, %k0
1892 ; AVX512VL-NEXT: kmovd %k0, %eax
1893 ; AVX512VL-NEXT: movl %eax, %ecx
1894 ; AVX512VL-NEXT: shrl $16, %ecx
1895 ; AVX512VL-NEXT: xorl %eax, %ecx
1896 ; AVX512VL-NEXT: movl %ecx, %eax
1897 ; AVX512VL-NEXT: shrl $8, %eax
1898 ; AVX512VL-NEXT: xorb %cl, %al
1899 ; AVX512VL-NEXT: setnp %al
1900 ; AVX512VL-NEXT: vzeroupper
1901 ; AVX512VL-NEXT: retq
1902 %a = icmp eq <32 x i16> %0, zeroinitializer
1903 %b = call i1 @llvm.experimental.vector.reduce.xor.v32i1(<32 x i1> %a)
1907 define i1 @icmp_v64i8_v64i1(<64 x i8>) {
1908 ; SSE-LABEL: icmp_v64i8_v64i1:
1910 ; SSE-NEXT: pxor %xmm4, %xmm4
1911 ; SSE-NEXT: pcmpeqb %xmm4, %xmm2
1912 ; SSE-NEXT: pcmpeqb %xmm4, %xmm0
1913 ; SSE-NEXT: pcmpeqb %xmm4, %xmm3
1914 ; SSE-NEXT: pcmpeqb %xmm4, %xmm1
1915 ; SSE-NEXT: pxor %xmm3, %xmm1
1916 ; SSE-NEXT: pxor %xmm2, %xmm1
1917 ; SSE-NEXT: pxor %xmm0, %xmm1
1918 ; SSE-NEXT: psllw $7, %xmm1
1919 ; SSE-NEXT: pmovmskb %xmm1, %eax
1920 ; SSE-NEXT: movl %eax, %ecx
1921 ; SSE-NEXT: shrl $8, %ecx
1922 ; SSE-NEXT: xorb %al, %cl
1923 ; SSE-NEXT: setnp %al
1926 ; AVX1-LABEL: icmp_v64i8_v64i1:
1928 ; AVX1-NEXT: vpxor %xmm2, %xmm2, %xmm2
1929 ; AVX1-NEXT: vpcmpeqb %xmm2, %xmm1, %xmm3
1930 ; AVX1-NEXT: vpcmpeqb %xmm2, %xmm0, %xmm4
1931 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm1
1932 ; AVX1-NEXT: vpcmpeqb %xmm2, %xmm1, %xmm1
1933 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm0
1934 ; AVX1-NEXT: vpcmpeqb %xmm2, %xmm0, %xmm0
1935 ; AVX1-NEXT: vpxor %xmm1, %xmm0, %xmm0
1936 ; AVX1-NEXT: vpxor %xmm0, %xmm3, %xmm0
1937 ; AVX1-NEXT: vpxor %xmm0, %xmm4, %xmm0
1938 ; AVX1-NEXT: vpsllw $7, %xmm0, %xmm0
1939 ; AVX1-NEXT: vpmovmskb %xmm0, %eax
1940 ; AVX1-NEXT: movl %eax, %ecx
1941 ; AVX1-NEXT: shrl $8, %ecx
1942 ; AVX1-NEXT: xorb %al, %cl
1943 ; AVX1-NEXT: setnp %al
1944 ; AVX1-NEXT: vzeroupper
1947 ; AVX2-LABEL: icmp_v64i8_v64i1:
1949 ; AVX2-NEXT: vpxor %xmm2, %xmm2, %xmm2
1950 ; AVX2-NEXT: vpcmpeqb %ymm2, %ymm1, %ymm1
1951 ; AVX2-NEXT: vpcmpeqb %ymm2, %ymm0, %ymm0
1952 ; AVX2-NEXT: vpxor %ymm1, %ymm0, %ymm0
1953 ; AVX2-NEXT: vpmovmskb %ymm0, %eax
1954 ; AVX2-NEXT: movl %eax, %ecx
1955 ; AVX2-NEXT: shrl $16, %ecx
1956 ; AVX2-NEXT: xorl %eax, %ecx
1957 ; AVX2-NEXT: movl %ecx, %eax
1958 ; AVX2-NEXT: shrl $8, %eax
1959 ; AVX2-NEXT: xorb %cl, %al
1960 ; AVX2-NEXT: setnp %al
1961 ; AVX2-NEXT: vzeroupper
1964 ; AVX512F-LABEL: icmp_v64i8_v64i1:
1966 ; AVX512F-NEXT: vextracti64x4 $1, %zmm0, %ymm1
1967 ; AVX512F-NEXT: vpxor %xmm2, %xmm2, %xmm2
1968 ; AVX512F-NEXT: vpcmpeqb %ymm2, %ymm1, %ymm1
1969 ; AVX512F-NEXT: vpcmpeqb %ymm2, %ymm0, %ymm0
1970 ; AVX512F-NEXT: vextracti128 $1, %ymm1, %xmm2
1971 ; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm3
1972 ; AVX512F-NEXT: vpxor %xmm2, %xmm3, %xmm2
1973 ; AVX512F-NEXT: vpxor %xmm2, %xmm1, %xmm1
1974 ; AVX512F-NEXT: vpxor %xmm1, %xmm0, %xmm0
1975 ; AVX512F-NEXT: vpmovsxbd %xmm0, %zmm0
1976 ; AVX512F-NEXT: vptestmd %zmm0, %zmm0, %k0
1977 ; AVX512F-NEXT: kshiftrw $8, %k0, %k1
1978 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
1979 ; AVX512F-NEXT: kshiftrw $4, %k0, %k1
1980 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
1981 ; AVX512F-NEXT: kshiftrw $2, %k0, %k1
1982 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
1983 ; AVX512F-NEXT: kshiftrw $1, %k0, %k1
1984 ; AVX512F-NEXT: kxorw %k1, %k0, %k0
1985 ; AVX512F-NEXT: kmovw %k0, %eax
1986 ; AVX512F-NEXT: # kill: def $al killed $al killed $eax
1987 ; AVX512F-NEXT: vzeroupper
1988 ; AVX512F-NEXT: retq
1990 ; AVX512BW-LABEL: icmp_v64i8_v64i1:
1991 ; AVX512BW: # %bb.0:
1992 ; AVX512BW-NEXT: vptestnmb %zmm0, %zmm0, %k0
1993 ; AVX512BW-NEXT: kmovq %k0, %rax
1994 ; AVX512BW-NEXT: movq %rax, %rcx
1995 ; AVX512BW-NEXT: shrq $32, %rcx
1996 ; AVX512BW-NEXT: xorl %eax, %ecx
1997 ; AVX512BW-NEXT: movl %ecx, %eax
1998 ; AVX512BW-NEXT: shrl $16, %eax
1999 ; AVX512BW-NEXT: xorl %ecx, %eax
2000 ; AVX512BW-NEXT: movl %eax, %ecx
2001 ; AVX512BW-NEXT: shrl $8, %ecx
2002 ; AVX512BW-NEXT: xorb %al, %cl
2003 ; AVX512BW-NEXT: setnp %al
2004 ; AVX512BW-NEXT: vzeroupper
2005 ; AVX512BW-NEXT: retq
2007 ; AVX512VL-LABEL: icmp_v64i8_v64i1:
2008 ; AVX512VL: # %bb.0:
2009 ; AVX512VL-NEXT: vptestnmb %zmm0, %zmm0, %k0
2010 ; AVX512VL-NEXT: kmovq %k0, %rax
2011 ; AVX512VL-NEXT: movq %rax, %rcx
2012 ; AVX512VL-NEXT: shrq $32, %rcx
2013 ; AVX512VL-NEXT: xorl %eax, %ecx
2014 ; AVX512VL-NEXT: movl %ecx, %eax
2015 ; AVX512VL-NEXT: shrl $16, %eax
2016 ; AVX512VL-NEXT: xorl %ecx, %eax
2017 ; AVX512VL-NEXT: movl %eax, %ecx
2018 ; AVX512VL-NEXT: shrl $8, %ecx
2019 ; AVX512VL-NEXT: xorb %al, %cl
2020 ; AVX512VL-NEXT: setnp %al
2021 ; AVX512VL-NEXT: vzeroupper
2022 ; AVX512VL-NEXT: retq
2023 %a = icmp eq <64 x i8> %0, zeroinitializer
2024 %b = call i1 @llvm.experimental.vector.reduce.xor.v64i1(<64 x i1> %a)
2028 declare i1 @llvm.experimental.vector.reduce.xor.v2i1(<2 x i1>)
2029 declare i1 @llvm.experimental.vector.reduce.xor.v4i1(<4 x i1>)
2030 declare i1 @llvm.experimental.vector.reduce.xor.v8i1(<8 x i1>)
2031 declare i1 @llvm.experimental.vector.reduce.xor.v16i1(<16 x i1>)
2032 declare i1 @llvm.experimental.vector.reduce.xor.v32i1(<32 x i1>)
2033 declare i1 @llvm.experimental.vector.reduce.xor.v64i1(<64 x i1>)