1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -mattr=+zfh \
3 ; RUN: -verify-machineinstrs -target-abi ilp32f | \
4 ; RUN: FileCheck -check-prefix=RV32IZFH %s
5 ; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -mattr=+zfh \
6 ; RUN: -verify-machineinstrs -target-abi lp64f | \
7 ; RUN: FileCheck -check-prefix=RV64IZFH %s
8 ; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -mattr=+d \
9 ; RUN: -mattr=+zfh -verify-machineinstrs -target-abi ilp32d | \
10 ; RUN: FileCheck -check-prefix=RV32IDZFH %s
11 ; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -mattr=+d \
12 ; RUN: -mattr=+zfh -verify-machineinstrs -target-abi lp64d | \
13 ; RUN: FileCheck -check-prefix=RV64IDZFH %s
15 ; These intrinsics require half to be a legal type.
17 declare iXLen @llvm.lrint.iXLen.f16(half)
19 define iXLen @lrint_f16(half %a) nounwind {
20 ; RV32IZFH-LABEL: lrint_f16:
22 ; RV32IZFH-NEXT: fcvt.w.h a0, fa0
25 ; RV64IZFH-LABEL: lrint_f16:
27 ; RV64IZFH-NEXT: fcvt.l.h a0, fa0
30 ; RV32IDZFH-LABEL: lrint_f16:
32 ; RV32IDZFH-NEXT: fcvt.w.h a0, fa0
35 ; RV64IDZFH-LABEL: lrint_f16:
37 ; RV64IDZFH-NEXT: fcvt.l.h a0, fa0
39 %1 = call iXLen @llvm.lrint.iXLen.f16(half %a)
43 declare iXLen @llvm.lround.iXLen.f16(half)
45 define iXLen @lround_f16(half %a) nounwind {
46 ; RV32IZFH-LABEL: lround_f16:
48 ; RV32IZFH-NEXT: fcvt.w.h a0, fa0, rmm
51 ; RV64IZFH-LABEL: lround_f16:
53 ; RV64IZFH-NEXT: fcvt.l.h a0, fa0, rmm
56 ; RV32IDZFH-LABEL: lround_f16:
58 ; RV32IDZFH-NEXT: fcvt.w.h a0, fa0, rmm
61 ; RV64IDZFH-LABEL: lround_f16:
63 ; RV64IDZFH-NEXT: fcvt.l.h a0, fa0, rmm
65 %1 = call iXLen @llvm.lround.iXLen.f16(half %a)