1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
| ; RUN: llc -mtriple=armv7k-apple-watchos2.0 < %s | FileCheck %s
define arm_aapcs_vfpcc float @t1(float %a, float %b) {
entry:
; CHECK: t1
; CHECK-NOT: vmov
; CHECK: vadd.f32
%a.addr = alloca float, align 4
%b.addr = alloca float, align 4
store float %a, float* %a.addr, align 4
store float %b, float* %b.addr, align 4
%0 = load float, float* %a.addr, align 4
%1 = load float, float* %b.addr, align 4
%add = fadd float %0, %1
ret float %add
}
define arm_aapcs_vfpcc double @t2(double %a, double %b) {
entry:
; CHECK: t2
; CHECK-NOT: vmov
; CHECK: vadd.f64
%a.addr = alloca double, align 8
%b.addr = alloca double, align 8
store double %a, double* %a.addr, align 8
store double %b, double* %b.addr, align 8
%0 = load double, double* %a.addr, align 8
%1 = load double, double* %b.addr, align 8
%add = fadd double %0, %1
ret double %add
}
define arm_aapcs_vfpcc i64 @t3(double %ti) {
entry:
; CHECK-LABEL: t3:
; CHECK-NOT: vmov
; CHECK: bl ___fixunsdfdi
%conv = fptoui double %ti to i64
ret i64 %conv
}
define arm_aapcs_vfpcc i64 @t4(double %ti) {
entry:
; CHECK-LABEL: t4:
; CHECK-NOT: vmov
; CHECK: bl ___fixdfdi
%conv = fptosi double %ti to i64
ret i64 %conv
}
define arm_aapcs_vfpcc double @t5(i64 %ti) {
entry:
; CHECK-LABEL: t5:
; CHECK: bl ___floatundidf
; CHECK-NOT: vmov
; CHECK: pop
%conv = uitofp i64 %ti to double
ret double %conv
}
define arm_aapcs_vfpcc double @t6(i64 %ti) {
entry:
; CHECK-LABEL: t6:
; CHECK: bl ___floatdidf
; CHECK-NOT: vmov
; CHECK: pop
%conv = sitofp i64 %ti to double
ret double %conv
}
define arm_aapcs_vfpcc float @t7(i64 %ti) {
entry:
; CHECK-LABEL: t7:
; CHECK: bl ___floatundisf
; CHECK-NOT: vmov
; CHECK: pop
%conv = uitofp i64 %ti to float
ret float %conv
}
define arm_aapcs_vfpcc float @t8(i64 %ti) {
entry:
; CHECK-LABEL: t8:
; CHECK: bl ___floatdisf
; CHECK-NOT: vmov
; CHECK: pop
%conv = sitofp i64 %ti to float
ret float %conv
}
define arm_aapcs_vfpcc double @t9(double %d0, double %d1, double %d2, double %d3, double %d4, double %d5, double %d6, double %d7, float %a, float %b) {
entry:
; CHECK-LABEL: t9:
; CHECK-NOT: vmov
; CHECK: vldr
%add = fadd float %a, %b
%conv = fpext float %add to double
ret double %conv
}
define arm_aapcs_vfpcc double @t10(double %d0, double %d1, double %d2, double %d3, double %d4, double %d5, double %a, float %b, double %c) {
entry:
; CHECK-LABEL: t10:
; CHECK-NOT: vmov
; CHECK: vldr
%add = fadd double %a, %c
ret double %add
}
define arm_aapcs_vfpcc float @t11(double %d0, double %d1, double %d2, double %d3, double %d4, double %d5, double %d6, float %a, double %b, float %c) {
entry:
; CHECK-LABEL: t11:
; CHECK: vldr
%add = fadd float %a, %c
ret float %add
}
define arm_aapcs_vfpcc double @t12(double %a, double %b) {
entry:
; CHECK-LABEL: t12:
; CHECK: vstr
%add = fadd double %a, %b
%sub = fsub double %a, %b
%call = tail call arm_aapcs_vfpcc double @x(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double %add, float 0.000000e+00, double %sub)
ret double %call
}
define arm_aapcs_vfpcc double @t13(double %x) {
entry:
; CHECK-LABEL: t13:
; CHECK-NOT: vmov
; CHECK: bl ___sincos_stret
%call = tail call arm_aapcs_vfpcc double @cos(double %x)
%call1 = tail call arm_aapcs_vfpcc double @sin(double %x)
%mul = fmul double %call, %call1
ret double %mul
}
define arm_aapcs_vfpcc double @t14(double %x) {
; CHECK-LABEL: t14:
; CHECK-NOT: vmov
; CHECK: b ___exp10
%__exp10 = tail call double @__exp10(double %x) #1
ret double %__exp10
}
declare arm_aapcs_vfpcc double @x(double, double, double, double, double, double, double, float, double)
declare arm_aapcs_vfpcc double @cos(double) #0
declare arm_aapcs_vfpcc double @sin(double) #0
declare double @__exp10(double)
attributes #0 = { readnone }
attributes #1 = { readonly }
|