1 ; RUN: llc -march=mipsel < %s | FileCheck -check-prefix=ALL %s
2 ; RUN: llc -march=mipsel -mcpu=mips32 < %s | FileCheck -check-prefixes=ALL,NO-MFHC1 %s
3 ; RUN: llc -march=mipsel -mcpu=mips32r2 < %s | FileCheck -check-prefixes=ALL,HAS-MFHC1 %s
4 ; RUN: llc -march=mipsel -mcpu=mips32r2 -mattr=+fp64 < %s | FileCheck -check-prefixes=ALL,HAS-MFHC1 %s
7 ; ALL-LABEL: testlowercall0:
8 ; ALL-DAG: ldc1 $f12, %lo
9 ; ALL-DAG: ldc1 $f14, %lo
10 define void @testlowercall0() nounwind {
12 tail call void @f0(double 5.000000e+00, double 6.000000e+00) nounwind
16 declare void @f0(double, double)
19 ; ALL-LABEL: testlowercall1:
20 ; ALL-DAG: lwc1 $f12, %lo
21 ; ALL-DAG: lwc1 $f14, %lo
22 define void @testlowercall1() nounwind {
24 tail call void @f1(float 8.000000e+00, float 9.000000e+00) nounwind
28 declare void @f1(float, float)
31 ; ALL-LABEL: testlowercall2:
32 ; ALL-DAG: lwc1 $f12, %lo
33 ; ALL-DAG: ldc1 $f14, %lo
34 define void @testlowercall2() nounwind {
36 tail call void @f2(float 8.000000e+00, double 6.000000e+00) nounwind
40 declare void @f2(float, double)
43 ; ALL-LABEL: testlowercall3:
44 ; ALL-DAG: ldc1 $f12, %lo
45 ; ALL-DAG: lwc1 $f14, %lo
46 define void @testlowercall3() nounwind {
48 tail call void @f3(double 5.000000e+00, float 9.000000e+00) nounwind
52 declare void @f3(double, float)
55 ; ALL-LABEL: testlowercall4:
56 ; ALL-DAG: addiu $4, $zero, 12
57 ; ALL-DAG: addiu $5, $zero, 13
58 ; ALL-DAG: addiu $6, $zero, 14
59 ; ALL-DAG: addiu $7, $zero, 15
60 define void @testlowercall4() nounwind {
62 tail call void @f4(i32 12, i32 13, i32 14, i32 15) nounwind
66 declare void @f4(i32, i32, i32, i32)
69 ; ALL-LABEL: testlowercall5:
70 ; ALL-DAG: ldc1 $f12, %lo
71 ; ALL-DAG: addiu $6, $zero, 23
72 ; ALL-DAG: sw ${{[a-z0-9]+}}, 16($sp)
73 ; ALL-DAG: sw ${{[a-z0-9]+}}, 20($sp)
74 define void @testlowercall5() nounwind {
76 tail call void @f5(double 1.500000e+01, i32 23, double 1.700000e+01) nounwind
80 declare void @f5(double, i32, double)
83 ; ALL-LABEL: testlowercall6:
84 ; ALL-DAG: ldc1 $f12, %lo
85 ; ALL-DAG: addiu $6, $zero, 33
86 ; ALL-DAG: addiu $7, $zero, 24
87 define void @testlowercall6() nounwind {
89 tail call void @f6(double 2.500000e+01, i32 33, i32 24) nounwind
93 declare void @f6(double, i32, i32)
96 ; ALL-LABEL: testlowercall7:
97 ; ALL-DAG: lwc1 $f12, %lo
98 ; ALL-DAG: addiu $5, $zero, 43
99 ; ALL-DAG: addiu $6, $zero, 34
100 define void @testlowercall7() nounwind {
102 tail call void @f7(float 1.800000e+01, i32 43, i32 34) nounwind
106 declare void @f7(float, i32, i32)
109 ; ALL-LABEL: testlowercall8:
110 ; ALL-DAG: addiu $4, $zero, 22
111 ; ALL-DAG: addiu $5, $zero, 53
112 ; ALL-DAG: addiu $6, $zero, 44
113 ; ALL-DAG: sw ${{[a-z0-9]+}}, 16($sp)
114 ; ALL-DAG: sw ${{[a-z0-9]+}}, 20($sp)
115 define void @testlowercall8() nounwind {
117 tail call void @f8(i32 22, i32 53, i32 44, double 4.000000e+00) nounwind
121 declare void @f8(i32, i32, i32, double)
124 ; ALL-LABEL: testlowercall9:
125 ; ALL-DAG: addiu $4, $zero, 32
126 ; ALL-DAG: addiu $5, $zero, 63
127 ; ALL-DAG: addiu $6, $zero, 54
128 ; ALL-DAG: lui $7, 16688
129 define void @testlowercall9() nounwind {
131 tail call void @f9(i32 32, i32 63, i32 54, float 1.100000e+01) nounwind
135 declare void @f9(i32, i32, i32, float)
138 ; ALL-LABEL: testlowercall10:
140 ; ALL-DAG: addiu $4, $zero, 42
141 ; ALL-DAG: addiu $5, $zero, 73
143 ; NO-MFHC1-DAG: mfc1 $6, $f{{[0-9]+}}
144 ; NO-MFHC1-DAG: mfc1 $7, $f{{[0-9]+}}
146 ; HAS-MFHC1-DAG: mfc1 $6, $f{{[0-9]+}}
147 ; HAS-MFHC1-DAG: mfhc1 $7, $f{{[0-9]+}}
148 define void @testlowercall10() nounwind {
150 tail call void @f10(i32 42, i32 73, double 2.700000e+01) nounwind
154 declare void @f10(i32, i32, double)
157 ; ALL-LABEL: testlowercall11:
158 ; ALL-DAG: addiu $4, $zero, 52
160 ; NO-MFHC1-DAG: mfc1 $6, $f{{[0-9]+}}
161 ; NO-MFHC1-DAG: mfc1 $7, $f{{[0-9]+}}
163 ; HAS-MFHC1-DAG: mfc1 $6, $f{{[0-9]+}}
164 ; HAS-MFHC1-DAG: mfhc1 $7, $f{{[0-9]+}}
165 define void @testlowercall11() nounwind {
167 tail call void @f11(i32 52, double 1.600000e+01) nounwind
171 declare void @f11(i32, double)
174 ; ALL-LABEL: testlowercall12:
175 ; ALL-DAG: lwc1 $f12, %lo
176 ; ALL-DAG: lwc1 $f14, %lo
177 ; ALL-DAG: lui $6, 16672
178 ; ALL-DAG: lui $7, 16808
179 define void @testlowercall12() nounwind {
181 tail call void @f12(float 2.800000e+01, float 1.900000e+01, float 1.000000e+01, float 2.100000e+01) nounwind
185 declare void @f12(float, float, float, float)
188 ; ALL-LABEL: testlowercall13:
189 ; ALL-DAG: lwc1 $f12, %lo
190 ; ALL-DAG: addiu $5, $zero, 83
191 ; ALL-DAG: lui $6, 16800
192 ; ALL-DAG: addiu $7, $zero, 25
193 define void @testlowercall13() nounwind {
195 tail call void @f13(float 3.800000e+01, i32 83, float 2.000000e+01, i32 25) nounwind
200 declare void @f13(float, i32, float, i32)
203 ; ALL-LABEL: testlowercall14:
204 ; ALL-DAG: ldc1 $f12, %lo
205 ; ALL-DAG: lwc1 $f14, %lo
206 ; ALL-DAG: lui $7, 16880
207 define void @testlowercall14() nounwind {
209 tail call void @f14(double 3.500000e+01, float 2.900000e+01, float 3.000000e+01) nounwind
213 declare void @f14(double, float, float)
215 ; $f12, $f14, ($6, $7)
216 ; ALL-LABEL: testlowercall15:
217 ; ALL-DAG: lwc1 $f12, %lo
218 ; ALL-DAG: lwc1 $f14, %lo
220 ; NO-MFHC1-DAG: mfc1 $6, $f{{[0-9]+}}
221 ; NO-MFHC1-DAG: mfc1 $7, $f{{[0-9]+}}
223 ; HAS-MFHC1-DAG: mfc1 $6, $f{{[0-9]+}}
224 ; HAS-MFHC1-DAG: mfhc1 $7, $f{{[0-9]+}}
225 define void @testlowercall15() nounwind {
227 tail call void @f15(float 4.800000e+01, float 3.900000e+01, double 3.700000e+01) nounwind
231 declare void @f15(float, float, double)
234 ; ALL-LABEL: testlowercall16:
235 ; ALL-DAG: addiu $4, $zero, 62
236 ; ALL-DAG: lui $5, 16964
237 ; ALL-DAG: addiu $6, $zero, 64
238 ; ALL-DAG: lui $7, 16888
239 define void @testlowercall16() nounwind {
241 tail call void @f16(i32 62, float 4.900000e+01, i32 64, float 3.100000e+01) nounwind
245 declare void @f16(i32, float, i32, float)
248 ; ALL-LABEL: testlowercall17:
249 ; ALL-DAG: addiu $4, $zero, 72
250 ; ALL-DAG: lui $5, 17004
251 ; ALL-DAG: addiu $6, $zero, 74
252 ; ALL-DAG: addiu $7, $zero, 35
253 define void @testlowercall17() nounwind {
255 tail call void @f17(i32 72, float 5.900000e+01, i32 74, i32 35) nounwind
259 declare void @f17(i32, float, i32, i32)
262 ; ALL-LABEL: testlowercall18:
263 ; ALL-DAG: addiu $4, $zero, 82
264 ; ALL-DAG: addiu $5, $zero, 93
265 ; ALL-DAG: lui $6, 16928
266 ; ALL-DAG: addiu $7, $zero, 45
267 define void @testlowercall18() nounwind {
269 tail call void @f18(i32 82, i32 93, float 4.000000e+01, i32 45) nounwind
273 declare void @f18(i32, i32, float, i32)
276 ; $4, ($6, $7), stack
277 ; ALL-LABEL: testlowercall20:
278 ; ALL-DAG: addiu $4, $zero, 92
279 ; ALL-DAG: sw ${{[a-z0-9]+}}, 16($sp)
280 ; ALL-DAG: sw ${{[a-z0-9]+}}, 20($sp)
282 ; NO-MFHC1-DAG: mfc1 $6, $f{{[0-9]+}}
283 ; NO-MFHC1-DAG: mfc1 $7, $f{{[0-9]+}}
285 ; HAS-MFHC1-DAG: mfc1 $6, $f{{[0-9]+}}
286 ; HAS-MFHC1-DAG: mfhc1 $7, $f{{[0-9]+}}
287 define void @testlowercall20() nounwind {
289 tail call void @f20(i32 92, double 2.600000e+01, double 4.700000e+01) nounwind
293 declare void @f20(i32, double, double)
296 ; ALL-LABEL: testlowercall21:
297 ; ALL-DAG: lwc1 $f12, %lo
298 ; ALL-DAG: addiu $5, $zero, 103
299 define void @testlowercall21() nounwind {
301 tail call void @f21(float 5.800000e+01, i32 103) nounwind
305 declare void @f21(float, i32)
308 ; ALL-LABEL: testlowercall22:
309 ; ALL-DAG: lwc1 $f12, %lo
310 ; ALL-DAG: addiu $5, $zero, 113
312 ; NO-MFHC1-DAG: mfc1 $6, $f{{[0-9]+}}
313 ; NO-MFHC1-DAG: mfc1 $7, $f{{[0-9]+}}
315 ; HAS-MFHC1-DAG: mfc1 $6, $f{{[0-9]+}}
316 ; HAS-MFHC1-DAG: mfhc1 $7, $f{{[0-9]+}}
317 define void @testlowercall22() nounwind {
319 tail call void @f22(float 6.800000e+01, i32 113, double 5.700000e+01) nounwind
323 declare void @f22(float, i32, double)
326 ; ALL-LABEL: testlowercall23:
327 ; ALL-DAG: ldc1 $f12, %lo
328 ; ALL-DAG: addiu $6, $zero, 123
329 define void @testlowercall23() nounwind {
331 tail call void @f23(double 4.500000e+01, i32 123) nounwind
335 declare void @f23(double, i32)
338 ; ALL-LABEL: testlowercall24:
339 ; ALL-DAG: ldc1 $f12, %lo
340 ; ALL-DAG: addiu $6, $zero, 133
341 ; ALL-DAG: sw ${{[a-z0-9]+}}, 16($sp)
342 ; ALL-DAG: sw ${{[a-z0-9]+}}, 20($sp)
343 define void @testlowercall24() nounwind {
345 tail call void @f24(double 5.500000e+01, i32 133, double 6.700000e+01) nounwind
349 declare void @f24(double, i32, double)
351 ; ALL-LABEL: testlowercall25:
352 ; ALL-DAG: lwc1 $f12, %lo
353 ; ALL-DAG: lwc1 $f14, %lo
356 ; ALL-DAG: lwc1 $f12, %lo
357 ; ALL-DAG: addiu $5, $zero, 83
359 ; ALL-DAG: addiu $7, $zero, 25
360 ; ALL-DAG: addiu $4, $zero, 82
361 ; ALL-DAG: addiu $5, $zero, 93
363 ; ALL-DAG: addiu $7, $zero, 45
364 define void @testlowercall25() nounwind {
366 tail call void @f12(float 2.800000e+01, float 1.900000e+01, float 1.000000e+01, float 2.100000e+01) nounwind
367 tail call void @f13(float 3.800000e+01, i32 83, float 2.000000e+01, i32 25) nounwind
368 tail call void @f18(i32 82, i32 93, float 4.000000e+01, i32 45) nounwind