• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -mtriple=riscv32 -target-abi ilp32 < %s 2>&1 \
2; RUN:   | FileCheck -check-prefix=RV32IF-ILP32 %s
3; RUN: llc -mtriple=riscv32 -target-abi ilp32f < %s 2>&1 \
4; RUN:   | FileCheck -check-prefix=RV32IF-ILP32F %s
5; RUN: llc -mtriple=riscv32 -mattr=-f -target-abi ilp32f <%s 2>&1 \
6; RUN:   | FileCheck -check-prefix=RV32I-ILP32F-FAILED %s
7
8; RV32I-ILP32F-FAILED: Hard-float 'f' ABI can't be used for a target that doesn't support the F instruction set extension
9
10
11define float @foo(i32 %a) nounwind #0 {
12; RV32IF-ILP32: fcvt.s.w  ft0, a0
13; RV32IF-ILP32-NEXT: fmv.x.w a0, ft0
14; RV32IF-ILP32F: fcvt.s.w fa0, a0
15; RV32IF-ILP32F-NEXT: ret
16  %conv = sitofp i32 %a to float
17  ret float %conv
18}
19
20attributes #0 = { "target-features"="+f"}
21