1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=riscv64 -mattr=+zfh \
3 ; RUN: -verify-machineinstrs -target-abi lp64f | \
4 ; RUN: FileCheck -check-prefix=RV64IZFH %s
5 ; RUN: llc < %s -mtriple=riscv64 -mattr=+d \
6 ; RUN: -mattr=+zfh -verify-machineinstrs -target-abi lp64d | \
7 ; RUN: FileCheck -check-prefix=RV64IDZFH %s
8 ; RUN: llc < %s -mtriple=riscv64 -mattr=+zhinx \
9 ; RUN: -verify-machineinstrs -target-abi lp64 | \
10 ; RUN: FileCheck -check-prefix=RV64IZHINX %s
11 ; RUN: llc < %s -mtriple=riscv64 -mattr=+zdinx \
12 ; RUN: -mattr=+zhinx -verify-machineinstrs -target-abi lp64 | \
13 ; RUN: FileCheck -check-prefix=RV64IZDINXZHINX %s
15 ; These intrinsics require half and i64 to be legal types.
17 declare i64 @llvm.llrint.i64.f16(half)
19 define i64 @llrint_f16(half %a) nounwind {
20 ; RV64IZFH-LABEL: llrint_f16:
22 ; RV64IZFH-NEXT: fcvt.l.h a0, fa0
25 ; RV64IDZFH-LABEL: llrint_f16:
27 ; RV64IDZFH-NEXT: fcvt.l.h a0, fa0
30 ; RV64IZHINX-LABEL: llrint_f16:
31 ; RV64IZHINX: # %bb.0:
32 ; RV64IZHINX-NEXT: fcvt.l.h a0, a0
33 ; RV64IZHINX-NEXT: ret
35 ; RV64IZDINXZHINX-LABEL: llrint_f16:
36 ; RV64IZDINXZHINX: # %bb.0:
37 ; RV64IZDINXZHINX-NEXT: fcvt.l.h a0, a0
38 ; RV64IZDINXZHINX-NEXT: ret
39 %1 = call i64 @llvm.llrint.i64.f16(half %a)
43 declare i64 @llvm.llround.i64.f16(half)
45 define i64 @llround_f16(half %a) nounwind {
46 ; RV64IZFH-LABEL: llround_f16:
48 ; RV64IZFH-NEXT: fcvt.l.h a0, fa0, rmm
51 ; RV64IDZFH-LABEL: llround_f16:
53 ; RV64IDZFH-NEXT: fcvt.l.h a0, fa0, rmm
56 ; RV64IZHINX-LABEL: llround_f16:
57 ; RV64IZHINX: # %bb.0:
58 ; RV64IZHINX-NEXT: fcvt.l.h a0, a0, rmm
59 ; RV64IZHINX-NEXT: ret
61 ; RV64IZDINXZHINX-LABEL: llround_f16:
62 ; RV64IZDINXZHINX: # %bb.0:
63 ; RV64IZDINXZHINX-NEXT: fcvt.l.h a0, a0, rmm
64 ; RV64IZDINXZHINX-NEXT: ret
65 %1 = call i64 @llvm.llround.i64.f16(half %a)