blob: f034b0aa7102aa30a082e210b05a3ea21e111997 [file] [log] [blame]
Dan Gohman0a063102009-09-08 23:54:48 +00001; RUN: llc < %s -march=x86 -mattr=+sse2 -o %t
Dan Gohman8c89a502007-08-15 13:36:28 +00002; RUN: grep movapd %t | count 1
3; RUN: grep movaps %t | count 1
4; RUN: grep movups %t | count 2
Dan Gohmanf17a25c2007-07-18 16:29:46 +00005
6target triple = "i686-apple-darwin"
Tanya Lattner632e88a2008-02-21 07:42:26 +00007@x = global [4 x i32] [ i32 1, i32 2, i32 3, i32 4 ] ; <[4 x i32]*> [#uses=4]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00008
Tanya Lattner632e88a2008-02-21 07:42:26 +00009define <2 x i64> @test1() {
10 %tmp = load i32* getelementptr ([4 x i32]* @x, i32 0, i32 0) ; <i32> [#uses=1]
11 %tmp3 = load i32* getelementptr ([4 x i32]* @x, i32 0, i32 1) ; <i32> [#uses=1]
12 %tmp5 = load i32* getelementptr ([4 x i32]* @x, i32 0, i32 2) ; <i32> [#uses=1]
13 %tmp7 = load i32* getelementptr ([4 x i32]* @x, i32 0, i32 3) ; <i32> [#uses=1]
14 %tmp.upgrd.1 = insertelement <4 x i32> undef, i32 %tmp, i32 0 ; <<4 x i32>> [#uses=1]
15 %tmp13 = insertelement <4 x i32> %tmp.upgrd.1, i32 %tmp3, i32 1 ; <<4 x i32>> [#uses=1]
16 %tmp14 = insertelement <4 x i32> %tmp13, i32 %tmp5, i32 2 ; <<4 x i32>> [#uses=1]
17 %tmp15 = insertelement <4 x i32> %tmp14, i32 %tmp7, i32 3 ; <<4 x i32>> [#uses=1]
18 %tmp16 = bitcast <4 x i32> %tmp15 to <2 x i64> ; <<2 x i64>> [#uses=1]
19 ret <2 x i64> %tmp16
Dan Gohmanf17a25c2007-07-18 16:29:46 +000020}
21
Tanya Lattner632e88a2008-02-21 07:42:26 +000022define <4 x float> @test2(i32 %dummy, float %a, float %b, float %c, float %d) {
23 %tmp = insertelement <4 x float> undef, float %a, i32 0 ; <<4 x float>> [#uses=1]
24 %tmp11 = insertelement <4 x float> %tmp, float %b, i32 1 ; <<4 x float>> [#uses=1]
25 %tmp12 = insertelement <4 x float> %tmp11, float %c, i32 2 ; <<4 x float>> [#uses=1]
26 %tmp13 = insertelement <4 x float> %tmp12, float %d, i32 3 ; <<4 x float>> [#uses=1]
Dan Gohmanf17a25c2007-07-18 16:29:46 +000027 ret <4 x float> %tmp13
28}
29
Tanya Lattner632e88a2008-02-21 07:42:26 +000030define <4 x float> @test3(float %a, float %b, float %c, float %d) {
31 %tmp = insertelement <4 x float> undef, float %a, i32 0 ; <<4 x float>> [#uses=1]
32 %tmp11 = insertelement <4 x float> %tmp, float %b, i32 1 ; <<4 x float>> [#uses=1]
33 %tmp12 = insertelement <4 x float> %tmp11, float %c, i32 2 ; <<4 x float>> [#uses=1]
34 %tmp13 = insertelement <4 x float> %tmp12, float %d, i32 3 ; <<4 x float>> [#uses=1]
Dan Gohmanf17a25c2007-07-18 16:29:46 +000035 ret <4 x float> %tmp13
36}
37
Tanya Lattner632e88a2008-02-21 07:42:26 +000038define <2 x double> @test4(double %a, double %b) {
39 %tmp = insertelement <2 x double> undef, double %a, i32 0 ; <<2 x double>> [#uses=1]
40 %tmp7 = insertelement <2 x double> %tmp, double %b, i32 1 ; <<2 x double>> [#uses=1]
Dan Gohmanf17a25c2007-07-18 16:29:46 +000041 ret <2 x double> %tmp7
42}