Add check so we don't try to perform an impossible transformation. Fixes issue from...
[oota-llvm.git] / test / CodeGen / X86 / vec_shuffle.ll
index 34c039ac2042d99ccb5f46e2d895145a2c4e2cc6..65995984859bfcbbdbc8a2d1a22c01effbb9a2e1 100644 (file)
@@ -1,9 +1,9 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -o %t -f
-; RUN: grep shufp   %t | count 1
-; RUN: grep movupd  %t | count 1
-; RUN: grep pshufhw %t | count 1
+; RUN: llc < %s -mtriple=i686-linux -mcpu=core2 | FileCheck %s
 
-define void @test_v4sf(<4 x float>* %P, float %X, float %Y) {
+; CHECK: test_v4sf
+; CHECK: movq 8(%esp)
+; CHECK: pshufd $80
+define void @test_v4sf(<4 x float>* %P, float %X, float %Y) nounwind {
        %tmp = insertelement <4 x float> zeroinitializer, float %X, i32 0               ; <<4 x float>> [#uses=1]
        %tmp2 = insertelement <4 x float> %tmp, float %X, i32 1         ; <<4 x float>> [#uses=1]
        %tmp4 = insertelement <4 x float> %tmp2, float %Y, i32 2                ; <<4 x float>> [#uses=1]
@@ -12,14 +12,20 @@ define void @test_v4sf(<4 x float>* %P, float %X, float %Y) {
        ret void
 }
 
-define void @test_v2sd(<2 x double>* %P, double %X, double %Y) {
+; CHECK: test_v2sd
+; CHECK: movups        8(%esp)
+; CHECK: movaps
+define void @test_v2sd(<2 x double>* %P, double %X, double %Y) nounwind {
        %tmp = insertelement <2 x double> zeroinitializer, double %X, i32 0             ; <<2 x double>> [#uses=1]
        %tmp2 = insertelement <2 x double> %tmp, double %Y, i32 1               ; <<2 x double>> [#uses=1]
        store <2 x double> %tmp2, <2 x double>* %P
        ret void
 }
 
-define void @test_v8i16(<2 x i64>* %res, <2 x i64>* %A) {
+; CHECK: test_v8i16
+; CHECK: pshufhw $-58
+; CHECK: movdqa
+define void @test_v8i16(<2 x i64>* %res, <2 x i64>* %A) nounwind {
        %tmp = load <2 x i64>* %A               ; <<2 x i64>> [#uses=1]
        %tmp.upgrd.1 = bitcast <2 x i64> %tmp to <8 x i16>              ; <<8 x i16>> [#uses=8]
        %tmp.upgrd.2 = extractelement <8 x i16> %tmp.upgrd.1, i32 0             ; <i16> [#uses=1]