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=RV32IF %s
4 ; RUN: llc -mtriple=riscv64 -mattr=+f -verify-machineinstrs < %s \
5 ; RUN: -target-abi=lp64f | FileCheck -check-prefix=RV64IF %s
8 declare void @exit(i32)
9 declare float @dummy(float)
11 define void @br_fcmp_false(float %a, float %b) nounwind {
12 ; RV32IF-LABEL: br_fcmp_false:
14 ; RV32IF-NEXT: addi sp, sp, -16
15 ; RV32IF-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
16 ; RV32IF-NEXT: li a0, 1
17 ; RV32IF-NEXT: bnez a0, .LBB0_2
18 ; RV32IF-NEXT: # %bb.1: # %if.then
19 ; RV32IF-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
20 ; RV32IF-NEXT: addi sp, sp, 16
22 ; RV32IF-NEXT: .LBB0_2: # %if.else
23 ; RV32IF-NEXT: call abort@plt
25 ; RV64IF-LABEL: br_fcmp_false:
27 ; RV64IF-NEXT: addi sp, sp, -16
28 ; RV64IF-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
29 ; RV64IF-NEXT: li a0, 1
30 ; RV64IF-NEXT: bnez a0, .LBB0_2
31 ; RV64IF-NEXT: # %bb.1: # %if.then
32 ; RV64IF-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
33 ; RV64IF-NEXT: addi sp, sp, 16
35 ; RV64IF-NEXT: .LBB0_2: # %if.else
36 ; RV64IF-NEXT: call abort@plt
37 %1 = fcmp false float %a, %b
38 br i1 %1, label %if.then, label %if.else
42 tail call void @abort()
46 define void @br_fcmp_oeq(float %a, float %b) nounwind {
47 ; RV32IF-LABEL: br_fcmp_oeq:
49 ; RV32IF-NEXT: addi sp, sp, -16
50 ; RV32IF-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
51 ; RV32IF-NEXT: feq.s a0, fa0, fa1
52 ; RV32IF-NEXT: bnez a0, .LBB1_2
53 ; RV32IF-NEXT: # %bb.1: # %if.else
54 ; RV32IF-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
55 ; RV32IF-NEXT: addi sp, sp, 16
57 ; RV32IF-NEXT: .LBB1_2: # %if.then
58 ; RV32IF-NEXT: call abort@plt
60 ; RV64IF-LABEL: br_fcmp_oeq:
62 ; RV64IF-NEXT: addi sp, sp, -16
63 ; RV64IF-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
64 ; RV64IF-NEXT: feq.s a0, fa0, fa1
65 ; RV64IF-NEXT: bnez a0, .LBB1_2
66 ; RV64IF-NEXT: # %bb.1: # %if.else
67 ; RV64IF-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
68 ; RV64IF-NEXT: addi sp, sp, 16
70 ; RV64IF-NEXT: .LBB1_2: # %if.then
71 ; RV64IF-NEXT: call abort@plt
72 %1 = fcmp oeq float %a, %b
73 br i1 %1, label %if.then, label %if.else
77 tail call void @abort()
81 ; TODO: generated code quality for this is very poor due to
82 ; DAGCombiner::visitXOR converting the legal setoeq to setune, which requires
84 define void @br_fcmp_oeq_alt(float %a, float %b) nounwind {
85 ; RV32IF-LABEL: br_fcmp_oeq_alt:
87 ; RV32IF-NEXT: addi sp, sp, -16
88 ; RV32IF-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
89 ; RV32IF-NEXT: feq.s a0, fa0, fa1
90 ; RV32IF-NEXT: bnez a0, .LBB2_2
91 ; RV32IF-NEXT: # %bb.1: # %if.else
92 ; RV32IF-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
93 ; RV32IF-NEXT: addi sp, sp, 16
95 ; RV32IF-NEXT: .LBB2_2: # %if.then
96 ; RV32IF-NEXT: call abort@plt
98 ; RV64IF-LABEL: br_fcmp_oeq_alt:
100 ; RV64IF-NEXT: addi sp, sp, -16
101 ; RV64IF-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
102 ; RV64IF-NEXT: feq.s a0, fa0, fa1
103 ; RV64IF-NEXT: bnez a0, .LBB2_2
104 ; RV64IF-NEXT: # %bb.1: # %if.else
105 ; RV64IF-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
106 ; RV64IF-NEXT: addi sp, sp, 16
108 ; RV64IF-NEXT: .LBB2_2: # %if.then
109 ; RV64IF-NEXT: call abort@plt
110 %1 = fcmp oeq float %a, %b
111 br i1 %1, label %if.then, label %if.else
113 tail call void @abort()
119 define void @br_fcmp_ogt(float %a, float %b) nounwind {
120 ; RV32IF-LABEL: br_fcmp_ogt:
122 ; RV32IF-NEXT: addi sp, sp, -16
123 ; RV32IF-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
124 ; RV32IF-NEXT: flt.s a0, fa1, fa0
125 ; RV32IF-NEXT: bnez a0, .LBB3_2
126 ; RV32IF-NEXT: # %bb.1: # %if.else
127 ; RV32IF-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
128 ; RV32IF-NEXT: addi sp, sp, 16
130 ; RV32IF-NEXT: .LBB3_2: # %if.then
131 ; RV32IF-NEXT: call abort@plt
133 ; RV64IF-LABEL: br_fcmp_ogt:
135 ; RV64IF-NEXT: addi sp, sp, -16
136 ; RV64IF-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
137 ; RV64IF-NEXT: flt.s a0, fa1, fa0
138 ; RV64IF-NEXT: bnez a0, .LBB3_2
139 ; RV64IF-NEXT: # %bb.1: # %if.else
140 ; RV64IF-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
141 ; RV64IF-NEXT: addi sp, sp, 16
143 ; RV64IF-NEXT: .LBB3_2: # %if.then
144 ; RV64IF-NEXT: call abort@plt
145 %1 = fcmp ogt float %a, %b
146 br i1 %1, label %if.then, label %if.else
150 tail call void @abort()
154 define void @br_fcmp_oge(float %a, float %b) nounwind {
155 ; RV32IF-LABEL: br_fcmp_oge:
157 ; RV32IF-NEXT: addi sp, sp, -16
158 ; RV32IF-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
159 ; RV32IF-NEXT: fle.s a0, fa1, fa0
160 ; RV32IF-NEXT: bnez a0, .LBB4_2
161 ; RV32IF-NEXT: # %bb.1: # %if.else
162 ; RV32IF-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
163 ; RV32IF-NEXT: addi sp, sp, 16
165 ; RV32IF-NEXT: .LBB4_2: # %if.then
166 ; RV32IF-NEXT: call abort@plt
168 ; RV64IF-LABEL: br_fcmp_oge:
170 ; RV64IF-NEXT: addi sp, sp, -16
171 ; RV64IF-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
172 ; RV64IF-NEXT: fle.s a0, fa1, fa0
173 ; RV64IF-NEXT: bnez a0, .LBB4_2
174 ; RV64IF-NEXT: # %bb.1: # %if.else
175 ; RV64IF-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
176 ; RV64IF-NEXT: addi sp, sp, 16
178 ; RV64IF-NEXT: .LBB4_2: # %if.then
179 ; RV64IF-NEXT: call abort@plt
180 %1 = fcmp oge float %a, %b
181 br i1 %1, label %if.then, label %if.else
185 tail call void @abort()
189 define void @br_fcmp_olt(float %a, float %b) nounwind {
190 ; RV32IF-LABEL: br_fcmp_olt:
192 ; RV32IF-NEXT: addi sp, sp, -16
193 ; RV32IF-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
194 ; RV32IF-NEXT: flt.s a0, fa0, fa1
195 ; RV32IF-NEXT: bnez a0, .LBB5_2
196 ; RV32IF-NEXT: # %bb.1: # %if.else
197 ; RV32IF-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
198 ; RV32IF-NEXT: addi sp, sp, 16
200 ; RV32IF-NEXT: .LBB5_2: # %if.then
201 ; RV32IF-NEXT: call abort@plt
203 ; RV64IF-LABEL: br_fcmp_olt:
205 ; RV64IF-NEXT: addi sp, sp, -16
206 ; RV64IF-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
207 ; RV64IF-NEXT: flt.s a0, fa0, fa1
208 ; RV64IF-NEXT: bnez a0, .LBB5_2
209 ; RV64IF-NEXT: # %bb.1: # %if.else
210 ; RV64IF-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
211 ; RV64IF-NEXT: addi sp, sp, 16
213 ; RV64IF-NEXT: .LBB5_2: # %if.then
214 ; RV64IF-NEXT: call abort@plt
215 %1 = fcmp olt float %a, %b
216 br i1 %1, label %if.then, label %if.else
220 tail call void @abort()
224 define void @br_fcmp_ole(float %a, float %b) nounwind {
225 ; RV32IF-LABEL: br_fcmp_ole:
227 ; RV32IF-NEXT: addi sp, sp, -16
228 ; RV32IF-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
229 ; RV32IF-NEXT: fle.s a0, fa0, fa1
230 ; RV32IF-NEXT: bnez a0, .LBB6_2
231 ; RV32IF-NEXT: # %bb.1: # %if.else
232 ; RV32IF-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
233 ; RV32IF-NEXT: addi sp, sp, 16
235 ; RV32IF-NEXT: .LBB6_2: # %if.then
236 ; RV32IF-NEXT: call abort@plt
238 ; RV64IF-LABEL: br_fcmp_ole:
240 ; RV64IF-NEXT: addi sp, sp, -16
241 ; RV64IF-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
242 ; RV64IF-NEXT: fle.s a0, fa0, fa1
243 ; RV64IF-NEXT: bnez a0, .LBB6_2
244 ; RV64IF-NEXT: # %bb.1: # %if.else
245 ; RV64IF-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
246 ; RV64IF-NEXT: addi sp, sp, 16
248 ; RV64IF-NEXT: .LBB6_2: # %if.then
249 ; RV64IF-NEXT: call abort@plt
250 %1 = fcmp ole float %a, %b
251 br i1 %1, label %if.then, label %if.else
255 tail call void @abort()
259 define void @br_fcmp_one(float %a, float %b) nounwind {
260 ; RV32IF-LABEL: br_fcmp_one:
262 ; RV32IF-NEXT: addi sp, sp, -16
263 ; RV32IF-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
264 ; RV32IF-NEXT: flt.s a0, fa0, fa1
265 ; RV32IF-NEXT: flt.s a1, fa1, fa0
266 ; RV32IF-NEXT: or a0, a1, a0
267 ; RV32IF-NEXT: bnez a0, .LBB7_2
268 ; RV32IF-NEXT: # %bb.1: # %if.else
269 ; RV32IF-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
270 ; RV32IF-NEXT: addi sp, sp, 16
272 ; RV32IF-NEXT: .LBB7_2: # %if.then
273 ; RV32IF-NEXT: call abort@plt
275 ; RV64IF-LABEL: br_fcmp_one:
277 ; RV64IF-NEXT: addi sp, sp, -16
278 ; RV64IF-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
279 ; RV64IF-NEXT: flt.s a0, fa0, fa1
280 ; RV64IF-NEXT: flt.s a1, fa1, fa0
281 ; RV64IF-NEXT: or a0, a1, a0
282 ; RV64IF-NEXT: bnez a0, .LBB7_2
283 ; RV64IF-NEXT: # %bb.1: # %if.else
284 ; RV64IF-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
285 ; RV64IF-NEXT: addi sp, sp, 16
287 ; RV64IF-NEXT: .LBB7_2: # %if.then
288 ; RV64IF-NEXT: call abort@plt
289 %1 = fcmp one float %a, %b
290 br i1 %1, label %if.then, label %if.else
294 tail call void @abort()
298 define void @br_fcmp_ord(float %a, float %b) nounwind {
299 ; RV32IF-LABEL: br_fcmp_ord:
301 ; RV32IF-NEXT: addi sp, sp, -16
302 ; RV32IF-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
303 ; RV32IF-NEXT: feq.s a0, fa1, fa1
304 ; RV32IF-NEXT: feq.s a1, fa0, fa0
305 ; RV32IF-NEXT: and a0, a1, a0
306 ; RV32IF-NEXT: bnez a0, .LBB8_2
307 ; RV32IF-NEXT: # %bb.1: # %if.else
308 ; RV32IF-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
309 ; RV32IF-NEXT: addi sp, sp, 16
311 ; RV32IF-NEXT: .LBB8_2: # %if.then
312 ; RV32IF-NEXT: call abort@plt
314 ; RV64IF-LABEL: br_fcmp_ord:
316 ; RV64IF-NEXT: addi sp, sp, -16
317 ; RV64IF-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
318 ; RV64IF-NEXT: feq.s a0, fa1, fa1
319 ; RV64IF-NEXT: feq.s a1, fa0, fa0
320 ; RV64IF-NEXT: and a0, a1, a0
321 ; RV64IF-NEXT: bnez a0, .LBB8_2
322 ; RV64IF-NEXT: # %bb.1: # %if.else
323 ; RV64IF-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
324 ; RV64IF-NEXT: addi sp, sp, 16
326 ; RV64IF-NEXT: .LBB8_2: # %if.then
327 ; RV64IF-NEXT: call abort@plt
328 %1 = fcmp ord float %a, %b
329 br i1 %1, label %if.then, label %if.else
333 tail call void @abort()
337 define void @br_fcmp_ueq(float %a, float %b) nounwind {
338 ; RV32IF-LABEL: br_fcmp_ueq:
340 ; RV32IF-NEXT: addi sp, sp, -16
341 ; RV32IF-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
342 ; RV32IF-NEXT: flt.s a0, fa0, fa1
343 ; RV32IF-NEXT: flt.s a1, fa1, fa0
344 ; RV32IF-NEXT: or a0, a1, a0
345 ; RV32IF-NEXT: beqz a0, .LBB9_2
346 ; RV32IF-NEXT: # %bb.1: # %if.else
347 ; RV32IF-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
348 ; RV32IF-NEXT: addi sp, sp, 16
350 ; RV32IF-NEXT: .LBB9_2: # %if.then
351 ; RV32IF-NEXT: call abort@plt
353 ; RV64IF-LABEL: br_fcmp_ueq:
355 ; RV64IF-NEXT: addi sp, sp, -16
356 ; RV64IF-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
357 ; RV64IF-NEXT: flt.s a0, fa0, fa1
358 ; RV64IF-NEXT: flt.s a1, fa1, fa0
359 ; RV64IF-NEXT: or a0, a1, a0
360 ; RV64IF-NEXT: beqz a0, .LBB9_2
361 ; RV64IF-NEXT: # %bb.1: # %if.else
362 ; RV64IF-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
363 ; RV64IF-NEXT: addi sp, sp, 16
365 ; RV64IF-NEXT: .LBB9_2: # %if.then
366 ; RV64IF-NEXT: call abort@plt
367 %1 = fcmp ueq float %a, %b
368 br i1 %1, label %if.then, label %if.else
372 tail call void @abort()
376 define void @br_fcmp_ugt(float %a, float %b) nounwind {
377 ; RV32IF-LABEL: br_fcmp_ugt:
379 ; RV32IF-NEXT: addi sp, sp, -16
380 ; RV32IF-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
381 ; RV32IF-NEXT: fle.s a0, fa0, fa1
382 ; RV32IF-NEXT: beqz a0, .LBB10_2
383 ; RV32IF-NEXT: # %bb.1: # %if.else
384 ; RV32IF-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
385 ; RV32IF-NEXT: addi sp, sp, 16
387 ; RV32IF-NEXT: .LBB10_2: # %if.then
388 ; RV32IF-NEXT: call abort@plt
390 ; RV64IF-LABEL: br_fcmp_ugt:
392 ; RV64IF-NEXT: addi sp, sp, -16
393 ; RV64IF-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
394 ; RV64IF-NEXT: fle.s a0, fa0, fa1
395 ; RV64IF-NEXT: beqz a0, .LBB10_2
396 ; RV64IF-NEXT: # %bb.1: # %if.else
397 ; RV64IF-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
398 ; RV64IF-NEXT: addi sp, sp, 16
400 ; RV64IF-NEXT: .LBB10_2: # %if.then
401 ; RV64IF-NEXT: call abort@plt
402 %1 = fcmp ugt float %a, %b
403 br i1 %1, label %if.then, label %if.else
407 tail call void @abort()
411 define void @br_fcmp_uge(float %a, float %b) nounwind {
412 ; RV32IF-LABEL: br_fcmp_uge:
414 ; RV32IF-NEXT: addi sp, sp, -16
415 ; RV32IF-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
416 ; RV32IF-NEXT: flt.s a0, fa0, fa1
417 ; RV32IF-NEXT: beqz a0, .LBB11_2
418 ; RV32IF-NEXT: # %bb.1: # %if.else
419 ; RV32IF-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
420 ; RV32IF-NEXT: addi sp, sp, 16
422 ; RV32IF-NEXT: .LBB11_2: # %if.then
423 ; RV32IF-NEXT: call abort@plt
425 ; RV64IF-LABEL: br_fcmp_uge:
427 ; RV64IF-NEXT: addi sp, sp, -16
428 ; RV64IF-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
429 ; RV64IF-NEXT: flt.s a0, fa0, fa1
430 ; RV64IF-NEXT: beqz a0, .LBB11_2
431 ; RV64IF-NEXT: # %bb.1: # %if.else
432 ; RV64IF-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
433 ; RV64IF-NEXT: addi sp, sp, 16
435 ; RV64IF-NEXT: .LBB11_2: # %if.then
436 ; RV64IF-NEXT: call abort@plt
437 %1 = fcmp uge float %a, %b
438 br i1 %1, label %if.then, label %if.else
442 tail call void @abort()
446 define void @br_fcmp_ult(float %a, float %b) nounwind {
447 ; RV32IF-LABEL: br_fcmp_ult:
449 ; RV32IF-NEXT: addi sp, sp, -16
450 ; RV32IF-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
451 ; RV32IF-NEXT: fle.s a0, fa1, fa0
452 ; RV32IF-NEXT: beqz a0, .LBB12_2
453 ; RV32IF-NEXT: # %bb.1: # %if.else
454 ; RV32IF-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
455 ; RV32IF-NEXT: addi sp, sp, 16
457 ; RV32IF-NEXT: .LBB12_2: # %if.then
458 ; RV32IF-NEXT: call abort@plt
460 ; RV64IF-LABEL: br_fcmp_ult:
462 ; RV64IF-NEXT: addi sp, sp, -16
463 ; RV64IF-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
464 ; RV64IF-NEXT: fle.s a0, fa1, fa0
465 ; RV64IF-NEXT: beqz a0, .LBB12_2
466 ; RV64IF-NEXT: # %bb.1: # %if.else
467 ; RV64IF-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
468 ; RV64IF-NEXT: addi sp, sp, 16
470 ; RV64IF-NEXT: .LBB12_2: # %if.then
471 ; RV64IF-NEXT: call abort@plt
472 %1 = fcmp ult float %a, %b
473 br i1 %1, label %if.then, label %if.else
477 tail call void @abort()
481 define void @br_fcmp_ule(float %a, float %b) nounwind {
482 ; RV32IF-LABEL: br_fcmp_ule:
484 ; RV32IF-NEXT: addi sp, sp, -16
485 ; RV32IF-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
486 ; RV32IF-NEXT: flt.s a0, fa1, fa0
487 ; RV32IF-NEXT: beqz a0, .LBB13_2
488 ; RV32IF-NEXT: # %bb.1: # %if.else
489 ; RV32IF-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
490 ; RV32IF-NEXT: addi sp, sp, 16
492 ; RV32IF-NEXT: .LBB13_2: # %if.then
493 ; RV32IF-NEXT: call abort@plt
495 ; RV64IF-LABEL: br_fcmp_ule:
497 ; RV64IF-NEXT: addi sp, sp, -16
498 ; RV64IF-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
499 ; RV64IF-NEXT: flt.s a0, fa1, fa0
500 ; RV64IF-NEXT: beqz a0, .LBB13_2
501 ; RV64IF-NEXT: # %bb.1: # %if.else
502 ; RV64IF-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
503 ; RV64IF-NEXT: addi sp, sp, 16
505 ; RV64IF-NEXT: .LBB13_2: # %if.then
506 ; RV64IF-NEXT: call abort@plt
507 %1 = fcmp ule float %a, %b
508 br i1 %1, label %if.then, label %if.else
512 tail call void @abort()
516 define void @br_fcmp_une(float %a, float %b) nounwind {
517 ; RV32IF-LABEL: br_fcmp_une:
519 ; RV32IF-NEXT: addi sp, sp, -16
520 ; RV32IF-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
521 ; RV32IF-NEXT: feq.s a0, fa0, fa1
522 ; RV32IF-NEXT: beqz a0, .LBB14_2
523 ; RV32IF-NEXT: # %bb.1: # %if.else
524 ; RV32IF-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
525 ; RV32IF-NEXT: addi sp, sp, 16
527 ; RV32IF-NEXT: .LBB14_2: # %if.then
528 ; RV32IF-NEXT: call abort@plt
530 ; RV64IF-LABEL: br_fcmp_une:
532 ; RV64IF-NEXT: addi sp, sp, -16
533 ; RV64IF-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
534 ; RV64IF-NEXT: feq.s a0, fa0, fa1
535 ; RV64IF-NEXT: beqz a0, .LBB14_2
536 ; RV64IF-NEXT: # %bb.1: # %if.else
537 ; RV64IF-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
538 ; RV64IF-NEXT: addi sp, sp, 16
540 ; RV64IF-NEXT: .LBB14_2: # %if.then
541 ; RV64IF-NEXT: call abort@plt
542 %1 = fcmp une float %a, %b
543 br i1 %1, label %if.then, label %if.else
547 tail call void @abort()
551 define void @br_fcmp_uno(float %a, float %b) nounwind {
552 ; RV32IF-LABEL: br_fcmp_uno:
554 ; RV32IF-NEXT: addi sp, sp, -16
555 ; RV32IF-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
556 ; RV32IF-NEXT: feq.s a0, fa1, fa1
557 ; RV32IF-NEXT: feq.s a1, fa0, fa0
558 ; RV32IF-NEXT: and a0, a1, a0
559 ; RV32IF-NEXT: beqz a0, .LBB15_2
560 ; RV32IF-NEXT: # %bb.1: # %if.else
561 ; RV32IF-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
562 ; RV32IF-NEXT: addi sp, sp, 16
564 ; RV32IF-NEXT: .LBB15_2: # %if.then
565 ; RV32IF-NEXT: call abort@plt
567 ; RV64IF-LABEL: br_fcmp_uno:
569 ; RV64IF-NEXT: addi sp, sp, -16
570 ; RV64IF-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
571 ; RV64IF-NEXT: feq.s a0, fa1, fa1
572 ; RV64IF-NEXT: feq.s a1, fa0, fa0
573 ; RV64IF-NEXT: and a0, a1, a0
574 ; RV64IF-NEXT: beqz a0, .LBB15_2
575 ; RV64IF-NEXT: # %bb.1: # %if.else
576 ; RV64IF-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
577 ; RV64IF-NEXT: addi sp, sp, 16
579 ; RV64IF-NEXT: .LBB15_2: # %if.then
580 ; RV64IF-NEXT: call abort@plt
581 %1 = fcmp uno float %a, %b
582 br i1 %1, label %if.then, label %if.else
586 tail call void @abort()
590 define void @br_fcmp_true(float %a, float %b) nounwind {
591 ; RV32IF-LABEL: br_fcmp_true:
593 ; RV32IF-NEXT: addi sp, sp, -16
594 ; RV32IF-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
595 ; RV32IF-NEXT: li a0, 1
596 ; RV32IF-NEXT: bnez a0, .LBB16_2
597 ; RV32IF-NEXT: # %bb.1: # %if.else
598 ; RV32IF-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
599 ; RV32IF-NEXT: addi sp, sp, 16
601 ; RV32IF-NEXT: .LBB16_2: # %if.then
602 ; RV32IF-NEXT: call abort@plt
604 ; RV64IF-LABEL: br_fcmp_true:
606 ; RV64IF-NEXT: addi sp, sp, -16
607 ; RV64IF-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
608 ; RV64IF-NEXT: li a0, 1
609 ; RV64IF-NEXT: bnez a0, .LBB16_2
610 ; RV64IF-NEXT: # %bb.1: # %if.else
611 ; RV64IF-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
612 ; RV64IF-NEXT: addi sp, sp, 16
614 ; RV64IF-NEXT: .LBB16_2: # %if.then
615 ; RV64IF-NEXT: call abort@plt
616 %1 = fcmp true float %a, %b
617 br i1 %1, label %if.then, label %if.else
621 tail call void @abort()
625 ; This test exists primarily to trigger RISCVInstrInfo::storeRegToStackSlot
626 ; and RISCVInstrInfo::loadRegFromStackSlot
627 define i32 @br_fcmp_store_load_stack_slot(float %a, float %b) nounwind {
628 ; RV32IF-LABEL: br_fcmp_store_load_stack_slot:
629 ; RV32IF: # %bb.0: # %entry
630 ; RV32IF-NEXT: addi sp, sp, -16
631 ; RV32IF-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
632 ; RV32IF-NEXT: fsw fs0, 8(sp) # 4-byte Folded Spill
633 ; RV32IF-NEXT: fmv.w.x fs0, zero
634 ; RV32IF-NEXT: fmv.s fa0, fs0
635 ; RV32IF-NEXT: call dummy@plt
636 ; RV32IF-NEXT: feq.s a0, fa0, fs0
637 ; RV32IF-NEXT: beqz a0, .LBB17_3
638 ; RV32IF-NEXT: # %bb.1: # %if.end
639 ; RV32IF-NEXT: fmv.s fa0, fs0
640 ; RV32IF-NEXT: call dummy@plt
641 ; RV32IF-NEXT: feq.s a0, fa0, fs0
642 ; RV32IF-NEXT: beqz a0, .LBB17_3
643 ; RV32IF-NEXT: # %bb.2: # %if.end4
644 ; RV32IF-NEXT: li a0, 0
645 ; RV32IF-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
646 ; RV32IF-NEXT: flw fs0, 8(sp) # 4-byte Folded Reload
647 ; RV32IF-NEXT: addi sp, sp, 16
649 ; RV32IF-NEXT: .LBB17_3: # %if.then
650 ; RV32IF-NEXT: call abort@plt
652 ; RV64IF-LABEL: br_fcmp_store_load_stack_slot:
653 ; RV64IF: # %bb.0: # %entry
654 ; RV64IF-NEXT: addi sp, sp, -16
655 ; RV64IF-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
656 ; RV64IF-NEXT: fsw fs0, 4(sp) # 4-byte Folded Spill
657 ; RV64IF-NEXT: fmv.w.x fs0, zero
658 ; RV64IF-NEXT: fmv.s fa0, fs0
659 ; RV64IF-NEXT: call dummy@plt
660 ; RV64IF-NEXT: feq.s a0, fa0, fs0
661 ; RV64IF-NEXT: beqz a0, .LBB17_3
662 ; RV64IF-NEXT: # %bb.1: # %if.end
663 ; RV64IF-NEXT: fmv.s fa0, fs0
664 ; RV64IF-NEXT: call dummy@plt
665 ; RV64IF-NEXT: feq.s a0, fa0, fs0
666 ; RV64IF-NEXT: beqz a0, .LBB17_3
667 ; RV64IF-NEXT: # %bb.2: # %if.end4
668 ; RV64IF-NEXT: li a0, 0
669 ; RV64IF-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
670 ; RV64IF-NEXT: flw fs0, 4(sp) # 4-byte Folded Reload
671 ; RV64IF-NEXT: addi sp, sp, 16
673 ; RV64IF-NEXT: .LBB17_3: # %if.then
674 ; RV64IF-NEXT: call abort@plt
676 %call = call float @dummy(float 0.000000e+00)
677 %cmp = fcmp une float %call, 0.000000e+00
678 br i1 %cmp, label %if.then, label %if.end
685 %call1 = call float @dummy(float 0.000000e+00)
686 %cmp2 = fcmp une float %call1, 0.000000e+00
687 br i1 %cmp2, label %if.then3, label %if.end4