mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
[x86] add tests for vector cmps; NFC
llvm-svn: 356959
This commit is contained in:
parent
a32f36d7ba
commit
12cade5fc8
@ -917,3 +917,707 @@ define i8 @test_v32i8_sext(<32 x i8> %a0, <32 x i8> %a1) {
|
||||
%11 = extractelement <32 x i8> %10, i32 0
|
||||
ret i8 %11
|
||||
}
|
||||
|
||||
define i1 @bool_reduction_v2f64(<2 x double> %x, <2 x double> %y) {
|
||||
; SSE-LABEL: bool_reduction_v2f64:
|
||||
; SSE: # %bb.0:
|
||||
; SSE-NEXT: cmpltpd %xmm0, %xmm1
|
||||
; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm1[2,3,0,1]
|
||||
; SSE-NEXT: pand %xmm1, %xmm0
|
||||
; SSE-NEXT: pextrb $0, %xmm0, %eax
|
||||
; SSE-NEXT: # kill: def $al killed $al killed $eax
|
||||
; SSE-NEXT: retq
|
||||
;
|
||||
; AVX-LABEL: bool_reduction_v2f64:
|
||||
; AVX: # %bb.0:
|
||||
; AVX-NEXT: vcmpltpd %xmm0, %xmm1, %xmm0
|
||||
; AVX-NEXT: vpermilpd {{.*#+}} xmm1 = xmm0[1,0]
|
||||
; AVX-NEXT: vandpd %xmm1, %xmm0, %xmm0
|
||||
; AVX-NEXT: vpextrb $0, %xmm0, %eax
|
||||
; AVX-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX-NEXT: retq
|
||||
;
|
||||
; AVX512-LABEL: bool_reduction_v2f64:
|
||||
; AVX512: # %bb.0:
|
||||
; AVX512-NEXT: vcmpltpd %xmm0, %xmm1, %k1
|
||||
; AVX512-NEXT: vpcmpeqd %xmm0, %xmm0, %xmm0
|
||||
; AVX512-NEXT: vmovdqa64 %xmm0, %xmm0 {%k1} {z}
|
||||
; AVX512-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[2,3,0,1]
|
||||
; AVX512-NEXT: vpsllq $63, %xmm0, %xmm0
|
||||
; AVX512-NEXT: vptestmq %xmm0, %xmm0, %k0 {%k1}
|
||||
; AVX512-NEXT: kmovd %k0, %eax
|
||||
; AVX512-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX512-NEXT: retq
|
||||
%a = fcmp ogt <2 x double> %x, %y
|
||||
%b = shufflevector <2 x i1> %a, <2 x i1> undef, <2 x i32> <i32 1, i32 undef>
|
||||
%c = and <2 x i1> %a, %b
|
||||
%d = extractelement <2 x i1> %c, i32 0
|
||||
ret i1 %d
|
||||
}
|
||||
|
||||
define i1 @bool_reduction_v4f32(<4 x float> %x, <4 x float> %y) {
|
||||
; SSE-LABEL: bool_reduction_v4f32:
|
||||
; SSE: # %bb.0:
|
||||
; SSE-NEXT: cmpeqps %xmm1, %xmm0
|
||||
; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
|
||||
; SSE-NEXT: pand %xmm0, %xmm1
|
||||
; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm1[1,1,2,3]
|
||||
; SSE-NEXT: pand %xmm1, %xmm0
|
||||
; SSE-NEXT: pextrb $0, %xmm0, %eax
|
||||
; SSE-NEXT: # kill: def $al killed $al killed $eax
|
||||
; SSE-NEXT: retq
|
||||
;
|
||||
; AVX-LABEL: bool_reduction_v4f32:
|
||||
; AVX: # %bb.0:
|
||||
; AVX-NEXT: vcmpeqps %xmm1, %xmm0, %xmm0
|
||||
; AVX-NEXT: vpermilpd {{.*#+}} xmm1 = xmm0[1,0]
|
||||
; AVX-NEXT: vandpd %xmm0, %xmm1, %xmm0
|
||||
; AVX-NEXT: vpermilps {{.*#+}} xmm1 = xmm0[1,1,2,3]
|
||||
; AVX-NEXT: vandpd %xmm0, %xmm1, %xmm0
|
||||
; AVX-NEXT: vpextrb $0, %xmm0, %eax
|
||||
; AVX-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX-NEXT: retq
|
||||
;
|
||||
; AVX512-LABEL: bool_reduction_v4f32:
|
||||
; AVX512: # %bb.0:
|
||||
; AVX512-NEXT: vcmpeqps %xmm1, %xmm0, %k1
|
||||
; AVX512-NEXT: vpcmpeqd %xmm0, %xmm0, %xmm0
|
||||
; AVX512-NEXT: vmovdqa32 %xmm0, %xmm1 {%k1} {z}
|
||||
; AVX512-NEXT: vpshufd {{.*#+}} xmm1 = xmm1[2,3,0,1]
|
||||
; AVX512-NEXT: vpslld $31, %xmm1, %xmm1
|
||||
; AVX512-NEXT: vptestmd %xmm1, %xmm1, %k1 {%k1}
|
||||
; AVX512-NEXT: vmovdqa32 %xmm0, %xmm0 {%k1} {z}
|
||||
; AVX512-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[1,1,2,3]
|
||||
; AVX512-NEXT: vpslld $31, %xmm0, %xmm0
|
||||
; AVX512-NEXT: vptestmd %xmm0, %xmm0, %k0 {%k1}
|
||||
; AVX512-NEXT: kmovd %k0, %eax
|
||||
; AVX512-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX512-NEXT: retq
|
||||
%a = fcmp oeq <4 x float> %x, %y
|
||||
%s1 = shufflevector <4 x i1> %a, <4 x i1> undef, <4 x i32> <i32 2, i32 3, i32 undef, i32 undef>
|
||||
%b = and <4 x i1> %s1, %a
|
||||
%s2 = shufflevector <4 x i1> %b, <4 x i1> undef, <4 x i32> <i32 1, i32 undef, i32 undef, i32 undef>
|
||||
%c = and <4 x i1> %s2, %b
|
||||
%d = extractelement <4 x i1> %c, i32 0
|
||||
ret i1 %d
|
||||
}
|
||||
|
||||
define i1 @bool_reduction_v4f64(<4 x double> %x, <4 x double> %y) {
|
||||
; SSE-LABEL: bool_reduction_v4f64:
|
||||
; SSE: # %bb.0:
|
||||
; SSE-NEXT: cmplepd %xmm1, %xmm3
|
||||
; SSE-NEXT: cmplepd %xmm0, %xmm2
|
||||
; SSE-NEXT: movapd %xmm2, %xmm0
|
||||
; SSE-NEXT: shufps {{.*#+}} xmm0 = xmm0[0,2],xmm3[0,2]
|
||||
; SSE-NEXT: shufps {{.*#+}} xmm3 = xmm3[0,2],xmm2[0,2]
|
||||
; SSE-NEXT: andps %xmm0, %xmm3
|
||||
; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm3[1,1,2,3]
|
||||
; SSE-NEXT: pand %xmm3, %xmm0
|
||||
; SSE-NEXT: pextrb $0, %xmm0, %eax
|
||||
; SSE-NEXT: # kill: def $al killed $al killed $eax
|
||||
; SSE-NEXT: retq
|
||||
;
|
||||
; AVX-LABEL: bool_reduction_v4f64:
|
||||
; AVX: # %bb.0:
|
||||
; AVX-NEXT: vcmplepd %ymm0, %ymm1, %ymm0
|
||||
; AVX-NEXT: vextractf128 $1, %ymm0, %xmm1
|
||||
; AVX-NEXT: vpackssdw %xmm1, %xmm0, %xmm2
|
||||
; AVX-NEXT: vpackssdw %xmm0, %xmm1, %xmm0
|
||||
; AVX-NEXT: vpand %xmm2, %xmm0, %xmm0
|
||||
; AVX-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
|
||||
; AVX-NEXT: vpand %xmm0, %xmm1, %xmm0
|
||||
; AVX-NEXT: vpextrb $0, %xmm0, %eax
|
||||
; AVX-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX-NEXT: vzeroupper
|
||||
; AVX-NEXT: retq
|
||||
;
|
||||
; AVX512-LABEL: bool_reduction_v4f64:
|
||||
; AVX512: # %bb.0:
|
||||
; AVX512-NEXT: vcmplepd %ymm0, %ymm1, %k1
|
||||
; AVX512-NEXT: vpcmpeqd %xmm0, %xmm0, %xmm0
|
||||
; AVX512-NEXT: vmovdqa32 %xmm0, %xmm1 {%k1} {z}
|
||||
; AVX512-NEXT: vpshufd {{.*#+}} xmm1 = xmm1[2,3,0,1]
|
||||
; AVX512-NEXT: vpslld $31, %xmm1, %xmm1
|
||||
; AVX512-NEXT: vptestmd %xmm1, %xmm1, %k1 {%k1}
|
||||
; AVX512-NEXT: vmovdqa32 %xmm0, %xmm0 {%k1} {z}
|
||||
; AVX512-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[1,1,2,3]
|
||||
; AVX512-NEXT: vpslld $31, %xmm0, %xmm0
|
||||
; AVX512-NEXT: vptestmd %xmm0, %xmm0, %k0 {%k1}
|
||||
; AVX512-NEXT: kmovd %k0, %eax
|
||||
; AVX512-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX512-NEXT: vzeroupper
|
||||
; AVX512-NEXT: retq
|
||||
%a = fcmp oge <4 x double> %x, %y
|
||||
%s1 = shufflevector <4 x i1> %a, <4 x i1> undef, <4 x i32> <i32 2, i32 3, i32 undef, i32 undef>
|
||||
%b = and <4 x i1> %s1, %a
|
||||
%s2 = shufflevector <4 x i1> %b, <4 x i1> undef, <4 x i32> <i32 1, i32 undef, i32 undef, i32 undef>
|
||||
%c = and <4 x i1> %s2, %b
|
||||
%d = extractelement <4 x i1> %c, i32 0
|
||||
ret i1 %d
|
||||
}
|
||||
|
||||
define i1 @bool_reduction_v8f32(<8 x float> %x, <8 x float> %y) {
|
||||
; SSE-LABEL: bool_reduction_v8f32:
|
||||
; SSE: # %bb.0:
|
||||
; SSE-NEXT: cmpneqps %xmm3, %xmm1
|
||||
; SSE-NEXT: cmpneqps %xmm2, %xmm0
|
||||
; SSE-NEXT: packssdw %xmm1, %xmm0
|
||||
; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
|
||||
; SSE-NEXT: pand %xmm0, %xmm1
|
||||
; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm1[1,1,2,3]
|
||||
; SSE-NEXT: pand %xmm0, %xmm1
|
||||
; SSE-NEXT: pand %xmm0, %xmm1
|
||||
; SSE-NEXT: pextrb $0, %xmm1, %eax
|
||||
; SSE-NEXT: # kill: def $al killed $al killed $eax
|
||||
; SSE-NEXT: retq
|
||||
;
|
||||
; AVX-LABEL: bool_reduction_v8f32:
|
||||
; AVX: # %bb.0:
|
||||
; AVX-NEXT: vcmpneqps %ymm1, %ymm0, %ymm0
|
||||
; AVX-NEXT: vextractf128 $1, %ymm0, %xmm1
|
||||
; AVX-NEXT: vpackssdw %xmm1, %xmm0, %xmm0
|
||||
; AVX-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
|
||||
; AVX-NEXT: vpand %xmm0, %xmm1, %xmm0
|
||||
; AVX-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
|
||||
; AVX-NEXT: vpand %xmm1, %xmm0, %xmm0
|
||||
; AVX-NEXT: vpand %xmm0, %xmm1, %xmm0
|
||||
; AVX-NEXT: vpextrb $0, %xmm0, %eax
|
||||
; AVX-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX-NEXT: vzeroupper
|
||||
; AVX-NEXT: retq
|
||||
;
|
||||
; AVX512-LABEL: bool_reduction_v8f32:
|
||||
; AVX512: # %bb.0:
|
||||
; AVX512-NEXT: vcmpneqps %ymm1, %ymm0, %k1
|
||||
; AVX512-NEXT: vpcmpeqd %ymm0, %ymm0, %ymm0
|
||||
; AVX512-NEXT: vmovdqa32 %ymm0, %ymm1 {%k1} {z}
|
||||
; AVX512-NEXT: vextracti128 $1, %ymm1, %xmm1
|
||||
; AVX512-NEXT: vpslld $31, %ymm1, %ymm1
|
||||
; AVX512-NEXT: vptestmd %ymm1, %ymm1, %k1 {%k1}
|
||||
; AVX512-NEXT: vmovdqa32 %ymm0, %ymm0 {%k1} {z}
|
||||
; AVX512-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[2,3,0,1]
|
||||
; AVX512-NEXT: vpslld $31, %ymm0, %ymm0
|
||||
; AVX512-NEXT: vptestmd %ymm0, %ymm0, %k1 {%k1}
|
||||
; AVX512-NEXT: vptestmd %ymm0, %ymm0, %k0 {%k1}
|
||||
; AVX512-NEXT: kmovd %k0, %eax
|
||||
; AVX512-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX512-NEXT: vzeroupper
|
||||
; AVX512-NEXT: retq
|
||||
%a = fcmp une <8 x float> %x, %y
|
||||
%s1 = shufflevector <8 x i1> %a, <8 x i1> undef, <8 x i32> <i32 4, i32 5, i32 6, i32 7, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%b = and <8 x i1> %s1, %a
|
||||
%s2 = shufflevector <8 x i1> %b, <8 x i1> undef, <8 x i32> <i32 2, i32 3, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%c = and <8 x i1> %s2, %b
|
||||
%s3 = shufflevector <8 x i1> %c, <8 x i1> undef, <8 x i32> <i32 1, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%d = and <8 x i1> %s2, %c
|
||||
%e = extractelement <8 x i1> %d, i32 0
|
||||
ret i1 %e
|
||||
}
|
||||
|
||||
define i1 @bool_reduction_v2i64(<2 x i64> %x, <2 x i64> %y) {
|
||||
; SSE-LABEL: bool_reduction_v2i64:
|
||||
; SSE: # %bb.0:
|
||||
; SSE-NEXT: movdqa {{.*#+}} xmm2 = [9223372036854775808,9223372036854775808]
|
||||
; SSE-NEXT: pxor %xmm2, %xmm1
|
||||
; SSE-NEXT: pxor %xmm2, %xmm0
|
||||
; SSE-NEXT: pcmpgtq %xmm1, %xmm0
|
||||
; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
|
||||
; SSE-NEXT: pand %xmm0, %xmm1
|
||||
; SSE-NEXT: pextrb $0, %xmm1, %eax
|
||||
; SSE-NEXT: # kill: def $al killed $al killed $eax
|
||||
; SSE-NEXT: retq
|
||||
;
|
||||
; AVX-LABEL: bool_reduction_v2i64:
|
||||
; AVX: # %bb.0:
|
||||
; AVX-NEXT: vmovdqa {{.*#+}} xmm2 = [9223372036854775808,9223372036854775808]
|
||||
; AVX-NEXT: vpxor %xmm2, %xmm1, %xmm1
|
||||
; AVX-NEXT: vpxor %xmm2, %xmm0, %xmm0
|
||||
; AVX-NEXT: vpcmpgtq %xmm1, %xmm0, %xmm0
|
||||
; AVX-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
|
||||
; AVX-NEXT: vpand %xmm1, %xmm0, %xmm0
|
||||
; AVX-NEXT: vpextrb $0, %xmm0, %eax
|
||||
; AVX-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX-NEXT: retq
|
||||
;
|
||||
; AVX512-LABEL: bool_reduction_v2i64:
|
||||
; AVX512: # %bb.0:
|
||||
; AVX512-NEXT: vpcmpnleuq %xmm1, %xmm0, %k1
|
||||
; AVX512-NEXT: vpcmpeqd %xmm0, %xmm0, %xmm0
|
||||
; AVX512-NEXT: vmovdqa64 %xmm0, %xmm0 {%k1} {z}
|
||||
; AVX512-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[2,3,0,1]
|
||||
; AVX512-NEXT: vpsllq $63, %xmm0, %xmm0
|
||||
; AVX512-NEXT: vptestmq %xmm0, %xmm0, %k0 {%k1}
|
||||
; AVX512-NEXT: kmovd %k0, %eax
|
||||
; AVX512-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX512-NEXT: retq
|
||||
%a = icmp ugt <2 x i64> %x, %y
|
||||
%b = shufflevector <2 x i1> %a, <2 x i1> undef, <2 x i32> <i32 1, i32 undef>
|
||||
%c = and <2 x i1> %a, %b
|
||||
%d = extractelement <2 x i1> %c, i32 0
|
||||
ret i1 %d
|
||||
}
|
||||
|
||||
define i1 @bool_reduction_v4i32(<4 x i32> %x, <4 x i32> %y) {
|
||||
; SSE-LABEL: bool_reduction_v4i32:
|
||||
; SSE: # %bb.0:
|
||||
; SSE-NEXT: pcmpeqd %xmm1, %xmm0
|
||||
; SSE-NEXT: pcmpeqd %xmm1, %xmm1
|
||||
; SSE-NEXT: pxor %xmm0, %xmm1
|
||||
; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm1[2,3,0,1]
|
||||
; SSE-NEXT: pandn %xmm1, %xmm0
|
||||
; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
|
||||
; SSE-NEXT: pand %xmm0, %xmm1
|
||||
; SSE-NEXT: pextrb $0, %xmm1, %eax
|
||||
; SSE-NEXT: # kill: def $al killed $al killed $eax
|
||||
; SSE-NEXT: retq
|
||||
;
|
||||
; AVX-LABEL: bool_reduction_v4i32:
|
||||
; AVX: # %bb.0:
|
||||
; AVX-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
|
||||
; AVX-NEXT: vpcmpeqd %xmm1, %xmm1, %xmm1
|
||||
; AVX-NEXT: vpxor %xmm1, %xmm0, %xmm1
|
||||
; AVX-NEXT: vpshufd {{.*#+}} xmm1 = xmm1[2,3,0,1]
|
||||
; AVX-NEXT: vpandn %xmm1, %xmm0, %xmm0
|
||||
; AVX-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
|
||||
; AVX-NEXT: vpand %xmm0, %xmm1, %xmm0
|
||||
; AVX-NEXT: vpextrb $0, %xmm0, %eax
|
||||
; AVX-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX-NEXT: retq
|
||||
;
|
||||
; AVX512-LABEL: bool_reduction_v4i32:
|
||||
; AVX512: # %bb.0:
|
||||
; AVX512-NEXT: vpcmpneqd %xmm1, %xmm0, %k1
|
||||
; AVX512-NEXT: vpcmpeqd %xmm0, %xmm0, %xmm0
|
||||
; AVX512-NEXT: vmovdqa32 %xmm0, %xmm1 {%k1} {z}
|
||||
; AVX512-NEXT: vpshufd {{.*#+}} xmm1 = xmm1[2,3,0,1]
|
||||
; AVX512-NEXT: vpslld $31, %xmm1, %xmm1
|
||||
; AVX512-NEXT: vptestmd %xmm1, %xmm1, %k1 {%k1}
|
||||
; AVX512-NEXT: vmovdqa32 %xmm0, %xmm0 {%k1} {z}
|
||||
; AVX512-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[1,1,2,3]
|
||||
; AVX512-NEXT: vpslld $31, %xmm0, %xmm0
|
||||
; AVX512-NEXT: vptestmd %xmm0, %xmm0, %k0 {%k1}
|
||||
; AVX512-NEXT: kmovd %k0, %eax
|
||||
; AVX512-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX512-NEXT: retq
|
||||
%a = icmp ne <4 x i32> %x, %y
|
||||
%s1 = shufflevector <4 x i1> %a, <4 x i1> undef, <4 x i32> <i32 2, i32 3, i32 undef, i32 undef>
|
||||
%b = and <4 x i1> %s1, %a
|
||||
%s2 = shufflevector <4 x i1> %b, <4 x i1> undef, <4 x i32> <i32 1, i32 undef, i32 undef, i32 undef>
|
||||
%c = and <4 x i1> %s2, %b
|
||||
%d = extractelement <4 x i1> %c, i32 0
|
||||
ret i1 %d
|
||||
}
|
||||
|
||||
define i1 @bool_reduction_v8i16(<8 x i16> %x, <8 x i16> %y) {
|
||||
; SSE-LABEL: bool_reduction_v8i16:
|
||||
; SSE: # %bb.0:
|
||||
; SSE-NEXT: pcmpgtw %xmm0, %xmm1
|
||||
; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm1[2,3,0,1]
|
||||
; SSE-NEXT: pand %xmm1, %xmm0
|
||||
; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
|
||||
; SSE-NEXT: pand %xmm0, %xmm1
|
||||
; SSE-NEXT: movdqa %xmm1, %xmm0
|
||||
; SSE-NEXT: psrld $16, %xmm0
|
||||
; SSE-NEXT: pand %xmm1, %xmm0
|
||||
; SSE-NEXT: pextrb $0, %xmm0, %eax
|
||||
; SSE-NEXT: # kill: def $al killed $al killed $eax
|
||||
; SSE-NEXT: retq
|
||||
;
|
||||
; AVX-LABEL: bool_reduction_v8i16:
|
||||
; AVX: # %bb.0:
|
||||
; AVX-NEXT: vpcmpgtw %xmm0, %xmm1, %xmm0
|
||||
; AVX-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
|
||||
; AVX-NEXT: vpand %xmm0, %xmm1, %xmm0
|
||||
; AVX-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
|
||||
; AVX-NEXT: vpand %xmm0, %xmm1, %xmm0
|
||||
; AVX-NEXT: vpsrld $16, %xmm0, %xmm1
|
||||
; AVX-NEXT: vpand %xmm0, %xmm1, %xmm0
|
||||
; AVX-NEXT: vpextrb $0, %xmm0, %eax
|
||||
; AVX-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX-NEXT: retq
|
||||
;
|
||||
; AVX512-LABEL: bool_reduction_v8i16:
|
||||
; AVX512: # %bb.0:
|
||||
; AVX512-NEXT: vpcmpgtw %xmm0, %xmm1, %k1
|
||||
; AVX512-NEXT: vpcmpeqd %ymm0, %ymm0, %ymm0
|
||||
; AVX512-NEXT: vmovdqa32 %ymm0, %ymm1 {%k1} {z}
|
||||
; AVX512-NEXT: vextracti128 $1, %ymm1, %xmm1
|
||||
; AVX512-NEXT: vpslld $31, %ymm1, %ymm1
|
||||
; AVX512-NEXT: vptestmd %ymm1, %ymm1, %k1 {%k1}
|
||||
; AVX512-NEXT: vmovdqa32 %ymm0, %ymm1 {%k1} {z}
|
||||
; AVX512-NEXT: vpshufd {{.*#+}} xmm1 = xmm1[2,3,0,1]
|
||||
; AVX512-NEXT: vpslld $31, %ymm1, %ymm1
|
||||
; AVX512-NEXT: vptestmd %ymm1, %ymm1, %k1 {%k1}
|
||||
; AVX512-NEXT: vmovdqa32 %ymm0, %ymm0 {%k1} {z}
|
||||
; AVX512-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[1,1,2,3]
|
||||
; AVX512-NEXT: vpslld $31, %ymm0, %ymm0
|
||||
; AVX512-NEXT: vptestmd %ymm0, %ymm0, %k0 {%k1}
|
||||
; AVX512-NEXT: kmovd %k0, %eax
|
||||
; AVX512-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX512-NEXT: vzeroupper
|
||||
; AVX512-NEXT: retq
|
||||
%a = icmp slt <8 x i16> %x, %y
|
||||
%s1 = shufflevector <8 x i1> %a, <8 x i1> undef, <8 x i32> <i32 4, i32 5, i32 6, i32 7, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%b = and <8 x i1> %s1, %a
|
||||
%s2 = shufflevector <8 x i1> %b, <8 x i1> undef, <8 x i32> <i32 2, i32 3, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%c = and <8 x i1> %s2, %b
|
||||
%s3 = shufflevector <8 x i1> %c, <8 x i1> undef, <8 x i32> <i32 1, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%d = and <8 x i1> %s3, %c
|
||||
%e = extractelement <8 x i1> %d, i32 0
|
||||
ret i1 %e
|
||||
}
|
||||
|
||||
define i1 @bool_reduction_v16i8(<16 x i8> %x, <16 x i8> %y) {
|
||||
; SSE-LABEL: bool_reduction_v16i8:
|
||||
; SSE: # %bb.0:
|
||||
; SSE-NEXT: pcmpgtb %xmm1, %xmm0
|
||||
; SSE-NEXT: pmovmskb %xmm0, %eax
|
||||
; SSE-NEXT: xorl %ecx, %ecx
|
||||
; SSE-NEXT: cmpl $65535, %eax # imm = 0xFFFF
|
||||
; SSE-NEXT: movl $-1, %eax
|
||||
; SSE-NEXT: cmovnel %ecx, %eax
|
||||
; SSE-NEXT: # kill: def $al killed $al killed $eax
|
||||
; SSE-NEXT: retq
|
||||
;
|
||||
; AVX-LABEL: bool_reduction_v16i8:
|
||||
; AVX: # %bb.0:
|
||||
; AVX-NEXT: vpcmpgtb %xmm1, %xmm0, %xmm0
|
||||
; AVX-NEXT: vpmovmskb %xmm0, %eax
|
||||
; AVX-NEXT: xorl %ecx, %ecx
|
||||
; AVX-NEXT: cmpl $65535, %eax # imm = 0xFFFF
|
||||
; AVX-NEXT: movl $-1, %eax
|
||||
; AVX-NEXT: cmovnel %ecx, %eax
|
||||
; AVX-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX-NEXT: retq
|
||||
;
|
||||
; AVX512-LABEL: bool_reduction_v16i8:
|
||||
; AVX512: # %bb.0:
|
||||
; AVX512-NEXT: vpcmpgtb %xmm1, %xmm0, %k0
|
||||
; AVX512-NEXT: kshiftrw $8, %k0, %k1
|
||||
; AVX512-NEXT: vpcmpgtb %xmm1, %xmm0, %k0 {%k1}
|
||||
; AVX512-NEXT: kshiftrw $4, %k0, %k1
|
||||
; AVX512-NEXT: kandw %k0, %k1, %k0
|
||||
; AVX512-NEXT: kshiftrw $2, %k0, %k1
|
||||
; AVX512-NEXT: kandw %k0, %k1, %k0
|
||||
; AVX512-NEXT: kshiftrw $1, %k0, %k1
|
||||
; AVX512-NEXT: kandw %k0, %k1, %k0
|
||||
; AVX512-NEXT: kmovd %k0, %eax
|
||||
; AVX512-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX512-NEXT: retq
|
||||
%a = icmp sgt <16 x i8> %x, %y
|
||||
%s1 = shufflevector <16 x i1> %a, <16 x i1> undef, <16 x i32> <i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%b = and <16 x i1> %s1, %a
|
||||
%s2 = shufflevector <16 x i1> %b, <16 x i1> undef, <16 x i32> <i32 4, i32 5, i32 6, i32 7, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%c = and <16 x i1> %s2, %b
|
||||
%s3 = shufflevector <16 x i1> %c, <16 x i1> undef, <16 x i32> <i32 2, i32 3, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%d = and <16 x i1> %s3, %c
|
||||
%s4 = shufflevector <16 x i1> %d, <16 x i1> undef, <16 x i32> <i32 1, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%e = and <16 x i1> %s4, %d
|
||||
%f = extractelement <16 x i1> %e, i32 0
|
||||
ret i1 %f
|
||||
}
|
||||
|
||||
define i1 @bool_reduction_v4i64(<4 x i64> %x, <4 x i64> %y) {
|
||||
; SSE-LABEL: bool_reduction_v4i64:
|
||||
; SSE: # %bb.0:
|
||||
; SSE-NEXT: pcmpgtq %xmm1, %xmm3
|
||||
; SSE-NEXT: pcmpgtq %xmm0, %xmm2
|
||||
; SSE-NEXT: shufps {{.*#+}} xmm2 = xmm2[0,2],xmm3[0,2]
|
||||
; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm2[2,3,0,1]
|
||||
; SSE-NEXT: pand %xmm2, %xmm0
|
||||
; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
|
||||
; SSE-NEXT: pand %xmm0, %xmm1
|
||||
; SSE-NEXT: pextrb $0, %xmm1, %eax
|
||||
; SSE-NEXT: # kill: def $al killed $al killed $eax
|
||||
; SSE-NEXT: retq
|
||||
;
|
||||
; AVX1-LABEL: bool_reduction_v4i64:
|
||||
; AVX1: # %bb.0:
|
||||
; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2
|
||||
; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm3
|
||||
; AVX1-NEXT: vpcmpgtq %xmm2, %xmm3, %xmm2
|
||||
; AVX1-NEXT: vpcmpgtq %xmm0, %xmm1, %xmm0
|
||||
; AVX1-NEXT: vpackssdw %xmm2, %xmm0, %xmm1
|
||||
; AVX1-NEXT: vpackssdw %xmm0, %xmm2, %xmm0
|
||||
; AVX1-NEXT: vpand %xmm1, %xmm0, %xmm0
|
||||
; AVX1-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
|
||||
; AVX1-NEXT: vpand %xmm0, %xmm1, %xmm0
|
||||
; AVX1-NEXT: vpextrb $0, %xmm0, %eax
|
||||
; AVX1-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX1-NEXT: vzeroupper
|
||||
; AVX1-NEXT: retq
|
||||
;
|
||||
; AVX2-LABEL: bool_reduction_v4i64:
|
||||
; AVX2: # %bb.0:
|
||||
; AVX2-NEXT: vpcmpgtq %ymm0, %ymm1, %ymm0
|
||||
; AVX2-NEXT: vextracti128 $1, %ymm0, %xmm1
|
||||
; AVX2-NEXT: vpackssdw %xmm1, %xmm0, %xmm2
|
||||
; AVX2-NEXT: vpackssdw %xmm0, %xmm1, %xmm0
|
||||
; AVX2-NEXT: vpand %xmm2, %xmm0, %xmm0
|
||||
; AVX2-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
|
||||
; AVX2-NEXT: vpand %xmm0, %xmm1, %xmm0
|
||||
; AVX2-NEXT: vpextrb $0, %xmm0, %eax
|
||||
; AVX2-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX2-NEXT: vzeroupper
|
||||
; AVX2-NEXT: retq
|
||||
;
|
||||
; AVX512-LABEL: bool_reduction_v4i64:
|
||||
; AVX512: # %bb.0:
|
||||
; AVX512-NEXT: vpcmpgtq %ymm0, %ymm1, %k1
|
||||
; AVX512-NEXT: vpcmpeqd %xmm0, %xmm0, %xmm0
|
||||
; AVX512-NEXT: vmovdqa32 %xmm0, %xmm1 {%k1} {z}
|
||||
; AVX512-NEXT: vpshufd {{.*#+}} xmm1 = xmm1[2,3,0,1]
|
||||
; AVX512-NEXT: vpslld $31, %xmm1, %xmm1
|
||||
; AVX512-NEXT: vptestmd %xmm1, %xmm1, %k1 {%k1}
|
||||
; AVX512-NEXT: vmovdqa32 %xmm0, %xmm0 {%k1} {z}
|
||||
; AVX512-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[1,1,2,3]
|
||||
; AVX512-NEXT: vpslld $31, %xmm0, %xmm0
|
||||
; AVX512-NEXT: vptestmd %xmm0, %xmm0, %k0 {%k1}
|
||||
; AVX512-NEXT: kmovd %k0, %eax
|
||||
; AVX512-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX512-NEXT: vzeroupper
|
||||
; AVX512-NEXT: retq
|
||||
%a = icmp slt <4 x i64> %x, %y
|
||||
%s1 = shufflevector <4 x i1> %a, <4 x i1> undef, <4 x i32> <i32 2, i32 3, i32 undef, i32 undef>
|
||||
%b = and <4 x i1> %s1, %a
|
||||
%s2 = shufflevector <4 x i1> %b, <4 x i1> undef, <4 x i32> <i32 1, i32 undef, i32 undef, i32 undef>
|
||||
%c = and <4 x i1> %s2, %b
|
||||
%d = extractelement <4 x i1> %c, i32 0
|
||||
ret i1 %d
|
||||
}
|
||||
|
||||
define i1 @bool_reduction_v8i32(<8 x i32> %x, <8 x i32> %y) {
|
||||
; SSE-LABEL: bool_reduction_v8i32:
|
||||
; SSE: # %bb.0:
|
||||
; SSE-NEXT: pminud %xmm1, %xmm3
|
||||
; SSE-NEXT: pcmpeqd %xmm1, %xmm3
|
||||
; SSE-NEXT: pminud %xmm0, %xmm2
|
||||
; SSE-NEXT: pcmpeqd %xmm0, %xmm2
|
||||
; SSE-NEXT: packssdw %xmm3, %xmm2
|
||||
; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm2[2,3,0,1]
|
||||
; SSE-NEXT: pand %xmm2, %xmm0
|
||||
; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
|
||||
; SSE-NEXT: pand %xmm0, %xmm1
|
||||
; SSE-NEXT: movdqa %xmm1, %xmm0
|
||||
; SSE-NEXT: psrld $16, %xmm0
|
||||
; SSE-NEXT: pand %xmm1, %xmm0
|
||||
; SSE-NEXT: pextrb $0, %xmm0, %eax
|
||||
; SSE-NEXT: # kill: def $al killed $al killed $eax
|
||||
; SSE-NEXT: retq
|
||||
;
|
||||
; AVX1-LABEL: bool_reduction_v8i32:
|
||||
; AVX1: # %bb.0:
|
||||
; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm2
|
||||
; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm3
|
||||
; AVX1-NEXT: vpminud %xmm2, %xmm3, %xmm2
|
||||
; AVX1-NEXT: vpcmpeqd %xmm2, %xmm3, %xmm2
|
||||
; AVX1-NEXT: vpminud %xmm1, %xmm0, %xmm1
|
||||
; AVX1-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
|
||||
; AVX1-NEXT: vpackssdw %xmm2, %xmm0, %xmm0
|
||||
; AVX1-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
|
||||
; AVX1-NEXT: vpand %xmm0, %xmm1, %xmm0
|
||||
; AVX1-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
|
||||
; AVX1-NEXT: vpand %xmm0, %xmm1, %xmm0
|
||||
; AVX1-NEXT: vpsrld $16, %xmm0, %xmm1
|
||||
; AVX1-NEXT: vpand %xmm0, %xmm1, %xmm0
|
||||
; AVX1-NEXT: vpextrb $0, %xmm0, %eax
|
||||
; AVX1-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX1-NEXT: vzeroupper
|
||||
; AVX1-NEXT: retq
|
||||
;
|
||||
; AVX2-LABEL: bool_reduction_v8i32:
|
||||
; AVX2: # %bb.0:
|
||||
; AVX2-NEXT: vpminud %ymm1, %ymm0, %ymm1
|
||||
; AVX2-NEXT: vpcmpeqd %ymm1, %ymm0, %ymm0
|
||||
; AVX2-NEXT: vextracti128 $1, %ymm0, %xmm1
|
||||
; AVX2-NEXT: vpackssdw %xmm1, %xmm0, %xmm0
|
||||
; AVX2-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
|
||||
; AVX2-NEXT: vpand %xmm0, %xmm1, %xmm0
|
||||
; AVX2-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
|
||||
; AVX2-NEXT: vpand %xmm0, %xmm1, %xmm0
|
||||
; AVX2-NEXT: vpsrld $16, %xmm0, %xmm1
|
||||
; AVX2-NEXT: vpand %xmm0, %xmm1, %xmm0
|
||||
; AVX2-NEXT: vpextrb $0, %xmm0, %eax
|
||||
; AVX2-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX2-NEXT: vzeroupper
|
||||
; AVX2-NEXT: retq
|
||||
;
|
||||
; AVX512-LABEL: bool_reduction_v8i32:
|
||||
; AVX512: # %bb.0:
|
||||
; AVX512-NEXT: vpcmpleud %ymm1, %ymm0, %k1
|
||||
; AVX512-NEXT: vpcmpeqd %ymm0, %ymm0, %ymm0
|
||||
; AVX512-NEXT: vmovdqa32 %ymm0, %ymm1 {%k1} {z}
|
||||
; AVX512-NEXT: vextracti128 $1, %ymm1, %xmm1
|
||||
; AVX512-NEXT: vpslld $31, %ymm1, %ymm1
|
||||
; AVX512-NEXT: vptestmd %ymm1, %ymm1, %k1 {%k1}
|
||||
; AVX512-NEXT: vmovdqa32 %ymm0, %ymm1 {%k1} {z}
|
||||
; AVX512-NEXT: vpshufd {{.*#+}} xmm1 = xmm1[2,3,0,1]
|
||||
; AVX512-NEXT: vpslld $31, %ymm1, %ymm1
|
||||
; AVX512-NEXT: vptestmd %ymm1, %ymm1, %k1 {%k1}
|
||||
; AVX512-NEXT: vmovdqa32 %ymm0, %ymm0 {%k1} {z}
|
||||
; AVX512-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[1,1,2,3]
|
||||
; AVX512-NEXT: vpslld $31, %ymm0, %ymm0
|
||||
; AVX512-NEXT: vptestmd %ymm0, %ymm0, %k0 {%k1}
|
||||
; AVX512-NEXT: kmovd %k0, %eax
|
||||
; AVX512-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX512-NEXT: vzeroupper
|
||||
; AVX512-NEXT: retq
|
||||
%a = icmp ule <8 x i32> %x, %y
|
||||
%s1 = shufflevector <8 x i1> %a, <8 x i1> undef, <8 x i32> <i32 4, i32 5, i32 6, i32 7, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%b = and <8 x i1> %s1, %a
|
||||
%s2 = shufflevector <8 x i1> %b, <8 x i1> undef, <8 x i32> <i32 2, i32 3, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%c = and <8 x i1> %s2, %b
|
||||
%s3 = shufflevector <8 x i1> %c, <8 x i1> undef, <8 x i32> <i32 1, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%d = and <8 x i1> %s3, %c
|
||||
%e = extractelement <8 x i1> %d, i32 0
|
||||
ret i1 %e
|
||||
}
|
||||
|
||||
define i1 @bool_reduction_v16i16(<16 x i16> %x, <16 x i16> %y) {
|
||||
; SSE-LABEL: bool_reduction_v16i16:
|
||||
; SSE: # %bb.0:
|
||||
; SSE-NEXT: pcmpeqw %xmm3, %xmm1
|
||||
; SSE-NEXT: pcmpeqw %xmm2, %xmm0
|
||||
; SSE-NEXT: packsswb %xmm1, %xmm0
|
||||
; SSE-NEXT: pmovmskb %xmm0, %eax
|
||||
; SSE-NEXT: xorl %ecx, %ecx
|
||||
; SSE-NEXT: cmpl $65535, %eax # imm = 0xFFFF
|
||||
; SSE-NEXT: movl $-1, %eax
|
||||
; SSE-NEXT: cmovnel %ecx, %eax
|
||||
; SSE-NEXT: # kill: def $al killed $al killed $eax
|
||||
; SSE-NEXT: retq
|
||||
;
|
||||
; AVX1-LABEL: bool_reduction_v16i16:
|
||||
; AVX1: # %bb.0:
|
||||
; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm2
|
||||
; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm3
|
||||
; AVX1-NEXT: vpcmpeqw %xmm2, %xmm3, %xmm2
|
||||
; AVX1-NEXT: vpcmpeqw %xmm1, %xmm0, %xmm0
|
||||
; AVX1-NEXT: vpacksswb %xmm2, %xmm0, %xmm0
|
||||
; AVX1-NEXT: vpmovmskb %xmm0, %eax
|
||||
; AVX1-NEXT: xorl %ecx, %ecx
|
||||
; AVX1-NEXT: cmpl $65535, %eax # imm = 0xFFFF
|
||||
; AVX1-NEXT: movl $-1, %eax
|
||||
; AVX1-NEXT: cmovnel %ecx, %eax
|
||||
; AVX1-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX1-NEXT: vzeroupper
|
||||
; AVX1-NEXT: retq
|
||||
;
|
||||
; AVX2-LABEL: bool_reduction_v16i16:
|
||||
; AVX2: # %bb.0:
|
||||
; AVX2-NEXT: vpcmpeqw %ymm1, %ymm0, %ymm0
|
||||
; AVX2-NEXT: vextracti128 $1, %ymm0, %xmm1
|
||||
; AVX2-NEXT: vpacksswb %xmm1, %xmm0, %xmm0
|
||||
; AVX2-NEXT: vpmovmskb %xmm0, %eax
|
||||
; AVX2-NEXT: xorl %ecx, %ecx
|
||||
; AVX2-NEXT: cmpl $65535, %eax # imm = 0xFFFF
|
||||
; AVX2-NEXT: movl $-1, %eax
|
||||
; AVX2-NEXT: cmovnel %ecx, %eax
|
||||
; AVX2-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX2-NEXT: vzeroupper
|
||||
; AVX2-NEXT: retq
|
||||
;
|
||||
; AVX512-LABEL: bool_reduction_v16i16:
|
||||
; AVX512: # %bb.0:
|
||||
; AVX512-NEXT: vpcmpeqw %ymm1, %ymm0, %k0
|
||||
; AVX512-NEXT: kshiftrw $8, %k0, %k1
|
||||
; AVX512-NEXT: vpcmpeqw %ymm1, %ymm0, %k0 {%k1}
|
||||
; AVX512-NEXT: kshiftrw $4, %k0, %k1
|
||||
; AVX512-NEXT: kandw %k0, %k1, %k0
|
||||
; AVX512-NEXT: kshiftrw $2, %k0, %k1
|
||||
; AVX512-NEXT: kandw %k0, %k1, %k0
|
||||
; AVX512-NEXT: kshiftrw $1, %k0, %k1
|
||||
; AVX512-NEXT: kandw %k0, %k1, %k0
|
||||
; AVX512-NEXT: kmovd %k0, %eax
|
||||
; AVX512-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX512-NEXT: vzeroupper
|
||||
; AVX512-NEXT: retq
|
||||
%a = icmp eq <16 x i16> %x, %y
|
||||
%s1 = shufflevector <16 x i1> %a, <16 x i1> undef, <16 x i32> <i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%b = and <16 x i1> %s1, %a
|
||||
%s2 = shufflevector <16 x i1> %b, <16 x i1> undef, <16 x i32> <i32 4, i32 5, i32 6, i32 7, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%c = and <16 x i1> %s2, %b
|
||||
%s3 = shufflevector <16 x i1> %c, <16 x i1> undef, <16 x i32> <i32 2, i32 3, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%d = and <16 x i1> %s3, %c
|
||||
%s4 = shufflevector <16 x i1> %d, <16 x i1> undef, <16 x i32> <i32 1, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%e = and <16 x i1> %s4, %d
|
||||
%f = extractelement <16 x i1> %e, i32 0
|
||||
ret i1 %f
|
||||
}
|
||||
|
||||
define i1 @bool_reduction_v32i8(<32 x i8> %x, <32 x i8> %y) {
|
||||
; SSE-LABEL: bool_reduction_v32i8:
|
||||
; SSE: # %bb.0:
|
||||
; SSE-NEXT: pcmpeqb %xmm2, %xmm0
|
||||
; SSE-NEXT: pcmpeqb %xmm3, %xmm1
|
||||
; SSE-NEXT: pand %xmm0, %xmm1
|
||||
; SSE-NEXT: pmovmskb %xmm1, %eax
|
||||
; SSE-NEXT: xorl %ecx, %ecx
|
||||
; SSE-NEXT: cmpl $65535, %eax # imm = 0xFFFF
|
||||
; SSE-NEXT: movl $-1, %eax
|
||||
; SSE-NEXT: cmovnel %ecx, %eax
|
||||
; SSE-NEXT: # kill: def $al killed $al killed $eax
|
||||
; SSE-NEXT: retq
|
||||
;
|
||||
; AVX1-LABEL: bool_reduction_v32i8:
|
||||
; AVX1: # %bb.0:
|
||||
; AVX1-NEXT: vpcmpeqb %xmm1, %xmm0, %xmm2
|
||||
; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm1
|
||||
; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm0
|
||||
; AVX1-NEXT: vpcmpeqb %xmm1, %xmm0, %xmm0
|
||||
; AVX1-NEXT: vpand %xmm2, %xmm0, %xmm0
|
||||
; AVX1-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
|
||||
; AVX1-NEXT: vpand %xmm0, %xmm1, %xmm0
|
||||
; AVX1-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
|
||||
; AVX1-NEXT: vpand %xmm0, %xmm1, %xmm0
|
||||
; AVX1-NEXT: vpsrld $16, %xmm0, %xmm1
|
||||
; AVX1-NEXT: vpand %xmm0, %xmm1, %xmm0
|
||||
; AVX1-NEXT: vpsrlw $8, %xmm0, %xmm1
|
||||
; AVX1-NEXT: vpand %xmm0, %xmm1, %xmm0
|
||||
; AVX1-NEXT: vpextrb $0, %xmm0, %eax
|
||||
; AVX1-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX1-NEXT: vzeroupper
|
||||
; AVX1-NEXT: retq
|
||||
;
|
||||
; AVX2-LABEL: bool_reduction_v32i8:
|
||||
; AVX2: # %bb.0:
|
||||
; AVX2-NEXT: vpcmpeqb %ymm1, %ymm0, %ymm0
|
||||
; AVX2-NEXT: vpmovmskb %ymm0, %ecx
|
||||
; AVX2-NEXT: xorl %eax, %eax
|
||||
; AVX2-NEXT: cmpl $-1, %ecx
|
||||
; AVX2-NEXT: cmovel %ecx, %eax
|
||||
; AVX2-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX2-NEXT: vzeroupper
|
||||
; AVX2-NEXT: retq
|
||||
;
|
||||
; AVX512-LABEL: bool_reduction_v32i8:
|
||||
; AVX512: # %bb.0:
|
||||
; AVX512-NEXT: vpcmpeqb %ymm1, %ymm0, %k0
|
||||
; AVX512-NEXT: kshiftrd $16, %k0, %k1
|
||||
; AVX512-NEXT: vpcmpeqb %ymm1, %ymm0, %k0 {%k1}
|
||||
; AVX512-NEXT: kshiftrd $8, %k0, %k1
|
||||
; AVX512-NEXT: kandd %k0, %k1, %k0
|
||||
; AVX512-NEXT: kshiftrd $4, %k0, %k1
|
||||
; AVX512-NEXT: kandd %k0, %k1, %k0
|
||||
; AVX512-NEXT: kshiftrd $2, %k0, %k1
|
||||
; AVX512-NEXT: kandd %k0, %k1, %k0
|
||||
; AVX512-NEXT: kshiftrd $1, %k0, %k1
|
||||
; AVX512-NEXT: kandd %k0, %k1, %k0
|
||||
; AVX512-NEXT: kmovd %k0, %eax
|
||||
; AVX512-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX512-NEXT: vzeroupper
|
||||
; AVX512-NEXT: retq
|
||||
%a = icmp eq <32 x i8> %x, %y
|
||||
%s1 = shufflevector <32 x i1> %a, <32 x i1> undef, <32 x i32> <i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%b = and <32 x i1> %s1, %a
|
||||
%s2 = shufflevector <32 x i1> %b, <32 x i1> undef, <32 x i32> <i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%c = and <32 x i1> %s2, %b
|
||||
%s3 = shufflevector <32 x i1> %c, <32 x i1> undef, <32 x i32> <i32 4, i32 5, i32 6, i32 7, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%d = and <32 x i1> %s3, %c
|
||||
%s4 = shufflevector <32 x i1> %d, <32 x i1> undef, <32 x i32> <i32 2, i32 3, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%e = and <32 x i1> %s4, %d
|
||||
%s5 = shufflevector <32 x i1> %e, <32 x i1> undef, <32 x i32> <i32 1, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%f = and <32 x i1> %s5, %e
|
||||
%g = extractelement <32 x i1> %f, i32 0
|
||||
ret i1 %g
|
||||
}
|
||||
|
@ -891,3 +891,719 @@ define i8 @test_v32i8_sext(<32 x i8> %a0, <32 x i8> %a1) {
|
||||
%11 = extractelement <32 x i8> %10, i32 0
|
||||
ret i8 %11
|
||||
}
|
||||
|
||||
define i1 @bool_reduction_v2f64(<2 x double> %x, <2 x double> %y) {
|
||||
; SSE-LABEL: bool_reduction_v2f64:
|
||||
; SSE: # %bb.0:
|
||||
; SSE-NEXT: cmpltpd %xmm0, %xmm1
|
||||
; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm1[2,3,0,1]
|
||||
; SSE-NEXT: por %xmm1, %xmm0
|
||||
; SSE-NEXT: pextrb $0, %xmm0, %eax
|
||||
; SSE-NEXT: # kill: def $al killed $al killed $eax
|
||||
; SSE-NEXT: retq
|
||||
;
|
||||
; AVX-LABEL: bool_reduction_v2f64:
|
||||
; AVX: # %bb.0:
|
||||
; AVX-NEXT: vcmpltpd %xmm0, %xmm1, %xmm0
|
||||
; AVX-NEXT: vpermilpd {{.*#+}} xmm1 = xmm0[1,0]
|
||||
; AVX-NEXT: vorpd %xmm1, %xmm0, %xmm0
|
||||
; AVX-NEXT: vpextrb $0, %xmm0, %eax
|
||||
; AVX-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX-NEXT: retq
|
||||
;
|
||||
; AVX512-LABEL: bool_reduction_v2f64:
|
||||
; AVX512: # %bb.0:
|
||||
; AVX512-NEXT: vcmpltpd %xmm0, %xmm1, %k1
|
||||
; AVX512-NEXT: vpcmpeqd %xmm0, %xmm0, %xmm0
|
||||
; AVX512-NEXT: vmovdqa64 %xmm0, %xmm0 {%k1} {z}
|
||||
; AVX512-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[2,3,0,1]
|
||||
; AVX512-NEXT: vpsllq $63, %xmm0, %xmm0
|
||||
; AVX512-NEXT: vptestmq %xmm0, %xmm0, %k0
|
||||
; AVX512-NEXT: korw %k0, %k1, %k0
|
||||
; AVX512-NEXT: kmovd %k0, %eax
|
||||
; AVX512-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX512-NEXT: retq
|
||||
%a = fcmp ogt <2 x double> %x, %y
|
||||
%b = shufflevector <2 x i1> %a, <2 x i1> undef, <2 x i32> <i32 1, i32 undef>
|
||||
%c = or <2 x i1> %a, %b
|
||||
%d = extractelement <2 x i1> %c, i32 0
|
||||
ret i1 %d
|
||||
}
|
||||
|
||||
define i1 @bool_reduction_v4f32(<4 x float> %x, <4 x float> %y) {
|
||||
; SSE-LABEL: bool_reduction_v4f32:
|
||||
; SSE: # %bb.0:
|
||||
; SSE-NEXT: cmpeqps %xmm1, %xmm0
|
||||
; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
|
||||
; SSE-NEXT: por %xmm0, %xmm1
|
||||
; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm1[1,1,2,3]
|
||||
; SSE-NEXT: por %xmm1, %xmm0
|
||||
; SSE-NEXT: pextrb $0, %xmm0, %eax
|
||||
; SSE-NEXT: # kill: def $al killed $al killed $eax
|
||||
; SSE-NEXT: retq
|
||||
;
|
||||
; AVX-LABEL: bool_reduction_v4f32:
|
||||
; AVX: # %bb.0:
|
||||
; AVX-NEXT: vcmpeqps %xmm1, %xmm0, %xmm0
|
||||
; AVX-NEXT: vpermilpd {{.*#+}} xmm1 = xmm0[1,0]
|
||||
; AVX-NEXT: vorpd %xmm0, %xmm1, %xmm0
|
||||
; AVX-NEXT: vpermilps {{.*#+}} xmm1 = xmm0[1,1,2,3]
|
||||
; AVX-NEXT: vorpd %xmm0, %xmm1, %xmm0
|
||||
; AVX-NEXT: vpextrb $0, %xmm0, %eax
|
||||
; AVX-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX-NEXT: retq
|
||||
;
|
||||
; AVX512-LABEL: bool_reduction_v4f32:
|
||||
; AVX512: # %bb.0:
|
||||
; AVX512-NEXT: vcmpeqps %xmm1, %xmm0, %k1
|
||||
; AVX512-NEXT: vpcmpeqd %xmm0, %xmm0, %xmm0
|
||||
; AVX512-NEXT: vmovdqa32 %xmm0, %xmm1 {%k1} {z}
|
||||
; AVX512-NEXT: vpshufd {{.*#+}} xmm1 = xmm1[2,3,0,1]
|
||||
; AVX512-NEXT: vpslld $31, %xmm1, %xmm1
|
||||
; AVX512-NEXT: vptestmd %xmm1, %xmm1, %k0
|
||||
; AVX512-NEXT: korw %k1, %k0, %k1
|
||||
; AVX512-NEXT: vmovdqa32 %xmm0, %xmm0 {%k1} {z}
|
||||
; AVX512-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[1,1,2,3]
|
||||
; AVX512-NEXT: vpslld $31, %xmm0, %xmm0
|
||||
; AVX512-NEXT: vptestmd %xmm0, %xmm0, %k0
|
||||
; AVX512-NEXT: korw %k1, %k0, %k0
|
||||
; AVX512-NEXT: kmovd %k0, %eax
|
||||
; AVX512-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX512-NEXT: retq
|
||||
%a = fcmp oeq <4 x float> %x, %y
|
||||
%s1 = shufflevector <4 x i1> %a, <4 x i1> undef, <4 x i32> <i32 2, i32 3, i32 undef, i32 undef>
|
||||
%b = or <4 x i1> %s1, %a
|
||||
%s2 = shufflevector <4 x i1> %b, <4 x i1> undef, <4 x i32> <i32 1, i32 undef, i32 undef, i32 undef>
|
||||
%c = or <4 x i1> %s2, %b
|
||||
%d = extractelement <4 x i1> %c, i32 0
|
||||
ret i1 %d
|
||||
}
|
||||
|
||||
define i1 @bool_reduction_v4f64(<4 x double> %x, <4 x double> %y) {
|
||||
; SSE-LABEL: bool_reduction_v4f64:
|
||||
; SSE: # %bb.0:
|
||||
; SSE-NEXT: cmplepd %xmm1, %xmm3
|
||||
; SSE-NEXT: cmplepd %xmm0, %xmm2
|
||||
; SSE-NEXT: movapd %xmm2, %xmm0
|
||||
; SSE-NEXT: shufps {{.*#+}} xmm0 = xmm0[0,2],xmm3[0,2]
|
||||
; SSE-NEXT: shufps {{.*#+}} xmm3 = xmm3[0,2],xmm2[0,2]
|
||||
; SSE-NEXT: orps %xmm0, %xmm3
|
||||
; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm3[1,1,2,3]
|
||||
; SSE-NEXT: por %xmm3, %xmm0
|
||||
; SSE-NEXT: pextrb $0, %xmm0, %eax
|
||||
; SSE-NEXT: # kill: def $al killed $al killed $eax
|
||||
; SSE-NEXT: retq
|
||||
;
|
||||
; AVX-LABEL: bool_reduction_v4f64:
|
||||
; AVX: # %bb.0:
|
||||
; AVX-NEXT: vcmplepd %ymm0, %ymm1, %ymm0
|
||||
; AVX-NEXT: vextractf128 $1, %ymm0, %xmm1
|
||||
; AVX-NEXT: vpackssdw %xmm1, %xmm0, %xmm2
|
||||
; AVX-NEXT: vpackssdw %xmm0, %xmm1, %xmm0
|
||||
; AVX-NEXT: vpor %xmm2, %xmm0, %xmm0
|
||||
; AVX-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
|
||||
; AVX-NEXT: vpor %xmm0, %xmm1, %xmm0
|
||||
; AVX-NEXT: vpextrb $0, %xmm0, %eax
|
||||
; AVX-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX-NEXT: vzeroupper
|
||||
; AVX-NEXT: retq
|
||||
;
|
||||
; AVX512-LABEL: bool_reduction_v4f64:
|
||||
; AVX512: # %bb.0:
|
||||
; AVX512-NEXT: vcmplepd %ymm0, %ymm1, %k1
|
||||
; AVX512-NEXT: vpcmpeqd %xmm0, %xmm0, %xmm0
|
||||
; AVX512-NEXT: vmovdqa32 %xmm0, %xmm1 {%k1} {z}
|
||||
; AVX512-NEXT: vpshufd {{.*#+}} xmm1 = xmm1[2,3,0,1]
|
||||
; AVX512-NEXT: vpslld $31, %xmm1, %xmm1
|
||||
; AVX512-NEXT: vptestmd %xmm1, %xmm1, %k0
|
||||
; AVX512-NEXT: korw %k1, %k0, %k1
|
||||
; AVX512-NEXT: vmovdqa32 %xmm0, %xmm0 {%k1} {z}
|
||||
; AVX512-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[1,1,2,3]
|
||||
; AVX512-NEXT: vpslld $31, %xmm0, %xmm0
|
||||
; AVX512-NEXT: vptestmd %xmm0, %xmm0, %k0
|
||||
; AVX512-NEXT: korw %k1, %k0, %k0
|
||||
; AVX512-NEXT: kmovd %k0, %eax
|
||||
; AVX512-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX512-NEXT: vzeroupper
|
||||
; AVX512-NEXT: retq
|
||||
%a = fcmp oge <4 x double> %x, %y
|
||||
%s1 = shufflevector <4 x i1> %a, <4 x i1> undef, <4 x i32> <i32 2, i32 3, i32 undef, i32 undef>
|
||||
%b = or <4 x i1> %s1, %a
|
||||
%s2 = shufflevector <4 x i1> %b, <4 x i1> undef, <4 x i32> <i32 1, i32 undef, i32 undef, i32 undef>
|
||||
%c = or <4 x i1> %s2, %b
|
||||
%d = extractelement <4 x i1> %c, i32 0
|
||||
ret i1 %d
|
||||
}
|
||||
|
||||
define i1 @bool_reduction_v8f32(<8 x float> %x, <8 x float> %y) {
|
||||
; SSE-LABEL: bool_reduction_v8f32:
|
||||
; SSE: # %bb.0:
|
||||
; SSE-NEXT: cmpneqps %xmm3, %xmm1
|
||||
; SSE-NEXT: cmpneqps %xmm2, %xmm0
|
||||
; SSE-NEXT: packssdw %xmm1, %xmm0
|
||||
; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
|
||||
; SSE-NEXT: por %xmm0, %xmm1
|
||||
; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm1[1,1,2,3]
|
||||
; SSE-NEXT: por %xmm0, %xmm1
|
||||
; SSE-NEXT: por %xmm0, %xmm1
|
||||
; SSE-NEXT: pextrb $0, %xmm1, %eax
|
||||
; SSE-NEXT: # kill: def $al killed $al killed $eax
|
||||
; SSE-NEXT: retq
|
||||
;
|
||||
; AVX-LABEL: bool_reduction_v8f32:
|
||||
; AVX: # %bb.0:
|
||||
; AVX-NEXT: vcmpneqps %ymm1, %ymm0, %ymm0
|
||||
; AVX-NEXT: vextractf128 $1, %ymm0, %xmm1
|
||||
; AVX-NEXT: vpackssdw %xmm1, %xmm0, %xmm0
|
||||
; AVX-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
|
||||
; AVX-NEXT: vpor %xmm0, %xmm1, %xmm0
|
||||
; AVX-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
|
||||
; AVX-NEXT: vpor %xmm1, %xmm0, %xmm0
|
||||
; AVX-NEXT: vpor %xmm0, %xmm1, %xmm0
|
||||
; AVX-NEXT: vpextrb $0, %xmm0, %eax
|
||||
; AVX-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX-NEXT: vzeroupper
|
||||
; AVX-NEXT: retq
|
||||
;
|
||||
; AVX512-LABEL: bool_reduction_v8f32:
|
||||
; AVX512: # %bb.0:
|
||||
; AVX512-NEXT: vcmpneqps %ymm1, %ymm0, %k1
|
||||
; AVX512-NEXT: vpcmpeqd %ymm0, %ymm0, %ymm0
|
||||
; AVX512-NEXT: vmovdqa32 %ymm0, %ymm1 {%k1} {z}
|
||||
; AVX512-NEXT: vextracti128 $1, %ymm1, %xmm1
|
||||
; AVX512-NEXT: vpslld $31, %ymm1, %ymm1
|
||||
; AVX512-NEXT: vptestmd %ymm1, %ymm1, %k0
|
||||
; AVX512-NEXT: korw %k1, %k0, %k1
|
||||
; AVX512-NEXT: vmovdqa32 %ymm0, %ymm0 {%k1} {z}
|
||||
; AVX512-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[2,3,0,1]
|
||||
; AVX512-NEXT: vpslld $31, %ymm0, %ymm0
|
||||
; AVX512-NEXT: vptestmd %ymm0, %ymm0, %k0
|
||||
; AVX512-NEXT: korw %k1, %k0, %k1
|
||||
; AVX512-NEXT: korw %k1, %k0, %k0
|
||||
; AVX512-NEXT: kmovd %k0, %eax
|
||||
; AVX512-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX512-NEXT: vzeroupper
|
||||
; AVX512-NEXT: retq
|
||||
%a = fcmp une <8 x float> %x, %y
|
||||
%s1 = shufflevector <8 x i1> %a, <8 x i1> undef, <8 x i32> <i32 4, i32 5, i32 6, i32 7, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%b = or <8 x i1> %s1, %a
|
||||
%s2 = shufflevector <8 x i1> %b, <8 x i1> undef, <8 x i32> <i32 2, i32 3, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%c = or <8 x i1> %s2, %b
|
||||
%s3 = shufflevector <8 x i1> %c, <8 x i1> undef, <8 x i32> <i32 1, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%d = or <8 x i1> %s2, %c
|
||||
%e = extractelement <8 x i1> %d, i32 0
|
||||
ret i1 %e
|
||||
}
|
||||
|
||||
define i1 @bool_reduction_v2i64(<2 x i64> %x, <2 x i64> %y) {
|
||||
; SSE-LABEL: bool_reduction_v2i64:
|
||||
; SSE: # %bb.0:
|
||||
; SSE-NEXT: movdqa {{.*#+}} xmm2 = [9223372036854775808,9223372036854775808]
|
||||
; SSE-NEXT: pxor %xmm2, %xmm1
|
||||
; SSE-NEXT: pxor %xmm2, %xmm0
|
||||
; SSE-NEXT: pcmpgtq %xmm1, %xmm0
|
||||
; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
|
||||
; SSE-NEXT: por %xmm0, %xmm1
|
||||
; SSE-NEXT: pextrb $0, %xmm1, %eax
|
||||
; SSE-NEXT: # kill: def $al killed $al killed $eax
|
||||
; SSE-NEXT: retq
|
||||
;
|
||||
; AVX-LABEL: bool_reduction_v2i64:
|
||||
; AVX: # %bb.0:
|
||||
; AVX-NEXT: vmovdqa {{.*#+}} xmm2 = [9223372036854775808,9223372036854775808]
|
||||
; AVX-NEXT: vpxor %xmm2, %xmm1, %xmm1
|
||||
; AVX-NEXT: vpxor %xmm2, %xmm0, %xmm0
|
||||
; AVX-NEXT: vpcmpgtq %xmm1, %xmm0, %xmm0
|
||||
; AVX-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
|
||||
; AVX-NEXT: vpor %xmm1, %xmm0, %xmm0
|
||||
; AVX-NEXT: vpextrb $0, %xmm0, %eax
|
||||
; AVX-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX-NEXT: retq
|
||||
;
|
||||
; AVX512-LABEL: bool_reduction_v2i64:
|
||||
; AVX512: # %bb.0:
|
||||
; AVX512-NEXT: vpcmpnleuq %xmm1, %xmm0, %k1
|
||||
; AVX512-NEXT: vpcmpeqd %xmm0, %xmm0, %xmm0
|
||||
; AVX512-NEXT: vmovdqa64 %xmm0, %xmm0 {%k1} {z}
|
||||
; AVX512-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[2,3,0,1]
|
||||
; AVX512-NEXT: vpsllq $63, %xmm0, %xmm0
|
||||
; AVX512-NEXT: vptestmq %xmm0, %xmm0, %k0
|
||||
; AVX512-NEXT: korw %k0, %k1, %k0
|
||||
; AVX512-NEXT: kmovd %k0, %eax
|
||||
; AVX512-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX512-NEXT: retq
|
||||
%a = icmp ugt <2 x i64> %x, %y
|
||||
%b = shufflevector <2 x i1> %a, <2 x i1> undef, <2 x i32> <i32 1, i32 undef>
|
||||
%c = or <2 x i1> %a, %b
|
||||
%d = extractelement <2 x i1> %c, i32 0
|
||||
ret i1 %d
|
||||
}
|
||||
|
||||
define i1 @bool_reduction_v4i32(<4 x i32> %x, <4 x i32> %y) {
|
||||
; SSE-LABEL: bool_reduction_v4i32:
|
||||
; SSE: # %bb.0:
|
||||
; SSE-NEXT: pcmpeqd %xmm1, %xmm0
|
||||
; SSE-NEXT: pcmpeqd %xmm1, %xmm1
|
||||
; SSE-NEXT: pxor %xmm0, %xmm1
|
||||
; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm1[2,3,0,1]
|
||||
; SSE-NEXT: por %xmm1, %xmm0
|
||||
; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
|
||||
; SSE-NEXT: por %xmm0, %xmm1
|
||||
; SSE-NEXT: pextrb $0, %xmm1, %eax
|
||||
; SSE-NEXT: # kill: def $al killed $al killed $eax
|
||||
; SSE-NEXT: retq
|
||||
;
|
||||
; AVX-LABEL: bool_reduction_v4i32:
|
||||
; AVX: # %bb.0:
|
||||
; AVX-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
|
||||
; AVX-NEXT: vpcmpeqd %xmm1, %xmm1, %xmm1
|
||||
; AVX-NEXT: vpxor %xmm1, %xmm0, %xmm0
|
||||
; AVX-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
|
||||
; AVX-NEXT: vpor %xmm0, %xmm1, %xmm0
|
||||
; AVX-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
|
||||
; AVX-NEXT: vpor %xmm0, %xmm1, %xmm0
|
||||
; AVX-NEXT: vpextrb $0, %xmm0, %eax
|
||||
; AVX-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX-NEXT: retq
|
||||
;
|
||||
; AVX512-LABEL: bool_reduction_v4i32:
|
||||
; AVX512: # %bb.0:
|
||||
; AVX512-NEXT: vpcmpneqd %xmm1, %xmm0, %k1
|
||||
; AVX512-NEXT: vpcmpeqd %xmm0, %xmm0, %xmm0
|
||||
; AVX512-NEXT: vmovdqa32 %xmm0, %xmm1 {%k1} {z}
|
||||
; AVX512-NEXT: vpshufd {{.*#+}} xmm1 = xmm1[2,3,0,1]
|
||||
; AVX512-NEXT: vpslld $31, %xmm1, %xmm1
|
||||
; AVX512-NEXT: vptestmd %xmm1, %xmm1, %k0
|
||||
; AVX512-NEXT: korw %k1, %k0, %k1
|
||||
; AVX512-NEXT: vmovdqa32 %xmm0, %xmm0 {%k1} {z}
|
||||
; AVX512-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[1,1,2,3]
|
||||
; AVX512-NEXT: vpslld $31, %xmm0, %xmm0
|
||||
; AVX512-NEXT: vptestmd %xmm0, %xmm0, %k0
|
||||
; AVX512-NEXT: korw %k1, %k0, %k0
|
||||
; AVX512-NEXT: kmovd %k0, %eax
|
||||
; AVX512-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX512-NEXT: retq
|
||||
%a = icmp ne <4 x i32> %x, %y
|
||||
%s1 = shufflevector <4 x i1> %a, <4 x i1> undef, <4 x i32> <i32 2, i32 3, i32 undef, i32 undef>
|
||||
%b = or <4 x i1> %s1, %a
|
||||
%s2 = shufflevector <4 x i1> %b, <4 x i1> undef, <4 x i32> <i32 1, i32 undef, i32 undef, i32 undef>
|
||||
%c = or <4 x i1> %s2, %b
|
||||
%d = extractelement <4 x i1> %c, i32 0
|
||||
ret i1 %d
|
||||
}
|
||||
|
||||
define i1 @bool_reduction_v8i16(<8 x i16> %x, <8 x i16> %y) {
|
||||
; SSE-LABEL: bool_reduction_v8i16:
|
||||
; SSE: # %bb.0:
|
||||
; SSE-NEXT: pcmpgtw %xmm0, %xmm1
|
||||
; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm1[2,3,0,1]
|
||||
; SSE-NEXT: por %xmm1, %xmm0
|
||||
; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
|
||||
; SSE-NEXT: por %xmm0, %xmm1
|
||||
; SSE-NEXT: movdqa %xmm1, %xmm0
|
||||
; SSE-NEXT: psrld $16, %xmm0
|
||||
; SSE-NEXT: por %xmm1, %xmm0
|
||||
; SSE-NEXT: pextrb $0, %xmm0, %eax
|
||||
; SSE-NEXT: # kill: def $al killed $al killed $eax
|
||||
; SSE-NEXT: retq
|
||||
;
|
||||
; AVX-LABEL: bool_reduction_v8i16:
|
||||
; AVX: # %bb.0:
|
||||
; AVX-NEXT: vpcmpgtw %xmm0, %xmm1, %xmm0
|
||||
; AVX-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
|
||||
; AVX-NEXT: vpor %xmm0, %xmm1, %xmm0
|
||||
; AVX-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
|
||||
; AVX-NEXT: vpor %xmm0, %xmm1, %xmm0
|
||||
; AVX-NEXT: vpsrld $16, %xmm0, %xmm1
|
||||
; AVX-NEXT: vpor %xmm0, %xmm1, %xmm0
|
||||
; AVX-NEXT: vpextrb $0, %xmm0, %eax
|
||||
; AVX-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX-NEXT: retq
|
||||
;
|
||||
; AVX512-LABEL: bool_reduction_v8i16:
|
||||
; AVX512: # %bb.0:
|
||||
; AVX512-NEXT: vpcmpgtw %xmm0, %xmm1, %k1
|
||||
; AVX512-NEXT: vpcmpeqd %ymm0, %ymm0, %ymm0
|
||||
; AVX512-NEXT: vmovdqa32 %ymm0, %ymm1 {%k1} {z}
|
||||
; AVX512-NEXT: vextracti128 $1, %ymm1, %xmm1
|
||||
; AVX512-NEXT: vpslld $31, %ymm1, %ymm1
|
||||
; AVX512-NEXT: vptestmd %ymm1, %ymm1, %k0
|
||||
; AVX512-NEXT: korw %k1, %k0, %k1
|
||||
; AVX512-NEXT: vmovdqa32 %ymm0, %ymm1 {%k1} {z}
|
||||
; AVX512-NEXT: vpshufd {{.*#+}} xmm1 = xmm1[2,3,0,1]
|
||||
; AVX512-NEXT: vpslld $31, %ymm1, %ymm1
|
||||
; AVX512-NEXT: vptestmd %ymm1, %ymm1, %k0
|
||||
; AVX512-NEXT: korw %k1, %k0, %k1
|
||||
; AVX512-NEXT: vmovdqa32 %ymm0, %ymm0 {%k1} {z}
|
||||
; AVX512-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[1,1,2,3]
|
||||
; AVX512-NEXT: vpslld $31, %ymm0, %ymm0
|
||||
; AVX512-NEXT: vptestmd %ymm0, %ymm0, %k0
|
||||
; AVX512-NEXT: korw %k1, %k0, %k0
|
||||
; AVX512-NEXT: kmovd %k0, %eax
|
||||
; AVX512-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX512-NEXT: vzeroupper
|
||||
; AVX512-NEXT: retq
|
||||
%a = icmp slt <8 x i16> %x, %y
|
||||
%s1 = shufflevector <8 x i1> %a, <8 x i1> undef, <8 x i32> <i32 4, i32 5, i32 6, i32 7, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%b = or <8 x i1> %s1, %a
|
||||
%s2 = shufflevector <8 x i1> %b, <8 x i1> undef, <8 x i32> <i32 2, i32 3, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%c = or <8 x i1> %s2, %b
|
||||
%s3 = shufflevector <8 x i1> %c, <8 x i1> undef, <8 x i32> <i32 1, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%d = or <8 x i1> %s3, %c
|
||||
%e = extractelement <8 x i1> %d, i32 0
|
||||
ret i1 %e
|
||||
}
|
||||
|
||||
define i1 @bool_reduction_v16i8(<16 x i8> %x, <16 x i8> %y) {
|
||||
; SSE-LABEL: bool_reduction_v16i8:
|
||||
; SSE: # %bb.0:
|
||||
; SSE-NEXT: pcmpgtb %xmm1, %xmm0
|
||||
; SSE-NEXT: pmovmskb %xmm0, %ecx
|
||||
; SSE-NEXT: xorl %eax, %eax
|
||||
; SSE-NEXT: cmpl %ecx, %eax
|
||||
; SSE-NEXT: sbbl %eax, %eax
|
||||
; SSE-NEXT: # kill: def $al killed $al killed $eax
|
||||
; SSE-NEXT: retq
|
||||
;
|
||||
; AVX-LABEL: bool_reduction_v16i8:
|
||||
; AVX: # %bb.0:
|
||||
; AVX-NEXT: vpcmpgtb %xmm1, %xmm0, %xmm0
|
||||
; AVX-NEXT: vpmovmskb %xmm0, %ecx
|
||||
; AVX-NEXT: xorl %eax, %eax
|
||||
; AVX-NEXT: cmpl %ecx, %eax
|
||||
; AVX-NEXT: sbbl %eax, %eax
|
||||
; AVX-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX-NEXT: retq
|
||||
;
|
||||
; AVX512-LABEL: bool_reduction_v16i8:
|
||||
; AVX512: # %bb.0:
|
||||
; AVX512-NEXT: vpcmpgtb %xmm1, %xmm0, %k0
|
||||
; AVX512-NEXT: kshiftrw $8, %k0, %k1
|
||||
; AVX512-NEXT: korw %k0, %k1, %k0
|
||||
; AVX512-NEXT: kshiftrw $4, %k0, %k1
|
||||
; AVX512-NEXT: korw %k0, %k1, %k0
|
||||
; AVX512-NEXT: kshiftrw $2, %k0, %k1
|
||||
; AVX512-NEXT: korw %k0, %k1, %k0
|
||||
; AVX512-NEXT: kshiftrw $1, %k0, %k1
|
||||
; AVX512-NEXT: korw %k0, %k1, %k0
|
||||
; AVX512-NEXT: kmovd %k0, %eax
|
||||
; AVX512-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX512-NEXT: retq
|
||||
%a = icmp sgt <16 x i8> %x, %y
|
||||
%s1 = shufflevector <16 x i1> %a, <16 x i1> undef, <16 x i32> <i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%b = or <16 x i1> %s1, %a
|
||||
%s2 = shufflevector <16 x i1> %b, <16 x i1> undef, <16 x i32> <i32 4, i32 5, i32 6, i32 7, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%c = or <16 x i1> %s2, %b
|
||||
%s3 = shufflevector <16 x i1> %c, <16 x i1> undef, <16 x i32> <i32 2, i32 3, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%d = or <16 x i1> %s3, %c
|
||||
%s4 = shufflevector <16 x i1> %d, <16 x i1> undef, <16 x i32> <i32 1, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%e = or <16 x i1> %s4, %d
|
||||
%f = extractelement <16 x i1> %e, i32 0
|
||||
ret i1 %f
|
||||
}
|
||||
|
||||
define i1 @bool_reduction_v4i64(<4 x i64> %x, <4 x i64> %y) {
|
||||
; SSE-LABEL: bool_reduction_v4i64:
|
||||
; SSE: # %bb.0:
|
||||
; SSE-NEXT: pcmpgtq %xmm1, %xmm3
|
||||
; SSE-NEXT: pcmpgtq %xmm0, %xmm2
|
||||
; SSE-NEXT: shufps {{.*#+}} xmm2 = xmm2[0,2],xmm3[0,2]
|
||||
; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm2[2,3,0,1]
|
||||
; SSE-NEXT: por %xmm2, %xmm0
|
||||
; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
|
||||
; SSE-NEXT: por %xmm0, %xmm1
|
||||
; SSE-NEXT: pextrb $0, %xmm1, %eax
|
||||
; SSE-NEXT: # kill: def $al killed $al killed $eax
|
||||
; SSE-NEXT: retq
|
||||
;
|
||||
; AVX1-LABEL: bool_reduction_v4i64:
|
||||
; AVX1: # %bb.0:
|
||||
; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2
|
||||
; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm3
|
||||
; AVX1-NEXT: vpcmpgtq %xmm2, %xmm3, %xmm2
|
||||
; AVX1-NEXT: vpcmpgtq %xmm0, %xmm1, %xmm0
|
||||
; AVX1-NEXT: vpackssdw %xmm2, %xmm0, %xmm1
|
||||
; AVX1-NEXT: vpackssdw %xmm0, %xmm2, %xmm0
|
||||
; AVX1-NEXT: vpor %xmm1, %xmm0, %xmm0
|
||||
; AVX1-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
|
||||
; AVX1-NEXT: vpor %xmm0, %xmm1, %xmm0
|
||||
; AVX1-NEXT: vpextrb $0, %xmm0, %eax
|
||||
; AVX1-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX1-NEXT: vzeroupper
|
||||
; AVX1-NEXT: retq
|
||||
;
|
||||
; AVX2-LABEL: bool_reduction_v4i64:
|
||||
; AVX2: # %bb.0:
|
||||
; AVX2-NEXT: vpcmpgtq %ymm0, %ymm1, %ymm0
|
||||
; AVX2-NEXT: vextracti128 $1, %ymm0, %xmm1
|
||||
; AVX2-NEXT: vpackssdw %xmm1, %xmm0, %xmm2
|
||||
; AVX2-NEXT: vpackssdw %xmm0, %xmm1, %xmm0
|
||||
; AVX2-NEXT: vpor %xmm2, %xmm0, %xmm0
|
||||
; AVX2-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
|
||||
; AVX2-NEXT: vpor %xmm0, %xmm1, %xmm0
|
||||
; AVX2-NEXT: vpextrb $0, %xmm0, %eax
|
||||
; AVX2-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX2-NEXT: vzeroupper
|
||||
; AVX2-NEXT: retq
|
||||
;
|
||||
; AVX512-LABEL: bool_reduction_v4i64:
|
||||
; AVX512: # %bb.0:
|
||||
; AVX512-NEXT: vpcmpgtq %ymm0, %ymm1, %k1
|
||||
; AVX512-NEXT: vpcmpeqd %xmm0, %xmm0, %xmm0
|
||||
; AVX512-NEXT: vmovdqa32 %xmm0, %xmm1 {%k1} {z}
|
||||
; AVX512-NEXT: vpshufd {{.*#+}} xmm1 = xmm1[2,3,0,1]
|
||||
; AVX512-NEXT: vpslld $31, %xmm1, %xmm1
|
||||
; AVX512-NEXT: vptestmd %xmm1, %xmm1, %k0
|
||||
; AVX512-NEXT: korw %k1, %k0, %k1
|
||||
; AVX512-NEXT: vmovdqa32 %xmm0, %xmm0 {%k1} {z}
|
||||
; AVX512-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[1,1,2,3]
|
||||
; AVX512-NEXT: vpslld $31, %xmm0, %xmm0
|
||||
; AVX512-NEXT: vptestmd %xmm0, %xmm0, %k0
|
||||
; AVX512-NEXT: korw %k1, %k0, %k0
|
||||
; AVX512-NEXT: kmovd %k0, %eax
|
||||
; AVX512-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX512-NEXT: vzeroupper
|
||||
; AVX512-NEXT: retq
|
||||
%a = icmp slt <4 x i64> %x, %y
|
||||
%s1 = shufflevector <4 x i1> %a, <4 x i1> undef, <4 x i32> <i32 2, i32 3, i32 undef, i32 undef>
|
||||
%b = or <4 x i1> %s1, %a
|
||||
%s2 = shufflevector <4 x i1> %b, <4 x i1> undef, <4 x i32> <i32 1, i32 undef, i32 undef, i32 undef>
|
||||
%c = or <4 x i1> %s2, %b
|
||||
%d = extractelement <4 x i1> %c, i32 0
|
||||
ret i1 %d
|
||||
}
|
||||
|
||||
define i1 @bool_reduction_v8i32(<8 x i32> %x, <8 x i32> %y) {
|
||||
; SSE-LABEL: bool_reduction_v8i32:
|
||||
; SSE: # %bb.0:
|
||||
; SSE-NEXT: pminud %xmm1, %xmm3
|
||||
; SSE-NEXT: pcmpeqd %xmm1, %xmm3
|
||||
; SSE-NEXT: pminud %xmm0, %xmm2
|
||||
; SSE-NEXT: pcmpeqd %xmm0, %xmm2
|
||||
; SSE-NEXT: packssdw %xmm3, %xmm2
|
||||
; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm2[2,3,0,1]
|
||||
; SSE-NEXT: por %xmm2, %xmm0
|
||||
; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
|
||||
; SSE-NEXT: por %xmm0, %xmm1
|
||||
; SSE-NEXT: movdqa %xmm1, %xmm0
|
||||
; SSE-NEXT: psrld $16, %xmm0
|
||||
; SSE-NEXT: por %xmm1, %xmm0
|
||||
; SSE-NEXT: pextrb $0, %xmm0, %eax
|
||||
; SSE-NEXT: # kill: def $al killed $al killed $eax
|
||||
; SSE-NEXT: retq
|
||||
;
|
||||
; AVX1-LABEL: bool_reduction_v8i32:
|
||||
; AVX1: # %bb.0:
|
||||
; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm2
|
||||
; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm3
|
||||
; AVX1-NEXT: vpminud %xmm2, %xmm3, %xmm2
|
||||
; AVX1-NEXT: vpcmpeqd %xmm2, %xmm3, %xmm2
|
||||
; AVX1-NEXT: vpminud %xmm1, %xmm0, %xmm1
|
||||
; AVX1-NEXT: vpcmpeqd %xmm1, %xmm0, %xmm0
|
||||
; AVX1-NEXT: vpackssdw %xmm2, %xmm0, %xmm0
|
||||
; AVX1-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
|
||||
; AVX1-NEXT: vpor %xmm0, %xmm1, %xmm0
|
||||
; AVX1-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
|
||||
; AVX1-NEXT: vpor %xmm0, %xmm1, %xmm0
|
||||
; AVX1-NEXT: vpsrld $16, %xmm0, %xmm1
|
||||
; AVX1-NEXT: vpor %xmm0, %xmm1, %xmm0
|
||||
; AVX1-NEXT: vpextrb $0, %xmm0, %eax
|
||||
; AVX1-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX1-NEXT: vzeroupper
|
||||
; AVX1-NEXT: retq
|
||||
;
|
||||
; AVX2-LABEL: bool_reduction_v8i32:
|
||||
; AVX2: # %bb.0:
|
||||
; AVX2-NEXT: vpminud %ymm1, %ymm0, %ymm1
|
||||
; AVX2-NEXT: vpcmpeqd %ymm1, %ymm0, %ymm0
|
||||
; AVX2-NEXT: vextracti128 $1, %ymm0, %xmm1
|
||||
; AVX2-NEXT: vpackssdw %xmm1, %xmm0, %xmm0
|
||||
; AVX2-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
|
||||
; AVX2-NEXT: vpor %xmm0, %xmm1, %xmm0
|
||||
; AVX2-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
|
||||
; AVX2-NEXT: vpor %xmm0, %xmm1, %xmm0
|
||||
; AVX2-NEXT: vpsrld $16, %xmm0, %xmm1
|
||||
; AVX2-NEXT: vpor %xmm0, %xmm1, %xmm0
|
||||
; AVX2-NEXT: vpextrb $0, %xmm0, %eax
|
||||
; AVX2-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX2-NEXT: vzeroupper
|
||||
; AVX2-NEXT: retq
|
||||
;
|
||||
; AVX512-LABEL: bool_reduction_v8i32:
|
||||
; AVX512: # %bb.0:
|
||||
; AVX512-NEXT: vpcmpleud %ymm1, %ymm0, %k1
|
||||
; AVX512-NEXT: vpcmpeqd %ymm0, %ymm0, %ymm0
|
||||
; AVX512-NEXT: vmovdqa32 %ymm0, %ymm1 {%k1} {z}
|
||||
; AVX512-NEXT: vextracti128 $1, %ymm1, %xmm1
|
||||
; AVX512-NEXT: vpslld $31, %ymm1, %ymm1
|
||||
; AVX512-NEXT: vptestmd %ymm1, %ymm1, %k0
|
||||
; AVX512-NEXT: korw %k1, %k0, %k1
|
||||
; AVX512-NEXT: vmovdqa32 %ymm0, %ymm1 {%k1} {z}
|
||||
; AVX512-NEXT: vpshufd {{.*#+}} xmm1 = xmm1[2,3,0,1]
|
||||
; AVX512-NEXT: vpslld $31, %ymm1, %ymm1
|
||||
; AVX512-NEXT: vptestmd %ymm1, %ymm1, %k0
|
||||
; AVX512-NEXT: korw %k1, %k0, %k1
|
||||
; AVX512-NEXT: vmovdqa32 %ymm0, %ymm0 {%k1} {z}
|
||||
; AVX512-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[1,1,2,3]
|
||||
; AVX512-NEXT: vpslld $31, %ymm0, %ymm0
|
||||
; AVX512-NEXT: vptestmd %ymm0, %ymm0, %k0
|
||||
; AVX512-NEXT: korw %k1, %k0, %k0
|
||||
; AVX512-NEXT: kmovd %k0, %eax
|
||||
; AVX512-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX512-NEXT: vzeroupper
|
||||
; AVX512-NEXT: retq
|
||||
%a = icmp ule <8 x i32> %x, %y
|
||||
%s1 = shufflevector <8 x i1> %a, <8 x i1> undef, <8 x i32> <i32 4, i32 5, i32 6, i32 7, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%b = or <8 x i1> %s1, %a
|
||||
%s2 = shufflevector <8 x i1> %b, <8 x i1> undef, <8 x i32> <i32 2, i32 3, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%c = or <8 x i1> %s2, %b
|
||||
%s3 = shufflevector <8 x i1> %c, <8 x i1> undef, <8 x i32> <i32 1, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%d = or <8 x i1> %s3, %c
|
||||
%e = extractelement <8 x i1> %d, i32 0
|
||||
ret i1 %e
|
||||
}
|
||||
|
||||
define i1 @bool_reduction_v16i16(<16 x i16> %x, <16 x i16> %y) {
|
||||
; SSE-LABEL: bool_reduction_v16i16:
|
||||
; SSE: # %bb.0:
|
||||
; SSE-NEXT: pcmpeqw %xmm3, %xmm1
|
||||
; SSE-NEXT: pcmpeqw %xmm2, %xmm0
|
||||
; SSE-NEXT: packsswb %xmm1, %xmm0
|
||||
; SSE-NEXT: pmovmskb %xmm0, %ecx
|
||||
; SSE-NEXT: xorl %eax, %eax
|
||||
; SSE-NEXT: cmpl %ecx, %eax
|
||||
; SSE-NEXT: sbbl %eax, %eax
|
||||
; SSE-NEXT: # kill: def $al killed $al killed $eax
|
||||
; SSE-NEXT: retq
|
||||
;
|
||||
; AVX1-LABEL: bool_reduction_v16i16:
|
||||
; AVX1: # %bb.0:
|
||||
; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm2
|
||||
; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm3
|
||||
; AVX1-NEXT: vpcmpeqw %xmm2, %xmm3, %xmm2
|
||||
; AVX1-NEXT: vpcmpeqw %xmm1, %xmm0, %xmm0
|
||||
; AVX1-NEXT: vpacksswb %xmm2, %xmm0, %xmm0
|
||||
; AVX1-NEXT: vpmovmskb %xmm0, %ecx
|
||||
; AVX1-NEXT: xorl %eax, %eax
|
||||
; AVX1-NEXT: cmpl %ecx, %eax
|
||||
; AVX1-NEXT: sbbl %eax, %eax
|
||||
; AVX1-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX1-NEXT: vzeroupper
|
||||
; AVX1-NEXT: retq
|
||||
;
|
||||
; AVX2-LABEL: bool_reduction_v16i16:
|
||||
; AVX2: # %bb.0:
|
||||
; AVX2-NEXT: vpcmpeqw %ymm1, %ymm0, %ymm0
|
||||
; AVX2-NEXT: vextracti128 $1, %ymm0, %xmm1
|
||||
; AVX2-NEXT: vpacksswb %xmm1, %xmm0, %xmm0
|
||||
; AVX2-NEXT: vpmovmskb %xmm0, %ecx
|
||||
; AVX2-NEXT: xorl %eax, %eax
|
||||
; AVX2-NEXT: cmpl %ecx, %eax
|
||||
; AVX2-NEXT: sbbl %eax, %eax
|
||||
; AVX2-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX2-NEXT: vzeroupper
|
||||
; AVX2-NEXT: retq
|
||||
;
|
||||
; AVX512-LABEL: bool_reduction_v16i16:
|
||||
; AVX512: # %bb.0:
|
||||
; AVX512-NEXT: vpcmpeqw %ymm1, %ymm0, %k0
|
||||
; AVX512-NEXT: kshiftrw $8, %k0, %k1
|
||||
; AVX512-NEXT: korw %k0, %k1, %k0
|
||||
; AVX512-NEXT: kshiftrw $4, %k0, %k1
|
||||
; AVX512-NEXT: korw %k0, %k1, %k0
|
||||
; AVX512-NEXT: kshiftrw $2, %k0, %k1
|
||||
; AVX512-NEXT: korw %k0, %k1, %k0
|
||||
; AVX512-NEXT: kshiftrw $1, %k0, %k1
|
||||
; AVX512-NEXT: korw %k0, %k1, %k0
|
||||
; AVX512-NEXT: kmovd %k0, %eax
|
||||
; AVX512-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX512-NEXT: vzeroupper
|
||||
; AVX512-NEXT: retq
|
||||
%a = icmp eq <16 x i16> %x, %y
|
||||
%s1 = shufflevector <16 x i1> %a, <16 x i1> undef, <16 x i32> <i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%b = or <16 x i1> %s1, %a
|
||||
%s2 = shufflevector <16 x i1> %b, <16 x i1> undef, <16 x i32> <i32 4, i32 5, i32 6, i32 7, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%c = or <16 x i1> %s2, %b
|
||||
%s3 = shufflevector <16 x i1> %c, <16 x i1> undef, <16 x i32> <i32 2, i32 3, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%d = or <16 x i1> %s3, %c
|
||||
%s4 = shufflevector <16 x i1> %d, <16 x i1> undef, <16 x i32> <i32 1, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%e = or <16 x i1> %s4, %d
|
||||
%f = extractelement <16 x i1> %e, i32 0
|
||||
ret i1 %f
|
||||
}
|
||||
|
||||
define i1 @bool_reduction_v32i8(<32 x i8> %x, <32 x i8> %y) {
|
||||
; SSE-LABEL: bool_reduction_v32i8:
|
||||
; SSE: # %bb.0:
|
||||
; SSE-NEXT: pcmpeqb %xmm2, %xmm0
|
||||
; SSE-NEXT: pcmpeqb %xmm3, %xmm1
|
||||
; SSE-NEXT: por %xmm0, %xmm1
|
||||
; SSE-NEXT: pmovmskb %xmm1, %ecx
|
||||
; SSE-NEXT: xorl %eax, %eax
|
||||
; SSE-NEXT: cmpl %ecx, %eax
|
||||
; SSE-NEXT: sbbl %eax, %eax
|
||||
; SSE-NEXT: # kill: def $al killed $al killed $eax
|
||||
; SSE-NEXT: retq
|
||||
;
|
||||
; AVX1-LABEL: bool_reduction_v32i8:
|
||||
; AVX1: # %bb.0:
|
||||
; AVX1-NEXT: vpcmpeqb %xmm1, %xmm0, %xmm2
|
||||
; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm1
|
||||
; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm0
|
||||
; AVX1-NEXT: vpcmpeqb %xmm1, %xmm0, %xmm0
|
||||
; AVX1-NEXT: vpor %xmm2, %xmm0, %xmm0
|
||||
; AVX1-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
|
||||
; AVX1-NEXT: vpor %xmm0, %xmm1, %xmm0
|
||||
; AVX1-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
|
||||
; AVX1-NEXT: vpor %xmm0, %xmm1, %xmm0
|
||||
; AVX1-NEXT: vpsrld $16, %xmm0, %xmm1
|
||||
; AVX1-NEXT: vpor %xmm0, %xmm1, %xmm0
|
||||
; AVX1-NEXT: vpsrlw $8, %xmm0, %xmm1
|
||||
; AVX1-NEXT: vpor %xmm0, %xmm1, %xmm0
|
||||
; AVX1-NEXT: vpextrb $0, %xmm0, %eax
|
||||
; AVX1-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX1-NEXT: vzeroupper
|
||||
; AVX1-NEXT: retq
|
||||
;
|
||||
; AVX2-LABEL: bool_reduction_v32i8:
|
||||
; AVX2: # %bb.0:
|
||||
; AVX2-NEXT: vpcmpeqb %ymm1, %ymm0, %ymm0
|
||||
; AVX2-NEXT: vpmovmskb %ymm0, %ecx
|
||||
; AVX2-NEXT: xorl %eax, %eax
|
||||
; AVX2-NEXT: cmpl %ecx, %eax
|
||||
; AVX2-NEXT: sbbl %eax, %eax
|
||||
; AVX2-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX2-NEXT: vzeroupper
|
||||
; AVX2-NEXT: retq
|
||||
;
|
||||
; AVX512-LABEL: bool_reduction_v32i8:
|
||||
; AVX512: # %bb.0:
|
||||
; AVX512-NEXT: vpcmpeqb %ymm1, %ymm0, %k0
|
||||
; AVX512-NEXT: kshiftrd $16, %k0, %k1
|
||||
; AVX512-NEXT: kord %k0, %k1, %k0
|
||||
; AVX512-NEXT: kshiftrd $8, %k0, %k1
|
||||
; AVX512-NEXT: kord %k0, %k1, %k0
|
||||
; AVX512-NEXT: kshiftrd $4, %k0, %k1
|
||||
; AVX512-NEXT: kord %k0, %k1, %k0
|
||||
; AVX512-NEXT: kshiftrd $2, %k0, %k1
|
||||
; AVX512-NEXT: kord %k0, %k1, %k0
|
||||
; AVX512-NEXT: kshiftrd $1, %k0, %k1
|
||||
; AVX512-NEXT: kord %k0, %k1, %k0
|
||||
; AVX512-NEXT: kmovd %k0, %eax
|
||||
; AVX512-NEXT: # kill: def $al killed $al killed $eax
|
||||
; AVX512-NEXT: vzeroupper
|
||||
; AVX512-NEXT: retq
|
||||
%a = icmp eq <32 x i8> %x, %y
|
||||
%s1 = shufflevector <32 x i1> %a, <32 x i1> undef, <32 x i32> <i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%b = or <32 x i1> %s1, %a
|
||||
%s2 = shufflevector <32 x i1> %b, <32 x i1> undef, <32 x i32> <i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%c = or <32 x i1> %s2, %b
|
||||
%s3 = shufflevector <32 x i1> %c, <32 x i1> undef, <32 x i32> <i32 4, i32 5, i32 6, i32 7, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%d = or <32 x i1> %s3, %c
|
||||
%s4 = shufflevector <32 x i1> %d, <32 x i1> undef, <32 x i32> <i32 2, i32 3, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%e = or <32 x i1> %s4, %d
|
||||
%s5 = shufflevector <32 x i1> %e, <32 x i1> undef, <32 x i32> <i32 1, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
||||
%f = or <32 x i1> %s5, %e
|
||||
%g = extractelement <32 x i1> %f, i32 0
|
||||
ret i1 %g
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user