aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-03-22 19:12:46 +0000
committerChris Lattner <sabre@nondot.org>2006-03-22 19:12:46 +0000
commit6bf9791d5196bf5a66309d3b7c27b87a3d60ab72 (patch)
treec9990c0228fd2f5695212b09263e5d7efdffe5b3 /test
parent0188ecba85c7139f237baa4ce5612fdfc83e1b84 (diff)
downloadexternal_llvm-6bf9791d5196bf5a66309d3b7c27b87a3d60ab72.zip
external_llvm-6bf9791d5196bf5a66309d3b7c27b87a3d60ab72.tar.gz
external_llvm-6bf9791d5196bf5a66309d3b7c27b87a3d60ab72.tar.bz2
test that vspltw is generated for test cases
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26955 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/PowerPC/vec_spat.ll31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/CodeGen/PowerPC/vec_spat.ll b/test/CodeGen/PowerPC/vec_spat.ll
new file mode 100644
index 0000000..a06b625
--- /dev/null
+++ b/test/CodeGen/PowerPC/vec_spat.ll
@@ -0,0 +1,31 @@
+; Test that vectors are scalarized/lowered correctly.
+; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 | grep vspltw | wc -l | grep 2 &&
+; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g3 | grep stfs | wc -l | grep 4
+
+%f4 = type <4 x float>
+%i4 = type <4 x int>
+
+implementation
+
+void %splat(%f4* %P, %f4* %Q, float %X) {
+ %tmp = insertelement %f4 undef, float %X, uint 0
+ %tmp2 = insertelement %f4 %tmp, float %X, uint 1
+ %tmp4 = insertelement %f4 %tmp2, float %X, uint 2
+ %tmp6 = insertelement %f4 %tmp4, float %X, uint 3
+ %q = load %f4* %Q
+ %R = add %f4 %q, %tmp6
+ store %f4 %R, %f4* %P
+ ret void
+}
+
+void %splat_i4(%i4* %P, %i4* %Q, int %X) {
+ %tmp = insertelement %i4 undef, int %X, uint 0
+ %tmp2 = insertelement %i4 %tmp, int %X, uint 1
+ %tmp4 = insertelement %i4 %tmp2, int %X, uint 2
+ %tmp6 = insertelement %i4 %tmp4, int %X, uint 3
+ %q = load %i4* %Q
+ %R = add %i4 %q, %tmp6
+ store %i4 %R, %i4* %P
+ ret void
+}
+