# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 3
# RUN: llc -mtriple=riscv32 -mattr=+d,+zfh -run-pass=legalizer %s -o - \
# RUN: | FileCheck %s
# RUN: llc -mtriple=riscv64 -mattr=+d,+zfh -run-pass=legalizer %s -o - \
# RUN: | FileCheck %s
---
name: fpext_f32
body: |
bb.1:
liveins: $f10_h
; CHECK-LABEL: name: fpext_f32
; CHECK: liveins: $f10_h
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $f10_h
; CHECK-NEXT: [[FPEXT:%[0-9]+]]:_(s32) = G_FPEXT [[COPY]](s16)
; CHECK-NEXT: $f10_f = COPY [[FPEXT]](s32)
; CHECK-NEXT: PseudoRET implicit $f10_f
%0:_(s16) = COPY $f10_h
%1:_(s32) = G_FPEXT %0(s16)
$f10_f = COPY %1(s32)
PseudoRET implicit $f10_f
...
---
name: fptrunc_f32
body: |
bb.1:
liveins: $f10_f
; CHECK-LABEL: name: fptrunc_f32
; CHECK: liveins: $f10_f
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $f10_f
; CHECK-NEXT: [[FPTRUNC:%[0-9]+]]:_(s16) = G_FPTRUNC [[COPY]](s32)
; CHECK-NEXT: $f10_h = COPY [[FPTRUNC]](s16)
; CHECK-NEXT: PseudoRET implicit $f10_h
%0:_(s32) = COPY $f10_f
%1:_(s16) = G_FPTRUNC %0(s32)
$f10_h = COPY %1(s16)
PseudoRET implicit $f10_h
...
---
name: fpext_f64
body: |
bb.1:
liveins: $f10_h
; CHECK-LABEL: name: fpext_f64
; CHECK: liveins: $f10_h
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $f10_h
; CHECK-NEXT: [[FPEXT:%[0-9]+]]:_(s64) = G_FPEXT [[COPY]](s16)
; CHECK-NEXT: $f10_d = COPY [[FPEXT]](s64)
; CHECK-NEXT: PseudoRET implicit $f10_d
%0:_(s16) = COPY $f10_h
%1:_(s64) = G_FPEXT %0(s16)
$f10_d = COPY %1(s64)
PseudoRET implicit $f10_d
...
---
name: fptrunc_f64
body: |
bb.1:
liveins: $f10_d
; CHECK-LABEL: name: fptrunc_f64
; CHECK: liveins: $f10_d
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $f10_d
; CHECK-NEXT: [[FPTRUNC:%[0-9]+]]:_(s16) = G_FPTRUNC [[COPY]](s64)
; CHECK-NEXT: $f10_h = COPY [[FPTRUNC]](s16)
; CHECK-NEXT: PseudoRET implicit $f10_h
%0:_(s64) = COPY $f10_d
%1:_(s16) = G_FPTRUNC %0(s64)
$f10_h = COPY %1(s16)
PseudoRET implicit $f10_h
...