blob: 4fc652c022ae2ec600f1a21d7686f91f0012b1aa [file] [log] [blame]
Tanya Lattner33eefff2008-02-21 07:42:26 +00001; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -o %t -f
Evan Cheng7a831ce2007-12-15 03:00:47 +00002; RUN: grep movlhps %t | count 1
Evan Cheng7a831ce2007-12-15 03:00:47 +00003; RUN: grep movq %t | count 1
Evan Cheng7e2ff772008-05-08 00:57:18 +00004; RUN: grep movsd %t | count 1
Evan Chengee183472006-04-22 06:19:11 +00005
Evan Cheng687bcb22008-05-07 22:59:08 +00006define <4 x float> @test1(float %a, float %b) nounwind {
Tanya Lattner33eefff2008-02-21 07:42:26 +00007 %tmp = insertelement <4 x float> zeroinitializer, float %a, i32 0 ; <<4 x float>> [#uses=1]
8 %tmp6 = insertelement <4 x float> %tmp, float 0.000000e+00, i32 1 ; <<4 x float>> [#uses=1]
9 %tmp8 = insertelement <4 x float> %tmp6, float %b, i32 2 ; <<4 x float>> [#uses=1]
10 %tmp9 = insertelement <4 x float> %tmp8, float 0.000000e+00, i32 3 ; <<4 x float>> [#uses=1]
Evan Chengee183472006-04-22 06:19:11 +000011 ret <4 x float> %tmp9
12}
13
Evan Cheng687bcb22008-05-07 22:59:08 +000014define <4 x float> @test2(float %a, float %b) nounwind {
Tanya Lattner33eefff2008-02-21 07:42:26 +000015 %tmp = insertelement <4 x float> zeroinitializer, float %a, i32 0 ; <<4 x float>> [#uses=1]
16 %tmp7 = insertelement <4 x float> %tmp, float %b, i32 1 ; <<4 x float>> [#uses=1]
17 %tmp8 = insertelement <4 x float> %tmp7, float 0.000000e+00, i32 2 ; <<4 x float>> [#uses=1]
18 %tmp9 = insertelement <4 x float> %tmp8, float 0.000000e+00, i32 3 ; <<4 x float>> [#uses=1]
Evan Chengee183472006-04-22 06:19:11 +000019 ret <4 x float> %tmp9
20}
21
Evan Cheng687bcb22008-05-07 22:59:08 +000022define <2 x i64> @test3(i32 %a, i32 %b) nounwind {
Tanya Lattner33eefff2008-02-21 07:42:26 +000023 %tmp = insertelement <4 x i32> zeroinitializer, i32 %a, i32 0 ; <<4 x i32>> [#uses=1]
24 %tmp6 = insertelement <4 x i32> %tmp, i32 %b, i32 1 ; <<4 x i32>> [#uses=1]
25 %tmp8 = insertelement <4 x i32> %tmp6, i32 0, i32 2 ; <<4 x i32>> [#uses=1]
26 %tmp10 = insertelement <4 x i32> %tmp8, i32 0, i32 3 ; <<4 x i32>> [#uses=1]
27 %tmp11 = bitcast <4 x i32> %tmp10 to <2 x i64> ; <<2 x i64>> [#uses=1]
28 ret <2 x i64> %tmp11
Evan Chengee183472006-04-22 06:19:11 +000029}