Add SplitKit::isOriginalEndpoint and use it to force live range splitting to terminate.
[oota-llvm.git] / test / CodeGen / X86 / 2010-04-23-mmx-movdq2q.ll
1 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=+mmx,+sse2 | FileCheck %s
2 ; There are no MMX operations here, so we use XMM or i64.
3
4 define void @ti8(double %a, double %b) nounwind {
5 entry:
6         %tmp1 = bitcast double %a to <8 x i8>
7         %tmp2 = bitcast double %b to <8 x i8>
8         %tmp3 = add <8 x i8> %tmp1, %tmp2
9 ; CHECK:  paddb %xmm1, %xmm0
10         store <8 x i8> %tmp3, <8 x i8>* null
11         ret void
12 }
13
14 define void @ti16(double %a, double %b) nounwind {
15 entry:
16         %tmp1 = bitcast double %a to <4 x i16>
17         %tmp2 = bitcast double %b to <4 x i16>
18         %tmp3 = add <4 x i16> %tmp1, %tmp2
19 ; CHECK:  paddw %xmm1, %xmm0
20         store <4 x i16> %tmp3, <4 x i16>* null
21         ret void
22 }
23
24 define void @ti32(double %a, double %b) nounwind {
25 entry:
26         %tmp1 = bitcast double %a to <2 x i32>
27         %tmp2 = bitcast double %b to <2 x i32>
28         %tmp3 = add <2 x i32> %tmp1, %tmp2
29 ; CHECK:  paddd %xmm1, %xmm0
30         store <2 x i32> %tmp3, <2 x i32>* null
31         ret void
32 }
33
34 define void @ti64(double %a, double %b) nounwind {
35 entry:
36         %tmp1 = bitcast double %a to <1 x i64>
37         %tmp2 = bitcast double %b to <1 x i64>
38         %tmp3 = add <1 x i64> %tmp1, %tmp2
39 ; CHECK:  addq  %rax, %rcx
40         store <1 x i64> %tmp3, <1 x i64>* null
41         ret void
42 }
43
44 ; MMX intrinsics calls get us MMX instructions.
45
46 define void @ti8a(double %a, double %b) nounwind {
47 entry:
48         %tmp1 = bitcast double %a to x86_mmx
49 ; CHECK: movdq2q
50         %tmp2 = bitcast double %b to x86_mmx
51 ; CHECK: movdq2q
52         %tmp3 = tail call x86_mmx @llvm.x86.mmx.padd.b(x86_mmx %tmp1, x86_mmx %tmp2)
53         store x86_mmx %tmp3, x86_mmx* null
54         ret void
55 }
56
57 define void @ti16a(double %a, double %b) nounwind {
58 entry:
59         %tmp1 = bitcast double %a to x86_mmx
60 ; CHECK: movdq2q
61         %tmp2 = bitcast double %b to x86_mmx
62 ; CHECK: movdq2q
63         %tmp3 = tail call x86_mmx @llvm.x86.mmx.padd.w(x86_mmx %tmp1, x86_mmx %tmp2)
64         store x86_mmx %tmp3, x86_mmx* null
65         ret void
66 }
67
68 define void @ti32a(double %a, double %b) nounwind {
69 entry:
70         %tmp1 = bitcast double %a to x86_mmx
71 ; CHECK: movdq2q
72         %tmp2 = bitcast double %b to x86_mmx
73 ; CHECK: movdq2q
74         %tmp3 = tail call x86_mmx @llvm.x86.mmx.padd.d(x86_mmx %tmp1, x86_mmx %tmp2)
75         store x86_mmx %tmp3, x86_mmx* null
76         ret void
77 }
78
79 define void @ti64a(double %a, double %b) nounwind {
80 entry:
81         %tmp1 = bitcast double %a to x86_mmx
82 ; CHECK: movdq2q
83         %tmp2 = bitcast double %b to x86_mmx
84 ; CHECK: movdq2q
85         %tmp3 = tail call x86_mmx @llvm.x86.mmx.padd.q(x86_mmx %tmp1, x86_mmx %tmp2)
86         store x86_mmx %tmp3, x86_mmx* null
87         ret void
88 }
89  
90 declare x86_mmx @llvm.x86.mmx.padd.b(x86_mmx, x86_mmx)
91 declare x86_mmx @llvm.x86.mmx.padd.w(x86_mmx, x86_mmx)
92 declare x86_mmx @llvm.x86.mmx.padd.d(x86_mmx, x86_mmx)
93 declare x86_mmx @llvm.x86.mmx.padd.q(x86_mmx, x86_mmx)