Fix a latent bug exposed by my truncstore patch. We compiled stfiwx-2.ll to:
[oota-llvm.git] / test / CodeGen / PowerPC / vec_spat.ll
index c8c6e4a5e614b50f5e186edddd6c33b6a4c09a6c..a8acee06264dcff20637597001e0219d2357d19c 100644 (file)
@@ -1,8 +1,10 @@
 ; 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 &&
-; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 | grep vsplti | wc -l | grep 2 &&
-; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 | grep vsplth | wc -l | grep 1
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g3 | \
+; RUN:    grep stfs | count 4
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 -o %t -f
+; RUN: grep vspltw %t | count 2
+; RUN: grep vsplti %t | count 3
+; RUN: grep vsplth %t | count 1
 
 %f4 = type <4 x float>
 %i4 = type <4 x int>
@@ -59,3 +61,13 @@ void %splat_h(short %tmp, <16 x ubyte>* %dst) {
        ret void
 }
 
+void %spltish(<16 x ubyte>* %A, <16 x ubyte>* %B) {
+       ; Gets converted to 16 x ubyte 
+        %tmp = load <16 x ubyte>* %B            
+        %tmp.s = cast <16 x ubyte> %tmp to <16 x sbyte>           
+        %tmp4 = sub <16 x sbyte> %tmp.s, cast (<8 x short> < short 15, short 15, short 15, short 15, short 15, short 15, short 15, short 15 > to <16 x sbyte>)            
+        %tmp4.u = cast <16 x sbyte> %tmp4 to <16 x ubyte>         
+        store <16 x ubyte> %tmp4.u, <16 x ubyte>* %A
+        ret void
+}
+