[X86][SSE] Add OR(EXTRACTELT(X,0),OR(EXTRACTELT(X,1))) movmsk v2X64 tests

llvm-svn: 375462
This commit is contained in:
Simon Pilgrim 2019-10-21 22:36:07 +00:00
parent 0b4368cbfb
commit 95c184cd0a
1 changed files with 110 additions and 10 deletions

View File

@ -4457,8 +4457,8 @@ define i1 @movmsk_v4i32(<4 x i32> %x, <4 x i32> %y) {
ret i1 %u1
}
define i1 @movmsk_v2i64(<2 x i64> %x, <2 x i64> %y) {
; SSE2-LABEL: movmsk_v2i64:
define i1 @movmsk_and_v2i64(<2 x i64> %x, <2 x i64> %y) {
; SSE2-LABEL: movmsk_and_v2i64:
; SSE2: # %bb.0:
; SSE2-NEXT: pcmpeqd %xmm1, %xmm0
; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,0,3,2]
@ -4469,7 +4469,7 @@ define i1 @movmsk_v2i64(<2 x i64> %x, <2 x i64> %y) {
; SSE2-NEXT: sete %al
; SSE2-NEXT: retq
;
; AVX-LABEL: movmsk_v2i64:
; AVX-LABEL: movmsk_and_v2i64:
; AVX: # %bb.0:
; AVX-NEXT: vpcmpeqq %xmm1, %xmm0, %xmm0
; AVX-NEXT: vmovmskpd %xmm0, %eax
@ -4478,7 +4478,7 @@ define i1 @movmsk_v2i64(<2 x i64> %x, <2 x i64> %y) {
; AVX-NEXT: sete %al
; AVX-NEXT: retq
;
; KNL-LABEL: movmsk_v2i64:
; KNL-LABEL: movmsk_and_v2i64:
; KNL: # %bb.0:
; KNL-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
; KNL-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
@ -4491,7 +4491,7 @@ define i1 @movmsk_v2i64(<2 x i64> %x, <2 x i64> %y) {
; KNL-NEXT: vzeroupper
; KNL-NEXT: retq
;
; SKX-LABEL: movmsk_v2i64:
; SKX-LABEL: movmsk_and_v2i64:
; SKX: # %bb.0:
; SKX-NEXT: vpcmpneqq %xmm1, %xmm0, %k0
; SKX-NEXT: kshiftrb $1, %k0, %k1
@ -4507,6 +4507,58 @@ define i1 @movmsk_v2i64(<2 x i64> %x, <2 x i64> %y) {
ret i1 %u1
}
define i1 @movmsk_or_v2i64(<2 x i64> %x, <2 x i64> %y) {
; SSE2-LABEL: movmsk_or_v2i64:
; SSE2: # %bb.0:
; SSE2-NEXT: pcmpeqd %xmm1, %xmm0
; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,0,3,2]
; SSE2-NEXT: pand %xmm0, %xmm1
; SSE2-NEXT: movmskpd %xmm1, %ecx
; SSE2-NEXT: xorl $3, %ecx
; SSE2-NEXT: movl %ecx, %eax
; SSE2-NEXT: shrb %al
; SSE2-NEXT: orb %cl, %al
; SSE2-NEXT: retq
;
; AVX-LABEL: movmsk_or_v2i64:
; AVX: # %bb.0:
; AVX-NEXT: vpcmpeqq %xmm1, %xmm0, %xmm0
; AVX-NEXT: vmovmskpd %xmm0, %ecx
; AVX-NEXT: xorl $3, %ecx
; AVX-NEXT: movl %ecx, %eax
; AVX-NEXT: shrb %al
; AVX-NEXT: orb %cl, %al
; AVX-NEXT: retq
;
; KNL-LABEL: movmsk_or_v2i64:
; KNL: # %bb.0:
; KNL-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
; KNL-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
; KNL-NEXT: vpcmpneqq %zmm1, %zmm0, %k0
; KNL-NEXT: kshiftrw $1, %k0, %k1
; KNL-NEXT: kmovw %k1, %ecx
; KNL-NEXT: kmovw %k0, %eax
; KNL-NEXT: orb %cl, %al
; KNL-NEXT: # kill: def $al killed $al killed $eax
; KNL-NEXT: vzeroupper
; KNL-NEXT: retq
;
; SKX-LABEL: movmsk_or_v2i64:
; SKX: # %bb.0:
; SKX-NEXT: vpcmpneqq %xmm1, %xmm0, %k0
; SKX-NEXT: kshiftrb $1, %k0, %k1
; SKX-NEXT: kmovd %k1, %ecx
; SKX-NEXT: kmovd %k0, %eax
; SKX-NEXT: orb %cl, %al
; SKX-NEXT: # kill: def $al killed $al killed $eax
; SKX-NEXT: retq
%cmp = icmp ne <2 x i64> %x, %y
%e1 = extractelement <2 x i1> %cmp, i32 0
%e2 = extractelement <2 x i1> %cmp, i32 1
%u1 = or i1 %e1, %e2
ret i1 %u1
}
define i1 @movmsk_v4f32(<4 x float> %x, <4 x float> %y) {
; SSE2-LABEL: movmsk_v4f32:
; SSE2: # %bb.0:
@ -4566,8 +4618,8 @@ define i1 @movmsk_v4f32(<4 x float> %x, <4 x float> %y) {
ret i1 %u2
}
define i1 @movmsk_v2f64(<2 x double> %x, <2 x double> %y) {
; SSE2-LABEL: movmsk_v2f64:
define i1 @movmsk_and_v2f64(<2 x double> %x, <2 x double> %y) {
; SSE2-LABEL: movmsk_and_v2f64:
; SSE2: # %bb.0:
; SSE2-NEXT: cmplepd %xmm0, %xmm1
; SSE2-NEXT: movmskpd %xmm1, %eax
@ -4575,7 +4627,7 @@ define i1 @movmsk_v2f64(<2 x double> %x, <2 x double> %y) {
; SSE2-NEXT: sete %al
; SSE2-NEXT: retq
;
; AVX-LABEL: movmsk_v2f64:
; AVX-LABEL: movmsk_and_v2f64:
; AVX: # %bb.0:
; AVX-NEXT: vcmplepd %xmm0, %xmm1, %xmm0
; AVX-NEXT: vmovmskpd %xmm0, %eax
@ -4583,7 +4635,7 @@ define i1 @movmsk_v2f64(<2 x double> %x, <2 x double> %y) {
; AVX-NEXT: sete %al
; AVX-NEXT: retq
;
; KNL-LABEL: movmsk_v2f64:
; KNL-LABEL: movmsk_and_v2f64:
; KNL: # %bb.0:
; KNL-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
; KNL-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
@ -4596,7 +4648,7 @@ define i1 @movmsk_v2f64(<2 x double> %x, <2 x double> %y) {
; KNL-NEXT: vzeroupper
; KNL-NEXT: retq
;
; SKX-LABEL: movmsk_v2f64:
; SKX-LABEL: movmsk_and_v2f64:
; SKX: # %bb.0:
; SKX-NEXT: vcmplepd %xmm0, %xmm1, %k0
; SKX-NEXT: kshiftrb $1, %k0, %k1
@ -4612,6 +4664,54 @@ define i1 @movmsk_v2f64(<2 x double> %x, <2 x double> %y) {
ret i1 %u1
}
define i1 @movmsk_or_v2f64(<2 x double> %x, <2 x double> %y) {
; SSE2-LABEL: movmsk_or_v2f64:
; SSE2: # %bb.0:
; SSE2-NEXT: cmplepd %xmm0, %xmm1
; SSE2-NEXT: movmskpd %xmm1, %ecx
; SSE2-NEXT: movl %ecx, %eax
; SSE2-NEXT: shrb %al
; SSE2-NEXT: orb %cl, %al
; SSE2-NEXT: retq
;
; AVX-LABEL: movmsk_or_v2f64:
; AVX: # %bb.0:
; AVX-NEXT: vcmplepd %xmm0, %xmm1, %xmm0
; AVX-NEXT: vmovmskpd %xmm0, %ecx
; AVX-NEXT: movl %ecx, %eax
; AVX-NEXT: shrb %al
; AVX-NEXT: orb %cl, %al
; AVX-NEXT: retq
;
; KNL-LABEL: movmsk_or_v2f64:
; KNL: # %bb.0:
; KNL-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
; KNL-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
; KNL-NEXT: vcmplepd %zmm0, %zmm1, %k0
; KNL-NEXT: kshiftrw $1, %k0, %k1
; KNL-NEXT: kmovw %k1, %ecx
; KNL-NEXT: kmovw %k0, %eax
; KNL-NEXT: orb %cl, %al
; KNL-NEXT: # kill: def $al killed $al killed $eax
; KNL-NEXT: vzeroupper
; KNL-NEXT: retq
;
; SKX-LABEL: movmsk_or_v2f64:
; SKX: # %bb.0:
; SKX-NEXT: vcmplepd %xmm0, %xmm1, %k0
; SKX-NEXT: kshiftrb $1, %k0, %k1
; SKX-NEXT: kmovd %k1, %ecx
; SKX-NEXT: kmovd %k0, %eax
; SKX-NEXT: orb %cl, %al
; SKX-NEXT: # kill: def $al killed $al killed $eax
; SKX-NEXT: retq
%cmp = fcmp oge <2 x double> %x, %y
%e1 = extractelement <2 x i1> %cmp, i32 0
%e2 = extractelement <2 x i1> %cmp, i32 1
%u1 = or i1 %e1, %e2
ret i1 %u1
}
define i32 @PR39665_c_ray(<2 x double> %x, <2 x double> %y) {
; SSE2-LABEL: PR39665_c_ray:
; SSE2: # %bb.0: