1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=riscv32 -mattr=+d -run-pass=regbankselect \
3 # RUN: -simplify-mir -verify-machineinstrs %s \
4 # RUN: -o - | FileCheck %s
5 # RUN: llc -mtriple=riscv64 -mattr=+d -run-pass=regbankselect \
6 # RUN: -simplify-mir -verify-machineinstrs %s \
7 # RUN: -o - | FileCheck %s
12 tracksRegLiveness: true
15 liveins: $f10_f, $f11_f
17 ; CHECK-LABEL: name: fadd_f32
18 ; CHECK: liveins: $f10_f, $f11_f
20 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s32) = COPY $f10_f
21 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fprb(s32) = COPY $f11_f
22 ; CHECK-NEXT: [[FADD:%[0-9]+]]:fprb(s32) = G_FADD [[COPY]], [[COPY1]]
23 ; CHECK-NEXT: $f10_f = COPY [[FADD]](s32)
24 ; CHECK-NEXT: PseudoRET implicit $f10_f
25 %0:_(s32) = COPY $f10_f
26 %1:_(s32) = COPY $f11_f
27 %2:_(s32) = G_FADD %0, %1
29 PseudoRET implicit $f10_f
35 tracksRegLiveness: true
38 liveins: $f10_f, $f11_f
40 ; CHECK-LABEL: name: fsub_f32
41 ; CHECK: liveins: $f10_f, $f11_f
43 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s32) = COPY $f10_f
44 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fprb(s32) = COPY $f11_f
45 ; CHECK-NEXT: [[FSUB:%[0-9]+]]:fprb(s32) = G_FSUB [[COPY]], [[COPY1]]
46 ; CHECK-NEXT: $f10_f = COPY [[FSUB]](s32)
47 ; CHECK-NEXT: PseudoRET implicit $f10_f
48 %0:_(s32) = COPY $f10_f
49 %1:_(s32) = COPY $f11_f
50 %2:_(s32) = G_FSUB %0, %1
52 PseudoRET implicit $f10_f
58 tracksRegLiveness: true
61 liveins: $f10_f, $f11_f
63 ; CHECK-LABEL: name: fmul_f32
64 ; CHECK: liveins: $f10_f, $f11_f
66 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s32) = COPY $f10_f
67 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fprb(s32) = COPY $f11_f
68 ; CHECK-NEXT: [[FMUL:%[0-9]+]]:fprb(s32) = G_FMUL [[COPY]], [[COPY1]]
69 ; CHECK-NEXT: $f10_f = COPY [[FMUL]](s32)
70 ; CHECK-NEXT: PseudoRET implicit $f10_f
71 %0:_(s32) = COPY $f10_f
72 %1:_(s32) = COPY $f11_f
73 %2:_(s32) = G_FMUL %0, %1
75 PseudoRET implicit $f10_f
81 tracksRegLiveness: true
84 liveins: $f10_f, $f11_f
86 ; CHECK-LABEL: name: fdiv_f32
87 ; CHECK: liveins: $f10_f, $f11_f
89 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s32) = COPY $f10_f
90 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fprb(s32) = COPY $f11_f
91 ; CHECK-NEXT: [[FDIV:%[0-9]+]]:fprb(s32) = G_FDIV [[COPY]], [[COPY1]]
92 ; CHECK-NEXT: $f10_f = COPY [[FDIV]](s32)
93 ; CHECK-NEXT: PseudoRET implicit $f10_f
94 %0:_(s32) = COPY $f10_f
95 %1:_(s32) = COPY $f11_f
96 %2:_(s32) = G_FDIV %0, %1
98 PseudoRET implicit $f10_f
104 tracksRegLiveness: true
107 liveins: $f10_f, $f11_f, $f12_f
109 ; CHECK-LABEL: name: fma_f32
110 ; CHECK: liveins: $f10_f, $f11_f, $f12_f
112 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s32) = COPY $f10_f
113 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fprb(s32) = COPY $f11_f
114 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:fprb(s32) = COPY $f12_f
115 ; CHECK-NEXT: [[FMA:%[0-9]+]]:fprb(s32) = G_FMA [[COPY]], [[COPY1]], [[COPY2]]
116 ; CHECK-NEXT: $f10_f = COPY [[FMA]](s32)
117 ; CHECK-NEXT: PseudoRET implicit $f10_f
118 %0:_(s32) = COPY $f10_f
119 %1:_(s32) = COPY $f11_f
120 %2:_(s32) = COPY $f12_f
121 %3:_(s32) = G_FMA %0, %1, %2
122 $f10_f = COPY %3(s32)
123 PseudoRET implicit $f10_f
129 tracksRegLiveness: true
134 ; CHECK-LABEL: name: fneg_f32
135 ; CHECK: liveins: $f10_f
137 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s32) = COPY $f10_f
138 ; CHECK-NEXT: [[FNEG:%[0-9]+]]:fprb(s32) = G_FNEG [[COPY]]
139 ; CHECK-NEXT: $f10_f = COPY [[FNEG]](s32)
140 ; CHECK-NEXT: PseudoRET implicit $f10_f
141 %0:_(s32) = COPY $f10_f
142 %1:_(s32) = G_FNEG %0
143 $f10_f = COPY %1(s32)
144 PseudoRET implicit $f10_f
150 tracksRegLiveness: true
155 ; CHECK-LABEL: name: fabs_f32
156 ; CHECK: liveins: $f10_f
158 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s32) = COPY $f10_f
159 ; CHECK-NEXT: [[FABS:%[0-9]+]]:fprb(s32) = G_FABS [[COPY]]
160 ; CHECK-NEXT: $f10_f = COPY [[FABS]](s32)
161 ; CHECK-NEXT: PseudoRET implicit $f10_f
162 %0:_(s32) = COPY $f10_f
163 %1:_(s32) = G_FABS %0
164 $f10_f = COPY %1(s32)
165 PseudoRET implicit $f10_f
171 tracksRegLiveness: true
176 ; CHECK-LABEL: name: fsqrt_f32
177 ; CHECK: liveins: $f10_f
179 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s32) = COPY $f10_f
180 ; CHECK-NEXT: [[FSQRT:%[0-9]+]]:fprb(s32) = G_FSQRT [[COPY]]
181 ; CHECK-NEXT: $f10_f = COPY [[FSQRT]](s32)
182 ; CHECK-NEXT: PseudoRET implicit $f10_f
183 %0:_(s32) = COPY $f10_f
184 %1:_(s32) = G_FSQRT %0
185 $f10_f = COPY %1(s32)
186 PseudoRET implicit $f10_f
192 tracksRegLiveness: true
195 liveins: $f10_f, $f11_f
197 ; CHECK-LABEL: name: fmaxnum_f32
198 ; CHECK: liveins: $f10_f, $f11_f
200 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s32) = COPY $f10_f
201 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fprb(s32) = COPY $f11_f
202 ; CHECK-NEXT: [[FMAXNUM:%[0-9]+]]:fprb(s32) = G_FMAXNUM [[COPY]], [[COPY1]]
203 ; CHECK-NEXT: $f10_f = COPY [[FMAXNUM]](s32)
204 ; CHECK-NEXT: PseudoRET implicit $f10_f
205 %0:_(s32) = COPY $f10_f
206 %1:_(s32) = COPY $f11_f
207 %2:_(s32) = G_FMAXNUM %0, %1
208 $f10_f = COPY %2(s32)
209 PseudoRET implicit $f10_f
215 tracksRegLiveness: true
218 liveins: $f10_f, $f11_f
220 ; CHECK-LABEL: name: fminnum_f32
221 ; CHECK: liveins: $f10_f, $f11_f
223 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s32) = COPY $f10_f
224 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fprb(s32) = COPY $f11_f
225 ; CHECK-NEXT: [[FMINNUM:%[0-9]+]]:fprb(s32) = G_FMINNUM [[COPY]], [[COPY1]]
226 ; CHECK-NEXT: $f10_f = COPY [[FMINNUM]](s32)
227 ; CHECK-NEXT: PseudoRET implicit $f10_f
228 %0:_(s32) = COPY $f10_f
229 %1:_(s32) = COPY $f11_f
230 %2:_(s32) = G_FMINNUM %0, %1
231 $f10_f = COPY %2(s32)
232 PseudoRET implicit $f10_f
238 tracksRegLiveness: true
241 liveins: $f10_d, $f11_d
243 ; CHECK-LABEL: name: fadd_f64
244 ; CHECK: liveins: $f10_d, $f11_d
246 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s64) = COPY $f10_d
247 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fprb(s64) = COPY $f11_d
248 ; CHECK-NEXT: [[FADD:%[0-9]+]]:fprb(s64) = G_FADD [[COPY]], [[COPY1]]
249 ; CHECK-NEXT: $f10_d = COPY [[FADD]](s64)
250 ; CHECK-NEXT: PseudoRET implicit $f10_d
251 %0:_(s64) = COPY $f10_d
252 %1:_(s64) = COPY $f11_d
253 %2:_(s64) = G_FADD %0, %1
254 $f10_d = COPY %2(s64)
255 PseudoRET implicit $f10_d
261 tracksRegLiveness: true
264 liveins: $f10_d, $f11_d
266 ; CHECK-LABEL: name: fsub_f64
267 ; CHECK: liveins: $f10_d, $f11_d
269 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s64) = COPY $f10_d
270 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fprb(s64) = COPY $f11_d
271 ; CHECK-NEXT: [[FSUB:%[0-9]+]]:fprb(s64) = G_FSUB [[COPY]], [[COPY1]]
272 ; CHECK-NEXT: $f10_d = COPY [[FSUB]](s64)
273 ; CHECK-NEXT: PseudoRET implicit $f10_d
274 %0:_(s64) = COPY $f10_d
275 %1:_(s64) = COPY $f11_d
276 %2:_(s64) = G_FSUB %0, %1
277 $f10_d = COPY %2(s64)
278 PseudoRET implicit $f10_d
284 tracksRegLiveness: true
287 liveins: $f10_d, $f11_d
289 ; CHECK-LABEL: name: fmul_f64
290 ; CHECK: liveins: $f10_d, $f11_d
292 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s64) = COPY $f10_d
293 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fprb(s64) = COPY $f11_d
294 ; CHECK-NEXT: [[FMUL:%[0-9]+]]:fprb(s64) = G_FMUL [[COPY]], [[COPY1]]
295 ; CHECK-NEXT: $f10_d = COPY [[FMUL]](s64)
296 ; CHECK-NEXT: PseudoRET implicit $f10_d
297 %0:_(s64) = COPY $f10_d
298 %1:_(s64) = COPY $f11_d
299 %2:_(s64) = G_FMUL %0, %1
300 $f10_d = COPY %2(s64)
301 PseudoRET implicit $f10_d
307 tracksRegLiveness: true
310 liveins: $f10_d, $f11_d
312 ; CHECK-LABEL: name: fdiv_f64
313 ; CHECK: liveins: $f10_d, $f11_d
315 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s64) = COPY $f10_d
316 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fprb(s64) = COPY $f11_d
317 ; CHECK-NEXT: [[FDIV:%[0-9]+]]:fprb(s64) = G_FDIV [[COPY]], [[COPY1]]
318 ; CHECK-NEXT: $f10_d = COPY [[FDIV]](s64)
319 ; CHECK-NEXT: PseudoRET implicit $f10_d
320 %0:_(s64) = COPY $f10_d
321 %1:_(s64) = COPY $f11_d
322 %2:_(s64) = G_FDIV %0, %1
323 $f10_d = COPY %2(s64)
324 PseudoRET implicit $f10_d
330 tracksRegLiveness: true
333 liveins: $f10_d, $f11_d, $f12_d
335 ; CHECK-LABEL: name: fma_f64
336 ; CHECK: liveins: $f10_d, $f11_d, $f12_d
338 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s64) = COPY $f10_d
339 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fprb(s64) = COPY $f11_d
340 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:fprb(s64) = COPY $f12_d
341 ; CHECK-NEXT: [[FMA:%[0-9]+]]:fprb(s64) = G_FMA [[COPY]], [[COPY1]], [[COPY2]]
342 ; CHECK-NEXT: $f10_d = COPY [[FMA]](s64)
343 ; CHECK-NEXT: PseudoRET implicit $f10_d
344 %0:_(s64) = COPY $f10_d
345 %1:_(s64) = COPY $f11_d
346 %2:_(s64) = COPY $f12_d
347 %3:_(s64) = G_FMA %0, %1, %2
348 $f10_d = COPY %3(s64)
349 PseudoRET implicit $f10_d
355 tracksRegLiveness: true
360 ; CHECK-LABEL: name: fneg_f64
361 ; CHECK: liveins: $f10_d
363 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s64) = COPY $f10_d
364 ; CHECK-NEXT: [[FNEG:%[0-9]+]]:fprb(s64) = G_FNEG [[COPY]]
365 ; CHECK-NEXT: $f10_d = COPY [[FNEG]](s64)
366 ; CHECK-NEXT: PseudoRET implicit $f10_d
367 %0:_(s64) = COPY $f10_d
368 %1:_(s64) = G_FNEG %0
369 $f10_d = COPY %1(s64)
370 PseudoRET implicit $f10_d
376 tracksRegLiveness: true
381 ; CHECK-LABEL: name: fabs_f64
382 ; CHECK: liveins: $f10_d
384 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s64) = COPY $f10_d
385 ; CHECK-NEXT: [[FABS:%[0-9]+]]:fprb(s64) = G_FABS [[COPY]]
386 ; CHECK-NEXT: $f10_d = COPY [[FABS]](s64)
387 ; CHECK-NEXT: PseudoRET implicit $f10_d
388 %0:_(s64) = COPY $f10_d
389 %1:_(s64) = G_FABS %0
390 $f10_d = COPY %1(s64)
391 PseudoRET implicit $f10_d
397 tracksRegLiveness: true
402 ; CHECK-LABEL: name: fsqrt_f64
403 ; CHECK: liveins: $f10_d
405 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s64) = COPY $f10_d
406 ; CHECK-NEXT: [[FSQRT:%[0-9]+]]:fprb(s64) = G_FSQRT [[COPY]]
407 ; CHECK-NEXT: $f10_d = COPY [[FSQRT]](s64)
408 ; CHECK-NEXT: PseudoRET implicit $f10_d
409 %0:_(s64) = COPY $f10_d
410 %1:_(s64) = G_FSQRT %0
411 $f10_d = COPY %1(s64)
412 PseudoRET implicit $f10_d
418 tracksRegLiveness: true
421 liveins: $f10_d, $f11_d
423 ; CHECK-LABEL: name: fmaxnum_f64
424 ; CHECK: liveins: $f10_d, $f11_d
426 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s64) = COPY $f10_d
427 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fprb(s64) = COPY $f11_d
428 ; CHECK-NEXT: [[FMAXNUM:%[0-9]+]]:fprb(s64) = G_FMAXNUM [[COPY]], [[COPY1]]
429 ; CHECK-NEXT: $f10_d = COPY [[FMAXNUM]](s64)
430 ; CHECK-NEXT: PseudoRET implicit $f10_d
431 %0:_(s64) = COPY $f10_d
432 %1:_(s64) = COPY $f11_d
433 %2:_(s64) = G_FMAXNUM %0, %1
434 $f10_d = COPY %2(s64)
435 PseudoRET implicit $f10_d
441 tracksRegLiveness: true
444 liveins: $f10_d, $f11_d
446 ; CHECK-LABEL: name: fminnum_f64
447 ; CHECK: liveins: $f10_d, $f11_d
449 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s64) = COPY $f10_d
450 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fprb(s64) = COPY $f11_d
451 ; CHECK-NEXT: [[FMINNUM:%[0-9]+]]:fprb(s64) = G_FMINNUM [[COPY]], [[COPY1]]
452 ; CHECK-NEXT: $f10_d = COPY [[FMINNUM]](s64)
453 ; CHECK-NEXT: PseudoRET implicit $f10_d
454 %0:_(s64) = COPY $f10_d
455 %1:_(s64) = COPY $f11_d
456 %2:_(s64) = G_FMINNUM %0, %1
457 $f10_d = COPY %2(s64)
458 PseudoRET implicit $f10_d