1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc --mtriple=loongarch32 --mattr=+f,-d < %s | FileCheck %s --check-prefix=LA32
3 ; RUN: llc --mtriple=loongarch64 --mattr=+f,-d < %s | FileCheck %s --check-prefix=LA64
5 declare i1 @llvm.experimental.constrained.fcmp.f32(float, float, metadata, metadata)
7 define i32 @fcmp_oeq(float %a, float %b) nounwind strictfp {
8 ; LA32-LABEL: fcmp_oeq:
10 ; LA32-NEXT: fcmp.ceq.s $fcc0, $fa0, $fa1
11 ; LA32-NEXT: movcf2gr $a0, $fcc0
14 ; LA64-LABEL: fcmp_oeq:
16 ; LA64-NEXT: fcmp.ceq.s $fcc0, $fa0, $fa1
17 ; LA64-NEXT: movcf2gr $a0, $fcc0
19 %1 = call i1 @llvm.experimental.constrained.fcmp.f32(float %a, float %b, metadata !"oeq", metadata !"fpexcept.strict") strictfp
20 %2 = zext i1 %1 to i32
24 define i32 @fcmp_ogt(float %a, float %b) nounwind strictfp {
25 ; LA32-LABEL: fcmp_ogt:
27 ; LA32-NEXT: fcmp.clt.s $fcc0, $fa1, $fa0
28 ; LA32-NEXT: movcf2gr $a0, $fcc0
31 ; LA64-LABEL: fcmp_ogt:
33 ; LA64-NEXT: fcmp.clt.s $fcc0, $fa1, $fa0
34 ; LA64-NEXT: movcf2gr $a0, $fcc0
36 %1 = call i1 @llvm.experimental.constrained.fcmp.f32(float %a, float %b, metadata !"ogt", metadata !"fpexcept.strict") strictfp
37 %2 = zext i1 %1 to i32
41 define i32 @fcmp_oge(float %a, float %b) nounwind strictfp {
42 ; LA32-LABEL: fcmp_oge:
44 ; LA32-NEXT: fcmp.cle.s $fcc0, $fa1, $fa0
45 ; LA32-NEXT: movcf2gr $a0, $fcc0
48 ; LA64-LABEL: fcmp_oge:
50 ; LA64-NEXT: fcmp.cle.s $fcc0, $fa1, $fa0
51 ; LA64-NEXT: movcf2gr $a0, $fcc0
53 %1 = call i1 @llvm.experimental.constrained.fcmp.f32(float %a, float %b, metadata !"oge", metadata !"fpexcept.strict") strictfp
54 %2 = zext i1 %1 to i32
58 define i32 @fcmp_olt(float %a, float %b) nounwind strictfp {
59 ; LA32-LABEL: fcmp_olt:
61 ; LA32-NEXT: fcmp.clt.s $fcc0, $fa0, $fa1
62 ; LA32-NEXT: movcf2gr $a0, $fcc0
65 ; LA64-LABEL: fcmp_olt:
67 ; LA64-NEXT: fcmp.clt.s $fcc0, $fa0, $fa1
68 ; LA64-NEXT: movcf2gr $a0, $fcc0
70 %1 = call i1 @llvm.experimental.constrained.fcmp.f32(float %a, float %b, metadata !"olt", metadata !"fpexcept.strict") strictfp
71 %2 = zext i1 %1 to i32
75 define i32 @fcmp_ole(float %a, float %b) nounwind strictfp {
76 ; LA32-LABEL: fcmp_ole:
78 ; LA32-NEXT: fcmp.cle.s $fcc0, $fa0, $fa1
79 ; LA32-NEXT: movcf2gr $a0, $fcc0
82 ; LA64-LABEL: fcmp_ole:
84 ; LA64-NEXT: fcmp.cle.s $fcc0, $fa0, $fa1
85 ; LA64-NEXT: movcf2gr $a0, $fcc0
87 %1 = call i1 @llvm.experimental.constrained.fcmp.f32(float %a, float %b, metadata !"ole", metadata !"fpexcept.strict") strictfp
88 %2 = zext i1 %1 to i32
92 define i32 @fcmp_one(float %a, float %b) nounwind strictfp {
93 ; LA32-LABEL: fcmp_one:
95 ; LA32-NEXT: fcmp.cne.s $fcc0, $fa0, $fa1
96 ; LA32-NEXT: movcf2gr $a0, $fcc0
99 ; LA64-LABEL: fcmp_one:
101 ; LA64-NEXT: fcmp.cne.s $fcc0, $fa0, $fa1
102 ; LA64-NEXT: movcf2gr $a0, $fcc0
104 %1 = call i1 @llvm.experimental.constrained.fcmp.f32(float %a, float %b, metadata !"one", metadata !"fpexcept.strict") strictfp
105 %2 = zext i1 %1 to i32
109 define i32 @fcmp_ord(float %a, float %b) nounwind strictfp {
110 ; LA32-LABEL: fcmp_ord:
112 ; LA32-NEXT: fcmp.cor.s $fcc0, $fa0, $fa1
113 ; LA32-NEXT: movcf2gr $a0, $fcc0
116 ; LA64-LABEL: fcmp_ord:
118 ; LA64-NEXT: fcmp.cor.s $fcc0, $fa0, $fa1
119 ; LA64-NEXT: movcf2gr $a0, $fcc0
121 %1 = call i1 @llvm.experimental.constrained.fcmp.f32(float %a, float %b, metadata !"ord", metadata !"fpexcept.strict") strictfp
122 %2 = zext i1 %1 to i32
126 define i32 @fcmp_ueq(float %a, float %b) nounwind strictfp {
127 ; LA32-LABEL: fcmp_ueq:
129 ; LA32-NEXT: fcmp.cueq.s $fcc0, $fa0, $fa1
130 ; LA32-NEXT: movcf2gr $a0, $fcc0
133 ; LA64-LABEL: fcmp_ueq:
135 ; LA64-NEXT: fcmp.cueq.s $fcc0, $fa0, $fa1
136 ; LA64-NEXT: movcf2gr $a0, $fcc0
138 %1 = call i1 @llvm.experimental.constrained.fcmp.f32(float %a, float %b, metadata !"ueq", metadata !"fpexcept.strict") strictfp
139 %2 = zext i1 %1 to i32
143 define i32 @fcmp_ugt(float %a, float %b) nounwind strictfp {
144 ; LA32-LABEL: fcmp_ugt:
146 ; LA32-NEXT: fcmp.cult.s $fcc0, $fa1, $fa0
147 ; LA32-NEXT: movcf2gr $a0, $fcc0
150 ; LA64-LABEL: fcmp_ugt:
152 ; LA64-NEXT: fcmp.cult.s $fcc0, $fa1, $fa0
153 ; LA64-NEXT: movcf2gr $a0, $fcc0
155 %1 = call i1 @llvm.experimental.constrained.fcmp.f32(float %a, float %b, metadata !"ugt", metadata !"fpexcept.strict") strictfp
156 %2 = zext i1 %1 to i32
160 define i32 @fcmp_uge(float %a, float %b) nounwind strictfp {
161 ; LA32-LABEL: fcmp_uge:
163 ; LA32-NEXT: fcmp.cule.s $fcc0, $fa1, $fa0
164 ; LA32-NEXT: movcf2gr $a0, $fcc0
167 ; LA64-LABEL: fcmp_uge:
169 ; LA64-NEXT: fcmp.cule.s $fcc0, $fa1, $fa0
170 ; LA64-NEXT: movcf2gr $a0, $fcc0
172 %1 = call i1 @llvm.experimental.constrained.fcmp.f32(float %a, float %b, metadata !"uge", metadata !"fpexcept.strict") strictfp
173 %2 = zext i1 %1 to i32
177 define i32 @fcmp_ult(float %a, float %b) nounwind strictfp {
178 ; LA32-LABEL: fcmp_ult:
180 ; LA32-NEXT: fcmp.cult.s $fcc0, $fa0, $fa1
181 ; LA32-NEXT: movcf2gr $a0, $fcc0
184 ; LA64-LABEL: fcmp_ult:
186 ; LA64-NEXT: fcmp.cult.s $fcc0, $fa0, $fa1
187 ; LA64-NEXT: movcf2gr $a0, $fcc0
189 %1 = call i1 @llvm.experimental.constrained.fcmp.f32(float %a, float %b, metadata !"ult", metadata !"fpexcept.strict") strictfp
190 %2 = zext i1 %1 to i32
194 define i32 @fcmp_ule(float %a, float %b) nounwind strictfp {
195 ; LA32-LABEL: fcmp_ule:
197 ; LA32-NEXT: fcmp.cule.s $fcc0, $fa0, $fa1
198 ; LA32-NEXT: movcf2gr $a0, $fcc0
201 ; LA64-LABEL: fcmp_ule:
203 ; LA64-NEXT: fcmp.cule.s $fcc0, $fa0, $fa1
204 ; LA64-NEXT: movcf2gr $a0, $fcc0
206 %1 = call i1 @llvm.experimental.constrained.fcmp.f32(float %a, float %b, metadata !"ule", metadata !"fpexcept.strict") strictfp
207 %2 = zext i1 %1 to i32
211 define i32 @fcmp_une(float %a, float %b) nounwind strictfp {
212 ; LA32-LABEL: fcmp_une:
214 ; LA32-NEXT: fcmp.cune.s $fcc0, $fa0, $fa1
215 ; LA32-NEXT: movcf2gr $a0, $fcc0
218 ; LA64-LABEL: fcmp_une:
220 ; LA64-NEXT: fcmp.cune.s $fcc0, $fa0, $fa1
221 ; LA64-NEXT: movcf2gr $a0, $fcc0
223 %1 = call i1 @llvm.experimental.constrained.fcmp.f32(float %a, float %b, metadata !"une", metadata !"fpexcept.strict") strictfp
224 %2 = zext i1 %1 to i32
228 define i32 @fcmp_uno(float %a, float %b) nounwind strictfp {
229 ; LA32-LABEL: fcmp_uno:
231 ; LA32-NEXT: fcmp.cun.s $fcc0, $fa0, $fa1
232 ; LA32-NEXT: movcf2gr $a0, $fcc0
235 ; LA64-LABEL: fcmp_uno:
237 ; LA64-NEXT: fcmp.cun.s $fcc0, $fa0, $fa1
238 ; LA64-NEXT: movcf2gr $a0, $fcc0
240 %1 = call i1 @llvm.experimental.constrained.fcmp.f32(float %a, float %b, metadata !"uno", metadata !"fpexcept.strict") strictfp
241 %2 = zext i1 %1 to i32