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_f, $f11_f
243 ; CHECK-LABEL: name: fcopysign_f32
244 ; CHECK: liveins: $f10_f, $f11_f
246 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s32) = COPY $f10_f
247 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fprb(s32) = COPY $f11_f
248 ; CHECK-NEXT: [[FCOPYSIGN:%[0-9]+]]:fprb(s32) = G_FCOPYSIGN [[COPY]], [[COPY1]](s32)
249 ; CHECK-NEXT: $f10_f = COPY [[FCOPYSIGN]](s32)
250 ; CHECK-NEXT: PseudoRET implicit $f10_f
251 %0:_(s32) = COPY $f10_f
252 %1:_(s32) = COPY $f11_f
253 %2:_(s32) = G_FCOPYSIGN %0, %1
254 $f10_f = COPY %2(s32)
255 PseudoRET implicit $f10_f
261 tracksRegLiveness: true
264 liveins: $f10_d, $f11_d
266 ; CHECK-LABEL: name: fadd_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: [[FADD:%[0-9]+]]:fprb(s64) = G_FADD [[COPY]], [[COPY1]]
272 ; CHECK-NEXT: $f10_d = COPY [[FADD]](s64)
273 ; CHECK-NEXT: PseudoRET implicit $f10_d
274 %0:_(s64) = COPY $f10_d
275 %1:_(s64) = COPY $f11_d
276 %2:_(s64) = G_FADD %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: fsub_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: [[FSUB:%[0-9]+]]:fprb(s64) = G_FSUB [[COPY]], [[COPY1]]
295 ; CHECK-NEXT: $f10_d = COPY [[FSUB]](s64)
296 ; CHECK-NEXT: PseudoRET implicit $f10_d
297 %0:_(s64) = COPY $f10_d
298 %1:_(s64) = COPY $f11_d
299 %2:_(s64) = G_FSUB %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: fmul_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: [[FMUL:%[0-9]+]]:fprb(s64) = G_FMUL [[COPY]], [[COPY1]]
318 ; CHECK-NEXT: $f10_d = COPY [[FMUL]](s64)
319 ; CHECK-NEXT: PseudoRET implicit $f10_d
320 %0:_(s64) = COPY $f10_d
321 %1:_(s64) = COPY $f11_d
322 %2:_(s64) = G_FMUL %0, %1
323 $f10_d = COPY %2(s64)
324 PseudoRET implicit $f10_d
330 tracksRegLiveness: true
333 liveins: $f10_d, $f11_d
335 ; CHECK-LABEL: name: fdiv_f64
336 ; CHECK: liveins: $f10_d, $f11_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: [[FDIV:%[0-9]+]]:fprb(s64) = G_FDIV [[COPY]], [[COPY1]]
341 ; CHECK-NEXT: $f10_d = COPY [[FDIV]](s64)
342 ; CHECK-NEXT: PseudoRET implicit $f10_d
343 %0:_(s64) = COPY $f10_d
344 %1:_(s64) = COPY $f11_d
345 %2:_(s64) = G_FDIV %0, %1
346 $f10_d = COPY %2(s64)
347 PseudoRET implicit $f10_d
353 tracksRegLiveness: true
356 liveins: $f10_d, $f11_d, $f12_d
358 ; CHECK-LABEL: name: fma_f64
359 ; CHECK: liveins: $f10_d, $f11_d, $f12_d
361 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s64) = COPY $f10_d
362 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fprb(s64) = COPY $f11_d
363 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:fprb(s64) = COPY $f12_d
364 ; CHECK-NEXT: [[FMA:%[0-9]+]]:fprb(s64) = G_FMA [[COPY]], [[COPY1]], [[COPY2]]
365 ; CHECK-NEXT: $f10_d = COPY [[FMA]](s64)
366 ; CHECK-NEXT: PseudoRET implicit $f10_d
367 %0:_(s64) = COPY $f10_d
368 %1:_(s64) = COPY $f11_d
369 %2:_(s64) = COPY $f12_d
370 %3:_(s64) = G_FMA %0, %1, %2
371 $f10_d = COPY %3(s64)
372 PseudoRET implicit $f10_d
378 tracksRegLiveness: true
383 ; CHECK-LABEL: name: fneg_f64
384 ; CHECK: liveins: $f10_d
386 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s64) = COPY $f10_d
387 ; CHECK-NEXT: [[FNEG:%[0-9]+]]:fprb(s64) = G_FNEG [[COPY]]
388 ; CHECK-NEXT: $f10_d = COPY [[FNEG]](s64)
389 ; CHECK-NEXT: PseudoRET implicit $f10_d
390 %0:_(s64) = COPY $f10_d
391 %1:_(s64) = G_FNEG %0
392 $f10_d = COPY %1(s64)
393 PseudoRET implicit $f10_d
399 tracksRegLiveness: true
404 ; CHECK-LABEL: name: fabs_f64
405 ; CHECK: liveins: $f10_d
407 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s64) = COPY $f10_d
408 ; CHECK-NEXT: [[FABS:%[0-9]+]]:fprb(s64) = G_FABS [[COPY]]
409 ; CHECK-NEXT: $f10_d = COPY [[FABS]](s64)
410 ; CHECK-NEXT: PseudoRET implicit $f10_d
411 %0:_(s64) = COPY $f10_d
412 %1:_(s64) = G_FABS %0
413 $f10_d = COPY %1(s64)
414 PseudoRET implicit $f10_d
420 tracksRegLiveness: true
425 ; CHECK-LABEL: name: fsqrt_f64
426 ; CHECK: liveins: $f10_d
428 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s64) = COPY $f10_d
429 ; CHECK-NEXT: [[FSQRT:%[0-9]+]]:fprb(s64) = G_FSQRT [[COPY]]
430 ; CHECK-NEXT: $f10_d = COPY [[FSQRT]](s64)
431 ; CHECK-NEXT: PseudoRET implicit $f10_d
432 %0:_(s64) = COPY $f10_d
433 %1:_(s64) = G_FSQRT %0
434 $f10_d = COPY %1(s64)
435 PseudoRET implicit $f10_d
441 tracksRegLiveness: true
444 liveins: $f10_d, $f11_d
446 ; CHECK-LABEL: name: fmaxnum_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: [[FMAXNUM:%[0-9]+]]:fprb(s64) = G_FMAXNUM [[COPY]], [[COPY1]]
452 ; CHECK-NEXT: $f10_d = COPY [[FMAXNUM]](s64)
453 ; CHECK-NEXT: PseudoRET implicit $f10_d
454 %0:_(s64) = COPY $f10_d
455 %1:_(s64) = COPY $f11_d
456 %2:_(s64) = G_FMAXNUM %0, %1
457 $f10_d = COPY %2(s64)
458 PseudoRET implicit $f10_d
464 tracksRegLiveness: true
467 liveins: $f10_d, $f11_d
469 ; CHECK-LABEL: name: fminnum_f64
470 ; CHECK: liveins: $f10_d, $f11_d
472 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s64) = COPY $f10_d
473 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fprb(s64) = COPY $f11_d
474 ; CHECK-NEXT: [[FMINNUM:%[0-9]+]]:fprb(s64) = G_FMINNUM [[COPY]], [[COPY1]]
475 ; CHECK-NEXT: $f10_d = COPY [[FMINNUM]](s64)
476 ; CHECK-NEXT: PseudoRET implicit $f10_d
477 %0:_(s64) = COPY $f10_d
478 %1:_(s64) = COPY $f11_d
479 %2:_(s64) = G_FMINNUM %0, %1
480 $f10_d = COPY %2(s64)
481 PseudoRET implicit $f10_d
487 tracksRegLiveness: true
490 liveins: $f10_d, $f11_d
492 ; CHECK-LABEL: name: fcopysign_f64
493 ; CHECK: liveins: $f10_d, $f11_d
495 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fprb(s64) = COPY $f10_d
496 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fprb(s64) = COPY $f11_d
497 ; CHECK-NEXT: [[FCOPYSIGN:%[0-9]+]]:fprb(s64) = G_FCOPYSIGN [[COPY]], [[COPY1]](s64)
498 ; CHECK-NEXT: $f10_d = COPY [[FCOPYSIGN]](s64)
499 ; CHECK-NEXT: PseudoRET implicit $f10_d
500 %0:_(s64) = COPY $f10_d
501 %1:_(s64) = COPY $f11_d
502 %2:_(s64) = G_FCOPYSIGN %0, %1
503 $f10_d = COPY %2(s64)
504 PseudoRET implicit $f10_d