1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+f -verify-machineinstrs < %s \
3 ; RUN: -target-abi=ilp32f | FileCheck -check-prefix=CHECKIF %s
4 ; RUN: llc -mtriple=riscv64 -mattr=+f -verify-machineinstrs < %s \
5 ; RUN: -target-abi=lp64f | FileCheck -check-prefix=CHECKIF %s
6 ; RUN: llc -mtriple=riscv32 -mattr=+zfinx -verify-machineinstrs < %s \
7 ; RUN: -target-abi=ilp32 | FileCheck -check-prefix=CHECKIZFINX %s
8 ; RUN: llc -mtriple=riscv64 -mattr=+zfinx -verify-machineinstrs < %s \
9 ; RUN: -target-abi=lp64 | FileCheck -check-prefix=CHECKIZFINX %s
10 ; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s \
11 ; RUN: | FileCheck -check-prefix=RV32I %s
12 ; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s \
13 ; RUN: | FileCheck -check-prefix=RV64I %s
15 define i32 @fcmp_false(float %a, float %b) nounwind {
16 ; CHECKIF-LABEL: fcmp_false:
18 ; CHECKIF-NEXT: li a0, 0
21 ; CHECKIZFINX-LABEL: fcmp_false:
22 ; CHECKIZFINX: # %bb.0:
23 ; CHECKIZFINX-NEXT: li a0, 0
24 ; CHECKIZFINX-NEXT: ret
26 ; RV32I-LABEL: fcmp_false:
28 ; RV32I-NEXT: li a0, 0
31 ; RV64I-LABEL: fcmp_false:
33 ; RV64I-NEXT: li a0, 0
35 %1 = fcmp false float %a, %b
36 %2 = zext i1 %1 to i32
40 define i32 @fcmp_oeq(float %a, float %b) nounwind {
41 ; CHECKIF-LABEL: fcmp_oeq:
43 ; CHECKIF-NEXT: feq.s a0, fa0, fa1
46 ; CHECKIZFINX-LABEL: fcmp_oeq:
47 ; CHECKIZFINX: # %bb.0:
48 ; CHECKIZFINX-NEXT: feq.s a0, a0, a1
49 ; CHECKIZFINX-NEXT: ret
51 ; RV32I-LABEL: fcmp_oeq:
53 ; RV32I-NEXT: addi sp, sp, -16
54 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
55 ; RV32I-NEXT: call __eqsf2
56 ; RV32I-NEXT: seqz a0, a0
57 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
58 ; RV32I-NEXT: addi sp, sp, 16
61 ; RV64I-LABEL: fcmp_oeq:
63 ; RV64I-NEXT: addi sp, sp, -16
64 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
65 ; RV64I-NEXT: call __eqsf2
66 ; RV64I-NEXT: seqz a0, a0
67 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
68 ; RV64I-NEXT: addi sp, sp, 16
70 %1 = fcmp oeq float %a, %b
71 %2 = zext i1 %1 to i32
75 define i32 @fcmp_ogt(float %a, float %b) nounwind {
76 ; CHECKIF-LABEL: fcmp_ogt:
78 ; CHECKIF-NEXT: flt.s a0, fa1, fa0
81 ; CHECKIZFINX-LABEL: fcmp_ogt:
82 ; CHECKIZFINX: # %bb.0:
83 ; CHECKIZFINX-NEXT: flt.s a0, a1, a0
84 ; CHECKIZFINX-NEXT: ret
86 ; RV32I-LABEL: fcmp_ogt:
88 ; RV32I-NEXT: addi sp, sp, -16
89 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
90 ; RV32I-NEXT: call __gtsf2
91 ; RV32I-NEXT: sgtz a0, a0
92 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
93 ; RV32I-NEXT: addi sp, sp, 16
96 ; RV64I-LABEL: fcmp_ogt:
98 ; RV64I-NEXT: addi sp, sp, -16
99 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
100 ; RV64I-NEXT: call __gtsf2
101 ; RV64I-NEXT: sgtz a0, a0
102 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
103 ; RV64I-NEXT: addi sp, sp, 16
105 %1 = fcmp ogt float %a, %b
106 %2 = zext i1 %1 to i32
110 define i32 @fcmp_oge(float %a, float %b) nounwind {
111 ; CHECKIF-LABEL: fcmp_oge:
113 ; CHECKIF-NEXT: fle.s a0, fa1, fa0
116 ; CHECKIZFINX-LABEL: fcmp_oge:
117 ; CHECKIZFINX: # %bb.0:
118 ; CHECKIZFINX-NEXT: fle.s a0, a1, a0
119 ; CHECKIZFINX-NEXT: ret
121 ; RV32I-LABEL: fcmp_oge:
123 ; RV32I-NEXT: addi sp, sp, -16
124 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
125 ; RV32I-NEXT: call __gesf2
126 ; RV32I-NEXT: slti a0, a0, 0
127 ; RV32I-NEXT: xori a0, a0, 1
128 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
129 ; RV32I-NEXT: addi sp, sp, 16
132 ; RV64I-LABEL: fcmp_oge:
134 ; RV64I-NEXT: addi sp, sp, -16
135 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
136 ; RV64I-NEXT: call __gesf2
137 ; RV64I-NEXT: slti a0, a0, 0
138 ; RV64I-NEXT: xori a0, a0, 1
139 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
140 ; RV64I-NEXT: addi sp, sp, 16
142 %1 = fcmp oge float %a, %b
143 %2 = zext i1 %1 to i32
147 define i32 @fcmp_olt(float %a, float %b) nounwind {
148 ; CHECKIF-LABEL: fcmp_olt:
150 ; CHECKIF-NEXT: flt.s a0, fa0, fa1
153 ; CHECKIZFINX-LABEL: fcmp_olt:
154 ; CHECKIZFINX: # %bb.0:
155 ; CHECKIZFINX-NEXT: flt.s a0, a0, a1
156 ; CHECKIZFINX-NEXT: ret
158 ; RV32I-LABEL: fcmp_olt:
160 ; RV32I-NEXT: addi sp, sp, -16
161 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
162 ; RV32I-NEXT: call __ltsf2
163 ; RV32I-NEXT: slti a0, a0, 0
164 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
165 ; RV32I-NEXT: addi sp, sp, 16
168 ; RV64I-LABEL: fcmp_olt:
170 ; RV64I-NEXT: addi sp, sp, -16
171 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
172 ; RV64I-NEXT: call __ltsf2
173 ; RV64I-NEXT: slti a0, a0, 0
174 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
175 ; RV64I-NEXT: addi sp, sp, 16
177 %1 = fcmp olt float %a, %b
178 %2 = zext i1 %1 to i32
182 define i32 @fcmp_ole(float %a, float %b) nounwind {
183 ; CHECKIF-LABEL: fcmp_ole:
185 ; CHECKIF-NEXT: fle.s a0, fa0, fa1
188 ; CHECKIZFINX-LABEL: fcmp_ole:
189 ; CHECKIZFINX: # %bb.0:
190 ; CHECKIZFINX-NEXT: fle.s a0, a0, a1
191 ; CHECKIZFINX-NEXT: ret
193 ; RV32I-LABEL: fcmp_ole:
195 ; RV32I-NEXT: addi sp, sp, -16
196 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
197 ; RV32I-NEXT: call __lesf2
198 ; RV32I-NEXT: slti a0, a0, 1
199 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
200 ; RV32I-NEXT: addi sp, sp, 16
203 ; RV64I-LABEL: fcmp_ole:
205 ; RV64I-NEXT: addi sp, sp, -16
206 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
207 ; RV64I-NEXT: call __lesf2
208 ; RV64I-NEXT: slti a0, a0, 1
209 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
210 ; RV64I-NEXT: addi sp, sp, 16
212 %1 = fcmp ole float %a, %b
213 %2 = zext i1 %1 to i32
217 define i32 @fcmp_one(float %a, float %b) nounwind {
218 ; CHECKIF-LABEL: fcmp_one:
220 ; CHECKIF-NEXT: flt.s a0, fa0, fa1
221 ; CHECKIF-NEXT: flt.s a1, fa1, fa0
222 ; CHECKIF-NEXT: or a0, a1, a0
225 ; CHECKIZFINX-LABEL: fcmp_one:
226 ; CHECKIZFINX: # %bb.0:
227 ; CHECKIZFINX-NEXT: flt.s a2, a0, a1
228 ; CHECKIZFINX-NEXT: flt.s a0, a1, a0
229 ; CHECKIZFINX-NEXT: or a0, a0, a2
230 ; CHECKIZFINX-NEXT: ret
232 ; RV32I-LABEL: fcmp_one:
234 ; RV32I-NEXT: addi sp, sp, -16
235 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
236 ; RV32I-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
237 ; RV32I-NEXT: sw s1, 4(sp) # 4-byte Folded Spill
238 ; RV32I-NEXT: sw s2, 0(sp) # 4-byte Folded Spill
239 ; RV32I-NEXT: mv s0, a1
240 ; RV32I-NEXT: mv s1, a0
241 ; RV32I-NEXT: call __eqsf2
242 ; RV32I-NEXT: snez s2, a0
243 ; RV32I-NEXT: mv a0, s1
244 ; RV32I-NEXT: mv a1, s0
245 ; RV32I-NEXT: call __unordsf2
246 ; RV32I-NEXT: seqz a0, a0
247 ; RV32I-NEXT: and a0, a0, s2
248 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
249 ; RV32I-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
250 ; RV32I-NEXT: lw s1, 4(sp) # 4-byte Folded Reload
251 ; RV32I-NEXT: lw s2, 0(sp) # 4-byte Folded Reload
252 ; RV32I-NEXT: addi sp, sp, 16
255 ; RV64I-LABEL: fcmp_one:
257 ; RV64I-NEXT: addi sp, sp, -32
258 ; RV64I-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
259 ; RV64I-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
260 ; RV64I-NEXT: sd s1, 8(sp) # 8-byte Folded Spill
261 ; RV64I-NEXT: sd s2, 0(sp) # 8-byte Folded Spill
262 ; RV64I-NEXT: mv s0, a1
263 ; RV64I-NEXT: mv s1, a0
264 ; RV64I-NEXT: call __eqsf2
265 ; RV64I-NEXT: snez s2, a0
266 ; RV64I-NEXT: mv a0, s1
267 ; RV64I-NEXT: mv a1, s0
268 ; RV64I-NEXT: call __unordsf2
269 ; RV64I-NEXT: seqz a0, a0
270 ; RV64I-NEXT: and a0, a0, s2
271 ; RV64I-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
272 ; RV64I-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
273 ; RV64I-NEXT: ld s1, 8(sp) # 8-byte Folded Reload
274 ; RV64I-NEXT: ld s2, 0(sp) # 8-byte Folded Reload
275 ; RV64I-NEXT: addi sp, sp, 32
277 %1 = fcmp one float %a, %b
278 %2 = zext i1 %1 to i32
282 define i32 @fcmp_ord(float %a, float %b) nounwind {
283 ; CHECKIF-LABEL: fcmp_ord:
285 ; CHECKIF-NEXT: feq.s a0, fa1, fa1
286 ; CHECKIF-NEXT: feq.s a1, fa0, fa0
287 ; CHECKIF-NEXT: and a0, a1, a0
290 ; CHECKIZFINX-LABEL: fcmp_ord:
291 ; CHECKIZFINX: # %bb.0:
292 ; CHECKIZFINX-NEXT: feq.s a1, a1, a1
293 ; CHECKIZFINX-NEXT: feq.s a0, a0, a0
294 ; CHECKIZFINX-NEXT: and a0, a0, a1
295 ; CHECKIZFINX-NEXT: ret
297 ; RV32I-LABEL: fcmp_ord:
299 ; RV32I-NEXT: addi sp, sp, -16
300 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
301 ; RV32I-NEXT: call __unordsf2
302 ; RV32I-NEXT: seqz a0, a0
303 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
304 ; RV32I-NEXT: addi sp, sp, 16
307 ; RV64I-LABEL: fcmp_ord:
309 ; RV64I-NEXT: addi sp, sp, -16
310 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
311 ; RV64I-NEXT: call __unordsf2
312 ; RV64I-NEXT: seqz a0, a0
313 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
314 ; RV64I-NEXT: addi sp, sp, 16
316 %1 = fcmp ord float %a, %b
317 %2 = zext i1 %1 to i32
321 define i32 @fcmp_ueq(float %a, float %b) nounwind {
322 ; CHECKIF-LABEL: fcmp_ueq:
324 ; CHECKIF-NEXT: flt.s a0, fa0, fa1
325 ; CHECKIF-NEXT: flt.s a1, fa1, fa0
326 ; CHECKIF-NEXT: or a0, a1, a0
327 ; CHECKIF-NEXT: xori a0, a0, 1
330 ; CHECKIZFINX-LABEL: fcmp_ueq:
331 ; CHECKIZFINX: # %bb.0:
332 ; CHECKIZFINX-NEXT: flt.s a2, a0, a1
333 ; CHECKIZFINX-NEXT: flt.s a0, a1, a0
334 ; CHECKIZFINX-NEXT: or a0, a0, a2
335 ; CHECKIZFINX-NEXT: xori a0, a0, 1
336 ; CHECKIZFINX-NEXT: ret
338 ; RV32I-LABEL: fcmp_ueq:
340 ; RV32I-NEXT: addi sp, sp, -16
341 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
342 ; RV32I-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
343 ; RV32I-NEXT: sw s1, 4(sp) # 4-byte Folded Spill
344 ; RV32I-NEXT: sw s2, 0(sp) # 4-byte Folded Spill
345 ; RV32I-NEXT: mv s0, a1
346 ; RV32I-NEXT: mv s1, a0
347 ; RV32I-NEXT: call __eqsf2
348 ; RV32I-NEXT: seqz s2, a0
349 ; RV32I-NEXT: mv a0, s1
350 ; RV32I-NEXT: mv a1, s0
351 ; RV32I-NEXT: call __unordsf2
352 ; RV32I-NEXT: snez a0, a0
353 ; RV32I-NEXT: or a0, a0, s2
354 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
355 ; RV32I-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
356 ; RV32I-NEXT: lw s1, 4(sp) # 4-byte Folded Reload
357 ; RV32I-NEXT: lw s2, 0(sp) # 4-byte Folded Reload
358 ; RV32I-NEXT: addi sp, sp, 16
361 ; RV64I-LABEL: fcmp_ueq:
363 ; RV64I-NEXT: addi sp, sp, -32
364 ; RV64I-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
365 ; RV64I-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
366 ; RV64I-NEXT: sd s1, 8(sp) # 8-byte Folded Spill
367 ; RV64I-NEXT: sd s2, 0(sp) # 8-byte Folded Spill
368 ; RV64I-NEXT: mv s0, a1
369 ; RV64I-NEXT: mv s1, a0
370 ; RV64I-NEXT: call __eqsf2
371 ; RV64I-NEXT: seqz s2, a0
372 ; RV64I-NEXT: mv a0, s1
373 ; RV64I-NEXT: mv a1, s0
374 ; RV64I-NEXT: call __unordsf2
375 ; RV64I-NEXT: snez a0, a0
376 ; RV64I-NEXT: or a0, a0, s2
377 ; RV64I-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
378 ; RV64I-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
379 ; RV64I-NEXT: ld s1, 8(sp) # 8-byte Folded Reload
380 ; RV64I-NEXT: ld s2, 0(sp) # 8-byte Folded Reload
381 ; RV64I-NEXT: addi sp, sp, 32
383 %1 = fcmp ueq float %a, %b
384 %2 = zext i1 %1 to i32
388 define i32 @fcmp_ugt(float %a, float %b) nounwind {
389 ; CHECKIF-LABEL: fcmp_ugt:
391 ; CHECKIF-NEXT: fle.s a0, fa0, fa1
392 ; CHECKIF-NEXT: xori a0, a0, 1
395 ; CHECKIZFINX-LABEL: fcmp_ugt:
396 ; CHECKIZFINX: # %bb.0:
397 ; CHECKIZFINX-NEXT: fle.s a0, a0, a1
398 ; CHECKIZFINX-NEXT: xori a0, a0, 1
399 ; CHECKIZFINX-NEXT: ret
401 ; RV32I-LABEL: fcmp_ugt:
403 ; RV32I-NEXT: addi sp, sp, -16
404 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
405 ; RV32I-NEXT: call __lesf2
406 ; RV32I-NEXT: sgtz a0, a0
407 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
408 ; RV32I-NEXT: addi sp, sp, 16
411 ; RV64I-LABEL: fcmp_ugt:
413 ; RV64I-NEXT: addi sp, sp, -16
414 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
415 ; RV64I-NEXT: call __lesf2
416 ; RV64I-NEXT: sgtz a0, a0
417 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
418 ; RV64I-NEXT: addi sp, sp, 16
420 %1 = fcmp ugt float %a, %b
421 %2 = zext i1 %1 to i32
425 define i32 @fcmp_uge(float %a, float %b) nounwind {
426 ; CHECKIF-LABEL: fcmp_uge:
428 ; CHECKIF-NEXT: flt.s a0, fa0, fa1
429 ; CHECKIF-NEXT: xori a0, a0, 1
432 ; CHECKIZFINX-LABEL: fcmp_uge:
433 ; CHECKIZFINX: # %bb.0:
434 ; CHECKIZFINX-NEXT: flt.s a0, a0, a1
435 ; CHECKIZFINX-NEXT: xori a0, a0, 1
436 ; CHECKIZFINX-NEXT: ret
438 ; RV32I-LABEL: fcmp_uge:
440 ; RV32I-NEXT: addi sp, sp, -16
441 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
442 ; RV32I-NEXT: call __ltsf2
443 ; RV32I-NEXT: slti a0, a0, 0
444 ; RV32I-NEXT: xori a0, a0, 1
445 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
446 ; RV32I-NEXT: addi sp, sp, 16
449 ; RV64I-LABEL: fcmp_uge:
451 ; RV64I-NEXT: addi sp, sp, -16
452 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
453 ; RV64I-NEXT: call __ltsf2
454 ; RV64I-NEXT: slti a0, a0, 0
455 ; RV64I-NEXT: xori a0, a0, 1
456 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
457 ; RV64I-NEXT: addi sp, sp, 16
459 %1 = fcmp uge float %a, %b
460 %2 = zext i1 %1 to i32
464 define i32 @fcmp_ult(float %a, float %b) nounwind {
465 ; CHECKIF-LABEL: fcmp_ult:
467 ; CHECKIF-NEXT: fle.s a0, fa1, fa0
468 ; CHECKIF-NEXT: xori a0, a0, 1
471 ; CHECKIZFINX-LABEL: fcmp_ult:
472 ; CHECKIZFINX: # %bb.0:
473 ; CHECKIZFINX-NEXT: fle.s a0, a1, a0
474 ; CHECKIZFINX-NEXT: xori a0, a0, 1
475 ; CHECKIZFINX-NEXT: ret
477 ; RV32I-LABEL: fcmp_ult:
479 ; RV32I-NEXT: addi sp, sp, -16
480 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
481 ; RV32I-NEXT: call __gesf2
482 ; RV32I-NEXT: slti a0, a0, 0
483 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
484 ; RV32I-NEXT: addi sp, sp, 16
487 ; RV64I-LABEL: fcmp_ult:
489 ; RV64I-NEXT: addi sp, sp, -16
490 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
491 ; RV64I-NEXT: call __gesf2
492 ; RV64I-NEXT: slti a0, a0, 0
493 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
494 ; RV64I-NEXT: addi sp, sp, 16
496 %1 = fcmp ult float %a, %b
497 %2 = zext i1 %1 to i32
501 define i32 @fcmp_ule(float %a, float %b) nounwind {
502 ; CHECKIF-LABEL: fcmp_ule:
504 ; CHECKIF-NEXT: flt.s a0, fa1, fa0
505 ; CHECKIF-NEXT: xori a0, a0, 1
508 ; CHECKIZFINX-LABEL: fcmp_ule:
509 ; CHECKIZFINX: # %bb.0:
510 ; CHECKIZFINX-NEXT: flt.s a0, a1, a0
511 ; CHECKIZFINX-NEXT: xori a0, a0, 1
512 ; CHECKIZFINX-NEXT: ret
514 ; RV32I-LABEL: fcmp_ule:
516 ; RV32I-NEXT: addi sp, sp, -16
517 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
518 ; RV32I-NEXT: call __gtsf2
519 ; RV32I-NEXT: slti a0, a0, 1
520 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
521 ; RV32I-NEXT: addi sp, sp, 16
524 ; RV64I-LABEL: fcmp_ule:
526 ; RV64I-NEXT: addi sp, sp, -16
527 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
528 ; RV64I-NEXT: call __gtsf2
529 ; RV64I-NEXT: slti a0, a0, 1
530 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
531 ; RV64I-NEXT: addi sp, sp, 16
533 %1 = fcmp ule float %a, %b
534 %2 = zext i1 %1 to i32
538 define i32 @fcmp_une(float %a, float %b) nounwind {
539 ; CHECKIF-LABEL: fcmp_une:
541 ; CHECKIF-NEXT: feq.s a0, fa0, fa1
542 ; CHECKIF-NEXT: xori a0, a0, 1
545 ; CHECKIZFINX-LABEL: fcmp_une:
546 ; CHECKIZFINX: # %bb.0:
547 ; CHECKIZFINX-NEXT: feq.s a0, a0, a1
548 ; CHECKIZFINX-NEXT: xori a0, a0, 1
549 ; CHECKIZFINX-NEXT: ret
551 ; RV32I-LABEL: fcmp_une:
553 ; RV32I-NEXT: addi sp, sp, -16
554 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
555 ; RV32I-NEXT: call __nesf2
556 ; RV32I-NEXT: snez a0, a0
557 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
558 ; RV32I-NEXT: addi sp, sp, 16
561 ; RV64I-LABEL: fcmp_une:
563 ; RV64I-NEXT: addi sp, sp, -16
564 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
565 ; RV64I-NEXT: call __nesf2
566 ; RV64I-NEXT: snez a0, a0
567 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
568 ; RV64I-NEXT: addi sp, sp, 16
570 %1 = fcmp une float %a, %b
571 %2 = zext i1 %1 to i32
575 define i32 @fcmp_uno(float %a, float %b) nounwind {
576 ; CHECKIF-LABEL: fcmp_uno:
578 ; CHECKIF-NEXT: feq.s a0, fa1, fa1
579 ; CHECKIF-NEXT: feq.s a1, fa0, fa0
580 ; CHECKIF-NEXT: and a0, a1, a0
581 ; CHECKIF-NEXT: xori a0, a0, 1
584 ; CHECKIZFINX-LABEL: fcmp_uno:
585 ; CHECKIZFINX: # %bb.0:
586 ; CHECKIZFINX-NEXT: feq.s a1, a1, a1
587 ; CHECKIZFINX-NEXT: feq.s a0, a0, a0
588 ; CHECKIZFINX-NEXT: and a0, a0, a1
589 ; CHECKIZFINX-NEXT: xori a0, a0, 1
590 ; CHECKIZFINX-NEXT: ret
592 ; RV32I-LABEL: fcmp_uno:
594 ; RV32I-NEXT: addi sp, sp, -16
595 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
596 ; RV32I-NEXT: call __unordsf2
597 ; RV32I-NEXT: snez a0, a0
598 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
599 ; RV32I-NEXT: addi sp, sp, 16
602 ; RV64I-LABEL: fcmp_uno:
604 ; RV64I-NEXT: addi sp, sp, -16
605 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
606 ; RV64I-NEXT: call __unordsf2
607 ; RV64I-NEXT: snez a0, a0
608 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
609 ; RV64I-NEXT: addi sp, sp, 16
611 %1 = fcmp uno float %a, %b
612 %2 = zext i1 %1 to i32
616 define i32 @fcmp_true(float %a, float %b) nounwind {
617 ; CHECKIF-LABEL: fcmp_true:
619 ; CHECKIF-NEXT: li a0, 1
622 ; CHECKIZFINX-LABEL: fcmp_true:
623 ; CHECKIZFINX: # %bb.0:
624 ; CHECKIZFINX-NEXT: li a0, 1
625 ; CHECKIZFINX-NEXT: ret
627 ; RV32I-LABEL: fcmp_true:
629 ; RV32I-NEXT: li a0, 1
632 ; RV64I-LABEL: fcmp_true:
634 ; RV64I-NEXT: li a0, 1
636 %1 = fcmp true float %a, %b
637 %2 = zext i1 %1 to i32