summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/vec_logical.ll
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2017-01-28 23:52:04 +0000
committerCraig Topper <craig.topper@gmail.com>2017-01-28 23:52:04 +0000
commited0ea561fbd00afd1478a85c2c04f1b76f201203 (patch)
tree035fb95b3e45fac1aa6416d21668b7891104f577 /llvm/test/CodeGen/X86/vec_logical.ll
parent9b8738d7c8ff00911b49eea1d4e527655dbc135f (diff)
downloadbcm5719-llvm-ed0ea561fbd00afd1478a85c2c04f1b76f201203.tar.gz
bcm5719-llvm-ed0ea561fbd00afd1478a85c2c04f1b76f201203.zip
[X86] Add test case that shows failure to use a vector ANDN when both inputs to the AND are XORs.
The matching code tries to canonicalize XOR to the left, but if there are two XORs and only one is a vnot, this canonicalization can prevent matching. llvm-svn: 293402
Diffstat (limited to 'llvm/test/CodeGen/X86/vec_logical.ll')
-rw-r--r--llvm/test/CodeGen/X86/vec_logical.ll27
1 files changed, 25 insertions, 2 deletions
diff --git a/llvm/test/CodeGen/X86/vec_logical.ll b/llvm/test/CodeGen/X86/vec_logical.ll
index b632616cde8..fb9db449ac9 100644
--- a/llvm/test/CodeGen/X86/vec_logical.ll
+++ b/llvm/test/CodeGen/X86/vec_logical.ll
@@ -5,13 +5,13 @@
define void @t(<4 x float> %A) {
; SSE-LABEL: t:
; SSE: # BB#0:
-; SSE-NEXT: xorps .LCPI0_0, %xmm0
+; SSE-NEXT: xorps {{\.LCPI.*}}, %xmm0
; SSE-NEXT: movaps %xmm0, 0
; SSE-NEXT: retl
;
; AVX-LABEL: t:
; AVX: # BB#0:
-; AVX-NEXT: vxorps .LCPI0_0, %xmm0, %xmm0
+; AVX-NEXT: vxorps {{\.LCPI.*}}, %xmm0, %xmm0
; AVX-NEXT: vmovaps %xmm0, 0
; AVX-NEXT: retl
%tmp1277 = fsub <4 x float> < float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00 >, %A
@@ -85,3 +85,26 @@ entry:
store <4 x float> %tmp30, <4 x float>* %d
ret void
}
+
+define <2 x i64> @andn_double_xor(<2 x i64> %a, <2 x i64> %b, <2 x i64> %c) {
+; SSE-LABEL: andn_double_xor:
+; SSE: # BB#0:
+; SSE-NEXT: pcmpeqd %xmm3, %xmm3
+; SSE-NEXT: pxor %xmm3, %xmm0
+; SSE-NEXT: pxor %xmm2, %xmm1
+; SSE-NEXT: pand %xmm1, %xmm0
+; SSE-NEXT: retl
+;
+; AVX-LABEL: andn_double_xor:
+; AVX: # BB#0:
+; AVX-NEXT: vpcmpeqd %xmm3, %xmm3, %xmm3
+; AVX-NEXT: vpxor %xmm3, %xmm0, %xmm0
+; AVX-NEXT: vpxor %xmm2, %xmm1, %xmm1
+; AVX-NEXT: vpand %xmm1, %xmm0, %xmm0
+; AVX-NEXT: retl
+ %1 = xor <2 x i64> %a, <i64 -1, i64 -1>
+ %2 = xor <2 x i64> %b, %c
+ %3 = and <2 x i64> %1, %2
+ ret <2 x i64> %3
+}
+
OpenPOWER on IntegriCloud