# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple=riscv64 -mattr=+zfh -run-pass=instruction-select \
# RUN: -simplify-mir -verify-machineinstrs %s -o - | FileCheck %s
---
name: sitofp_s64_s32
legalized: true
regBankSelected: true
tracksRegLiveness: true
body: |
bb.0:
liveins: $x10
; CHECK-LABEL: name: sitofp_s64_s32
; CHECK: liveins: $x10
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
; CHECK-NEXT: [[FCVT_H_W:%[0-9]+]]:fpr16 = nofpexcept FCVT_H_W [[COPY]], 7
; CHECK-NEXT: $f10_h = COPY [[FCVT_H_W]]
; CHECK-NEXT: PseudoRET implicit $f10_h
%0:gprb(s64) = COPY $x10
%1:gprb(s32) = G_TRUNC %0(s64)
%2:fprb(s16) = G_SITOFP %1(s32)
$f10_h = COPY %2(s16)
PseudoRET implicit $f10_h
...
---
name: uitofp_s64_s32
legalized: true
regBankSelected: true
tracksRegLiveness: true
body: |
bb.0:
liveins: $x10
; CHECK-LABEL: name: uitofp_s64_s32
; CHECK: liveins: $x10
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
; CHECK-NEXT: [[FCVT_H_WU:%[0-9]+]]:fpr16 = nofpexcept FCVT_H_WU [[COPY]], 7
; CHECK-NEXT: $f10_h = COPY [[FCVT_H_WU]]
; CHECK-NEXT: PseudoRET implicit $f10_h
%0:gprb(s64) = COPY $x10
%1:gprb(s32) = G_TRUNC %0(s64)
%2:fprb(s16) = G_UITOFP %1(s32)
$f10_h = COPY %2(s16)
PseudoRET implicit $f10_h
...
---
name: sitofp_s64_s64
legalized: true
regBankSelected: true
tracksRegLiveness: true
body: |
bb.0:
liveins: $x10
; CHECK-LABEL: name: sitofp_s64_s64
; CHECK: liveins: $x10
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
; CHECK-NEXT: [[FCVT_H_L:%[0-9]+]]:fpr16 = nofpexcept FCVT_H_L [[COPY]], 7
; CHECK-NEXT: $f10_h = COPY [[FCVT_H_L]]
; CHECK-NEXT: PseudoRET implicit $f10_h
%0:gprb(s64) = COPY $x10
%1:fprb(s16) = G_SITOFP %0(s64)
$f10_h = COPY %1(s16)
PseudoRET implicit $f10_h
...
---
name: uitofp_s64_s64
legalized: true
regBankSelected: true
tracksRegLiveness: true
body: |
bb.0:
liveins: $x10
; CHECK-LABEL: name: uitofp_s64_s64
; CHECK: liveins: $x10
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
; CHECK-NEXT: [[FCVT_H_LU:%[0-9]+]]:fpr16 = nofpexcept FCVT_H_LU [[COPY]], 7
; CHECK-NEXT: $f10_h = COPY [[FCVT_H_LU]]
; CHECK-NEXT: PseudoRET implicit $f10_h
%0:gprb(s64) = COPY $x10
%1:fprb(s16) = G_UITOFP %0(s64)
$f10_h = COPY %1(s16)
PseudoRET implicit $f10_h
...