1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -mtriple=mipsel-linux-gnu -run-pass=regbankselect -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=FP32
3 # RUN: llc -O0 -mtriple=mipsel-linux-gnu -mattr=+fp64,+mips32r2 -run-pass=regbankselect -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=FP64
7 define void @float_in_fpr() {entry: ret void}
8 define void @double_in_fpr() {entry: ret void}
9 define void @float_in_gpr() {entry: ret void}
10 define void @double_in_gpr() {entry: ret void}
11 define void @call_float_in_fpr() {entry: ret void}
12 define void @call_double_in_fpr() {entry: ret void}
13 define void @call_float_in_gpr() {entry: ret void}
14 define void @call_double_in_gpr() {entry: ret void}
21 tracksRegLiveness: true
26 ; FP32-LABEL: name: float_in_fpr
27 ; FP32: liveins: $f12, $f14
28 ; FP32: [[COPY:%[0-9]+]]:fprb(s32) = COPY $f14
29 ; FP32: $f0 = COPY [[COPY]](s32)
30 ; FP32: RetRA implicit $f0
31 ; FP64-LABEL: name: float_in_fpr
32 ; FP64: liveins: $f12, $f14
33 ; FP64: [[COPY:%[0-9]+]]:fprb(s32) = COPY $f14
34 ; FP64: $f0 = COPY [[COPY]](s32)
35 ; FP64: RetRA implicit $f0
45 tracksRegLiveness: true
50 ; FP32-LABEL: name: double_in_fpr
51 ; FP32: liveins: $d6, $d7
52 ; FP32: [[COPY:%[0-9]+]]:fprb(s64) = COPY $d7
53 ; FP32: $d0 = COPY [[COPY]](s64)
54 ; FP32: RetRA implicit $d0
55 ; FP64-LABEL: name: double_in_fpr
56 ; FP64: liveins: $d6, $d7
57 ; FP64: [[COPY:%[0-9]+]]:fprb(s64) = COPY $d7
58 ; FP64: $d0 = COPY [[COPY]](s64)
59 ; FP64: RetRA implicit $d0
69 tracksRegLiveness: true
74 ; FP32-LABEL: name: float_in_gpr
75 ; FP32: liveins: $a0, $a1
76 ; FP32: [[COPY:%[0-9]+]]:gprb(s32) = COPY $a1
77 ; FP32: $f0 = COPY [[COPY]](s32)
78 ; FP32: RetRA implicit $f0
79 ; FP64-LABEL: name: float_in_gpr
80 ; FP64: liveins: $a0, $a1
81 ; FP64: [[COPY:%[0-9]+]]:gprb(s32) = COPY $a1
82 ; FP64: $f0 = COPY [[COPY]](s32)
83 ; FP64: RetRA implicit $f0
93 tracksRegLiveness: true
96 liveins: $a0, $a2, $a3
98 ; FP32-LABEL: name: double_in_gpr
99 ; FP32: liveins: $a0, $a2, $a3
100 ; FP32: [[COPY:%[0-9]+]]:gprb(s32) = COPY $a2
101 ; FP32: [[COPY1:%[0-9]+]]:gprb(s32) = COPY $a3
102 ; FP32: [[MV:%[0-9]+]]:fprb(s64) = G_MERGE_VALUES [[COPY]](s32), [[COPY1]](s32)
103 ; FP32: $d0 = COPY [[MV]](s64)
104 ; FP32: RetRA implicit $d0
105 ; FP64-LABEL: name: double_in_gpr
106 ; FP64: liveins: $a0, $a2, $a3
107 ; FP64: [[COPY:%[0-9]+]]:gprb(s32) = COPY $a2
108 ; FP64: [[COPY1:%[0-9]+]]:gprb(s32) = COPY $a3
109 ; FP64: [[MV:%[0-9]+]]:fprb(s64) = G_MERGE_VALUES [[COPY]](s32), [[COPY1]](s32)
110 ; FP64: $d0 = COPY [[MV]](s64)
111 ; FP64: RetRA implicit $d0
114 %1:_(s64) = G_MERGE_VALUES %2(s32), %3(s32)
120 name: call_float_in_fpr
123 tracksRegLiveness: true
128 ; FP32-LABEL: name: call_float_in_fpr
129 ; FP32: liveins: $f12, $f14
130 ; FP32: [[COPY:%[0-9]+]]:fprb(s32) = COPY $f12
131 ; FP32: [[COPY1:%[0-9]+]]:fprb(s32) = COPY $f14
132 ; FP32: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
133 ; FP32: $f12 = COPY [[COPY]](s32)
134 ; FP32: $f14 = COPY [[COPY1]](s32)
135 ; FP32: JAL @float_in_fpr, csr_o32, implicit-def $ra, implicit-def $sp, implicit $f12, implicit $f14, implicit-def $f0
136 ; FP32: [[COPY2:%[0-9]+]]:fprb(s32) = COPY $f0
137 ; FP32: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
138 ; FP32: $f0 = COPY [[COPY2]](s32)
139 ; FP32: RetRA implicit $f0
140 ; FP64-LABEL: name: call_float_in_fpr
141 ; FP64: liveins: $f12, $f14
142 ; FP64: [[COPY:%[0-9]+]]:fprb(s32) = COPY $f12
143 ; FP64: [[COPY1:%[0-9]+]]:fprb(s32) = COPY $f14
144 ; FP64: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
145 ; FP64: $f12 = COPY [[COPY]](s32)
146 ; FP64: $f14 = COPY [[COPY1]](s32)
147 ; FP64: JAL @float_in_fpr, csr_o32, implicit-def $ra, implicit-def $sp, implicit $f12, implicit $f14, implicit-def $f0
148 ; FP64: [[COPY2:%[0-9]+]]:fprb(s32) = COPY $f0
149 ; FP64: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
150 ; FP64: $f0 = COPY [[COPY2]](s32)
151 ; FP64: RetRA implicit $f0
152 %0:_(s32) = COPY $f12
153 %1:_(s32) = COPY $f14
154 ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
157 JAL @float_in_fpr, csr_o32, implicit-def $ra, implicit-def $sp, implicit $f12, implicit $f14, implicit-def $f0
159 ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
165 name: call_double_in_fpr
168 tracksRegLiveness: true
173 ; FP32-LABEL: name: call_double_in_fpr
174 ; FP32: liveins: $d6, $d7
175 ; FP32: [[COPY:%[0-9]+]]:fprb(s64) = COPY $d6
176 ; FP32: [[COPY1:%[0-9]+]]:fprb(s64) = COPY $d7
177 ; FP32: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
178 ; FP32: $d6 = COPY [[COPY]](s64)
179 ; FP32: $d7 = COPY [[COPY1]](s64)
180 ; FP32: JAL @double_in_fpr, csr_o32, implicit-def $ra, implicit-def $sp, implicit $d6, implicit $d7, implicit-def $d0
181 ; FP32: [[COPY2:%[0-9]+]]:fprb(s64) = COPY $d0
182 ; FP32: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
183 ; FP32: $d0 = COPY [[COPY2]](s64)
184 ; FP32: RetRA implicit $d0
185 ; FP64-LABEL: name: call_double_in_fpr
186 ; FP64: liveins: $d6, $d7
187 ; FP64: [[COPY:%[0-9]+]]:fprb(s64) = COPY $d6
188 ; FP64: [[COPY1:%[0-9]+]]:fprb(s64) = COPY $d7
189 ; FP64: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
190 ; FP64: $d6 = COPY [[COPY]](s64)
191 ; FP64: $d7 = COPY [[COPY1]](s64)
192 ; FP64: JAL @double_in_fpr, csr_o32, implicit-def $ra, implicit-def $sp, implicit $d6, implicit $d7, implicit-def $d0
193 ; FP64: [[COPY2:%[0-9]+]]:fprb(s64) = COPY $d0
194 ; FP64: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
195 ; FP64: $d0 = COPY [[COPY2]](s64)
196 ; FP64: RetRA implicit $d0
199 ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
202 JAL @double_in_fpr, csr_o32, implicit-def $ra, implicit-def $sp, implicit $d6, implicit $d7, implicit-def $d0
204 ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
210 name: call_float_in_gpr
213 tracksRegLiveness: true
218 ; FP32-LABEL: name: call_float_in_gpr
219 ; FP32: liveins: $a0, $a1
220 ; FP32: [[COPY:%[0-9]+]]:gprb(s32) = COPY $a0
221 ; FP32: [[COPY1:%[0-9]+]]:gprb(s32) = COPY $a1
222 ; FP32: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
223 ; FP32: $a0 = COPY [[COPY]](s32)
224 ; FP32: $a1 = COPY [[COPY1]](s32)
225 ; FP32: JAL @float_in_gpr, csr_o32, implicit-def $ra, implicit-def $sp, implicit $a0, implicit-def $f0
226 ; FP32: [[COPY2:%[0-9]+]]:fprb(s32) = COPY $f0
227 ; FP32: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
228 ; FP32: $f0 = COPY [[COPY2]](s32)
229 ; FP32: RetRA implicit $f0
230 ; FP64-LABEL: name: call_float_in_gpr
231 ; FP64: liveins: $a0, $a1
232 ; FP64: [[COPY:%[0-9]+]]:gprb(s32) = COPY $a0
233 ; FP64: [[COPY1:%[0-9]+]]:gprb(s32) = COPY $a1
234 ; FP64: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
235 ; FP64: $a0 = COPY [[COPY]](s32)
236 ; FP64: $a1 = COPY [[COPY1]](s32)
237 ; FP64: JAL @float_in_gpr, csr_o32, implicit-def $ra, implicit-def $sp, implicit $a0, implicit-def $f0
238 ; FP64: [[COPY2:%[0-9]+]]:fprb(s32) = COPY $f0
239 ; FP64: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
240 ; FP64: $f0 = COPY [[COPY2]](s32)
241 ; FP64: RetRA implicit $f0
244 ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
247 JAL @float_in_gpr, csr_o32, implicit-def $ra, implicit-def $sp, implicit $a0, implicit-def $f0
249 ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
255 name: call_double_in_gpr
258 tracksRegLiveness: true
261 liveins: $a0, $a2, $a3
263 ; FP32-LABEL: name: call_double_in_gpr
264 ; FP32: liveins: $a0, $a2, $a3
265 ; FP32: [[COPY:%[0-9]+]]:gprb(s32) = COPY $a0
266 ; FP32: [[COPY1:%[0-9]+]]:gprb(s32) = COPY $a2
267 ; FP32: [[COPY2:%[0-9]+]]:gprb(s32) = COPY $a3
268 ; FP32: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
269 ; FP32: $a0 = COPY [[COPY]](s32)
270 ; FP32: $a2 = COPY [[COPY1]](s32)
271 ; FP32: $a3 = COPY [[COPY2]](s32)
272 ; FP32: JAL @double_in_gpr, csr_o32, implicit-def $ra, implicit-def $sp, implicit $a0, implicit-def $d0
273 ; FP32: [[COPY3:%[0-9]+]]:fprb(s64) = COPY $d0
274 ; FP32: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
275 ; FP32: $d0 = COPY [[COPY3]](s64)
276 ; FP32: RetRA implicit $d0
277 ; FP64-LABEL: name: call_double_in_gpr
278 ; FP64: liveins: $a0, $a2, $a3
279 ; FP64: [[COPY:%[0-9]+]]:gprb(s32) = COPY $a0
280 ; FP64: [[COPY1:%[0-9]+]]:gprb(s32) = COPY $a2
281 ; FP64: [[COPY2:%[0-9]+]]:gprb(s32) = COPY $a3
282 ; FP64: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
283 ; FP64: $a0 = COPY [[COPY]](s32)
284 ; FP64: $a2 = COPY [[COPY1]](s32)
285 ; FP64: $a3 = COPY [[COPY2]](s32)
286 ; FP64: JAL @double_in_gpr, csr_o32, implicit-def $ra, implicit-def $sp, implicit $a0, implicit-def $d0
287 ; FP64: [[COPY3:%[0-9]+]]:fprb(s64) = COPY $d0
288 ; FP64: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
289 ; FP64: $d0 = COPY [[COPY3]](s64)
290 ; FP64: RetRA implicit $d0
294 ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
298 JAL @double_in_gpr, csr_o32, implicit-def $ra, implicit-def $sp, implicit $a0, implicit-def $d0
300 ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp