1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -target-abi ilp32f -mattr=+zfa,+zfh < %s \
4 ; RUN: llc -mtriple=riscv64 -target-abi lp64f -mattr=+zfa,+zfh < %s \
7 declare half @llvm.minimum.f16(half, half)
9 define half @fminm_h(half %a, half %b) nounwind {
10 ; CHECK-LABEL: fminm_h:
12 ; CHECK-NEXT: fminm.h fa0, fa0, fa1
14 %1 = call half @llvm.minimum.f16(half %a, half %b)
18 declare half @llvm.maximum.f16(half, half)
20 define half @fmaxm_h(half %a, half %b) nounwind {
21 ; CHECK-LABEL: fmaxm_h:
23 ; CHECK-NEXT: fmaxm.h fa0, fa0, fa1
25 %1 = tail call half @llvm.maximum.f16(half %a, half %b)
29 define half @fround_h_1(half %a) nounwind {
30 ; CHECK-LABEL: fround_h_1:
32 ; CHECK-NEXT: fround.h fa0, fa0, rmm
34 %call = tail call half @llvm.round.f16(half %a) nounwind readnone
38 declare half @llvm.round.f16(half) nounwind readnone
41 define half @fround_h_2(half %a) nounwind {
42 ; CHECK-LABEL: fround_h_2:
44 ; CHECK-NEXT: fround.h fa0, fa0, rdn
46 %call = tail call half @llvm.floor.f16(half %a) nounwind readnone
50 declare half @llvm.floor.f16(half) nounwind readnone
53 define half @fround_h_3(half %a) nounwind {
54 ; CHECK-LABEL: fround_h_3:
56 ; CHECK-NEXT: fround.h fa0, fa0, rup
58 %call = tail call half @llvm.ceil.f16(half %a) nounwind readnone
62 declare half @llvm.ceil.f16(half) nounwind readnone
65 define half @fround_h_4(half %a) nounwind {
66 ; CHECK-LABEL: fround_h_4:
68 ; CHECK-NEXT: fround.h fa0, fa0, rtz
70 %call = tail call half @llvm.trunc.f16(half %a) nounwind readnone
74 declare half @llvm.trunc.f16(half) nounwind readnone
77 define half @fround_h_5(half %a) nounwind {
78 ; CHECK-LABEL: fround_h_5:
80 ; CHECK-NEXT: fround.h fa0, fa0
82 %call = tail call half @llvm.nearbyint.f16(half %a) nounwind readnone
86 declare half @llvm.nearbyint.f16(half) nounwind readnone
89 define half @froundnx_h(half %a) nounwind {
90 ; CHECK-LABEL: froundnx_h:
92 ; CHECK-NEXT: froundnx.h fa0, fa0
94 %call = tail call half @llvm.rint.f16(half %a) nounwind readnone
98 declare half @llvm.rint.f16(half) nounwind readnone
100 declare i1 @llvm.experimental.constrained.fcmp.f16(half, half, metadata, metadata)
102 define i32 @fcmp_olt_q(half %a, half %b) nounwind strictfp {
103 ; CHECK-LABEL: fcmp_olt_q:
105 ; CHECK-NEXT: fltq.h a0, fa0, fa1
107 %1 = call i1 @llvm.experimental.constrained.fcmp.f16(half %a, half %b, metadata !"olt", metadata !"fpexcept.strict") strictfp
108 %2 = zext i1 %1 to i32
112 define i32 @fcmp_ole_q(half %a, half %b) nounwind strictfp {
113 ; CHECK-LABEL: fcmp_ole_q:
115 ; CHECK-NEXT: fleq.h a0, fa0, fa1
117 %1 = call i1 @llvm.experimental.constrained.fcmp.f16(half %a, half %b, metadata !"ole", metadata !"fpexcept.strict") strictfp
118 %2 = zext i1 %1 to i32
122 define i32 @fcmp_one_q(half %a, half %b) nounwind strictfp {
123 ; CHECK-LABEL: fcmp_one_q:
125 ; CHECK-NEXT: fltq.h a0, fa0, fa1
126 ; CHECK-NEXT: fltq.h a1, fa1, fa0
127 ; CHECK-NEXT: or a0, a1, a0
129 %1 = call i1 @llvm.experimental.constrained.fcmp.f16(half %a, half %b, metadata !"one", metadata !"fpexcept.strict") strictfp
130 %2 = zext i1 %1 to i32
134 define i32 @fcmp_ueq_q(half %a, half %b) nounwind strictfp {
135 ; CHECK-LABEL: fcmp_ueq_q:
137 ; CHECK-NEXT: fltq.h a0, fa0, fa1
138 ; CHECK-NEXT: fltq.h a1, fa1, fa0
139 ; CHECK-NEXT: or a0, a1, a0
140 ; CHECK-NEXT: xori a0, a0, 1
142 %1 = call i1 @llvm.experimental.constrained.fcmp.f16(half %a, half %b, metadata !"ueq", metadata !"fpexcept.strict") strictfp
143 %2 = zext i1 %1 to i32