1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+d -verify-machineinstrs < %s \
3 ; RUN: | FileCheck -check-prefix=RV32IFD %s
4 ; RUN: llc -mtriple=riscv64 -mattr=+d -verify-machineinstrs < %s \
5 ; RUN: | FileCheck -check-prefix=RV64IFD %s
8 declare void @exit(i32)
10 define void @br_fcmp_false(double %a, double %b) nounwind {
11 ; RV32IFD-LABEL: br_fcmp_false:
13 ; RV32IFD-NEXT: addi sp, sp, -16
14 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
15 ; RV32IFD-NEXT: addi a0, zero, 1
16 ; RV32IFD-NEXT: bnez a0, .LBB0_2
17 ; RV32IFD-NEXT: # %bb.1: # %if.then
18 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
19 ; RV32IFD-NEXT: addi sp, sp, 16
21 ; RV32IFD-NEXT: .LBB0_2: # %if.else
22 ; RV32IFD-NEXT: call abort@plt
24 ; RV64IFD-LABEL: br_fcmp_false:
26 ; RV64IFD-NEXT: addi sp, sp, -16
27 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
28 ; RV64IFD-NEXT: addi a0, zero, 1
29 ; RV64IFD-NEXT: bnez a0, .LBB0_2
30 ; RV64IFD-NEXT: # %bb.1: # %if.then
31 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
32 ; RV64IFD-NEXT: addi sp, sp, 16
34 ; RV64IFD-NEXT: .LBB0_2: # %if.else
35 ; RV64IFD-NEXT: call abort@plt
36 %1 = fcmp false double %a, %b
37 br i1 %1, label %if.then, label %if.else
41 tail call void @abort()
45 define void @br_fcmp_oeq(double %a, double %b) nounwind {
46 ; RV32IFD-LABEL: br_fcmp_oeq:
48 ; RV32IFD-NEXT: addi sp, sp, -16
49 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
50 ; RV32IFD-NEXT: sw a2, 0(sp)
51 ; RV32IFD-NEXT: sw a3, 4(sp)
52 ; RV32IFD-NEXT: fld ft0, 0(sp)
53 ; RV32IFD-NEXT: sw a0, 0(sp)
54 ; RV32IFD-NEXT: sw a1, 4(sp)
55 ; RV32IFD-NEXT: fld ft1, 0(sp)
56 ; RV32IFD-NEXT: feq.d a0, ft1, ft0
57 ; RV32IFD-NEXT: bnez a0, .LBB1_2
58 ; RV32IFD-NEXT: # %bb.1: # %if.else
59 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
60 ; RV32IFD-NEXT: addi sp, sp, 16
62 ; RV32IFD-NEXT: .LBB1_2: # %if.then
63 ; RV32IFD-NEXT: call abort@plt
65 ; RV64IFD-LABEL: br_fcmp_oeq:
67 ; RV64IFD-NEXT: addi sp, sp, -16
68 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
69 ; RV64IFD-NEXT: fmv.d.x ft0, a1
70 ; RV64IFD-NEXT: fmv.d.x ft1, a0
71 ; RV64IFD-NEXT: feq.d a0, ft1, ft0
72 ; RV64IFD-NEXT: bnez a0, .LBB1_2
73 ; RV64IFD-NEXT: # %bb.1: # %if.else
74 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
75 ; RV64IFD-NEXT: addi sp, sp, 16
77 ; RV64IFD-NEXT: .LBB1_2: # %if.then
78 ; RV64IFD-NEXT: call abort@plt
79 %1 = fcmp oeq double %a, %b
80 br i1 %1, label %if.then, label %if.else
84 tail call void @abort()
88 ; TODO: generated code quality for this is very poor due to
89 ; DAGCombiner::visitXOR converting the legal setoeq to setune, which requires
91 define void @br_fcmp_oeq_alt(double %a, double %b) nounwind {
92 ; RV32IFD-LABEL: br_fcmp_oeq_alt:
94 ; RV32IFD-NEXT: addi sp, sp, -16
95 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
96 ; RV32IFD-NEXT: sw a2, 0(sp)
97 ; RV32IFD-NEXT: sw a3, 4(sp)
98 ; RV32IFD-NEXT: fld ft0, 0(sp)
99 ; RV32IFD-NEXT: sw a0, 0(sp)
100 ; RV32IFD-NEXT: sw a1, 4(sp)
101 ; RV32IFD-NEXT: fld ft1, 0(sp)
102 ; RV32IFD-NEXT: feq.d a0, ft1, ft0
103 ; RV32IFD-NEXT: bnez a0, .LBB2_2
104 ; RV32IFD-NEXT: # %bb.1: # %if.else
105 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
106 ; RV32IFD-NEXT: addi sp, sp, 16
108 ; RV32IFD-NEXT: .LBB2_2: # %if.then
109 ; RV32IFD-NEXT: call abort@plt
111 ; RV64IFD-LABEL: br_fcmp_oeq_alt:
113 ; RV64IFD-NEXT: addi sp, sp, -16
114 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
115 ; RV64IFD-NEXT: fmv.d.x ft0, a1
116 ; RV64IFD-NEXT: fmv.d.x ft1, a0
117 ; RV64IFD-NEXT: feq.d a0, ft1, ft0
118 ; RV64IFD-NEXT: bnez a0, .LBB2_2
119 ; RV64IFD-NEXT: # %bb.1: # %if.else
120 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
121 ; RV64IFD-NEXT: addi sp, sp, 16
123 ; RV64IFD-NEXT: .LBB2_2: # %if.then
124 ; RV64IFD-NEXT: call abort@plt
125 %1 = fcmp oeq double %a, %b
126 br i1 %1, label %if.then, label %if.else
128 tail call void @abort()
134 define void @br_fcmp_ogt(double %a, double %b) nounwind {
135 ; RV32IFD-LABEL: br_fcmp_ogt:
137 ; RV32IFD-NEXT: addi sp, sp, -16
138 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
139 ; RV32IFD-NEXT: sw a0, 0(sp)
140 ; RV32IFD-NEXT: sw a1, 4(sp)
141 ; RV32IFD-NEXT: fld ft0, 0(sp)
142 ; RV32IFD-NEXT: sw a2, 0(sp)
143 ; RV32IFD-NEXT: sw a3, 4(sp)
144 ; RV32IFD-NEXT: fld ft1, 0(sp)
145 ; RV32IFD-NEXT: flt.d a0, ft1, ft0
146 ; RV32IFD-NEXT: bnez a0, .LBB3_2
147 ; RV32IFD-NEXT: # %bb.1: # %if.else
148 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
149 ; RV32IFD-NEXT: addi sp, sp, 16
151 ; RV32IFD-NEXT: .LBB3_2: # %if.then
152 ; RV32IFD-NEXT: call abort@plt
154 ; RV64IFD-LABEL: br_fcmp_ogt:
156 ; RV64IFD-NEXT: addi sp, sp, -16
157 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
158 ; RV64IFD-NEXT: fmv.d.x ft0, a0
159 ; RV64IFD-NEXT: fmv.d.x ft1, a1
160 ; RV64IFD-NEXT: flt.d a0, ft1, ft0
161 ; RV64IFD-NEXT: bnez a0, .LBB3_2
162 ; RV64IFD-NEXT: # %bb.1: # %if.else
163 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
164 ; RV64IFD-NEXT: addi sp, sp, 16
166 ; RV64IFD-NEXT: .LBB3_2: # %if.then
167 ; RV64IFD-NEXT: call abort@plt
168 %1 = fcmp ogt double %a, %b
169 br i1 %1, label %if.then, label %if.else
173 tail call void @abort()
177 define void @br_fcmp_oge(double %a, double %b) nounwind {
178 ; RV32IFD-LABEL: br_fcmp_oge:
180 ; RV32IFD-NEXT: addi sp, sp, -16
181 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
182 ; RV32IFD-NEXT: sw a0, 0(sp)
183 ; RV32IFD-NEXT: sw a1, 4(sp)
184 ; RV32IFD-NEXT: fld ft0, 0(sp)
185 ; RV32IFD-NEXT: sw a2, 0(sp)
186 ; RV32IFD-NEXT: sw a3, 4(sp)
187 ; RV32IFD-NEXT: fld ft1, 0(sp)
188 ; RV32IFD-NEXT: fle.d a0, ft1, ft0
189 ; RV32IFD-NEXT: bnez a0, .LBB4_2
190 ; RV32IFD-NEXT: # %bb.1: # %if.else
191 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
192 ; RV32IFD-NEXT: addi sp, sp, 16
194 ; RV32IFD-NEXT: .LBB4_2: # %if.then
195 ; RV32IFD-NEXT: call abort@plt
197 ; RV64IFD-LABEL: br_fcmp_oge:
199 ; RV64IFD-NEXT: addi sp, sp, -16
200 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
201 ; RV64IFD-NEXT: fmv.d.x ft0, a0
202 ; RV64IFD-NEXT: fmv.d.x ft1, a1
203 ; RV64IFD-NEXT: fle.d a0, ft1, ft0
204 ; RV64IFD-NEXT: bnez a0, .LBB4_2
205 ; RV64IFD-NEXT: # %bb.1: # %if.else
206 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
207 ; RV64IFD-NEXT: addi sp, sp, 16
209 ; RV64IFD-NEXT: .LBB4_2: # %if.then
210 ; RV64IFD-NEXT: call abort@plt
211 %1 = fcmp oge double %a, %b
212 br i1 %1, label %if.then, label %if.else
216 tail call void @abort()
220 define void @br_fcmp_olt(double %a, double %b) nounwind {
221 ; RV32IFD-LABEL: br_fcmp_olt:
223 ; RV32IFD-NEXT: addi sp, sp, -16
224 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
225 ; RV32IFD-NEXT: sw a2, 0(sp)
226 ; RV32IFD-NEXT: sw a3, 4(sp)
227 ; RV32IFD-NEXT: fld ft0, 0(sp)
228 ; RV32IFD-NEXT: sw a0, 0(sp)
229 ; RV32IFD-NEXT: sw a1, 4(sp)
230 ; RV32IFD-NEXT: fld ft1, 0(sp)
231 ; RV32IFD-NEXT: flt.d a0, ft1, ft0
232 ; RV32IFD-NEXT: bnez a0, .LBB5_2
233 ; RV32IFD-NEXT: # %bb.1: # %if.else
234 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
235 ; RV32IFD-NEXT: addi sp, sp, 16
237 ; RV32IFD-NEXT: .LBB5_2: # %if.then
238 ; RV32IFD-NEXT: call abort@plt
240 ; RV64IFD-LABEL: br_fcmp_olt:
242 ; RV64IFD-NEXT: addi sp, sp, -16
243 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
244 ; RV64IFD-NEXT: fmv.d.x ft0, a1
245 ; RV64IFD-NEXT: fmv.d.x ft1, a0
246 ; RV64IFD-NEXT: flt.d a0, ft1, ft0
247 ; RV64IFD-NEXT: bnez a0, .LBB5_2
248 ; RV64IFD-NEXT: # %bb.1: # %if.else
249 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
250 ; RV64IFD-NEXT: addi sp, sp, 16
252 ; RV64IFD-NEXT: .LBB5_2: # %if.then
253 ; RV64IFD-NEXT: call abort@plt
254 %1 = fcmp olt double %a, %b
255 br i1 %1, label %if.then, label %if.else
259 tail call void @abort()
263 define void @br_fcmp_ole(double %a, double %b) nounwind {
264 ; RV32IFD-LABEL: br_fcmp_ole:
266 ; RV32IFD-NEXT: addi sp, sp, -16
267 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
268 ; RV32IFD-NEXT: sw a2, 0(sp)
269 ; RV32IFD-NEXT: sw a3, 4(sp)
270 ; RV32IFD-NEXT: fld ft0, 0(sp)
271 ; RV32IFD-NEXT: sw a0, 0(sp)
272 ; RV32IFD-NEXT: sw a1, 4(sp)
273 ; RV32IFD-NEXT: fld ft1, 0(sp)
274 ; RV32IFD-NEXT: fle.d a0, ft1, ft0
275 ; RV32IFD-NEXT: bnez a0, .LBB6_2
276 ; RV32IFD-NEXT: # %bb.1: # %if.else
277 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
278 ; RV32IFD-NEXT: addi sp, sp, 16
280 ; RV32IFD-NEXT: .LBB6_2: # %if.then
281 ; RV32IFD-NEXT: call abort@plt
283 ; RV64IFD-LABEL: br_fcmp_ole:
285 ; RV64IFD-NEXT: addi sp, sp, -16
286 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
287 ; RV64IFD-NEXT: fmv.d.x ft0, a1
288 ; RV64IFD-NEXT: fmv.d.x ft1, a0
289 ; RV64IFD-NEXT: fle.d a0, ft1, ft0
290 ; RV64IFD-NEXT: bnez a0, .LBB6_2
291 ; RV64IFD-NEXT: # %bb.1: # %if.else
292 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
293 ; RV64IFD-NEXT: addi sp, sp, 16
295 ; RV64IFD-NEXT: .LBB6_2: # %if.then
296 ; RV64IFD-NEXT: call abort@plt
297 %1 = fcmp ole double %a, %b
298 br i1 %1, label %if.then, label %if.else
302 tail call void @abort()
306 define void @br_fcmp_one(double %a, double %b) nounwind {
307 ; RV32IFD-LABEL: br_fcmp_one:
309 ; RV32IFD-NEXT: addi sp, sp, -16
310 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
311 ; RV32IFD-NEXT: sw a2, 0(sp)
312 ; RV32IFD-NEXT: sw a3, 4(sp)
313 ; RV32IFD-NEXT: fld ft0, 0(sp)
314 ; RV32IFD-NEXT: sw a0, 0(sp)
315 ; RV32IFD-NEXT: sw a1, 4(sp)
316 ; RV32IFD-NEXT: fld ft1, 0(sp)
317 ; RV32IFD-NEXT: flt.d a0, ft1, ft0
318 ; RV32IFD-NEXT: flt.d a1, ft0, ft1
319 ; RV32IFD-NEXT: or a0, a1, a0
320 ; RV32IFD-NEXT: bnez a0, .LBB7_2
321 ; RV32IFD-NEXT: # %bb.1: # %if.else
322 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
323 ; RV32IFD-NEXT: addi sp, sp, 16
325 ; RV32IFD-NEXT: .LBB7_2: # %if.then
326 ; RV32IFD-NEXT: call abort@plt
328 ; RV64IFD-LABEL: br_fcmp_one:
330 ; RV64IFD-NEXT: addi sp, sp, -16
331 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
332 ; RV64IFD-NEXT: fmv.d.x ft0, a1
333 ; RV64IFD-NEXT: fmv.d.x ft1, a0
334 ; RV64IFD-NEXT: flt.d a0, ft1, ft0
335 ; RV64IFD-NEXT: flt.d a1, ft0, ft1
336 ; RV64IFD-NEXT: or a0, a1, a0
337 ; RV64IFD-NEXT: bnez a0, .LBB7_2
338 ; RV64IFD-NEXT: # %bb.1: # %if.else
339 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
340 ; RV64IFD-NEXT: addi sp, sp, 16
342 ; RV64IFD-NEXT: .LBB7_2: # %if.then
343 ; RV64IFD-NEXT: call abort@plt
344 %1 = fcmp one double %a, %b
345 br i1 %1, label %if.then, label %if.else
349 tail call void @abort()
353 define void @br_fcmp_ord(double %a, double %b) nounwind {
354 ; RV32IFD-LABEL: br_fcmp_ord:
356 ; RV32IFD-NEXT: addi sp, sp, -16
357 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
358 ; RV32IFD-NEXT: sw a0, 0(sp)
359 ; RV32IFD-NEXT: sw a1, 4(sp)
360 ; RV32IFD-NEXT: fld ft0, 0(sp)
361 ; RV32IFD-NEXT: sw a2, 0(sp)
362 ; RV32IFD-NEXT: sw a3, 4(sp)
363 ; RV32IFD-NEXT: fld ft1, 0(sp)
364 ; RV32IFD-NEXT: feq.d a0, ft1, ft1
365 ; RV32IFD-NEXT: feq.d a1, ft0, ft0
366 ; RV32IFD-NEXT: and a0, a1, a0
367 ; RV32IFD-NEXT: bnez a0, .LBB8_2
368 ; RV32IFD-NEXT: # %bb.1: # %if.else
369 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
370 ; RV32IFD-NEXT: addi sp, sp, 16
372 ; RV32IFD-NEXT: .LBB8_2: # %if.then
373 ; RV32IFD-NEXT: call abort@plt
375 ; RV64IFD-LABEL: br_fcmp_ord:
377 ; RV64IFD-NEXT: addi sp, sp, -16
378 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
379 ; RV64IFD-NEXT: fmv.d.x ft0, a0
380 ; RV64IFD-NEXT: fmv.d.x ft1, a1
381 ; RV64IFD-NEXT: feq.d a0, ft1, ft1
382 ; RV64IFD-NEXT: feq.d a1, ft0, ft0
383 ; RV64IFD-NEXT: and a0, a1, a0
384 ; RV64IFD-NEXT: bnez a0, .LBB8_2
385 ; RV64IFD-NEXT: # %bb.1: # %if.else
386 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
387 ; RV64IFD-NEXT: addi sp, sp, 16
389 ; RV64IFD-NEXT: .LBB8_2: # %if.then
390 ; RV64IFD-NEXT: call abort@plt
391 %1 = fcmp ord double %a, %b
392 br i1 %1, label %if.then, label %if.else
396 tail call void @abort()
400 define void @br_fcmp_ueq(double %a, double %b) nounwind {
401 ; RV32IFD-LABEL: br_fcmp_ueq:
403 ; RV32IFD-NEXT: addi sp, sp, -16
404 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
405 ; RV32IFD-NEXT: sw a2, 0(sp)
406 ; RV32IFD-NEXT: sw a3, 4(sp)
407 ; RV32IFD-NEXT: fld ft0, 0(sp)
408 ; RV32IFD-NEXT: sw a0, 0(sp)
409 ; RV32IFD-NEXT: sw a1, 4(sp)
410 ; RV32IFD-NEXT: fld ft1, 0(sp)
411 ; RV32IFD-NEXT: flt.d a0, ft1, ft0
412 ; RV32IFD-NEXT: flt.d a1, ft0, ft1
413 ; RV32IFD-NEXT: or a0, a1, a0
414 ; RV32IFD-NEXT: beqz a0, .LBB9_2
415 ; RV32IFD-NEXT: # %bb.1: # %if.else
416 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
417 ; RV32IFD-NEXT: addi sp, sp, 16
419 ; RV32IFD-NEXT: .LBB9_2: # %if.then
420 ; RV32IFD-NEXT: call abort@plt
422 ; RV64IFD-LABEL: br_fcmp_ueq:
424 ; RV64IFD-NEXT: addi sp, sp, -16
425 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
426 ; RV64IFD-NEXT: fmv.d.x ft0, a1
427 ; RV64IFD-NEXT: fmv.d.x ft1, a0
428 ; RV64IFD-NEXT: flt.d a0, ft1, ft0
429 ; RV64IFD-NEXT: flt.d a1, ft0, ft1
430 ; RV64IFD-NEXT: or a0, a1, a0
431 ; RV64IFD-NEXT: beqz a0, .LBB9_2
432 ; RV64IFD-NEXT: # %bb.1: # %if.else
433 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
434 ; RV64IFD-NEXT: addi sp, sp, 16
436 ; RV64IFD-NEXT: .LBB9_2: # %if.then
437 ; RV64IFD-NEXT: call abort@plt
438 %1 = fcmp ueq double %a, %b
439 br i1 %1, label %if.then, label %if.else
443 tail call void @abort()
447 define void @br_fcmp_ugt(double %a, double %b) nounwind {
448 ; RV32IFD-LABEL: br_fcmp_ugt:
450 ; RV32IFD-NEXT: addi sp, sp, -16
451 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
452 ; RV32IFD-NEXT: sw a2, 0(sp)
453 ; RV32IFD-NEXT: sw a3, 4(sp)
454 ; RV32IFD-NEXT: fld ft0, 0(sp)
455 ; RV32IFD-NEXT: sw a0, 0(sp)
456 ; RV32IFD-NEXT: sw a1, 4(sp)
457 ; RV32IFD-NEXT: fld ft1, 0(sp)
458 ; RV32IFD-NEXT: fle.d a0, ft1, ft0
459 ; RV32IFD-NEXT: beqz a0, .LBB10_2
460 ; RV32IFD-NEXT: # %bb.1: # %if.else
461 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
462 ; RV32IFD-NEXT: addi sp, sp, 16
464 ; RV32IFD-NEXT: .LBB10_2: # %if.then
465 ; RV32IFD-NEXT: call abort@plt
467 ; RV64IFD-LABEL: br_fcmp_ugt:
469 ; RV64IFD-NEXT: addi sp, sp, -16
470 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
471 ; RV64IFD-NEXT: fmv.d.x ft0, a1
472 ; RV64IFD-NEXT: fmv.d.x ft1, a0
473 ; RV64IFD-NEXT: fle.d a0, ft1, ft0
474 ; RV64IFD-NEXT: beqz a0, .LBB10_2
475 ; RV64IFD-NEXT: # %bb.1: # %if.else
476 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
477 ; RV64IFD-NEXT: addi sp, sp, 16
479 ; RV64IFD-NEXT: .LBB10_2: # %if.then
480 ; RV64IFD-NEXT: call abort@plt
481 %1 = fcmp ugt double %a, %b
482 br i1 %1, label %if.then, label %if.else
486 tail call void @abort()
490 define void @br_fcmp_uge(double %a, double %b) nounwind {
491 ; RV32IFD-LABEL: br_fcmp_uge:
493 ; RV32IFD-NEXT: addi sp, sp, -16
494 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
495 ; RV32IFD-NEXT: sw a2, 0(sp)
496 ; RV32IFD-NEXT: sw a3, 4(sp)
497 ; RV32IFD-NEXT: fld ft0, 0(sp)
498 ; RV32IFD-NEXT: sw a0, 0(sp)
499 ; RV32IFD-NEXT: sw a1, 4(sp)
500 ; RV32IFD-NEXT: fld ft1, 0(sp)
501 ; RV32IFD-NEXT: flt.d a0, ft1, ft0
502 ; RV32IFD-NEXT: beqz a0, .LBB11_2
503 ; RV32IFD-NEXT: # %bb.1: # %if.else
504 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
505 ; RV32IFD-NEXT: addi sp, sp, 16
507 ; RV32IFD-NEXT: .LBB11_2: # %if.then
508 ; RV32IFD-NEXT: call abort@plt
510 ; RV64IFD-LABEL: br_fcmp_uge:
512 ; RV64IFD-NEXT: addi sp, sp, -16
513 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
514 ; RV64IFD-NEXT: fmv.d.x ft0, a1
515 ; RV64IFD-NEXT: fmv.d.x ft1, a0
516 ; RV64IFD-NEXT: flt.d a0, ft1, ft0
517 ; RV64IFD-NEXT: beqz a0, .LBB11_2
518 ; RV64IFD-NEXT: # %bb.1: # %if.else
519 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
520 ; RV64IFD-NEXT: addi sp, sp, 16
522 ; RV64IFD-NEXT: .LBB11_2: # %if.then
523 ; RV64IFD-NEXT: call abort@plt
524 %1 = fcmp uge double %a, %b
525 br i1 %1, label %if.then, label %if.else
529 tail call void @abort()
533 define void @br_fcmp_ult(double %a, double %b) nounwind {
534 ; RV32IFD-LABEL: br_fcmp_ult:
536 ; RV32IFD-NEXT: addi sp, sp, -16
537 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
538 ; RV32IFD-NEXT: sw a0, 0(sp)
539 ; RV32IFD-NEXT: sw a1, 4(sp)
540 ; RV32IFD-NEXT: fld ft0, 0(sp)
541 ; RV32IFD-NEXT: sw a2, 0(sp)
542 ; RV32IFD-NEXT: sw a3, 4(sp)
543 ; RV32IFD-NEXT: fld ft1, 0(sp)
544 ; RV32IFD-NEXT: fle.d a0, ft1, ft0
545 ; RV32IFD-NEXT: beqz a0, .LBB12_2
546 ; RV32IFD-NEXT: # %bb.1: # %if.else
547 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
548 ; RV32IFD-NEXT: addi sp, sp, 16
550 ; RV32IFD-NEXT: .LBB12_2: # %if.then
551 ; RV32IFD-NEXT: call abort@plt
553 ; RV64IFD-LABEL: br_fcmp_ult:
555 ; RV64IFD-NEXT: addi sp, sp, -16
556 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
557 ; RV64IFD-NEXT: fmv.d.x ft0, a0
558 ; RV64IFD-NEXT: fmv.d.x ft1, a1
559 ; RV64IFD-NEXT: fle.d a0, ft1, ft0
560 ; RV64IFD-NEXT: beqz a0, .LBB12_2
561 ; RV64IFD-NEXT: # %bb.1: # %if.else
562 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
563 ; RV64IFD-NEXT: addi sp, sp, 16
565 ; RV64IFD-NEXT: .LBB12_2: # %if.then
566 ; RV64IFD-NEXT: call abort@plt
567 %1 = fcmp ult double %a, %b
568 br i1 %1, label %if.then, label %if.else
572 tail call void @abort()
576 define void @br_fcmp_ule(double %a, double %b) nounwind {
577 ; RV32IFD-LABEL: br_fcmp_ule:
579 ; RV32IFD-NEXT: addi sp, sp, -16
580 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
581 ; RV32IFD-NEXT: sw a0, 0(sp)
582 ; RV32IFD-NEXT: sw a1, 4(sp)
583 ; RV32IFD-NEXT: fld ft0, 0(sp)
584 ; RV32IFD-NEXT: sw a2, 0(sp)
585 ; RV32IFD-NEXT: sw a3, 4(sp)
586 ; RV32IFD-NEXT: fld ft1, 0(sp)
587 ; RV32IFD-NEXT: flt.d a0, ft1, ft0
588 ; RV32IFD-NEXT: beqz a0, .LBB13_2
589 ; RV32IFD-NEXT: # %bb.1: # %if.else
590 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
591 ; RV32IFD-NEXT: addi sp, sp, 16
593 ; RV32IFD-NEXT: .LBB13_2: # %if.then
594 ; RV32IFD-NEXT: call abort@plt
596 ; RV64IFD-LABEL: br_fcmp_ule:
598 ; RV64IFD-NEXT: addi sp, sp, -16
599 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
600 ; RV64IFD-NEXT: fmv.d.x ft0, a0
601 ; RV64IFD-NEXT: fmv.d.x ft1, a1
602 ; RV64IFD-NEXT: flt.d a0, ft1, ft0
603 ; RV64IFD-NEXT: beqz a0, .LBB13_2
604 ; RV64IFD-NEXT: # %bb.1: # %if.else
605 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
606 ; RV64IFD-NEXT: addi sp, sp, 16
608 ; RV64IFD-NEXT: .LBB13_2: # %if.then
609 ; RV64IFD-NEXT: call abort@plt
610 %1 = fcmp ule double %a, %b
611 br i1 %1, label %if.then, label %if.else
615 tail call void @abort()
619 define void @br_fcmp_une(double %a, double %b) nounwind {
620 ; RV32IFD-LABEL: br_fcmp_une:
622 ; RV32IFD-NEXT: addi sp, sp, -16
623 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
624 ; RV32IFD-NEXT: sw a2, 0(sp)
625 ; RV32IFD-NEXT: sw a3, 4(sp)
626 ; RV32IFD-NEXT: fld ft0, 0(sp)
627 ; RV32IFD-NEXT: sw a0, 0(sp)
628 ; RV32IFD-NEXT: sw a1, 4(sp)
629 ; RV32IFD-NEXT: fld ft1, 0(sp)
630 ; RV32IFD-NEXT: feq.d a0, ft1, ft0
631 ; RV32IFD-NEXT: beqz a0, .LBB14_2
632 ; RV32IFD-NEXT: # %bb.1: # %if.else
633 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
634 ; RV32IFD-NEXT: addi sp, sp, 16
636 ; RV32IFD-NEXT: .LBB14_2: # %if.then
637 ; RV32IFD-NEXT: call abort@plt
639 ; RV64IFD-LABEL: br_fcmp_une:
641 ; RV64IFD-NEXT: addi sp, sp, -16
642 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
643 ; RV64IFD-NEXT: fmv.d.x ft0, a1
644 ; RV64IFD-NEXT: fmv.d.x ft1, a0
645 ; RV64IFD-NEXT: feq.d a0, ft1, ft0
646 ; RV64IFD-NEXT: beqz a0, .LBB14_2
647 ; RV64IFD-NEXT: # %bb.1: # %if.else
648 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
649 ; RV64IFD-NEXT: addi sp, sp, 16
651 ; RV64IFD-NEXT: .LBB14_2: # %if.then
652 ; RV64IFD-NEXT: call abort@plt
653 %1 = fcmp une double %a, %b
654 br i1 %1, label %if.then, label %if.else
658 tail call void @abort()
662 define void @br_fcmp_uno(double %a, double %b) nounwind {
663 ; TODO: sltiu+bne -> beq
664 ; RV32IFD-LABEL: br_fcmp_uno:
666 ; RV32IFD-NEXT: addi sp, sp, -16
667 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
668 ; RV32IFD-NEXT: sw a0, 0(sp)
669 ; RV32IFD-NEXT: sw a1, 4(sp)
670 ; RV32IFD-NEXT: fld ft0, 0(sp)
671 ; RV32IFD-NEXT: sw a2, 0(sp)
672 ; RV32IFD-NEXT: sw a3, 4(sp)
673 ; RV32IFD-NEXT: fld ft1, 0(sp)
674 ; RV32IFD-NEXT: feq.d a0, ft1, ft1
675 ; RV32IFD-NEXT: feq.d a1, ft0, ft0
676 ; RV32IFD-NEXT: and a0, a1, a0
677 ; RV32IFD-NEXT: beqz a0, .LBB15_2
678 ; RV32IFD-NEXT: # %bb.1: # %if.else
679 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
680 ; RV32IFD-NEXT: addi sp, sp, 16
682 ; RV32IFD-NEXT: .LBB15_2: # %if.then
683 ; RV32IFD-NEXT: call abort@plt
685 ; RV64IFD-LABEL: br_fcmp_uno:
687 ; RV64IFD-NEXT: addi sp, sp, -16
688 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
689 ; RV64IFD-NEXT: fmv.d.x ft0, a0
690 ; RV64IFD-NEXT: fmv.d.x ft1, a1
691 ; RV64IFD-NEXT: feq.d a0, ft1, ft1
692 ; RV64IFD-NEXT: feq.d a1, ft0, ft0
693 ; RV64IFD-NEXT: and a0, a1, a0
694 ; RV64IFD-NEXT: beqz a0, .LBB15_2
695 ; RV64IFD-NEXT: # %bb.1: # %if.else
696 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
697 ; RV64IFD-NEXT: addi sp, sp, 16
699 ; RV64IFD-NEXT: .LBB15_2: # %if.then
700 ; RV64IFD-NEXT: call abort@plt
701 %1 = fcmp uno double %a, %b
702 br i1 %1, label %if.then, label %if.else
706 tail call void @abort()
710 define void @br_fcmp_true(double %a, double %b) nounwind {
711 ; RV32IFD-LABEL: br_fcmp_true:
713 ; RV32IFD-NEXT: addi sp, sp, -16
714 ; RV32IFD-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
715 ; RV32IFD-NEXT: addi a0, zero, 1
716 ; RV32IFD-NEXT: bnez a0, .LBB16_2
717 ; RV32IFD-NEXT: # %bb.1: # %if.else
718 ; RV32IFD-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
719 ; RV32IFD-NEXT: addi sp, sp, 16
721 ; RV32IFD-NEXT: .LBB16_2: # %if.then
722 ; RV32IFD-NEXT: call abort@plt
724 ; RV64IFD-LABEL: br_fcmp_true:
726 ; RV64IFD-NEXT: addi sp, sp, -16
727 ; RV64IFD-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
728 ; RV64IFD-NEXT: addi a0, zero, 1
729 ; RV64IFD-NEXT: bnez a0, .LBB16_2
730 ; RV64IFD-NEXT: # %bb.1: # %if.else
731 ; RV64IFD-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
732 ; RV64IFD-NEXT: addi sp, sp, 16
734 ; RV64IFD-NEXT: .LBB16_2: # %if.then
735 ; RV64IFD-NEXT: call abort@plt
736 %1 = fcmp true double %a, %b
737 br i1 %1, label %if.then, label %if.else
741 tail call void @abort()