• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
5
6; $f12, $f14
7; ALL-LABEL: testlowercall0:
8; ALL-DAG:       ldc1 $f12, %lo
9; ALL-DAG:       ldc1 $f14, %lo
10define void @testlowercall0() nounwind {
11entry:
12  tail call void @f0(double 5.000000e+00, double 6.000000e+00) nounwind
13  ret void
14}
15
16declare void @f0(double, double)
17
18; $f12, $f14
19; ALL-LABEL: testlowercall1:
20; ALL-DAG:       lwc1 $f12, %lo
21; ALL-DAG:       lwc1 $f14, %lo
22define void @testlowercall1() nounwind {
23entry:
24  tail call void @f1(float 8.000000e+00, float 9.000000e+00) nounwind
25  ret void
26}
27
28declare void @f1(float, float)
29
30; $f12, $f14
31; ALL-LABEL: testlowercall2:
32; ALL-DAG:       lwc1 $f12, %lo
33; ALL-DAG:       ldc1 $f14, %lo
34define void @testlowercall2() nounwind {
35entry:
36  tail call void @f2(float 8.000000e+00, double 6.000000e+00) nounwind
37  ret void
38}
39
40declare void @f2(float, double)
41
42; $f12, $f14
43; ALL-LABEL: testlowercall3:
44; ALL-DAG:       ldc1 $f12, %lo
45; ALL-DAG:       lwc1 $f14, %lo
46define void @testlowercall3() nounwind {
47entry:
48  tail call void @f3(double 5.000000e+00, float 9.000000e+00) nounwind
49  ret void
50}
51
52declare void @f3(double, float)
53
54; $4, $5, $6, $7
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
60define void @testlowercall4() nounwind {
61entry:
62  tail call void @f4(i32 12, i32 13, i32 14, i32 15) nounwind
63  ret void
64}
65
66declare void @f4(i32, i32, i32, i32)
67
68; $f12, $6, stack
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)
74define void @testlowercall5() nounwind {
75entry:
76  tail call void @f5(double 1.500000e+01, i32 23, double 1.700000e+01) nounwind
77  ret void
78}
79
80declare void @f5(double, i32, double)
81
82; $f12, $6, $7
83; ALL-LABEL: testlowercall6:
84; ALL-DAG:       ldc1 $f12, %lo
85; ALL-DAG:       addiu $6, $zero, 33
86; ALL-DAG:       addiu $7, $zero, 24
87define void @testlowercall6() nounwind {
88entry:
89  tail call void @f6(double 2.500000e+01, i32 33, i32 24) nounwind
90  ret void
91}
92
93declare void @f6(double, i32, i32)
94
95; $f12, $5, $6
96; ALL-LABEL: testlowercall7:
97; ALL-DAG:       lwc1 $f12, %lo
98; ALL-DAG:       addiu $5, $zero, 43
99; ALL-DAG:       addiu $6, $zero, 34
100define void @testlowercall7() nounwind {
101entry:
102  tail call void @f7(float 1.800000e+01, i32 43, i32 34) nounwind
103  ret void
104}
105
106declare void @f7(float, i32, i32)
107
108; $4, $5, $6, stack
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)
115define void @testlowercall8() nounwind {
116entry:
117  tail call void @f8(i32 22, i32 53, i32 44, double 4.000000e+00) nounwind
118  ret void
119}
120
121declare void @f8(i32, i32, i32, double)
122
123; $4, $5, $6, $7
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
129define void @testlowercall9() nounwind {
130entry:
131  tail call void @f9(i32 32, i32 63, i32 54, float 1.100000e+01) nounwind
132  ret void
133}
134
135declare void @f9(i32, i32, i32, float)
136
137; $4, $5, ($6, $7)
138; ALL-LABEL: testlowercall10:
139
140; ALL-DAG:       addiu $4, $zero, 42
141; ALL-DAG:       addiu $5, $zero, 73
142
143; NO-MFHC1-DAG:  mfc1 $6, $f{{[0-9]+}}
144; NO-MFHC1-DAG:  mfc1 $7, $f{{[0-9]+}}
145
146; HAS-MFHC1-DAG: mfc1 $6, $f{{[0-9]+}}
147; HAS-MFHC1-DAG: mfhc1 $7, $f{{[0-9]+}}
148define void @testlowercall10() nounwind {
149entry:
150  tail call void @f10(i32 42, i32 73, double 2.700000e+01) nounwind
151  ret void
152}
153
154declare void @f10(i32, i32, double)
155
156; $4, ($6, $7)
157; ALL-LABEL: testlowercall11:
158; ALL-DAG:       addiu $4, $zero, 52
159
160; NO-MFHC1-DAG:  mfc1 $6, $f{{[0-9]+}}
161; NO-MFHC1-DAG:  mfc1 $7, $f{{[0-9]+}}
162
163; HAS-MFHC1-DAG: mfc1 $6, $f{{[0-9]+}}
164; HAS-MFHC1-DAG: mfhc1 $7, $f{{[0-9]+}}
165define void @testlowercall11() nounwind {
166entry:
167  tail call void @f11(i32 52, double 1.600000e+01) nounwind
168  ret void
169}
170
171declare void @f11(i32, double)
172
173; $f12, $f14, $6, $7
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
179define void @testlowercall12() nounwind {
180entry:
181  tail call void @f12(float 2.800000e+01, float 1.900000e+01, float 1.000000e+01, float 2.100000e+01) nounwind
182  ret void
183}
184
185declare void @f12(float, float, float, float)
186
187; $f12, $5, $6, $7
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
193define void @testlowercall13() nounwind {
194entry:
195  tail call void @f13(float 3.800000e+01, i32 83, float 2.000000e+01, i32 25) nounwind
196  ret void
197}
198
199
200declare void @f13(float, i32, float, i32)
201
202; $f12, $f14, $7
203; ALL-LABEL: testlowercall14:
204; ALL-DAG:       ldc1 $f12, %lo
205; ALL-DAG:       lwc1 $f14, %lo
206; ALL-DAG:       lui $7, 16880
207define void @testlowercall14() nounwind {
208entry:
209  tail call void @f14(double 3.500000e+01, float 2.900000e+01, float 3.000000e+01) nounwind
210  ret void
211}
212
213declare void @f14(double, float, float)
214
215; $f12, $f14, ($6, $7)
216; ALL-LABEL: testlowercall15:
217; ALL-DAG:       lwc1 $f12, %lo
218; ALL-DAG:       lwc1 $f14, %lo
219
220; NO-MFHC1-DAG:  mfc1 $6, $f{{[0-9]+}}
221; NO-MFHC1-DAG:  mfc1 $7, $f{{[0-9]+}}
222
223; HAS-MFHC1-DAG: mfc1 $6, $f{{[0-9]+}}
224; HAS-MFHC1-DAG: mfhc1 $7, $f{{[0-9]+}}
225define void @testlowercall15() nounwind {
226entry:
227  tail call void @f15(float 4.800000e+01, float 3.900000e+01, double 3.700000e+01) nounwind
228  ret void
229}
230
231declare void @f15(float, float, double)
232
233; $4, $5, $6, $7
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
239define void @testlowercall16() nounwind {
240entry:
241  tail call void @f16(i32 62, float 4.900000e+01, i32 64, float 3.100000e+01) nounwind
242  ret void
243}
244
245declare void @f16(i32, float, i32, float)
246
247; $4, $5, $6, $7
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
253define void @testlowercall17() nounwind {
254entry:
255  tail call void @f17(i32 72, float 5.900000e+01, i32 74, i32 35) nounwind
256  ret void
257}
258
259declare void @f17(i32, float, i32, i32)
260
261; $4, $5, $6, $7
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
267define void @testlowercall18() nounwind {
268entry:
269  tail call void @f18(i32 82, i32 93, float 4.000000e+01, i32 45) nounwind
270  ret void
271}
272
273declare void @f18(i32, i32, float, i32)
274
275
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)
281
282; NO-MFHC1-DAG:  mfc1 $6, $f{{[0-9]+}}
283; NO-MFHC1-DAG:  mfc1 $7, $f{{[0-9]+}}
284
285; HAS-MFHC1-DAG: mfc1 $6, $f{{[0-9]+}}
286; HAS-MFHC1-DAG: mfhc1 $7, $f{{[0-9]+}}
287define void @testlowercall20() nounwind {
288entry:
289  tail call void @f20(i32 92, double 2.600000e+01, double 4.700000e+01) nounwind
290  ret void
291}
292
293declare void @f20(i32, double, double)
294
295; $f12, $5
296; ALL-LABEL: testlowercall21:
297; ALL-DAG:       lwc1 $f12, %lo
298; ALL-DAG:       addiu $5, $zero, 103
299define void @testlowercall21() nounwind {
300entry:
301  tail call void @f21(float 5.800000e+01, i32 103) nounwind
302  ret void
303}
304
305declare void @f21(float, i32)
306
307; $f12, $5, ($6, $7)
308; ALL-LABEL: testlowercall22:
309; ALL-DAG:       lwc1 $f12, %lo
310; ALL-DAG:       addiu $5, $zero, 113
311
312; NO-MFHC1-DAG:  mfc1 $6, $f{{[0-9]+}}
313; NO-MFHC1-DAG:  mfc1 $7, $f{{[0-9]+}}
314
315; HAS-MFHC1-DAG: mfc1 $6, $f{{[0-9]+}}
316; HAS-MFHC1-DAG: mfhc1 $7, $f{{[0-9]+}}
317define void @testlowercall22() nounwind {
318entry:
319  tail call void @f22(float 6.800000e+01, i32 113, double 5.700000e+01) nounwind
320  ret void
321}
322
323declare void @f22(float, i32, double)
324
325; $f12, f6
326; ALL-LABEL: testlowercall23:
327; ALL-DAG:       ldc1 $f12, %lo
328; ALL-DAG:       addiu $6, $zero, 123
329define void @testlowercall23() nounwind {
330entry:
331  tail call void @f23(double 4.500000e+01, i32 123) nounwind
332  ret void
333}
334
335declare void @f23(double, i32)
336
337; $f12,$6, stack
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)
343define void @testlowercall24() nounwind {
344entry:
345  tail call void @f24(double 5.500000e+01, i32 133, double 6.700000e+01) nounwind
346  ret void
347}
348
349declare void @f24(double, i32, double)
350
351; ALL-LABEL: testlowercall25:
352; ALL-DAG:      lwc1 $f12, %lo
353; ALL-DAG:      lwc1 $f14, %lo
354; ALL-DAG:      lui $6
355; ALL-DAG:      lui $7
356; ALL-DAG:      lwc1 $f12, %lo
357; ALL-DAG:      addiu $5, $zero, 83
358; ALL-DAG:      lui $6
359; ALL-DAG:      addiu $7, $zero, 25
360; ALL-DAG:      addiu $4, $zero, 82
361; ALL-DAG:      addiu $5, $zero, 93
362; ALL-DAG:      lui $6
363; ALL-DAG:      addiu $7, $zero, 45
364define void @testlowercall25() nounwind {
365entry:
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
369  ret void
370}
371