aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/X86/vec_shuffle-16.ll
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-04-05 00:30:36 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-04-05 00:30:36 +0000
commit0c0f83ff5d214a7f42e86ae62814526ba40a28cf (patch)
treeffb95313874d040042271f886170c24b80ebd693 /test/CodeGen/X86/vec_shuffle-16.ll
parenta4091d34f3c05717eb5bb66a1257a0c1005e6dfa (diff)
downloadexternal_llvm-0c0f83ff5d214a7f42e86ae62814526ba40a28cf.zip
external_llvm-0c0f83ff5d214a7f42e86ae62814526ba40a28cf.tar.gz
external_llvm-0c0f83ff5d214a7f42e86ae62814526ba40a28cf.tar.bz2
Favors pshufd over shufps when shuffling elements from one vector. pshufd is faster than shufps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49244 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/vec_shuffle-16.ll')
-rw-r--r--test/CodeGen/X86/vec_shuffle-16.ll25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/CodeGen/X86/vec_shuffle-16.ll b/test/CodeGen/X86/vec_shuffle-16.ll
new file mode 100644
index 0000000..2e12f6e
--- /dev/null
+++ b/test/CodeGen/X86/vec_shuffle-16.ll
@@ -0,0 +1,25 @@
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse | grep shufps | count 4
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse | grep mov | count 2
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep pshufd | count 4
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | not grep shufps
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | not grep mov
+
+define <4 x float> @t1(<4 x float> %a, <4 x float> %b) nounwind {
+ %tmp1 = shufflevector <4 x float> %b, <4 x float> undef, <4 x i32> zeroinitializer
+ ret <4 x float> %tmp1
+}
+
+define <4 x float> @t2(<4 x float> %A, <4 x float> %B) nounwind {
+ %tmp = shufflevector <4 x float> %A, <4 x float> %B, <4 x i32> < i32 3, i32 3, i32 3, i32 3 >
+ ret <4 x float> %tmp
+}
+
+define <4 x float> @t3(<4 x float> %A, <4 x float> %B) nounwind {
+ %tmp = shufflevector <4 x float> %A, <4 x float> %B, <4 x i32> < i32 4, i32 4, i32 4, i32 4 >
+ ret <4 x float> %tmp
+}
+
+define <4 x float> @t4(<4 x float> %A, <4 x float> %B) nounwind {
+ %tmp = shufflevector <4 x float> %A, <4 x float> %B, <4 x i32> < i32 1, i32 3, i32 2, i32 0 >
+ ret <4 x float> %tmp
+}