blob: 582804444f3b97cce1f6e4f6444e0391e79504e8 [file] [log] [blame]
Chris Dewhurst68388a02016-05-18 09:14:13 +00001; RUN: llc -march=sparc -mattr=soft-float -O0 < %s | FileCheck %s
2
3; Arithmetic functions
4
5define float @test_addsf3(float %a, float %b) #0 {
6 ; CHECK-LABEL: test_addsf3:
7 ; CHECK: call __addsf3
8 %add = fadd float %a, %b
9 ret float %add
10}
11
12define double @test_adddf3(double %a, double %b) #0 {
13 ; CHECK-LABEL: test_adddf3:
14 ; CHECK: call __adddf3
15 %add = fadd double %a, %b
16 ret double %add
17}
18
19define fp128 @test_addtf3(fp128 %a, fp128 %b) #0 {
20 ; CHECK-LABEL: test_addtf3:
21 ; CHECK: call __addtf3
22 %add = fadd fp128 %a, %b
23 ret fp128 %add
24}
25
26define float @test_mulsf3(float %a, float %b) #0 {
27 ; CHECK-LABEL: test_mulsf3:
28 ; CHECK: call __mulsf3
29 %mul = fmul float %a, %b
30 ret float %mul
31}
32
33define double @test_muldf3(double %a, double %b) #0 {
34 ; CHECK-LABEL: test_muldf3:
35 ; CHECK: call __muldf3
36 %mul = fmul double %a, %b
37 ret double %mul
38}
39
40define fp128 @test_multf3(fp128 %a, fp128 %b) #0 {
41 ; CHECK-LABEL: test_multf3:
42 ; CHECK: call __multf3
43 %mul = fmul fp128 %a, %b
44 ret fp128 %mul
45}
46
47define float @test_subsf3(float %a, float %b) #0 {
Davide Italianodb009392017-01-04 14:01:58 +000048 ; CHECK-LABEL: test_subsf3:
Chris Dewhurst68388a02016-05-18 09:14:13 +000049 ; CHECK: call __subsf3
50 %sub = fsub float %a, %b
51 ret float %sub
52}
53
54define double @test_subdf3(double %a, double %b) #0 {
Davide Italianodb009392017-01-04 14:01:58 +000055 ; CHECK-LABEL: test_subdf3:
Chris Dewhurst68388a02016-05-18 09:14:13 +000056 ; CHECK: call __subdf3
57 %sub = fsub double %a, %b
58 ret double %sub
59}
60
61define fp128 @test_subtf3(fp128 %a, fp128 %b) #0 {
Davide Italianodb009392017-01-04 14:01:58 +000062 ; CHECK-LABEL: test_subtf3:
Chris Dewhurst68388a02016-05-18 09:14:13 +000063 ; CHECK: call __subtf3
64 %sub = fsub fp128 %a, %b
65 ret fp128 %sub
66}
67
68define float @test_divsf3(float %a, float %b) #0 {
69 ; CHECK-LABEL: test_divsf3:
70 ; CHECK: call __divsf3
71 %div = fdiv float %a, %b
72 ret float %div
73}
74
75define double @test_divdf3(double %a, double %b) #0 {
76 ; CHECK-LABEL: test_divdf3:
77 ; CHECK: call __divdf3
78 %div = fdiv double %a, %b
79 ret double %div
80}
81
82define fp128 @test_divtf3(fp128 %a, fp128 %b) #0 {
83 ; CHECK-LABEL: test_divtf3:
84 ; CHECK: call __divtf3
85 %div = fdiv fp128 %a, %b
86 ret fp128 %div
87}
88
89; Comparison functions
90define i1 @test_unordsf2(float %a, float %b) #0 {
91 ; CHECK-LABEL: test_unordsf2:
92 ; CHECK: call __unordsf2
93 %cmp = fcmp uno float %a, %b
94 ret i1 %cmp
95}
96
97define i1 @test_unorddf2(double %a, double %b) #0 {
98 ; CHECK-LABEL: test_unorddf2:
99 ; CHECK: call __unorddf2
100 %cmp = fcmp uno double %a, %b
101 ret i1 %cmp
102}
103
104define i1 @test_unordtf2(fp128 %a, fp128 %b) #0 {
105 ; CHECK-LABEL: test_unordtf2:
106 ; CHECK: call __unordtf2
107 %cmp = fcmp uno fp128 %a, %b
108 ret i1 %cmp
109}
110
111define i1 @test_eqsf2(float %a, float %b) #0 {
112 ; CHECK-LABEL: test_eqsf2:
113 ; CHECK: call __eqsf2
114 %cmp = fcmp oeq float %a, %b
115 ret i1 %cmp
116}
117
118define i1 @test_eqdf2(double %a, double %b) #0 {
119 ; CHECK-LABEL: test_eqdf2:
120 ; CHECK: call __eqdf2
121 %cmp = fcmp oeq double %a, %b
122 ret i1 %cmp
123}
124
125define i1 @test_eqtf2(fp128 %a, fp128 %b) #0 {
126 ; CHECK-LABEL: test_eqtf2:
127 ; CHECK: call __eqtf2
128 %cmp = fcmp oeq fp128 %a, %b
129 ret i1 %cmp
130}
131
132define i1 @test_nesf2(float %a, float %b) #0 {
133 ; CHECK-LABEL: test_nesf2:
134 ; CHECK: call __nesf2
135 %cmp = fcmp une float %a, %b
136 ret i1 %cmp
137}
138
139define i1 @test_nedf2(double %a, double %b) #0 {
140 ; CHECK-LABEL: test_nedf2:
141 ; CHECK: call __nedf2
142 %cmp = fcmp une double %a, %b
143 ret i1 %cmp
144}
145
146define i1 @test_netf2(fp128 %a, fp128 %b) #0 {
147 ; CHECK-LABEL: test_netf2:
148 ; CHECK: call __netf2
149 %cmp = fcmp une fp128 %a, %b
150 ret i1 %cmp
151}
152
153define i1 @test_gesf2(float %a, float %b) #0 {
154 ; CHECK-LABLE: test_gesf2:
155 ; CHECK: call __gesf2
156 %cmp = fcmp oge float %a, %b
157 ret i1 %cmp
158}
159
160define i1 @test_gedf2(double %a, double %b) #0 {
161 ; CHECK-LABLE: test_gedf2:
162 ; CHECK: call __gedf2
163 %cmp = fcmp oge double %a, %b
164 ret i1 %cmp
165}
166
167define i1 @test_getf2(fp128 %a, fp128 %b) #0 {
168 ; CHECK-LABLE: test_getf2:
169 ; CHECK: call __getf2
170 %cmp = fcmp oge fp128 %a, %b
171 ret i1 %cmp
172}
173
174define i1 @test_ltsf2(float %a, float %b) #0 {
175 ; CHECK-LABEL: test_ltsf2:
176 ; CHECK: call __ltsf2
177 %cmp = fcmp olt float %a, %b
178 ret i1 %cmp
179}
180
181define i1 @test_ltdf2(double %a, double %b) #0 {
182 ; CHECK-LABEL: test_ltdf2:
183 ; CHECK: call __ltdf2
184 %cmp = fcmp olt double %a, %b
185 ret i1 %cmp
186}
187
188define i1 @test_lttf2(fp128 %a, fp128 %b) #0 {
189 ; CHECK-LABEL: test_lttf2:
190 ; CHECK: call __lttf2
191 %cmp = fcmp olt fp128 %a, %b
192 ret i1 %cmp
193}
194
195define i1 @test_lesf2(float %a, float %b) #0 {
196 ; CHECK-LABEL: test_lesf2:
197 ; CHECK: call __lesf2
198 %cmp = fcmp ole float %a, %b
199 ret i1 %cmp
200}
201
202define i1 @test_ledf2(double %a, double %b) #0 {
203 ; CHECK-LABEL: test_ledf2:
204 ; CHECK: call __ledf2
205 %cmp = fcmp ole double %a, %b
206 ret i1 %cmp
207}
208
209define i1 @test_letf2(fp128 %a, fp128 %b) #0 {
210 ; CHECK-LABEL: test_letf2:
211 ; CHECK: call __letf2
212 %cmp = fcmp ole fp128 %a, %b
213 ret i1 %cmp
214}
215
216define i1 @test_gtsf2(float %a, float %b) #0 {
217 ; CHECK-LABEL: test_gtsf2:
218 ; CHECK: call __gtsf2
219 %cmp = fcmp ogt float %a, %b
220 ret i1 %cmp
221}
222
223define i1 @test_gtdf2(double %a, double %b) #0 {
224 ; CHECK-LABEL: test_gtdf2:
225 ; CHECK: call __gtdf2
226 %cmp = fcmp ogt double %a, %b
227 ret i1 %cmp
228}
229
230define i1 @test_gttf2(fp128 %a, fp128 %b) #0 {
231 ; CHECK-LABEL: test_gttf2:
232 ; CHECK: call __gttf2
233 %cmp = fcmp ogt fp128 %a, %b
234 ret i1 %cmp
235}