llvm/llvm/test/CodeGen/RISCV/GlobalISel/regbankselect/itofp-rv64.mir

# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple=riscv64 -mattr=+d -run-pass=regbankselect \
# RUN:   -simplify-mir -verify-machineinstrs %s \
# RUN:   -o - | FileCheck %s

---
name:            sitofp_s32_s32
legalized:       true
tracksRegLiveness: true
body:             |
  bb.0:
    liveins: $x10

    ; CHECK-LABEL: name: sitofp_s32_s32
    ; CHECK: liveins: $x10
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:gprb(s64) = COPY $x10
    ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:gprb(s32) = G_TRUNC [[COPY]](s64)
    ; CHECK-NEXT: [[SITOFP:%[0-9]+]]:fprb(s32) = G_SITOFP [[TRUNC]](s32)
    ; CHECK-NEXT: $f10_f = COPY [[SITOFP]](s32)
    ; CHECK-NEXT: PseudoRET implicit $f10_f
    %0:_(s64) = COPY $x10
    %1:_(s32) = G_TRUNC %0(s64)
    %2:_(s32) = G_SITOFP %1(s32)
    $f10_f = COPY %2(s32)
    PseudoRET implicit $f10_f

...
---
name:            uitofp_s32_s32
legalized:       true
tracksRegLiveness: true
body:             |
  bb.0:
    liveins: $x10

    ; CHECK-LABEL: name: uitofp_s32_s32
    ; CHECK: liveins: $x10
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:gprb(s64) = COPY $x10
    ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:gprb(s32) = G_TRUNC [[COPY]](s64)
    ; CHECK-NEXT: [[UITOFP:%[0-9]+]]:fprb(s32) = G_UITOFP [[TRUNC]](s32)
    ; CHECK-NEXT: $f10_f = COPY [[UITOFP]](s32)
    ; CHECK-NEXT: PseudoRET implicit $f10_f
    %0:_(s64) = COPY $x10
    %1:_(s32) = G_TRUNC %0(s64)
    %2:_(s32) = G_UITOFP %1(s32)
    $f10_f = COPY %2(s32)
    PseudoRET implicit $f10_f

...
---
name:            sitofp_s32_s64
legalized:       true
tracksRegLiveness: true
body:             |
  bb.0:
    liveins: $x10

    ; CHECK-LABEL: name: sitofp_s32_s64
    ; CHECK: liveins: $x10
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:gprb(s64) = COPY $x10
    ; CHECK-NEXT: [[SITOFP:%[0-9]+]]:fprb(s32) = G_SITOFP [[COPY]](s64)
    ; CHECK-NEXT: $f10_f = COPY [[SITOFP]](s32)
    ; CHECK-NEXT: PseudoRET implicit $f10_f
    %0:_(s64) = COPY $x10
    %1:_(s32) = G_SITOFP %0(s64)
    $f10_f = COPY %1(s32)
    PseudoRET implicit $f10_f

...
---
name:            uitofp_s32_s64
legalized:       true
tracksRegLiveness: true
body:             |
  bb.0:
    liveins: $x10

    ; CHECK-LABEL: name: uitofp_s32_s64
    ; CHECK: liveins: $x10
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:gprb(s64) = COPY $x10
    ; CHECK-NEXT: [[UITOFP:%[0-9]+]]:fprb(s32) = G_UITOFP [[COPY]](s64)
    ; CHECK-NEXT: $f10_f = COPY [[UITOFP]](s32)
    ; CHECK-NEXT: PseudoRET implicit $f10_f
    %0:_(s64) = COPY $x10
    %1:_(s32) = G_UITOFP %0(s64)
    $f10_f = COPY %1(s32)
    PseudoRET implicit $f10_f

...
---
name:            sitofp_s64_s32
legalized:       true
tracksRegLiveness: true
body:             |
  bb.0:
    liveins: $x10

    ; CHECK-LABEL: name: sitofp_s64_s32
    ; CHECK: liveins: $x10
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:gprb(s64) = COPY $x10
    ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:gprb(s32) = G_TRUNC [[COPY]](s64)
    ; CHECK-NEXT: [[SITOFP:%[0-9]+]]:fprb(s64) = G_SITOFP [[TRUNC]](s32)
    ; CHECK-NEXT: $f10_d = COPY [[SITOFP]](s64)
    ; CHECK-NEXT: PseudoRET implicit $f10_d
    %0:_(s64) = COPY $x10
    %1:_(s32) = G_TRUNC %0(s64)
    %2:_(s64) = G_SITOFP %1(s32)
    $f10_d = COPY %2(s64)
    PseudoRET implicit $f10_d

...
---
name:            uitofp_s64_s32
legalized:       true
tracksRegLiveness: true
body:             |
  bb.0:
    liveins: $x10

    ; CHECK-LABEL: name: uitofp_s64_s32
    ; CHECK: liveins: $x10
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:gprb(s64) = COPY $x10
    ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:gprb(s32) = G_TRUNC [[COPY]](s64)
    ; CHECK-NEXT: [[UITOFP:%[0-9]+]]:fprb(s64) = G_UITOFP [[TRUNC]](s32)
    ; CHECK-NEXT: $f10_d = COPY [[UITOFP]](s64)
    ; CHECK-NEXT: PseudoRET implicit $f10_d
    %0:_(s64) = COPY $x10
    %1:_(s32) = G_TRUNC %0(s64)
    %2:_(s64) = G_UITOFP %1(s32)
    $f10_d = COPY %2(s64)
    PseudoRET implicit $f10_d

...
---
name:            sitofp_s64_s64
legalized:       true
tracksRegLiveness: true
body:             |
  bb.0:
    liveins: $x10

    ; CHECK-LABEL: name: sitofp_s64_s64
    ; CHECK: liveins: $x10
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:gprb(s64) = COPY $x10
    ; CHECK-NEXT: [[SITOFP:%[0-9]+]]:fprb(s64) = G_SITOFP [[COPY]](s64)
    ; CHECK-NEXT: $f10_d = COPY [[SITOFP]](s64)
    ; CHECK-NEXT: PseudoRET implicit $f10_d
    %0:_(s64) = COPY $x10
    %1:_(s64) = G_SITOFP %0(s64)
    $f10_d = COPY %1(s64)
    PseudoRET implicit $f10_d

...
---
name:            uitofp_s64_s64
legalized:       true
tracksRegLiveness: true
body:             |
  bb.0:
    liveins: $x10

    ; CHECK-LABEL: name: uitofp_s64_s64
    ; CHECK: liveins: $x10
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:gprb(s64) = COPY $x10
    ; CHECK-NEXT: [[UITOFP:%[0-9]+]]:fprb(s64) = G_UITOFP [[COPY]](s64)
    ; CHECK-NEXT: $f10_d = COPY [[UITOFP]](s64)
    ; CHECK-NEXT: PseudoRET implicit $f10_d
    %0:_(s64) = COPY $x10
    %1:_(s64) = G_UITOFP %0(s64)
    $f10_d = COPY %1(s64)
    PseudoRET implicit $f10_d

...