aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/X86/vec_compare.ll
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2012-12-25 12:54:19 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2012-12-25 12:54:19 +0000
commit382ed78d3fef9f6c582e3cdcfb30f8c6fa3d0d79 (patch)
tree8afbebf801304afabf67b3a32da347dc6e1a3159 /test/CodeGen/X86/vec_compare.ll
parent4684858624d7ffe82379783e9b678227d5e0b515 (diff)
downloadexternal_llvm-382ed78d3fef9f6c582e3cdcfb30f8c6fa3d0d79.zip
external_llvm-382ed78d3fef9f6c582e3cdcfb30f8c6fa3d0d79.tar.gz
external_llvm-382ed78d3fef9f6c582e3cdcfb30f8c6fa3d0d79.tar.bz2
X86: Custom lower <2 x i64> eq and ne when SSE41 is not available.
pcmpeqd, pshufd, pshufd, pand is cheaper than unpack + cmpq, sbbq, cmpq, sbbq + pack. Small speedup on loop-vectorized viterbi (-march=core2). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171063 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/vec_compare.ll')
-rw-r--r--test/CodeGen/X86/vec_compare.ll26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/CodeGen/X86/vec_compare.ll b/test/CodeGen/X86/vec_compare.ll
index 367dd27..cf86c73 100644
--- a/test/CodeGen/X86/vec_compare.ll
+++ b/test/CodeGen/X86/vec_compare.ll
@@ -41,3 +41,29 @@ define <4 x i32> @test4(<4 x i32> %A, <4 x i32> %B) nounwind {
%D = sext <4 x i1> %C to <4 x i32>
ret <4 x i32> %D
}
+
+define <2 x i64> @test5(<2 x i64> %A, <2 x i64> %B) nounwind {
+; CHECK: test5:
+; CHECK: pcmpeqd
+; CHECK: pshufd $-11
+; CHECK: pshufd $-96
+; CHECK: pand
+; CHECK: ret
+ %C = icmp eq <2 x i64> %A, %B
+ %D = sext <2 x i1> %C to <2 x i64>
+ ret <2 x i64> %D
+}
+
+define <2 x i64> @test6(<2 x i64> %A, <2 x i64> %B) nounwind {
+; CHECK: test6:
+; CHECK: pcmpeqd
+; CHECK: pshufd $-11
+; CHECK: pshufd $-96
+; CHECK: pand
+; CHECK: pcmpeqd
+; CHECK: pxor
+; CHECK: ret
+ %C = icmp ne <2 x i64> %A, %B
+ %D = sext <2 x i1> %C to <2 x i64>
+ ret <2 x i64> %D
+}