blob: 661fe09d5cd6f08d816e9b9d8406367c1f988c7b [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f
2; RUN: grep movapd %t | wc -l | grep 1
3; RUN: grep movaps %t | wc -l | grep 1
4; RUN: grep movups %t | wc -l | grep 2
5
6target triple = "i686-apple-darwin"
7
8%x = global [4 x int] [ int 1, int 2, int 3, int 4 ]
9
10<2 x long> %test1() {
11 %tmp = load int* getelementptr ([4 x int]* %x, int 0, int 0)
12 %tmp3 = load int* getelementptr ([4 x int]* %x, int 0, int 1)
13 %tmp5 = load int* getelementptr ([4 x int]* %x, int 0, int 2)
14 %tmp7 = load int* getelementptr ([4 x int]* %x, int 0, int 3)
15 %tmp = insertelement <4 x int> undef, int %tmp, uint 0
16 %tmp13 = insertelement <4 x int> %tmp, int %tmp3, uint 1
17 %tmp14 = insertelement <4 x int> %tmp13, int %tmp5, uint 2
18 %tmp15 = insertelement <4 x int> %tmp14, int %tmp7, uint 3
19 %tmp16 = cast <4 x int> %tmp15 to <2 x long>
20 ret <2 x long> %tmp16
21}
22
23<4 x float> %test2(int %dummy, float %a, float %b, float %c, float %d) {
24 %tmp = insertelement <4 x float> undef, float %a, uint 0
25 %tmp11 = insertelement <4 x float> %tmp, float %b, uint 1
26 %tmp12 = insertelement <4 x float> %tmp11, float %c, uint 2
27 %tmp13 = insertelement <4 x float> %tmp12, float %d, uint 3
28 ret <4 x float> %tmp13
29}
30
31<4 x float> %test3(float %a, float %b, float %c, float %d) {
32 %tmp = insertelement <4 x float> undef, float %a, uint 0
33 %tmp11 = insertelement <4 x float> %tmp, float %b, uint 1
34 %tmp12 = insertelement <4 x float> %tmp11, float %c, uint 2
35 %tmp13 = insertelement <4 x float> %tmp12, float %d, uint 3
36 ret <4 x float> %tmp13
37}
38
39<2 x double> %test4(double %a, double %b) {
40 %tmp = insertelement <2 x double> undef, double %a, uint 0
41 %tmp7 = insertelement <2 x double> %tmp, double %b, uint 1
42 ret <2 x double> %tmp7
43}