1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=riscv32 -mattr=+d -run-pass=instruction-select \
3 # RUN: -simplify-mir -verify-machineinstrs %s -o - | FileCheck %s
4 # RUN: llc -mtriple=riscv64 -mattr=+d -run-pass=instruction-select \
5 # RUN: -simplify-mir -verify-machineinstrs %s -o - | FileCheck %s
11 tracksRegLiveness: true
14 liveins: $f10_f, $f11_f
16 ; CHECK-LABEL: name: fadd_f32
17 ; CHECK: liveins: $f10_f, $f11_f
19 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr32 = COPY $f10_f
20 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fpr32 = COPY $f11_f
21 ; CHECK-NEXT: [[FADD_S:%[0-9]+]]:fpr32 = nofpexcept FADD_S [[COPY]], [[COPY1]], 7
22 ; CHECK-NEXT: $f10_f = COPY [[FADD_S]]
23 ; CHECK-NEXT: PseudoRET implicit $f10_f
24 %0:fprb(s32) = COPY $f10_f
25 %1:fprb(s32) = COPY $f11_f
26 %2:fprb(s32) = G_FADD %0, %1
28 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]+]]:fpr32 = COPY $f10_f
44 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fpr32 = COPY $f11_f
45 ; CHECK-NEXT: [[FSUB_S:%[0-9]+]]:fpr32 = nofpexcept FSUB_S [[COPY]], [[COPY1]], 7
46 ; CHECK-NEXT: $f10_f = COPY [[FSUB_S]]
47 ; CHECK-NEXT: PseudoRET implicit $f10_f
48 %0:fprb(s32) = COPY $f10_f
49 %1:fprb(s32) = COPY $f11_f
50 %2:fprb(s32) = G_FSUB %0, %1
52 PseudoRET implicit $f10_f
59 tracksRegLiveness: true
62 liveins: $f10_f, $f11_f
64 ; CHECK-LABEL: name: fmul_f32
65 ; CHECK: liveins: $f10_f, $f11_f
67 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr32 = COPY $f10_f
68 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fpr32 = COPY $f11_f
69 ; CHECK-NEXT: [[FMUL_S:%[0-9]+]]:fpr32 = nofpexcept FMUL_S [[COPY]], [[COPY1]], 7
70 ; CHECK-NEXT: $f10_f = COPY [[FMUL_S]]
71 ; CHECK-NEXT: PseudoRET implicit $f10_f
72 %0:fprb(s32) = COPY $f10_f
73 %1:fprb(s32) = COPY $f11_f
74 %2:fprb(s32) = G_FMUL %0, %1
76 PseudoRET implicit $f10_f
83 tracksRegLiveness: true
86 liveins: $f10_f, $f11_f
88 ; CHECK-LABEL: name: fdiv_f32
89 ; CHECK: liveins: $f10_f, $f11_f
91 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr32 = COPY $f10_f
92 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fpr32 = COPY $f11_f
93 ; CHECK-NEXT: [[FDIV_S:%[0-9]+]]:fpr32 = nofpexcept FDIV_S [[COPY]], [[COPY1]], 7
94 ; CHECK-NEXT: $f10_f = COPY [[FDIV_S]]
95 ; CHECK-NEXT: PseudoRET implicit $f10_f
96 %0:fprb(s32) = COPY $f10_f
97 %1:fprb(s32) = COPY $f11_f
98 %2:fprb(s32) = G_FDIV %0, %1
100 PseudoRET implicit $f10_f
106 regBankSelected: true
107 tracksRegLiveness: true
110 liveins: $f10_f, $f11_f, $f12_f
112 ; CHECK-LABEL: name: fma_f32
113 ; CHECK: liveins: $f10_f, $f11_f, $f12_f
115 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr32 = COPY $f10_f
116 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fpr32 = COPY $f11_f
117 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:fpr32 = COPY $f12_f
118 ; CHECK-NEXT: [[FMADD_S:%[0-9]+]]:fpr32 = nofpexcept FMADD_S [[COPY]], [[COPY1]], [[COPY2]], 7
119 ; CHECK-NEXT: $f10_f = COPY [[FMADD_S]]
120 ; CHECK-NEXT: PseudoRET implicit $f10_f
121 %0:fprb(s32) = COPY $f10_f
122 %1:fprb(s32) = COPY $f11_f
123 %2:fprb(s32) = COPY $f12_f
124 %3:fprb(s32) = G_FMA %0, %1, %2
125 $f10_f = COPY %3(s32)
126 PseudoRET implicit $f10_f
132 regBankSelected: true
133 tracksRegLiveness: true
136 liveins: $f10_f, $f11_f, $f12_f
138 ; CHECK-LABEL: name: fneg_f32
139 ; CHECK: liveins: $f10_f, $f11_f, $f12_f
141 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr32 = COPY $f10_f
142 ; CHECK-NEXT: [[FSGNJN_S:%[0-9]+]]:fpr32 = FSGNJN_S [[COPY]], [[COPY]]
143 ; CHECK-NEXT: $f10_f = COPY [[FSGNJN_S]]
144 ; CHECK-NEXT: PseudoRET implicit $f10_f
145 %0:fprb(s32) = COPY $f10_f
146 %1:fprb(s32) = G_FNEG %0
147 $f10_f = COPY %1(s32)
148 PseudoRET implicit $f10_f
154 regBankSelected: true
155 tracksRegLiveness: true
158 liveins: $f10_f, $f11_f, $f12_f
160 ; CHECK-LABEL: name: fabs_f32
161 ; CHECK: liveins: $f10_f, $f11_f, $f12_f
163 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr32 = COPY $f10_f
164 ; CHECK-NEXT: [[FSGNJX_S:%[0-9]+]]:fpr32 = FSGNJX_S [[COPY]], [[COPY]]
165 ; CHECK-NEXT: $f10_f = COPY [[FSGNJX_S]]
166 ; CHECK-NEXT: PseudoRET implicit $f10_f
167 %0:fprb(s32) = COPY $f10_f
168 %1:fprb(s32) = G_FABS %0
169 $f10_f = COPY %1(s32)
170 PseudoRET implicit $f10_f
176 regBankSelected: true
177 tracksRegLiveness: true
180 liveins: $f10_f, $f11_f, $f12_f
182 ; CHECK-LABEL: name: fsqrt_f32
183 ; CHECK: liveins: $f10_f, $f11_f, $f12_f
185 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr32 = COPY $f10_f
186 ; CHECK-NEXT: [[FSQRT_S:%[0-9]+]]:fpr32 = nofpexcept FSQRT_S [[COPY]], 7
187 ; CHECK-NEXT: $f10_f = COPY [[FSQRT_S]]
188 ; CHECK-NEXT: PseudoRET implicit $f10_f
189 %0:fprb(s32) = COPY $f10_f
190 %1:fprb(s32) = G_FSQRT %0
191 $f10_f = COPY %1(s32)
192 PseudoRET implicit $f10_f
198 regBankSelected: true
199 tracksRegLiveness: true
202 liveins: $f10_d, $f11_d
204 ; CHECK-LABEL: name: fadd_f64
205 ; CHECK: liveins: $f10_d, $f11_d
207 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr64 = COPY $f10_d
208 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fpr64 = COPY $f11_d
209 ; CHECK-NEXT: [[FADD_D:%[0-9]+]]:fpr64 = nofpexcept FADD_D [[COPY]], [[COPY1]], 7
210 ; CHECK-NEXT: $f10_d = COPY [[FADD_D]]
211 ; CHECK-NEXT: PseudoRET implicit $f10_d
212 %0:fprb(s64) = COPY $f10_d
213 %1:fprb(s64) = COPY $f11_d
214 %2:fprb(s64) = G_FADD %0, %1
215 $f10_d = COPY %2(s64)
216 PseudoRET implicit $f10_d
222 regBankSelected: true
223 tracksRegLiveness: true
226 liveins: $f10_f, $f11_f
228 ; CHECK-LABEL: name: fmaxnum_f32
229 ; CHECK: liveins: $f10_f, $f11_f
231 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr32 = COPY $f10_f
232 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fpr32 = COPY $f11_f
233 ; CHECK-NEXT: [[FMAX_S:%[0-9]+]]:fpr32 = nofpexcept FMAX_S [[COPY]], [[COPY1]]
234 ; CHECK-NEXT: $f10_f = COPY [[FMAX_S]]
235 ; CHECK-NEXT: PseudoRET implicit $f10_f
236 %0:fprb(s32) = COPY $f10_f
237 %1:fprb(s32) = COPY $f11_f
238 %2:fprb(s32) = G_FMAXNUM %0, %1
239 $f10_f = COPY %2(s32)
240 PseudoRET implicit $f10_f
246 regBankSelected: true
247 tracksRegLiveness: true
250 liveins: $f10_f, $f11_f
252 ; CHECK-LABEL: name: fminnum_f32
253 ; CHECK: liveins: $f10_f, $f11_f
255 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr32 = COPY $f10_f
256 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fpr32 = COPY $f11_f
257 ; CHECK-NEXT: [[FMIN_S:%[0-9]+]]:fpr32 = nofpexcept FMIN_S [[COPY]], [[COPY1]]
258 ; CHECK-NEXT: $f10_f = COPY [[FMIN_S]]
259 ; CHECK-NEXT: PseudoRET implicit $f10_f
260 %0:fprb(s32) = COPY $f10_f
261 %1:fprb(s32) = COPY $f11_f
262 %2:fprb(s32) = G_FMINNUM %0, %1
263 $f10_f = COPY %2(s32)
264 PseudoRET implicit $f10_f
270 regBankSelected: true
271 tracksRegLiveness: true
274 liveins: $f10_f, $f11_f
276 ; CHECK-LABEL: name: fcopysign_f32
277 ; CHECK: liveins: $f10_f, $f11_f
279 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr32 = COPY $f10_f
280 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fpr32 = COPY $f11_f
281 ; CHECK-NEXT: [[FSGNJ_S:%[0-9]+]]:fpr32 = FSGNJ_S [[COPY]], [[COPY1]]
282 ; CHECK-NEXT: $f10_f = COPY [[FSGNJ_S]]
283 ; CHECK-NEXT: PseudoRET implicit $f10_f
284 %0:fprb(s32) = COPY $f10_f
285 %1:fprb(s32) = COPY $f11_f
286 %2:fprb(s32) = G_FCOPYSIGN %0, %1
287 $f10_f = COPY %2(s32)
288 PseudoRET implicit $f10_f
294 regBankSelected: true
295 tracksRegLiveness: true
298 liveins: $f10_d, $f11_d
300 ; CHECK-LABEL: name: fsub_f64
301 ; CHECK: liveins: $f10_d, $f11_d
303 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr64 = COPY $f10_d
304 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fpr64 = COPY $f11_d
305 ; CHECK-NEXT: [[FSUB_D:%[0-9]+]]:fpr64 = nofpexcept FSUB_D [[COPY]], [[COPY1]], 7
306 ; CHECK-NEXT: $f10_d = COPY [[FSUB_D]]
307 ; CHECK-NEXT: PseudoRET implicit $f10_d
308 %0:fprb(s64) = COPY $f10_d
309 %1:fprb(s64) = COPY $f11_d
310 %2:fprb(s64) = G_FSUB %0, %1
311 $f10_d = COPY %2(s64)
312 PseudoRET implicit $f10_d
318 regBankSelected: true
319 tracksRegLiveness: true
322 liveins: $f10_d, $f11_d
324 ; CHECK-LABEL: name: fmul_f64
325 ; CHECK: liveins: $f10_d, $f11_d
327 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr64 = COPY $f10_d
328 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fpr64 = COPY $f11_d
329 ; CHECK-NEXT: [[FMUL_D:%[0-9]+]]:fpr64 = nofpexcept FMUL_D [[COPY]], [[COPY1]], 7
330 ; CHECK-NEXT: $f10_d = COPY [[FMUL_D]]
331 ; CHECK-NEXT: PseudoRET implicit $f10_d
332 %0:fprb(s64) = COPY $f10_d
333 %1:fprb(s64) = COPY $f11_d
334 %2:fprb(s64) = G_FMUL %0, %1
335 $f10_d = COPY %2(s64)
336 PseudoRET implicit $f10_d
342 regBankSelected: true
343 tracksRegLiveness: true
346 liveins: $f10_d, $f11_d
348 ; CHECK-LABEL: name: fdiv_f64
349 ; CHECK: liveins: $f10_d, $f11_d
351 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr64 = COPY $f10_d
352 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fpr64 = COPY $f11_d
353 ; CHECK-NEXT: [[FDIV_D:%[0-9]+]]:fpr64 = nofpexcept FDIV_D [[COPY]], [[COPY1]], 7
354 ; CHECK-NEXT: $f10_d = COPY [[FDIV_D]]
355 ; CHECK-NEXT: PseudoRET implicit $f10_d
356 %0:fprb(s64) = COPY $f10_d
357 %1:fprb(s64) = COPY $f11_d
358 %2:fprb(s64) = G_FDIV %0, %1
359 $f10_d = COPY %2(s64)
360 PseudoRET implicit $f10_d
366 regBankSelected: true
367 tracksRegLiveness: true
370 liveins: $f10_d, $f11_d, $f12_d
372 ; CHECK-LABEL: name: fma_f64
373 ; CHECK: liveins: $f10_d, $f11_d, $f12_d
375 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr64 = COPY $f10_d
376 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fpr64 = COPY $f11_d
377 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:fpr64 = COPY $f12_d
378 ; CHECK-NEXT: [[FMADD_D:%[0-9]+]]:fpr64 = nofpexcept FMADD_D [[COPY]], [[COPY1]], [[COPY2]], 7
379 ; CHECK-NEXT: $f10_d = COPY [[FMADD_D]]
380 ; CHECK-NEXT: PseudoRET implicit $f10_d
381 %0:fprb(s64) = COPY $f10_d
382 %1:fprb(s64) = COPY $f11_d
383 %2:fprb(s64) = COPY $f12_d
384 %3:fprb(s64) = G_FMA %0, %1, %2
385 $f10_d = COPY %3(s64)
386 PseudoRET implicit $f10_d
392 regBankSelected: true
393 tracksRegLiveness: true
398 ; CHECK-LABEL: name: fneg_f64
399 ; CHECK: liveins: $f10_d
401 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr64 = COPY $f10_d
402 ; CHECK-NEXT: [[FSGNJN_D:%[0-9]+]]:fpr64 = FSGNJN_D [[COPY]], [[COPY]]
403 ; CHECK-NEXT: $f10_d = COPY [[FSGNJN_D]]
404 ; CHECK-NEXT: PseudoRET implicit $f10_d
405 %0:fprb(s64) = COPY $f10_d
406 %1:fprb(s64) = G_FNEG %0
407 $f10_d = COPY %1(s64)
408 PseudoRET implicit $f10_d
414 regBankSelected: true
415 tracksRegLiveness: true
420 ; CHECK-LABEL: name: fabs_f64
421 ; CHECK: liveins: $f10_d
423 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr64 = COPY $f10_d
424 ; CHECK-NEXT: [[FSGNJX_D:%[0-9]+]]:fpr64 = FSGNJX_D [[COPY]], [[COPY]]
425 ; CHECK-NEXT: $f10_d = COPY [[FSGNJX_D]]
426 ; CHECK-NEXT: PseudoRET implicit $f10_d
427 %0:fprb(s64) = COPY $f10_d
428 %1:fprb(s64) = G_FABS %0
429 $f10_d = COPY %1(s64)
430 PseudoRET implicit $f10_d
436 regBankSelected: true
437 tracksRegLiveness: true
442 ; CHECK-LABEL: name: fsqrt_f64
443 ; CHECK: liveins: $f10_d
445 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr64 = COPY $f10_d
446 ; CHECK-NEXT: [[FSQRT_D:%[0-9]+]]:fpr64 = nofpexcept FSQRT_D [[COPY]], 7
447 ; CHECK-NEXT: $f10_d = COPY [[FSQRT_D]]
448 ; CHECK-NEXT: PseudoRET implicit $f10_d
449 %0:fprb(s64) = COPY $f10_d
450 %1:fprb(s64) = G_FSQRT %0
451 $f10_d = COPY %1(s64)
452 PseudoRET implicit $f10_d
458 regBankSelected: true
459 tracksRegLiveness: true
462 liveins: $f10_d, $f11_d
464 ; CHECK-LABEL: name: fmaxnum_f64
465 ; CHECK: liveins: $f10_d, $f11_d
467 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr64 = COPY $f10_d
468 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fpr64 = COPY $f11_d
469 ; CHECK-NEXT: [[FMAX_D:%[0-9]+]]:fpr64 = nofpexcept FMAX_D [[COPY]], [[COPY1]]
470 ; CHECK-NEXT: $f10_d = COPY [[FMAX_D]]
471 ; CHECK-NEXT: PseudoRET implicit $f10_d
472 %0:fprb(s64) = COPY $f10_d
473 %1:fprb(s64) = COPY $f11_d
474 %2:fprb(s64) = G_FMAXNUM %0, %1
475 $f10_d = COPY %2(s64)
476 PseudoRET implicit $f10_d
482 regBankSelected: true
483 tracksRegLiveness: true
486 liveins: $f10_d, $f11_d
488 ; CHECK-LABEL: name: fminnum_f64
489 ; CHECK: liveins: $f10_d, $f11_d
491 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr64 = COPY $f10_d
492 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fpr64 = COPY $f11_d
493 ; CHECK-NEXT: [[FMIN_D:%[0-9]+]]:fpr64 = nofpexcept FMIN_D [[COPY]], [[COPY1]]
494 ; CHECK-NEXT: $f10_d = COPY [[FMIN_D]]
495 ; CHECK-NEXT: PseudoRET implicit $f10_d
496 %0:fprb(s64) = COPY $f10_d
497 %1:fprb(s64) = COPY $f11_d
498 %2:fprb(s64) = G_FMINNUM %0, %1
499 $f10_d = COPY %2(s64)
500 PseudoRET implicit $f10_d
506 regBankSelected: true
507 tracksRegLiveness: true
510 liveins: $f10_d, $f11_d
512 ; CHECK-LABEL: name: fcopysign_f64
513 ; CHECK: liveins: $f10_d, $f11_d
515 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr64 = COPY $f10_d
516 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fpr64 = COPY $f11_d
517 ; CHECK-NEXT: [[FSGNJ_D:%[0-9]+]]:fpr64 = FSGNJ_D [[COPY]], [[COPY1]]
518 ; CHECK-NEXT: $f10_d = COPY [[FSGNJ_D]]
519 ; CHECK-NEXT: PseudoRET implicit $f10_d
520 %0:fprb(s64) = COPY $f10_d
521 %1:fprb(s64) = COPY $f11_d
522 %2:fprb(s64) = G_FCOPYSIGN %0, %1
523 $f10_d = COPY %2(s64)
524 PseudoRET implicit $f10_d