; SSE2-NEXT: pxor %xmm1, %xmm1
; SSE2-NEXT: pcmpeqb %xmm0, %xmm1
; SSE2-NEXT: pmovmskb %xmm1, %eax
-; SSE2-NEXT: cmpw $-1, %ax
+; SSE2-NEXT: xorl $65535, %eax # imm = 0xFFFF
; SSE2-NEXT: setne %al
; SSE2-NEXT: retq
;
; SSE41-NEXT: setne %al
; SSE41-NEXT: retq
;
-; AVX1OR2-LABEL: allzeros_v16i8_not:
-; AVX1OR2: # %bb.0:
-; AVX1OR2-NEXT: vptest %xmm0, %xmm0
-; AVX1OR2-NEXT: setne %al
-; AVX1OR2-NEXT: retq
-;
-; KNL-LABEL: allzeros_v16i8_not:
-; KNL: # %bb.0:
-; KNL-NEXT: vptest %xmm0, %xmm0
-; KNL-NEXT: setne %al
-; KNL-NEXT: retq
-;
-; SKX-LABEL: allzeros_v16i8_not:
-; SKX: # %bb.0:
-; SKX-NEXT: vptestnmb %xmm0, %xmm0, %k0
-; SKX-NEXT: kortestw %k0, %k0
-; SKX-NEXT: setae %al
-; SKX-NEXT: retq
+; AVX-LABEL: allzeros_v16i8_not:
+; AVX: # %bb.0:
+; AVX-NEXT: vptest %xmm0, %xmm0
+; AVX-NEXT: setne %al
+; AVX-NEXT: retq
%1 = icmp eq <16 x i8> %a0, zeroinitializer
%2 = bitcast <16 x i1> %1 to i16
%3 = icmp ne i16 %2, -1
; SSE2: # %bb.0:
; SSE2-NEXT: pxor %xmm1, %xmm1
; SSE2-NEXT: pcmpeqd %xmm0, %xmm1
-; SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm1[1,0,3,2]
-; SSE2-NEXT: pand %xmm1, %xmm0
-; SSE2-NEXT: movmskpd %xmm0, %eax
-; SSE2-NEXT: cmpb $3, %al
+; SSE2-NEXT: movmskps %xmm1, %eax
+; SSE2-NEXT: xorl $15, %eax
; SSE2-NEXT: setne %al
; SSE2-NEXT: retq
;
; SSE41-NEXT: setne %al
; SSE41-NEXT: retq
;
-; AVX1OR2-LABEL: allzeros_v2i64_not:
-; AVX1OR2: # %bb.0:
-; AVX1OR2-NEXT: vptest %xmm0, %xmm0
-; AVX1OR2-NEXT: setne %al
-; AVX1OR2-NEXT: retq
-;
-; KNL-LABEL: allzeros_v2i64_not:
-; KNL: # %bb.0:
-; KNL-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
-; KNL-NEXT: vptestmq %zmm0, %zmm0, %k0
-; KNL-NEXT: kmovw %k0, %eax
-; KNL-NEXT: testb $3, %al
-; KNL-NEXT: setne %al
-; KNL-NEXT: vzeroupper
-; KNL-NEXT: retq
-;
-; SKX-LABEL: allzeros_v2i64_not:
-; SKX: # %bb.0:
-; SKX-NEXT: vptestnmq %xmm0, %xmm0, %k0
-; SKX-NEXT: kmovd %k0, %eax
-; SKX-NEXT: cmpb $3, %al
-; SKX-NEXT: setne %al
-; SKX-NEXT: retq
+; AVX-LABEL: allzeros_v2i64_not:
+; AVX: # %bb.0:
+; AVX-NEXT: vptest %xmm0, %xmm0
+; AVX-NEXT: setne %al
+; AVX-NEXT: retq
%1 = icmp eq <2 x i64> %a0, zeroinitializer
%2 = bitcast <2 x i1> %1 to i2
%3 = icmp ne i2 %2, -1
}
define i1 @allzeros_v8i32_not(<8 x i32> %a0) {
-; SSE-LABEL: allzeros_v8i32_not:
-; SSE: # %bb.0:
-; SSE-NEXT: pxor %xmm2, %xmm2
-; SSE-NEXT: pcmpeqd %xmm2, %xmm1
-; SSE-NEXT: pcmpeqd %xmm2, %xmm0
-; SSE-NEXT: packssdw %xmm1, %xmm0
-; SSE-NEXT: packsswb %xmm0, %xmm0
-; SSE-NEXT: pmovmskb %xmm0, %eax
-; SSE-NEXT: cmpb $-1, %al
-; SSE-NEXT: setne %al
-; SSE-NEXT: retq
-;
-; AVX1-LABEL: allzeros_v8i32_not:
-; AVX1: # %bb.0:
-; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
-; AVX1-NEXT: vpor %xmm1, %xmm0, %xmm0
-; AVX1-NEXT: vptest %xmm0, %xmm0
-; AVX1-NEXT: setne %al
-; AVX1-NEXT: vzeroupper
-; AVX1-NEXT: retq
-;
-; AVX2-LABEL: allzeros_v8i32_not:
-; AVX2: # %bb.0:
-; AVX2-NEXT: vptest %ymm0, %ymm0
-; AVX2-NEXT: setne %al
-; AVX2-NEXT: vzeroupper
-; AVX2-NEXT: retq
+; SSE2-LABEL: allzeros_v8i32_not:
+; SSE2: # %bb.0:
+; SSE2-NEXT: por %xmm1, %xmm0
+; SSE2-NEXT: pxor %xmm1, %xmm1
+; SSE2-NEXT: pcmpeqd %xmm0, %xmm1
+; SSE2-NEXT: movmskps %xmm1, %eax
+; SSE2-NEXT: xorl $15, %eax
+; SSE2-NEXT: setne %al
+; SSE2-NEXT: retq
;
-; KNL-LABEL: allzeros_v8i32_not:
-; KNL: # %bb.0:
-; KNL-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
-; KNL-NEXT: vptestnmd %zmm0, %zmm0, %k0
-; KNL-NEXT: kmovw %k0, %eax
-; KNL-NEXT: cmpb $-1, %al
-; KNL-NEXT: setne %al
-; KNL-NEXT: vzeroupper
-; KNL-NEXT: retq
+; SSE41-LABEL: allzeros_v8i32_not:
+; SSE41: # %bb.0:
+; SSE41-NEXT: por %xmm1, %xmm0
+; SSE41-NEXT: ptest %xmm0, %xmm0
+; SSE41-NEXT: setne %al
+; SSE41-NEXT: retq
;
-; SKX-LABEL: allzeros_v8i32_not:
-; SKX: # %bb.0:
-; SKX-NEXT: vptestnmd %ymm0, %ymm0, %k0
-; SKX-NEXT: kortestb %k0, %k0
-; SKX-NEXT: setae %al
-; SKX-NEXT: vzeroupper
-; SKX-NEXT: retq
+; AVX-LABEL: allzeros_v8i32_not:
+; AVX: # %bb.0:
+; AVX-NEXT: vptest %ymm0, %ymm0
+; AVX-NEXT: setne %al
+; AVX-NEXT: vzeroupper
+; AVX-NEXT: retq
%1 = icmp eq <8 x i32> %a0, zeroinitializer
%2 = bitcast <8 x i1> %1 to i8
%3 = icmp ne i8 %2, -1
define i1 @allzeros_v8i64_not(<8 x i64> %a0) {
; SSE2-LABEL: allzeros_v8i64_not:
; SSE2: # %bb.0:
-; SSE2-NEXT: pxor %xmm4, %xmm4
-; SSE2-NEXT: pcmpeqd %xmm4, %xmm3
-; SSE2-NEXT: pshufd {{.*#+}} xmm5 = xmm3[1,0,3,2]
-; SSE2-NEXT: pand %xmm3, %xmm5
-; SSE2-NEXT: pcmpeqd %xmm4, %xmm2
-; SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm2[1,0,3,2]
-; SSE2-NEXT: pand %xmm2, %xmm3
-; SSE2-NEXT: packssdw %xmm5, %xmm3
-; SSE2-NEXT: pcmpeqd %xmm4, %xmm1
-; SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm1[1,0,3,2]
-; SSE2-NEXT: pand %xmm1, %xmm2
-; SSE2-NEXT: pcmpeqd %xmm4, %xmm0
-; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,0,3,2]
-; SSE2-NEXT: pand %xmm0, %xmm1
-; SSE2-NEXT: packssdw %xmm2, %xmm1
-; SSE2-NEXT: packssdw %xmm3, %xmm1
-; SSE2-NEXT: packsswb %xmm1, %xmm1
-; SSE2-NEXT: pmovmskb %xmm1, %eax
-; SSE2-NEXT: cmpb $-1, %al
+; SSE2-NEXT: por %xmm3, %xmm1
+; SSE2-NEXT: por %xmm2, %xmm0
+; SSE2-NEXT: por %xmm1, %xmm0
+; SSE2-NEXT: pxor %xmm1, %xmm1
+; SSE2-NEXT: pcmpeqd %xmm0, %xmm1
+; SSE2-NEXT: movmskps %xmm1, %eax
+; SSE2-NEXT: xorl $15, %eax
; SSE2-NEXT: setne %al
; SSE2-NEXT: retq
;
; SSE41-LABEL: allzeros_v8i64_not:
; SSE41: # %bb.0:
-; SSE41-NEXT: pxor %xmm4, %xmm4
-; SSE41-NEXT: pcmpeqq %xmm4, %xmm3
-; SSE41-NEXT: pcmpeqq %xmm4, %xmm2
-; SSE41-NEXT: packssdw %xmm3, %xmm2
-; SSE41-NEXT: pcmpeqq %xmm4, %xmm1
-; SSE41-NEXT: pcmpeqq %xmm4, %xmm0
-; SSE41-NEXT: packssdw %xmm1, %xmm0
-; SSE41-NEXT: packssdw %xmm2, %xmm0
-; SSE41-NEXT: packsswb %xmm0, %xmm0
-; SSE41-NEXT: pmovmskb %xmm0, %eax
-; SSE41-NEXT: cmpb $-1, %al
+; SSE41-NEXT: por %xmm3, %xmm1
+; SSE41-NEXT: por %xmm2, %xmm0
+; SSE41-NEXT: por %xmm1, %xmm0
+; SSE41-NEXT: ptest %xmm0, %xmm0
; SSE41-NEXT: setne %al
; SSE41-NEXT: retq
;
; AVX1-LABEL: allzeros_v8i64_not:
; AVX1: # %bb.0:
-; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm2
-; AVX1-NEXT: vpxor %xmm3, %xmm3, %xmm3
-; AVX1-NEXT: vpcmpeqq %xmm3, %xmm2, %xmm2
-; AVX1-NEXT: vpcmpeqq %xmm3, %xmm1, %xmm1
-; AVX1-NEXT: vpackssdw %xmm2, %xmm1, %xmm1
-; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2
-; AVX1-NEXT: vpcmpeqq %xmm3, %xmm2, %xmm2
-; AVX1-NEXT: vpcmpeqq %xmm3, %xmm0, %xmm0
-; AVX1-NEXT: vpackssdw %xmm2, %xmm0, %xmm0
-; AVX1-NEXT: vpand %xmm1, %xmm0, %xmm0
-; AVX1-NEXT: vmovmskps %xmm0, %eax
-; AVX1-NEXT: cmpl $15, %eax
+; AVX1-NEXT: vorps %ymm1, %ymm0, %ymm0
+; AVX1-NEXT: vptest %ymm0, %ymm0
; AVX1-NEXT: setne %al
; AVX1-NEXT: vzeroupper
; AVX1-NEXT: retq
;
; AVX2-LABEL: allzeros_v8i64_not:
; AVX2: # %bb.0:
-; AVX2-NEXT: vpxor %xmm2, %xmm2, %xmm2
-; AVX2-NEXT: vpcmpeqq %ymm2, %ymm1, %ymm1
-; AVX2-NEXT: vpcmpeqq %ymm2, %ymm0, %ymm0
-; AVX2-NEXT: vpackssdw %ymm1, %ymm0, %ymm0
-; AVX2-NEXT: vmovmskps %ymm0, %eax
-; AVX2-NEXT: cmpb $-1, %al
+; AVX2-NEXT: vpor %ymm1, %ymm0, %ymm0
+; AVX2-NEXT: vptest %ymm0, %ymm0
; AVX2-NEXT: setne %al
; AVX2-NEXT: vzeroupper
; AVX2-NEXT: retq
;
-; KNL-LABEL: allzeros_v8i64_not:
-; KNL: # %bb.0:
-; KNL-NEXT: vptestnmq %zmm0, %zmm0, %k0
-; KNL-NEXT: kmovw %k0, %eax
-; KNL-NEXT: cmpb $-1, %al
-; KNL-NEXT: setne %al
-; KNL-NEXT: vzeroupper
-; KNL-NEXT: retq
-;
-; SKX-LABEL: allzeros_v8i64_not:
-; SKX: # %bb.0:
-; SKX-NEXT: vptestnmq %zmm0, %zmm0, %k0
-; SKX-NEXT: kortestb %k0, %k0
-; SKX-NEXT: setae %al
-; SKX-NEXT: vzeroupper
-; SKX-NEXT: retq
+; AVX512-LABEL: allzeros_v8i64_not:
+; AVX512: # %bb.0:
+; AVX512-NEXT: vptestmd %zmm0, %zmm0, %k0
+; AVX512-NEXT: kortestw %k0, %k0
+; AVX512-NEXT: setne %al
+; AVX512-NEXT: vzeroupper
+; AVX512-NEXT: retq
%1 = icmp eq <8 x i64> %a0, zeroinitializer
%2 = bitcast <8 x i1> %1 to i8
%3 = icmp ne i8 %2, -1
;
; AVX512BW-LABEL: icmp0_v8i16_v8i1:
; AVX512BW: # %bb.0:
-; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
-; AVX512BW-NEXT: vptestnmw %zmm0, %zmm0, %k0
-; AVX512BW-NEXT: kmovd %k0, %eax
-; AVX512BW-NEXT: cmpb $-1, %al
+; AVX512BW-NEXT: vptest %xmm0, %xmm0
; AVX512BW-NEXT: sete %al
-; AVX512BW-NEXT: vzeroupper
; AVX512BW-NEXT: retq
;
; AVX512VL-LABEL: icmp0_v8i16_v8i1:
; AVX512VL: # %bb.0:
-; AVX512VL-NEXT: vptestnmw %xmm0, %xmm0, %k0
-; AVX512VL-NEXT: kmovd %k0, %eax
-; AVX512VL-NEXT: cmpb $-1, %al
+; AVX512VL-NEXT: vptest %xmm0, %xmm0
; AVX512VL-NEXT: sete %al
; AVX512VL-NEXT: retq
%a = icmp eq <8 x i16> %0, zeroinitializer
; SSE41-NEXT: sete %al
; SSE41-NEXT: retq
;
-; AVX1OR2-LABEL: icmp0_v16i8_v16i1:
-; AVX1OR2: # %bb.0:
-; AVX1OR2-NEXT: vptest %xmm0, %xmm0
-; AVX1OR2-NEXT: sete %al
-; AVX1OR2-NEXT: retq
-;
-; AVX512F-LABEL: icmp0_v16i8_v16i1:
-; AVX512F: # %bb.0:
-; AVX512F-NEXT: vptest %xmm0, %xmm0
-; AVX512F-NEXT: sete %al
-; AVX512F-NEXT: retq
-;
-; AVX512BW-LABEL: icmp0_v16i8_v16i1:
-; AVX512BW: # %bb.0:
-; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
-; AVX512BW-NEXT: vptestnmb %zmm0, %zmm0, %k0
-; AVX512BW-NEXT: kortestw %k0, %k0
-; AVX512BW-NEXT: setb %al
-; AVX512BW-NEXT: vzeroupper
-; AVX512BW-NEXT: retq
-;
-; AVX512VL-LABEL: icmp0_v16i8_v16i1:
-; AVX512VL: # %bb.0:
-; AVX512VL-NEXT: vptestnmb %xmm0, %xmm0, %k0
-; AVX512VL-NEXT: kortestw %k0, %k0
-; AVX512VL-NEXT: setb %al
-; AVX512VL-NEXT: retq
+; AVX-LABEL: icmp0_v16i8_v16i1:
+; AVX: # %bb.0:
+; AVX-NEXT: vptest %xmm0, %xmm0
+; AVX-NEXT: sete %al
+; AVX-NEXT: retq
%a = icmp eq <16 x i8> %0, zeroinitializer
%b = call i1 @llvm.vector.reduce.and.v16i1(<16 x i1> %a)
ret i1 %b
; SSE41-NEXT: sete %al
; SSE41-NEXT: retq
;
-; AVX1OR2-LABEL: icmp0_v8i32_v8i1:
-; AVX1OR2: # %bb.0:
-; AVX1OR2-NEXT: vptest %ymm0, %ymm0
-; AVX1OR2-NEXT: sete %al
-; AVX1OR2-NEXT: vzeroupper
-; AVX1OR2-NEXT: retq
-;
-; AVX512F-LABEL: icmp0_v8i32_v8i1:
-; AVX512F: # %bb.0:
-; AVX512F-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
-; AVX512F-NEXT: vptestnmd %zmm0, %zmm0, %k0
-; AVX512F-NEXT: kmovw %k0, %eax
-; AVX512F-NEXT: cmpb $-1, %al
-; AVX512F-NEXT: sete %al
-; AVX512F-NEXT: vzeroupper
-; AVX512F-NEXT: retq
-;
-; AVX512BW-LABEL: icmp0_v8i32_v8i1:
-; AVX512BW: # %bb.0:
-; AVX512BW-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
-; AVX512BW-NEXT: vptestnmd %zmm0, %zmm0, %k0
-; AVX512BW-NEXT: kmovd %k0, %eax
-; AVX512BW-NEXT: cmpb $-1, %al
-; AVX512BW-NEXT: sete %al
-; AVX512BW-NEXT: vzeroupper
-; AVX512BW-NEXT: retq
-;
-; AVX512VL-LABEL: icmp0_v8i32_v8i1:
-; AVX512VL: # %bb.0:
-; AVX512VL-NEXT: vptestnmd %ymm0, %ymm0, %k0
-; AVX512VL-NEXT: kmovd %k0, %eax
-; AVX512VL-NEXT: cmpb $-1, %al
-; AVX512VL-NEXT: sete %al
-; AVX512VL-NEXT: vzeroupper
-; AVX512VL-NEXT: retq
+; AVX-LABEL: icmp0_v8i32_v8i1:
+; AVX: # %bb.0:
+; AVX-NEXT: vptest %ymm0, %ymm0
+; AVX-NEXT: sete %al
+; AVX-NEXT: vzeroupper
+; AVX-NEXT: retq
%a = icmp eq <8 x i32> %0, zeroinitializer
%b = call i1 @llvm.vector.reduce.and.v8i1(<8 x i1> %a)
ret i1 %b
;
; AVX512BW-LABEL: icmp0_v16i16_v16i1:
; AVX512BW: # %bb.0:
-; AVX512BW-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
-; AVX512BW-NEXT: vptestnmw %zmm0, %zmm0, %k0
-; AVX512BW-NEXT: kortestw %k0, %k0
-; AVX512BW-NEXT: setb %al
+; AVX512BW-NEXT: vptest %ymm0, %ymm0
+; AVX512BW-NEXT: sete %al
; AVX512BW-NEXT: vzeroupper
; AVX512BW-NEXT: retq
;
; AVX512VL-LABEL: icmp0_v16i16_v16i1:
; AVX512VL: # %bb.0:
-; AVX512VL-NEXT: vptestnmw %ymm0, %ymm0, %k0
-; AVX512VL-NEXT: kortestw %k0, %k0
-; AVX512VL-NEXT: setb %al
+; AVX512VL-NEXT: vptest %ymm0, %ymm0
+; AVX512VL-NEXT: sete %al
; AVX512VL-NEXT: vzeroupper
; AVX512VL-NEXT: retq
%a = icmp eq <16 x i16> %0, zeroinitializer
;
; AVX512BW-LABEL: icmp0_v32i8_v32i1:
; AVX512BW: # %bb.0:
-; AVX512BW-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
-; AVX512BW-NEXT: vptestnmb %zmm0, %zmm0, %k0
-; AVX512BW-NEXT: kortestd %k0, %k0
-; AVX512BW-NEXT: setb %al
+; AVX512BW-NEXT: vptest %ymm0, %ymm0
+; AVX512BW-NEXT: sete %al
; AVX512BW-NEXT: vzeroupper
; AVX512BW-NEXT: retq
;
; AVX512VL-LABEL: icmp0_v32i8_v32i1:
; AVX512VL: # %bb.0:
-; AVX512VL-NEXT: vptestnmb %ymm0, %ymm0, %k0
-; AVX512VL-NEXT: kortestd %k0, %k0
-; AVX512VL-NEXT: setb %al
+; AVX512VL-NEXT: vptest %ymm0, %ymm0
+; AVX512VL-NEXT: sete %al
; AVX512VL-NEXT: vzeroupper
; AVX512VL-NEXT: retq
%a = icmp eq <32 x i8> %0, zeroinitializer
; AVX2-NEXT: vzeroupper
; AVX2-NEXT: retq
;
-; AVX512F-LABEL: icmp0_v8i64_v8i1:
-; AVX512F: # %bb.0:
-; AVX512F-NEXT: vptestnmq %zmm0, %zmm0, %k0
-; AVX512F-NEXT: kmovw %k0, %eax
-; AVX512F-NEXT: cmpb $-1, %al
-; AVX512F-NEXT: sete %al
-; AVX512F-NEXT: vzeroupper
-; AVX512F-NEXT: retq
-;
-; AVX512BW-LABEL: icmp0_v8i64_v8i1:
-; AVX512BW: # %bb.0:
-; AVX512BW-NEXT: vptestnmq %zmm0, %zmm0, %k0
-; AVX512BW-NEXT: kmovd %k0, %eax
-; AVX512BW-NEXT: cmpb $-1, %al
-; AVX512BW-NEXT: sete %al
-; AVX512BW-NEXT: vzeroupper
-; AVX512BW-NEXT: retq
-;
-; AVX512VL-LABEL: icmp0_v8i64_v8i1:
-; AVX512VL: # %bb.0:
-; AVX512VL-NEXT: vptestnmq %zmm0, %zmm0, %k0
-; AVX512VL-NEXT: kmovd %k0, %eax
-; AVX512VL-NEXT: cmpb $-1, %al
-; AVX512VL-NEXT: sete %al
-; AVX512VL-NEXT: vzeroupper
-; AVX512VL-NEXT: retq
+; AVX512-LABEL: icmp0_v8i64_v8i1:
+; AVX512: # %bb.0:
+; AVX512-NEXT: vptestmd %zmm0, %zmm0, %k0
+; AVX512-NEXT: kortestw %k0, %k0
+; AVX512-NEXT: sete %al
+; AVX512-NEXT: vzeroupper
+; AVX512-NEXT: retq
%a = icmp eq <8 x i64> %0, zeroinitializer
%b = call i1 @llvm.vector.reduce.and.v8i1(<8 x i1> %a)
ret i1 %b
;
; AVX512-LABEL: icmp0_v16i32_v16i1:
; AVX512: # %bb.0:
-; AVX512-NEXT: vptestnmd %zmm0, %zmm0, %k0
+; AVX512-NEXT: vptestmd %zmm0, %zmm0, %k0
; AVX512-NEXT: kortestw %k0, %k0
-; AVX512-NEXT: setb %al
+; AVX512-NEXT: sete %al
; AVX512-NEXT: vzeroupper
; AVX512-NEXT: retq
%a = icmp eq <16 x i32> %0, zeroinitializer
;
; AVX512BW-LABEL: icmp0_v32i16_v32i1:
; AVX512BW: # %bb.0:
-; AVX512BW-NEXT: vptestnmw %zmm0, %zmm0, %k0
-; AVX512BW-NEXT: kortestd %k0, %k0
-; AVX512BW-NEXT: setb %al
+; AVX512BW-NEXT: vptestmd %zmm0, %zmm0, %k0
+; AVX512BW-NEXT: kortestw %k0, %k0
+; AVX512BW-NEXT: sete %al
; AVX512BW-NEXT: vzeroupper
; AVX512BW-NEXT: retq
;
; AVX512VL-LABEL: icmp0_v32i16_v32i1:
; AVX512VL: # %bb.0:
-; AVX512VL-NEXT: vptestnmw %zmm0, %zmm0, %k0
-; AVX512VL-NEXT: kortestd %k0, %k0
-; AVX512VL-NEXT: setb %al
+; AVX512VL-NEXT: vptestmd %zmm0, %zmm0, %k0
+; AVX512VL-NEXT: kortestw %k0, %k0
+; AVX512VL-NEXT: sete %al
; AVX512VL-NEXT: vzeroupper
; AVX512VL-NEXT: retq
%a = icmp eq <32 x i16> %0, zeroinitializer
;
; AVX512BW-LABEL: icmp0_v64i8_v64i1:
; AVX512BW: # %bb.0:
-; AVX512BW-NEXT: vptestnmb %zmm0, %zmm0, %k0
-; AVX512BW-NEXT: kortestq %k0, %k0
-; AVX512BW-NEXT: setb %al
+; AVX512BW-NEXT: vptestmd %zmm0, %zmm0, %k0
+; AVX512BW-NEXT: kortestw %k0, %k0
+; AVX512BW-NEXT: sete %al
; AVX512BW-NEXT: vzeroupper
; AVX512BW-NEXT: retq
;
; AVX512VL-LABEL: icmp0_v64i8_v64i1:
; AVX512VL: # %bb.0:
-; AVX512VL-NEXT: vptestnmb %zmm0, %zmm0, %k0
-; AVX512VL-NEXT: kortestq %k0, %k0
-; AVX512VL-NEXT: setb %al
+; AVX512VL-NEXT: vptestmd %zmm0, %zmm0, %k0
+; AVX512VL-NEXT: kortestw %k0, %k0
+; AVX512VL-NEXT: sete %al
; AVX512VL-NEXT: vzeroupper
; AVX512VL-NEXT: retq
%a = icmp eq <64 x i8> %0, zeroinitializer
; AVX512BW-LABEL: icmp1_v8i16_v8i1:
; AVX512BW: # %bb.0:
; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
-; AVX512BW-NEXT: vpcmpeqd %xmm1, %xmm1, %xmm1
-; AVX512BW-NEXT: vpcmpeqw %zmm1, %zmm0, %k0
-; AVX512BW-NEXT: kmovd %k0, %eax
-; AVX512BW-NEXT: cmpb $-1, %al
-; AVX512BW-NEXT: sete %al
+; AVX512BW-NEXT: vmovdqa64 %zmm0, %zmm1
+; AVX512BW-NEXT: vpternlogq $15, %zmm0, %zmm0, %zmm1
+; AVX512BW-NEXT: vptest %xmm1, %xmm0
+; AVX512BW-NEXT: setb %al
; AVX512BW-NEXT: vzeroupper
; AVX512BW-NEXT: retq
;
; AVX512VL-LABEL: icmp1_v8i16_v8i1:
; AVX512VL: # %bb.0:
-; AVX512VL-NEXT: vpcmpeqd %xmm1, %xmm1, %xmm1
-; AVX512VL-NEXT: vpcmpeqw %xmm1, %xmm0, %k0
-; AVX512VL-NEXT: kmovd %k0, %eax
-; AVX512VL-NEXT: cmpb $-1, %al
-; AVX512VL-NEXT: sete %al
+; AVX512VL-NEXT: vmovdqa %xmm0, %xmm1
+; AVX512VL-NEXT: vpternlogq $15, %xmm0, %xmm0, %xmm1
+; AVX512VL-NEXT: vptest %xmm1, %xmm0
+; AVX512VL-NEXT: setb %al
; AVX512VL-NEXT: retq
%a = icmp eq <8 x i16> %0, <i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1>
%b = call i1 @llvm.vector.reduce.and.v8i1(<8 x i1> %a)
; AVX512BW-LABEL: icmp1_v16i8_v16i1:
; AVX512BW: # %bb.0:
; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
-; AVX512BW-NEXT: vpcmpeqd %xmm1, %xmm1, %xmm1
-; AVX512BW-NEXT: vpcmpeqb %zmm1, %zmm0, %k0
-; AVX512BW-NEXT: kortestw %k0, %k0
+; AVX512BW-NEXT: vmovdqa64 %zmm0, %zmm1
+; AVX512BW-NEXT: vpternlogq $15, %zmm0, %zmm0, %zmm1
+; AVX512BW-NEXT: vptest %xmm1, %xmm0
; AVX512BW-NEXT: setb %al
; AVX512BW-NEXT: vzeroupper
; AVX512BW-NEXT: retq
;
; AVX512VL-LABEL: icmp1_v16i8_v16i1:
; AVX512VL: # %bb.0:
-; AVX512VL-NEXT: vpcmpeqd %xmm1, %xmm1, %xmm1
-; AVX512VL-NEXT: vpcmpeqb %xmm1, %xmm0, %k0
-; AVX512VL-NEXT: kortestw %k0, %k0
+; AVX512VL-NEXT: vmovdqa %xmm0, %xmm1
+; AVX512VL-NEXT: vpternlogq $15, %xmm0, %xmm0, %xmm1
+; AVX512VL-NEXT: vptest %xmm1, %xmm0
; AVX512VL-NEXT: setb %al
; AVX512VL-NEXT: retq
%a = icmp eq <16 x i8> %0, <i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1>
; AVX512F-LABEL: icmp1_v8i32_v8i1:
; AVX512F: # %bb.0:
; AVX512F-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
-; AVX512F-NEXT: vpcmpeqd %ymm1, %ymm1, %ymm1
-; AVX512F-NEXT: vpcmpeqd %zmm1, %zmm0, %k0
-; AVX512F-NEXT: kmovw %k0, %eax
-; AVX512F-NEXT: cmpb $-1, %al
-; AVX512F-NEXT: sete %al
+; AVX512F-NEXT: vmovdqa64 %zmm0, %zmm1
+; AVX512F-NEXT: vpternlogq $15, %zmm0, %zmm0, %zmm1
+; AVX512F-NEXT: vptest %ymm1, %ymm0
+; AVX512F-NEXT: setb %al
; AVX512F-NEXT: vzeroupper
; AVX512F-NEXT: retq
;
; AVX512BW-LABEL: icmp1_v8i32_v8i1:
; AVX512BW: # %bb.0:
; AVX512BW-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
-; AVX512BW-NEXT: vpcmpeqd %ymm1, %ymm1, %ymm1
-; AVX512BW-NEXT: vpcmpeqd %zmm1, %zmm0, %k0
-; AVX512BW-NEXT: kmovd %k0, %eax
-; AVX512BW-NEXT: cmpb $-1, %al
-; AVX512BW-NEXT: sete %al
+; AVX512BW-NEXT: vmovdqa64 %zmm0, %zmm1
+; AVX512BW-NEXT: vpternlogq $15, %zmm0, %zmm0, %zmm1
+; AVX512BW-NEXT: vptest %ymm1, %ymm0
+; AVX512BW-NEXT: setb %al
; AVX512BW-NEXT: vzeroupper
; AVX512BW-NEXT: retq
;
; AVX512VL-LABEL: icmp1_v8i32_v8i1:
; AVX512VL: # %bb.0:
-; AVX512VL-NEXT: vpcmpeqd %ymm1, %ymm1, %ymm1
-; AVX512VL-NEXT: vpcmpeqd %ymm1, %ymm0, %k0
-; AVX512VL-NEXT: kmovd %k0, %eax
-; AVX512VL-NEXT: cmpb $-1, %al
-; AVX512VL-NEXT: sete %al
+; AVX512VL-NEXT: vmovdqa %ymm0, %ymm1
+; AVX512VL-NEXT: vpternlogq $15, %ymm0, %ymm0, %ymm1
+; AVX512VL-NEXT: vptest %ymm1, %ymm0
+; AVX512VL-NEXT: setb %al
; AVX512VL-NEXT: vzeroupper
; AVX512VL-NEXT: retq
%a = icmp eq <8 x i32> %0, <i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1>
; AVX512BW-LABEL: icmp1_v16i16_v16i1:
; AVX512BW: # %bb.0:
; AVX512BW-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
-; AVX512BW-NEXT: vpcmpeqd %ymm1, %ymm1, %ymm1
-; AVX512BW-NEXT: vpcmpeqw %zmm1, %zmm0, %k0
-; AVX512BW-NEXT: kortestw %k0, %k0
+; AVX512BW-NEXT: vmovdqa64 %zmm0, %zmm1
+; AVX512BW-NEXT: vpternlogq $15, %zmm0, %zmm0, %zmm1
+; AVX512BW-NEXT: vptest %ymm1, %ymm0
; AVX512BW-NEXT: setb %al
; AVX512BW-NEXT: vzeroupper
; AVX512BW-NEXT: retq
;
; AVX512VL-LABEL: icmp1_v16i16_v16i1:
; AVX512VL: # %bb.0:
-; AVX512VL-NEXT: vpcmpeqd %ymm1, %ymm1, %ymm1
-; AVX512VL-NEXT: vpcmpeqw %ymm1, %ymm0, %k0
-; AVX512VL-NEXT: kortestw %k0, %k0
+; AVX512VL-NEXT: vmovdqa %ymm0, %ymm1
+; AVX512VL-NEXT: vpternlogq $15, %ymm0, %ymm0, %ymm1
+; AVX512VL-NEXT: vptest %ymm1, %ymm0
; AVX512VL-NEXT: setb %al
; AVX512VL-NEXT: vzeroupper
; AVX512VL-NEXT: retq
; AVX512BW-LABEL: icmp1_v32i8_v32i1:
; AVX512BW: # %bb.0:
; AVX512BW-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
-; AVX512BW-NEXT: vpcmpeqd %ymm1, %ymm1, %ymm1
-; AVX512BW-NEXT: vpcmpeqb %zmm1, %zmm0, %k0
-; AVX512BW-NEXT: kortestd %k0, %k0
+; AVX512BW-NEXT: vmovdqa64 %zmm0, %zmm1
+; AVX512BW-NEXT: vpternlogq $15, %zmm0, %zmm0, %zmm1
+; AVX512BW-NEXT: vptest %ymm1, %ymm0
; AVX512BW-NEXT: setb %al
; AVX512BW-NEXT: vzeroupper
; AVX512BW-NEXT: retq
;
; AVX512VL-LABEL: icmp1_v32i8_v32i1:
; AVX512VL: # %bb.0:
-; AVX512VL-NEXT: vpcmpeqd %ymm1, %ymm1, %ymm1
-; AVX512VL-NEXT: vpcmpeqb %ymm1, %ymm0, %k0
-; AVX512VL-NEXT: kortestd %k0, %k0
+; AVX512VL-NEXT: vmovdqa %ymm0, %ymm1
+; AVX512VL-NEXT: vpternlogq $15, %ymm0, %ymm0, %ymm1
+; AVX512VL-NEXT: vptest %ymm1, %ymm0
; AVX512VL-NEXT: setb %al
; AVX512VL-NEXT: vzeroupper
; AVX512VL-NEXT: retq
; AVX2-NEXT: vzeroupper
; AVX2-NEXT: retq
;
-; AVX512F-LABEL: icmp1_v8i64_v8i1:
-; AVX512F: # %bb.0:
-; AVX512F-NEXT: vpternlogd $255, %zmm1, %zmm1, %zmm1
-; AVX512F-NEXT: vpcmpeqq %zmm1, %zmm0, %k0
-; AVX512F-NEXT: kmovw %k0, %eax
-; AVX512F-NEXT: cmpb $-1, %al
-; AVX512F-NEXT: sete %al
-; AVX512F-NEXT: vzeroupper
-; AVX512F-NEXT: retq
-;
-; AVX512BW-LABEL: icmp1_v8i64_v8i1:
-; AVX512BW: # %bb.0:
-; AVX512BW-NEXT: vpternlogd $255, %zmm1, %zmm1, %zmm1
-; AVX512BW-NEXT: vpcmpeqq %zmm1, %zmm0, %k0
-; AVX512BW-NEXT: kmovd %k0, %eax
-; AVX512BW-NEXT: cmpb $-1, %al
-; AVX512BW-NEXT: sete %al
-; AVX512BW-NEXT: vzeroupper
-; AVX512BW-NEXT: retq
-;
-; AVX512VL-LABEL: icmp1_v8i64_v8i1:
-; AVX512VL: # %bb.0:
-; AVX512VL-NEXT: vpternlogd $255, %zmm1, %zmm1, %zmm1
-; AVX512VL-NEXT: vpcmpeqq %zmm1, %zmm0, %k0
-; AVX512VL-NEXT: kmovd %k0, %eax
-; AVX512VL-NEXT: cmpb $-1, %al
-; AVX512VL-NEXT: sete %al
-; AVX512VL-NEXT: vzeroupper
-; AVX512VL-NEXT: retq
+; AVX512-LABEL: icmp1_v8i64_v8i1:
+; AVX512: # %bb.0:
+; AVX512-NEXT: vpternlogd $255, %zmm1, %zmm1, %zmm1
+; AVX512-NEXT: vpcmpneqd %zmm1, %zmm0, %k0
+; AVX512-NEXT: kortestw %k0, %k0
+; AVX512-NEXT: sete %al
+; AVX512-NEXT: vzeroupper
+; AVX512-NEXT: retq
%a = icmp eq <8 x i64> %0, <i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1>
%b = call i1 @llvm.vector.reduce.and.v8i1(<8 x i1> %a)
ret i1 %b
; AVX512-LABEL: icmp1_v16i32_v16i1:
; AVX512: # %bb.0:
; AVX512-NEXT: vpternlogd $255, %zmm1, %zmm1, %zmm1
-; AVX512-NEXT: vpcmpeqd %zmm1, %zmm0, %k0
+; AVX512-NEXT: vpcmpneqd %zmm1, %zmm0, %k0
; AVX512-NEXT: kortestw %k0, %k0
-; AVX512-NEXT: setb %al
+; AVX512-NEXT: sete %al
; AVX512-NEXT: vzeroupper
; AVX512-NEXT: retq
%a = icmp eq <16 x i32> %0, <i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1>
; AVX512BW-LABEL: icmp1_v32i16_v32i1:
; AVX512BW: # %bb.0:
; AVX512BW-NEXT: vpternlogd $255, %zmm1, %zmm1, %zmm1
-; AVX512BW-NEXT: vpcmpeqw %zmm1, %zmm0, %k0
-; AVX512BW-NEXT: kortestd %k0, %k0
-; AVX512BW-NEXT: setb %al
+; AVX512BW-NEXT: vpcmpneqd %zmm1, %zmm0, %k0
+; AVX512BW-NEXT: kortestw %k0, %k0
+; AVX512BW-NEXT: sete %al
; AVX512BW-NEXT: vzeroupper
; AVX512BW-NEXT: retq
;
; AVX512VL-LABEL: icmp1_v32i16_v32i1:
; AVX512VL: # %bb.0:
; AVX512VL-NEXT: vpternlogd $255, %zmm1, %zmm1, %zmm1
-; AVX512VL-NEXT: vpcmpeqw %zmm1, %zmm0, %k0
-; AVX512VL-NEXT: kortestd %k0, %k0
-; AVX512VL-NEXT: setb %al
+; AVX512VL-NEXT: vpcmpneqd %zmm1, %zmm0, %k0
+; AVX512VL-NEXT: kortestw %k0, %k0
+; AVX512VL-NEXT: sete %al
; AVX512VL-NEXT: vzeroupper
; AVX512VL-NEXT: retq
%a = icmp eq <32 x i16> %0, <i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1>
; AVX512BW-LABEL: icmp1_v64i8_v64i1:
; AVX512BW: # %bb.0:
; AVX512BW-NEXT: vpternlogd $255, %zmm1, %zmm1, %zmm1
-; AVX512BW-NEXT: vpcmpeqb %zmm1, %zmm0, %k0
-; AVX512BW-NEXT: kortestq %k0, %k0
-; AVX512BW-NEXT: setb %al
+; AVX512BW-NEXT: vpcmpneqd %zmm1, %zmm0, %k0
+; AVX512BW-NEXT: kortestw %k0, %k0
+; AVX512BW-NEXT: sete %al
; AVX512BW-NEXT: vzeroupper
; AVX512BW-NEXT: retq
;
; AVX512VL-LABEL: icmp1_v64i8_v64i1:
; AVX512VL: # %bb.0:
; AVX512VL-NEXT: vpternlogd $255, %zmm1, %zmm1, %zmm1
-; AVX512VL-NEXT: vpcmpeqb %zmm1, %zmm0, %k0
-; AVX512VL-NEXT: kortestq %k0, %k0
-; AVX512VL-NEXT: setb %al
+; AVX512VL-NEXT: vpcmpneqd %zmm1, %zmm0, %k0
+; AVX512VL-NEXT: kortestw %k0, %k0
+; AVX512VL-NEXT: sete %al
; AVX512VL-NEXT: vzeroupper
; AVX512VL-NEXT: retq
%a = icmp eq <64 x i8> %0, <i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1>
;
; AVX512BW-LABEL: icmp_v8i16_v8i1:
; AVX512BW: # %bb.0:
-; AVX512BW-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
-; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
-; AVX512BW-NEXT: vpcmpeqw %zmm1, %zmm0, %k0
-; AVX512BW-NEXT: kmovd %k0, %eax
-; AVX512BW-NEXT: cmpb $-1, %al
+; AVX512BW-NEXT: vpxor %xmm1, %xmm0, %xmm0
+; AVX512BW-NEXT: vptest %xmm0, %xmm0
; AVX512BW-NEXT: sete %al
-; AVX512BW-NEXT: vzeroupper
; AVX512BW-NEXT: retq
;
; AVX512VL-LABEL: icmp_v8i16_v8i1:
; AVX512VL: # %bb.0:
-; AVX512VL-NEXT: vpcmpeqw %xmm1, %xmm0, %k0
-; AVX512VL-NEXT: kmovd %k0, %eax
-; AVX512VL-NEXT: cmpb $-1, %al
+; AVX512VL-NEXT: vpxor %xmm1, %xmm0, %xmm0
+; AVX512VL-NEXT: vptest %xmm0, %xmm0
; AVX512VL-NEXT: sete %al
; AVX512VL-NEXT: retq
%a = icmp eq <8 x i16> %0, %1
;
; AVX512BW-LABEL: icmp_v16i8_v16i1:
; AVX512BW: # %bb.0:
-; AVX512BW-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
-; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
-; AVX512BW-NEXT: vpcmpeqb %zmm1, %zmm0, %k0
-; AVX512BW-NEXT: kortestw %k0, %k0
-; AVX512BW-NEXT: setb %al
-; AVX512BW-NEXT: vzeroupper
+; AVX512BW-NEXT: vpxor %xmm1, %xmm0, %xmm0
+; AVX512BW-NEXT: vptest %xmm0, %xmm0
+; AVX512BW-NEXT: sete %al
; AVX512BW-NEXT: retq
;
; AVX512VL-LABEL: icmp_v16i8_v16i1:
; AVX512VL: # %bb.0:
-; AVX512VL-NEXT: vpcmpeqb %xmm1, %xmm0, %k0
-; AVX512VL-NEXT: kortestw %k0, %k0
-; AVX512VL-NEXT: setb %al
+; AVX512VL-NEXT: vpxor %xmm1, %xmm0, %xmm0
+; AVX512VL-NEXT: vptest %xmm0, %xmm0
+; AVX512VL-NEXT: sete %al
; AVX512VL-NEXT: retq
%a = icmp eq <16 x i8> %0, %1
%b = call i1 @llvm.vector.reduce.and.v16i1(<16 x i1> %a)
; AVX2-NEXT: vzeroupper
; AVX2-NEXT: retq
;
-; AVX512F-LABEL: icmp_v8i32_v8i1:
-; AVX512F: # %bb.0:
-; AVX512F-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
-; AVX512F-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
-; AVX512F-NEXT: vpcmpeqd %zmm1, %zmm0, %k0
-; AVX512F-NEXT: kmovw %k0, %eax
-; AVX512F-NEXT: cmpb $-1, %al
-; AVX512F-NEXT: sete %al
-; AVX512F-NEXT: vzeroupper
-; AVX512F-NEXT: retq
-;
-; AVX512BW-LABEL: icmp_v8i32_v8i1:
-; AVX512BW: # %bb.0:
-; AVX512BW-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
-; AVX512BW-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
-; AVX512BW-NEXT: vpcmpeqd %zmm1, %zmm0, %k0
-; AVX512BW-NEXT: kmovd %k0, %eax
-; AVX512BW-NEXT: cmpb $-1, %al
-; AVX512BW-NEXT: sete %al
-; AVX512BW-NEXT: vzeroupper
-; AVX512BW-NEXT: retq
-;
-; AVX512VL-LABEL: icmp_v8i32_v8i1:
-; AVX512VL: # %bb.0:
-; AVX512VL-NEXT: vpcmpeqd %ymm1, %ymm0, %k0
-; AVX512VL-NEXT: kmovd %k0, %eax
-; AVX512VL-NEXT: cmpb $-1, %al
-; AVX512VL-NEXT: sete %al
-; AVX512VL-NEXT: vzeroupper
-; AVX512VL-NEXT: retq
+; AVX512-LABEL: icmp_v8i32_v8i1:
+; AVX512: # %bb.0:
+; AVX512-NEXT: vpxor %ymm1, %ymm0, %ymm0
+; AVX512-NEXT: vptest %ymm0, %ymm0
+; AVX512-NEXT: sete %al
+; AVX512-NEXT: vzeroupper
+; AVX512-NEXT: retq
%a = icmp eq <8 x i32> %0, %1
%b = call i1 @llvm.vector.reduce.and.v8i1(<8 x i1> %a)
ret i1 %b
;
; AVX512BW-LABEL: icmp_v16i16_v16i1:
; AVX512BW: # %bb.0:
-; AVX512BW-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
-; AVX512BW-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
-; AVX512BW-NEXT: vpcmpeqw %zmm1, %zmm0, %k0
-; AVX512BW-NEXT: kortestw %k0, %k0
-; AVX512BW-NEXT: setb %al
+; AVX512BW-NEXT: vpxor %ymm1, %ymm0, %ymm0
+; AVX512BW-NEXT: vptest %ymm0, %ymm0
+; AVX512BW-NEXT: sete %al
; AVX512BW-NEXT: vzeroupper
; AVX512BW-NEXT: retq
;
; AVX512VL-LABEL: icmp_v16i16_v16i1:
; AVX512VL: # %bb.0:
-; AVX512VL-NEXT: vpcmpeqw %ymm1, %ymm0, %k0
-; AVX512VL-NEXT: kortestw %k0, %k0
-; AVX512VL-NEXT: setb %al
+; AVX512VL-NEXT: vpxor %ymm1, %ymm0, %ymm0
+; AVX512VL-NEXT: vptest %ymm0, %ymm0
+; AVX512VL-NEXT: sete %al
; AVX512VL-NEXT: vzeroupper
; AVX512VL-NEXT: retq
%a = icmp eq <16 x i16> %0, %1
;
; AVX512BW-LABEL: icmp_v32i8_v32i1:
; AVX512BW: # %bb.0:
-; AVX512BW-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
-; AVX512BW-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
-; AVX512BW-NEXT: vpcmpeqb %zmm1, %zmm0, %k0
-; AVX512BW-NEXT: kortestd %k0, %k0
-; AVX512BW-NEXT: setb %al
+; AVX512BW-NEXT: vpxor %ymm1, %ymm0, %ymm0
+; AVX512BW-NEXT: vptest %ymm0, %ymm0
+; AVX512BW-NEXT: sete %al
; AVX512BW-NEXT: vzeroupper
; AVX512BW-NEXT: retq
;
; AVX512VL-LABEL: icmp_v32i8_v32i1:
; AVX512VL: # %bb.0:
-; AVX512VL-NEXT: vpcmpeqb %ymm1, %ymm0, %k0
-; AVX512VL-NEXT: kortestd %k0, %k0
-; AVX512VL-NEXT: setb %al
+; AVX512VL-NEXT: vpxor %ymm1, %ymm0, %ymm0
+; AVX512VL-NEXT: vptest %ymm0, %ymm0
+; AVX512VL-NEXT: sete %al
; AVX512VL-NEXT: vzeroupper
; AVX512VL-NEXT: retq
%a = icmp eq <32 x i8> %0, %1
; AVX2-NEXT: vzeroupper
; AVX2-NEXT: retq
;
-; AVX512F-LABEL: icmp_v8i64_v8i1:
-; AVX512F: # %bb.0:
-; AVX512F-NEXT: vpcmpeqq %zmm1, %zmm0, %k0
-; AVX512F-NEXT: kmovw %k0, %eax
-; AVX512F-NEXT: cmpb $-1, %al
-; AVX512F-NEXT: sete %al
-; AVX512F-NEXT: vzeroupper
-; AVX512F-NEXT: retq
-;
-; AVX512BW-LABEL: icmp_v8i64_v8i1:
-; AVX512BW: # %bb.0:
-; AVX512BW-NEXT: vpcmpeqq %zmm1, %zmm0, %k0
-; AVX512BW-NEXT: kmovd %k0, %eax
-; AVX512BW-NEXT: cmpb $-1, %al
-; AVX512BW-NEXT: sete %al
-; AVX512BW-NEXT: vzeroupper
-; AVX512BW-NEXT: retq
-;
-; AVX512VL-LABEL: icmp_v8i64_v8i1:
-; AVX512VL: # %bb.0:
-; AVX512VL-NEXT: vpcmpeqq %zmm1, %zmm0, %k0
-; AVX512VL-NEXT: kmovd %k0, %eax
-; AVX512VL-NEXT: cmpb $-1, %al
-; AVX512VL-NEXT: sete %al
-; AVX512VL-NEXT: vzeroupper
-; AVX512VL-NEXT: retq
+; AVX512-LABEL: icmp_v8i64_v8i1:
+; AVX512: # %bb.0:
+; AVX512-NEXT: vpcmpneqd %zmm1, %zmm0, %k0
+; AVX512-NEXT: kortestw %k0, %k0
+; AVX512-NEXT: sete %al
+; AVX512-NEXT: vzeroupper
+; AVX512-NEXT: retq
%a = icmp eq <8 x i64> %0, %1
%b = call i1 @llvm.vector.reduce.and.v8i1(<8 x i1> %a)
ret i1 %b
;
; AVX512-LABEL: icmp_v16i32_v16i1:
; AVX512: # %bb.0:
-; AVX512-NEXT: vpcmpeqd %zmm1, %zmm0, %k0
+; AVX512-NEXT: vpcmpneqd %zmm1, %zmm0, %k0
; AVX512-NEXT: kortestw %k0, %k0
-; AVX512-NEXT: setb %al
+; AVX512-NEXT: sete %al
; AVX512-NEXT: vzeroupper
; AVX512-NEXT: retq
%a = icmp eq <16 x i32> %0, %1
;
; AVX512BW-LABEL: icmp_v32i16_v32i1:
; AVX512BW: # %bb.0:
-; AVX512BW-NEXT: vpcmpeqw %zmm1, %zmm0, %k0
-; AVX512BW-NEXT: kortestd %k0, %k0
-; AVX512BW-NEXT: setb %al
+; AVX512BW-NEXT: vpcmpneqd %zmm1, %zmm0, %k0
+; AVX512BW-NEXT: kortestw %k0, %k0
+; AVX512BW-NEXT: sete %al
; AVX512BW-NEXT: vzeroupper
; AVX512BW-NEXT: retq
;
; AVX512VL-LABEL: icmp_v32i16_v32i1:
; AVX512VL: # %bb.0:
-; AVX512VL-NEXT: vpcmpeqw %zmm1, %zmm0, %k0
-; AVX512VL-NEXT: kortestd %k0, %k0
-; AVX512VL-NEXT: setb %al
+; AVX512VL-NEXT: vpcmpneqd %zmm1, %zmm0, %k0
+; AVX512VL-NEXT: kortestw %k0, %k0
+; AVX512VL-NEXT: sete %al
; AVX512VL-NEXT: vzeroupper
; AVX512VL-NEXT: retq
%a = icmp eq <32 x i16> %0, %1
;
; AVX512BW-LABEL: icmp_v64i8_v64i1:
; AVX512BW: # %bb.0:
-; AVX512BW-NEXT: vpcmpeqb %zmm1, %zmm0, %k0
-; AVX512BW-NEXT: kortestq %k0, %k0
-; AVX512BW-NEXT: setb %al
+; AVX512BW-NEXT: vpcmpneqd %zmm1, %zmm0, %k0
+; AVX512BW-NEXT: kortestw %k0, %k0
+; AVX512BW-NEXT: sete %al
; AVX512BW-NEXT: vzeroupper
; AVX512BW-NEXT: retq
;
; AVX512VL-LABEL: icmp_v64i8_v64i1:
; AVX512VL: # %bb.0:
-; AVX512VL-NEXT: vpcmpeqb %zmm1, %zmm0, %k0
-; AVX512VL-NEXT: kortestq %k0, %k0
-; AVX512VL-NEXT: setb %al
+; AVX512VL-NEXT: vpcmpneqd %zmm1, %zmm0, %k0
+; AVX512VL-NEXT: kortestw %k0, %k0
+; AVX512VL-NEXT: sete %al
; AVX512VL-NEXT: vzeroupper
; AVX512VL-NEXT: retq
%a = icmp eq <64 x i8> %0, %1