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)
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)
19 ; RV32IFD-NEXT: addi sp, sp, 16
21 ; RV32IFD-NEXT: .LBB0_2: # %if.else
22 ; RV32IFD-NEXT: call abort
24 ; RV64IFD-LABEL: br_fcmp_false:
26 ; RV64IFD-NEXT: addi sp, sp, -16
27 ; RV64IFD-NEXT: sd ra, 8(sp)
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)
32 ; RV64IFD-NEXT: addi sp, sp, 16
34 ; RV64IFD-NEXT: .LBB0_2: # %if.else
35 ; RV64IFD-NEXT: call abort
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)
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)
60 ; RV32IFD-NEXT: addi sp, sp, 16
62 ; RV32IFD-NEXT: .LBB1_2: # %if.then
63 ; RV32IFD-NEXT: call abort
65 ; RV64IFD-LABEL: br_fcmp_oeq:
67 ; RV64IFD-NEXT: addi sp, sp, -16
68 ; RV64IFD-NEXT: sd ra, 8(sp)
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)
75 ; RV64IFD-NEXT: addi sp, sp, 16
77 ; RV64IFD-NEXT: .LBB1_2: # %if.then
78 ; RV64IFD-NEXT: call abort
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)
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: xori a0, a0, 1
104 ; RV32IFD-NEXT: beqz a0, .LBB2_2
105 ; RV32IFD-NEXT: # %bb.1: # %if.else
106 ; RV32IFD-NEXT: lw ra, 12(sp)
107 ; RV32IFD-NEXT: addi sp, sp, 16
109 ; RV32IFD-NEXT: .LBB2_2: # %if.then
110 ; RV32IFD-NEXT: call abort
112 ; RV64IFD-LABEL: br_fcmp_oeq_alt:
114 ; RV64IFD-NEXT: addi sp, sp, -16
115 ; RV64IFD-NEXT: sd ra, 8(sp)
116 ; RV64IFD-NEXT: fmv.d.x ft0, a1
117 ; RV64IFD-NEXT: fmv.d.x ft1, a0
118 ; RV64IFD-NEXT: feq.d a0, ft1, ft0
119 ; RV64IFD-NEXT: xori a0, a0, 1
120 ; RV64IFD-NEXT: beqz a0, .LBB2_2
121 ; RV64IFD-NEXT: # %bb.1: # %if.else
122 ; RV64IFD-NEXT: ld ra, 8(sp)
123 ; RV64IFD-NEXT: addi sp, sp, 16
125 ; RV64IFD-NEXT: .LBB2_2: # %if.then
126 ; RV64IFD-NEXT: call abort
127 %1 = fcmp oeq double %a, %b
128 br i1 %1, label %if.then, label %if.else
130 tail call void @abort()
136 define void @br_fcmp_ogt(double %a, double %b) nounwind {
137 ; RV32IFD-LABEL: br_fcmp_ogt:
139 ; RV32IFD-NEXT: addi sp, sp, -16
140 ; RV32IFD-NEXT: sw ra, 12(sp)
141 ; RV32IFD-NEXT: sw a0, 0(sp)
142 ; RV32IFD-NEXT: sw a1, 4(sp)
143 ; RV32IFD-NEXT: fld ft0, 0(sp)
144 ; RV32IFD-NEXT: sw a2, 0(sp)
145 ; RV32IFD-NEXT: sw a3, 4(sp)
146 ; RV32IFD-NEXT: fld ft1, 0(sp)
147 ; RV32IFD-NEXT: flt.d a0, ft1, ft0
148 ; RV32IFD-NEXT: bnez a0, .LBB3_2
149 ; RV32IFD-NEXT: # %bb.1: # %if.else
150 ; RV32IFD-NEXT: lw ra, 12(sp)
151 ; RV32IFD-NEXT: addi sp, sp, 16
153 ; RV32IFD-NEXT: .LBB3_2: # %if.then
154 ; RV32IFD-NEXT: call abort
156 ; RV64IFD-LABEL: br_fcmp_ogt:
158 ; RV64IFD-NEXT: addi sp, sp, -16
159 ; RV64IFD-NEXT: sd ra, 8(sp)
160 ; RV64IFD-NEXT: fmv.d.x ft0, a0
161 ; RV64IFD-NEXT: fmv.d.x ft1, a1
162 ; RV64IFD-NEXT: flt.d a0, ft1, ft0
163 ; RV64IFD-NEXT: bnez a0, .LBB3_2
164 ; RV64IFD-NEXT: # %bb.1: # %if.else
165 ; RV64IFD-NEXT: ld ra, 8(sp)
166 ; RV64IFD-NEXT: addi sp, sp, 16
168 ; RV64IFD-NEXT: .LBB3_2: # %if.then
169 ; RV64IFD-NEXT: call abort
170 %1 = fcmp ogt double %a, %b
171 br i1 %1, label %if.then, label %if.else
175 tail call void @abort()
179 define void @br_fcmp_oge(double %a, double %b) nounwind {
180 ; RV32IFD-LABEL: br_fcmp_oge:
182 ; RV32IFD-NEXT: addi sp, sp, -16
183 ; RV32IFD-NEXT: sw ra, 12(sp)
184 ; RV32IFD-NEXT: sw a0, 0(sp)
185 ; RV32IFD-NEXT: sw a1, 4(sp)
186 ; RV32IFD-NEXT: fld ft0, 0(sp)
187 ; RV32IFD-NEXT: sw a2, 0(sp)
188 ; RV32IFD-NEXT: sw a3, 4(sp)
189 ; RV32IFD-NEXT: fld ft1, 0(sp)
190 ; RV32IFD-NEXT: fle.d a0, ft1, ft0
191 ; RV32IFD-NEXT: bnez a0, .LBB4_2
192 ; RV32IFD-NEXT: # %bb.1: # %if.else
193 ; RV32IFD-NEXT: lw ra, 12(sp)
194 ; RV32IFD-NEXT: addi sp, sp, 16
196 ; RV32IFD-NEXT: .LBB4_2: # %if.then
197 ; RV32IFD-NEXT: call abort
199 ; RV64IFD-LABEL: br_fcmp_oge:
201 ; RV64IFD-NEXT: addi sp, sp, -16
202 ; RV64IFD-NEXT: sd ra, 8(sp)
203 ; RV64IFD-NEXT: fmv.d.x ft0, a0
204 ; RV64IFD-NEXT: fmv.d.x ft1, a1
205 ; RV64IFD-NEXT: fle.d a0, ft1, ft0
206 ; RV64IFD-NEXT: bnez a0, .LBB4_2
207 ; RV64IFD-NEXT: # %bb.1: # %if.else
208 ; RV64IFD-NEXT: ld ra, 8(sp)
209 ; RV64IFD-NEXT: addi sp, sp, 16
211 ; RV64IFD-NEXT: .LBB4_2: # %if.then
212 ; RV64IFD-NEXT: call abort
213 %1 = fcmp oge double %a, %b
214 br i1 %1, label %if.then, label %if.else
218 tail call void @abort()
222 define void @br_fcmp_olt(double %a, double %b) nounwind {
223 ; RV32IFD-LABEL: br_fcmp_olt:
225 ; RV32IFD-NEXT: addi sp, sp, -16
226 ; RV32IFD-NEXT: sw ra, 12(sp)
227 ; RV32IFD-NEXT: sw a2, 0(sp)
228 ; RV32IFD-NEXT: sw a3, 4(sp)
229 ; RV32IFD-NEXT: fld ft0, 0(sp)
230 ; RV32IFD-NEXT: sw a0, 0(sp)
231 ; RV32IFD-NEXT: sw a1, 4(sp)
232 ; RV32IFD-NEXT: fld ft1, 0(sp)
233 ; RV32IFD-NEXT: flt.d a0, ft1, ft0
234 ; RV32IFD-NEXT: bnez a0, .LBB5_2
235 ; RV32IFD-NEXT: # %bb.1: # %if.else
236 ; RV32IFD-NEXT: lw ra, 12(sp)
237 ; RV32IFD-NEXT: addi sp, sp, 16
239 ; RV32IFD-NEXT: .LBB5_2: # %if.then
240 ; RV32IFD-NEXT: call abort
242 ; RV64IFD-LABEL: br_fcmp_olt:
244 ; RV64IFD-NEXT: addi sp, sp, -16
245 ; RV64IFD-NEXT: sd ra, 8(sp)
246 ; RV64IFD-NEXT: fmv.d.x ft0, a1
247 ; RV64IFD-NEXT: fmv.d.x ft1, a0
248 ; RV64IFD-NEXT: flt.d a0, ft1, ft0
249 ; RV64IFD-NEXT: bnez a0, .LBB5_2
250 ; RV64IFD-NEXT: # %bb.1: # %if.else
251 ; RV64IFD-NEXT: ld ra, 8(sp)
252 ; RV64IFD-NEXT: addi sp, sp, 16
254 ; RV64IFD-NEXT: .LBB5_2: # %if.then
255 ; RV64IFD-NEXT: call abort
256 %1 = fcmp olt double %a, %b
257 br i1 %1, label %if.then, label %if.else
261 tail call void @abort()
265 define void @br_fcmp_ole(double %a, double %b) nounwind {
266 ; RV32IFD-LABEL: br_fcmp_ole:
268 ; RV32IFD-NEXT: addi sp, sp, -16
269 ; RV32IFD-NEXT: sw ra, 12(sp)
270 ; RV32IFD-NEXT: sw a2, 0(sp)
271 ; RV32IFD-NEXT: sw a3, 4(sp)
272 ; RV32IFD-NEXT: fld ft0, 0(sp)
273 ; RV32IFD-NEXT: sw a0, 0(sp)
274 ; RV32IFD-NEXT: sw a1, 4(sp)
275 ; RV32IFD-NEXT: fld ft1, 0(sp)
276 ; RV32IFD-NEXT: fle.d a0, ft1, ft0
277 ; RV32IFD-NEXT: bnez a0, .LBB6_2
278 ; RV32IFD-NEXT: # %bb.1: # %if.else
279 ; RV32IFD-NEXT: lw ra, 12(sp)
280 ; RV32IFD-NEXT: addi sp, sp, 16
282 ; RV32IFD-NEXT: .LBB6_2: # %if.then
283 ; RV32IFD-NEXT: call abort
285 ; RV64IFD-LABEL: br_fcmp_ole:
287 ; RV64IFD-NEXT: addi sp, sp, -16
288 ; RV64IFD-NEXT: sd ra, 8(sp)
289 ; RV64IFD-NEXT: fmv.d.x ft0, a1
290 ; RV64IFD-NEXT: fmv.d.x ft1, a0
291 ; RV64IFD-NEXT: fle.d a0, ft1, ft0
292 ; RV64IFD-NEXT: bnez a0, .LBB6_2
293 ; RV64IFD-NEXT: # %bb.1: # %if.else
294 ; RV64IFD-NEXT: ld ra, 8(sp)
295 ; RV64IFD-NEXT: addi sp, sp, 16
297 ; RV64IFD-NEXT: .LBB6_2: # %if.then
298 ; RV64IFD-NEXT: call abort
299 %1 = fcmp ole double %a, %b
300 br i1 %1, label %if.then, label %if.else
304 tail call void @abort()
308 ; TODO: feq.s+sltiu+bne -> feq.s+beq
309 define void @br_fcmp_one(double %a, double %b) nounwind {
310 ; RV32IFD-LABEL: br_fcmp_one:
312 ; RV32IFD-NEXT: addi sp, sp, -16
313 ; RV32IFD-NEXT: sw ra, 12(sp)
314 ; RV32IFD-NEXT: sw a0, 0(sp)
315 ; RV32IFD-NEXT: sw a1, 4(sp)
316 ; RV32IFD-NEXT: fld ft0, 0(sp)
317 ; RV32IFD-NEXT: sw a2, 0(sp)
318 ; RV32IFD-NEXT: sw a3, 4(sp)
319 ; RV32IFD-NEXT: fld ft1, 0(sp)
320 ; RV32IFD-NEXT: feq.d a0, ft1, ft1
321 ; RV32IFD-NEXT: feq.d a1, ft0, ft0
322 ; RV32IFD-NEXT: and a0, a1, a0
323 ; RV32IFD-NEXT: feq.d a1, ft0, ft1
324 ; RV32IFD-NEXT: not a1, a1
325 ; RV32IFD-NEXT: seqz a0, a0
326 ; RV32IFD-NEXT: xori a0, a0, 1
327 ; RV32IFD-NEXT: and a0, a1, a0
328 ; RV32IFD-NEXT: bnez a0, .LBB7_2
329 ; RV32IFD-NEXT: # %bb.1: # %if.else
330 ; RV32IFD-NEXT: lw ra, 12(sp)
331 ; RV32IFD-NEXT: addi sp, sp, 16
333 ; RV32IFD-NEXT: .LBB7_2: # %if.then
334 ; RV32IFD-NEXT: call abort
336 ; RV64IFD-LABEL: br_fcmp_one:
338 ; RV64IFD-NEXT: addi sp, sp, -16
339 ; RV64IFD-NEXT: sd ra, 8(sp)
340 ; RV64IFD-NEXT: fmv.d.x ft0, a0
341 ; RV64IFD-NEXT: fmv.d.x ft1, a1
342 ; RV64IFD-NEXT: feq.d a0, ft1, ft1
343 ; RV64IFD-NEXT: feq.d a1, ft0, ft0
344 ; RV64IFD-NEXT: and a0, a1, a0
345 ; RV64IFD-NEXT: feq.d a1, ft0, ft1
346 ; RV64IFD-NEXT: not a1, a1
347 ; RV64IFD-NEXT: seqz a0, a0
348 ; RV64IFD-NEXT: xori a0, a0, 1
349 ; RV64IFD-NEXT: and a0, a1, a0
350 ; RV64IFD-NEXT: bnez a0, .LBB7_2
351 ; RV64IFD-NEXT: # %bb.1: # %if.else
352 ; RV64IFD-NEXT: ld ra, 8(sp)
353 ; RV64IFD-NEXT: addi sp, sp, 16
355 ; RV64IFD-NEXT: .LBB7_2: # %if.then
356 ; RV64IFD-NEXT: call abort
357 %1 = fcmp one double %a, %b
358 br i1 %1, label %if.then, label %if.else
362 tail call void @abort()
366 define void @br_fcmp_ord(double %a, double %b) nounwind {
367 ; RV32IFD-LABEL: br_fcmp_ord:
369 ; RV32IFD-NEXT: addi sp, sp, -16
370 ; RV32IFD-NEXT: sw ra, 12(sp)
371 ; RV32IFD-NEXT: sw a0, 0(sp)
372 ; RV32IFD-NEXT: sw a1, 4(sp)
373 ; RV32IFD-NEXT: fld ft0, 0(sp)
374 ; RV32IFD-NEXT: sw a2, 0(sp)
375 ; RV32IFD-NEXT: sw a3, 4(sp)
376 ; RV32IFD-NEXT: fld ft1, 0(sp)
377 ; RV32IFD-NEXT: feq.d a0, ft1, ft1
378 ; RV32IFD-NEXT: feq.d a1, ft0, ft0
379 ; RV32IFD-NEXT: and a0, a1, a0
380 ; RV32IFD-NEXT: seqz a0, a0
381 ; RV32IFD-NEXT: xori a0, a0, 1
382 ; RV32IFD-NEXT: bnez a0, .LBB8_2
383 ; RV32IFD-NEXT: # %bb.1: # %if.else
384 ; RV32IFD-NEXT: lw ra, 12(sp)
385 ; RV32IFD-NEXT: addi sp, sp, 16
387 ; RV32IFD-NEXT: .LBB8_2: # %if.then
388 ; RV32IFD-NEXT: call abort
390 ; RV64IFD-LABEL: br_fcmp_ord:
392 ; RV64IFD-NEXT: addi sp, sp, -16
393 ; RV64IFD-NEXT: sd ra, 8(sp)
394 ; RV64IFD-NEXT: fmv.d.x ft0, a1
395 ; RV64IFD-NEXT: feq.d a1, ft0, ft0
396 ; RV64IFD-NEXT: fmv.d.x ft0, a0
397 ; RV64IFD-NEXT: feq.d a0, ft0, ft0
398 ; RV64IFD-NEXT: and a0, a0, a1
399 ; RV64IFD-NEXT: seqz a0, a0
400 ; RV64IFD-NEXT: xori a0, a0, 1
401 ; RV64IFD-NEXT: bnez a0, .LBB8_2
402 ; RV64IFD-NEXT: # %bb.1: # %if.else
403 ; RV64IFD-NEXT: ld ra, 8(sp)
404 ; RV64IFD-NEXT: addi sp, sp, 16
406 ; RV64IFD-NEXT: .LBB8_2: # %if.then
407 ; RV64IFD-NEXT: call abort
408 %1 = fcmp ord double %a, %b
409 br i1 %1, label %if.then, label %if.else
413 tail call void @abort()
417 define void @br_fcmp_ueq(double %a, double %b) nounwind {
418 ; RV32IFD-LABEL: br_fcmp_ueq:
420 ; RV32IFD-NEXT: addi sp, sp, -16
421 ; RV32IFD-NEXT: sw ra, 12(sp)
422 ; RV32IFD-NEXT: sw a2, 0(sp)
423 ; RV32IFD-NEXT: sw a3, 4(sp)
424 ; RV32IFD-NEXT: fld ft0, 0(sp)
425 ; RV32IFD-NEXT: sw a0, 0(sp)
426 ; RV32IFD-NEXT: sw a1, 4(sp)
427 ; RV32IFD-NEXT: fld ft1, 0(sp)
428 ; RV32IFD-NEXT: feq.d a0, ft1, ft0
429 ; RV32IFD-NEXT: feq.d a1, ft0, ft0
430 ; RV32IFD-NEXT: feq.d a2, ft1, ft1
431 ; RV32IFD-NEXT: and a1, a2, a1
432 ; RV32IFD-NEXT: seqz a1, a1
433 ; RV32IFD-NEXT: or a0, a0, a1
434 ; RV32IFD-NEXT: bnez a0, .LBB9_2
435 ; RV32IFD-NEXT: # %bb.1: # %if.else
436 ; RV32IFD-NEXT: lw ra, 12(sp)
437 ; RV32IFD-NEXT: addi sp, sp, 16
439 ; RV32IFD-NEXT: .LBB9_2: # %if.then
440 ; RV32IFD-NEXT: call abort
442 ; RV64IFD-LABEL: br_fcmp_ueq:
444 ; RV64IFD-NEXT: addi sp, sp, -16
445 ; RV64IFD-NEXT: sd ra, 8(sp)
446 ; RV64IFD-NEXT: fmv.d.x ft0, a1
447 ; RV64IFD-NEXT: fmv.d.x ft1, a0
448 ; RV64IFD-NEXT: feq.d a0, ft1, ft0
449 ; RV64IFD-NEXT: feq.d a1, ft0, ft0
450 ; RV64IFD-NEXT: feq.d a2, ft1, ft1
451 ; RV64IFD-NEXT: and a1, a2, a1
452 ; RV64IFD-NEXT: seqz a1, a1
453 ; RV64IFD-NEXT: or a0, a0, a1
454 ; RV64IFD-NEXT: bnez a0, .LBB9_2
455 ; RV64IFD-NEXT: # %bb.1: # %if.else
456 ; RV64IFD-NEXT: ld ra, 8(sp)
457 ; RV64IFD-NEXT: addi sp, sp, 16
459 ; RV64IFD-NEXT: .LBB9_2: # %if.then
460 ; RV64IFD-NEXT: call abort
461 %1 = fcmp ueq double %a, %b
462 br i1 %1, label %if.then, label %if.else
466 tail call void @abort()
470 define void @br_fcmp_ugt(double %a, double %b) nounwind {
471 ; RV32IFD-LABEL: br_fcmp_ugt:
473 ; RV32IFD-NEXT: addi sp, sp, -16
474 ; RV32IFD-NEXT: sw ra, 12(sp)
475 ; RV32IFD-NEXT: sw a2, 0(sp)
476 ; RV32IFD-NEXT: sw a3, 4(sp)
477 ; RV32IFD-NEXT: fld ft0, 0(sp)
478 ; RV32IFD-NEXT: sw a0, 0(sp)
479 ; RV32IFD-NEXT: sw a1, 4(sp)
480 ; RV32IFD-NEXT: fld ft1, 0(sp)
481 ; RV32IFD-NEXT: fle.d a0, ft1, ft0
482 ; RV32IFD-NEXT: xori a0, a0, 1
483 ; RV32IFD-NEXT: bnez a0, .LBB10_2
484 ; RV32IFD-NEXT: # %bb.1: # %if.else
485 ; RV32IFD-NEXT: lw ra, 12(sp)
486 ; RV32IFD-NEXT: addi sp, sp, 16
488 ; RV32IFD-NEXT: .LBB10_2: # %if.then
489 ; RV32IFD-NEXT: call abort
491 ; RV64IFD-LABEL: br_fcmp_ugt:
493 ; RV64IFD-NEXT: addi sp, sp, -16
494 ; RV64IFD-NEXT: sd ra, 8(sp)
495 ; RV64IFD-NEXT: fmv.d.x ft0, a1
496 ; RV64IFD-NEXT: fmv.d.x ft1, a0
497 ; RV64IFD-NEXT: fle.d a0, ft1, ft0
498 ; RV64IFD-NEXT: xori a0, a0, 1
499 ; RV64IFD-NEXT: bnez a0, .LBB10_2
500 ; RV64IFD-NEXT: # %bb.1: # %if.else
501 ; RV64IFD-NEXT: ld ra, 8(sp)
502 ; RV64IFD-NEXT: addi sp, sp, 16
504 ; RV64IFD-NEXT: .LBB10_2: # %if.then
505 ; RV64IFD-NEXT: call abort
506 %1 = fcmp ugt double %a, %b
507 br i1 %1, label %if.then, label %if.else
511 tail call void @abort()
515 define void @br_fcmp_uge(double %a, double %b) nounwind {
516 ; RV32IFD-LABEL: br_fcmp_uge:
518 ; RV32IFD-NEXT: addi sp, sp, -16
519 ; RV32IFD-NEXT: sw ra, 12(sp)
520 ; RV32IFD-NEXT: sw a2, 0(sp)
521 ; RV32IFD-NEXT: sw a3, 4(sp)
522 ; RV32IFD-NEXT: fld ft0, 0(sp)
523 ; RV32IFD-NEXT: sw a0, 0(sp)
524 ; RV32IFD-NEXT: sw a1, 4(sp)
525 ; RV32IFD-NEXT: fld ft1, 0(sp)
526 ; RV32IFD-NEXT: flt.d a0, ft1, ft0
527 ; RV32IFD-NEXT: xori a0, a0, 1
528 ; RV32IFD-NEXT: bnez a0, .LBB11_2
529 ; RV32IFD-NEXT: # %bb.1: # %if.else
530 ; RV32IFD-NEXT: lw ra, 12(sp)
531 ; RV32IFD-NEXT: addi sp, sp, 16
533 ; RV32IFD-NEXT: .LBB11_2: # %if.then
534 ; RV32IFD-NEXT: call abort
536 ; RV64IFD-LABEL: br_fcmp_uge:
538 ; RV64IFD-NEXT: addi sp, sp, -16
539 ; RV64IFD-NEXT: sd ra, 8(sp)
540 ; RV64IFD-NEXT: fmv.d.x ft0, a1
541 ; RV64IFD-NEXT: fmv.d.x ft1, a0
542 ; RV64IFD-NEXT: flt.d a0, ft1, ft0
543 ; RV64IFD-NEXT: xori a0, a0, 1
544 ; RV64IFD-NEXT: bnez a0, .LBB11_2
545 ; RV64IFD-NEXT: # %bb.1: # %if.else
546 ; RV64IFD-NEXT: ld ra, 8(sp)
547 ; RV64IFD-NEXT: addi sp, sp, 16
549 ; RV64IFD-NEXT: .LBB11_2: # %if.then
550 ; RV64IFD-NEXT: call abort
551 %1 = fcmp uge double %a, %b
552 br i1 %1, label %if.then, label %if.else
556 tail call void @abort()
560 define void @br_fcmp_ult(double %a, double %b) nounwind {
561 ; RV32IFD-LABEL: br_fcmp_ult:
563 ; RV32IFD-NEXT: addi sp, sp, -16
564 ; RV32IFD-NEXT: sw ra, 12(sp)
565 ; RV32IFD-NEXT: sw a0, 0(sp)
566 ; RV32IFD-NEXT: sw a1, 4(sp)
567 ; RV32IFD-NEXT: fld ft0, 0(sp)
568 ; RV32IFD-NEXT: sw a2, 0(sp)
569 ; RV32IFD-NEXT: sw a3, 4(sp)
570 ; RV32IFD-NEXT: fld ft1, 0(sp)
571 ; RV32IFD-NEXT: fle.d a0, ft1, ft0
572 ; RV32IFD-NEXT: xori a0, a0, 1
573 ; RV32IFD-NEXT: bnez a0, .LBB12_2
574 ; RV32IFD-NEXT: # %bb.1: # %if.else
575 ; RV32IFD-NEXT: lw ra, 12(sp)
576 ; RV32IFD-NEXT: addi sp, sp, 16
578 ; RV32IFD-NEXT: .LBB12_2: # %if.then
579 ; RV32IFD-NEXT: call abort
581 ; RV64IFD-LABEL: br_fcmp_ult:
583 ; RV64IFD-NEXT: addi sp, sp, -16
584 ; RV64IFD-NEXT: sd ra, 8(sp)
585 ; RV64IFD-NEXT: fmv.d.x ft0, a0
586 ; RV64IFD-NEXT: fmv.d.x ft1, a1
587 ; RV64IFD-NEXT: fle.d a0, ft1, ft0
588 ; RV64IFD-NEXT: xori a0, a0, 1
589 ; RV64IFD-NEXT: bnez a0, .LBB12_2
590 ; RV64IFD-NEXT: # %bb.1: # %if.else
591 ; RV64IFD-NEXT: ld ra, 8(sp)
592 ; RV64IFD-NEXT: addi sp, sp, 16
594 ; RV64IFD-NEXT: .LBB12_2: # %if.then
595 ; RV64IFD-NEXT: call abort
596 %1 = fcmp ult double %a, %b
597 br i1 %1, label %if.then, label %if.else
601 tail call void @abort()
605 define void @br_fcmp_ule(double %a, double %b) nounwind {
606 ; RV32IFD-LABEL: br_fcmp_ule:
608 ; RV32IFD-NEXT: addi sp, sp, -16
609 ; RV32IFD-NEXT: sw ra, 12(sp)
610 ; RV32IFD-NEXT: sw a0, 0(sp)
611 ; RV32IFD-NEXT: sw a1, 4(sp)
612 ; RV32IFD-NEXT: fld ft0, 0(sp)
613 ; RV32IFD-NEXT: sw a2, 0(sp)
614 ; RV32IFD-NEXT: sw a3, 4(sp)
615 ; RV32IFD-NEXT: fld ft1, 0(sp)
616 ; RV32IFD-NEXT: flt.d a0, ft1, ft0
617 ; RV32IFD-NEXT: xori a0, a0, 1
618 ; RV32IFD-NEXT: bnez a0, .LBB13_2
619 ; RV32IFD-NEXT: # %bb.1: # %if.else
620 ; RV32IFD-NEXT: lw ra, 12(sp)
621 ; RV32IFD-NEXT: addi sp, sp, 16
623 ; RV32IFD-NEXT: .LBB13_2: # %if.then
624 ; RV32IFD-NEXT: call abort
626 ; RV64IFD-LABEL: br_fcmp_ule:
628 ; RV64IFD-NEXT: addi sp, sp, -16
629 ; RV64IFD-NEXT: sd ra, 8(sp)
630 ; RV64IFD-NEXT: fmv.d.x ft0, a0
631 ; RV64IFD-NEXT: fmv.d.x ft1, a1
632 ; RV64IFD-NEXT: flt.d a0, ft1, ft0
633 ; RV64IFD-NEXT: xori a0, a0, 1
634 ; RV64IFD-NEXT: bnez a0, .LBB13_2
635 ; RV64IFD-NEXT: # %bb.1: # %if.else
636 ; RV64IFD-NEXT: ld ra, 8(sp)
637 ; RV64IFD-NEXT: addi sp, sp, 16
639 ; RV64IFD-NEXT: .LBB13_2: # %if.then
640 ; RV64IFD-NEXT: call abort
641 %1 = fcmp ule double %a, %b
642 br i1 %1, label %if.then, label %if.else
646 tail call void @abort()
650 define void @br_fcmp_une(double %a, double %b) nounwind {
651 ; RV32IFD-LABEL: br_fcmp_une:
653 ; RV32IFD-NEXT: addi sp, sp, -16
654 ; RV32IFD-NEXT: sw ra, 12(sp)
655 ; RV32IFD-NEXT: sw a2, 0(sp)
656 ; RV32IFD-NEXT: sw a3, 4(sp)
657 ; RV32IFD-NEXT: fld ft0, 0(sp)
658 ; RV32IFD-NEXT: sw a0, 0(sp)
659 ; RV32IFD-NEXT: sw a1, 4(sp)
660 ; RV32IFD-NEXT: fld ft1, 0(sp)
661 ; RV32IFD-NEXT: feq.d a0, ft1, ft0
662 ; RV32IFD-NEXT: xori a0, a0, 1
663 ; RV32IFD-NEXT: bnez a0, .LBB14_2
664 ; RV32IFD-NEXT: # %bb.1: # %if.else
665 ; RV32IFD-NEXT: lw ra, 12(sp)
666 ; RV32IFD-NEXT: addi sp, sp, 16
668 ; RV32IFD-NEXT: .LBB14_2: # %if.then
669 ; RV32IFD-NEXT: call abort
671 ; RV64IFD-LABEL: br_fcmp_une:
673 ; RV64IFD-NEXT: addi sp, sp, -16
674 ; RV64IFD-NEXT: sd ra, 8(sp)
675 ; RV64IFD-NEXT: fmv.d.x ft0, a1
676 ; RV64IFD-NEXT: fmv.d.x ft1, a0
677 ; RV64IFD-NEXT: feq.d a0, ft1, ft0
678 ; RV64IFD-NEXT: xori a0, a0, 1
679 ; RV64IFD-NEXT: bnez a0, .LBB14_2
680 ; RV64IFD-NEXT: # %bb.1: # %if.else
681 ; RV64IFD-NEXT: ld ra, 8(sp)
682 ; RV64IFD-NEXT: addi sp, sp, 16
684 ; RV64IFD-NEXT: .LBB14_2: # %if.then
685 ; RV64IFD-NEXT: call abort
686 %1 = fcmp une double %a, %b
687 br i1 %1, label %if.then, label %if.else
691 tail call void @abort()
695 define void @br_fcmp_uno(double %a, double %b) nounwind {
696 ; TODO: sltiu+bne -> beq
697 ; RV32IFD-LABEL: br_fcmp_uno:
699 ; RV32IFD-NEXT: addi sp, sp, -16
700 ; RV32IFD-NEXT: sw ra, 12(sp)
701 ; RV32IFD-NEXT: sw a0, 0(sp)
702 ; RV32IFD-NEXT: sw a1, 4(sp)
703 ; RV32IFD-NEXT: fld ft0, 0(sp)
704 ; RV32IFD-NEXT: sw a2, 0(sp)
705 ; RV32IFD-NEXT: sw a3, 4(sp)
706 ; RV32IFD-NEXT: fld ft1, 0(sp)
707 ; RV32IFD-NEXT: feq.d a0, ft1, ft1
708 ; RV32IFD-NEXT: feq.d a1, ft0, ft0
709 ; RV32IFD-NEXT: and a0, a1, a0
710 ; RV32IFD-NEXT: seqz a0, a0
711 ; RV32IFD-NEXT: bnez a0, .LBB15_2
712 ; RV32IFD-NEXT: # %bb.1: # %if.else
713 ; RV32IFD-NEXT: lw ra, 12(sp)
714 ; RV32IFD-NEXT: addi sp, sp, 16
716 ; RV32IFD-NEXT: .LBB15_2: # %if.then
717 ; RV32IFD-NEXT: call abort
719 ; RV64IFD-LABEL: br_fcmp_uno:
721 ; RV64IFD-NEXT: addi sp, sp, -16
722 ; RV64IFD-NEXT: sd ra, 8(sp)
723 ; RV64IFD-NEXT: fmv.d.x ft0, a1
724 ; RV64IFD-NEXT: feq.d a1, ft0, ft0
725 ; RV64IFD-NEXT: fmv.d.x ft0, a0
726 ; RV64IFD-NEXT: feq.d a0, ft0, ft0
727 ; RV64IFD-NEXT: and a0, a0, a1
728 ; RV64IFD-NEXT: seqz a0, a0
729 ; RV64IFD-NEXT: bnez a0, .LBB15_2
730 ; RV64IFD-NEXT: # %bb.1: # %if.else
731 ; RV64IFD-NEXT: ld ra, 8(sp)
732 ; RV64IFD-NEXT: addi sp, sp, 16
734 ; RV64IFD-NEXT: .LBB15_2: # %if.then
735 ; RV64IFD-NEXT: call abort
736 %1 = fcmp uno double %a, %b
737 br i1 %1, label %if.then, label %if.else
741 tail call void @abort()
745 define void @br_fcmp_true(double %a, double %b) nounwind {
746 ; RV32IFD-LABEL: br_fcmp_true:
748 ; RV32IFD-NEXT: addi sp, sp, -16
749 ; RV32IFD-NEXT: sw ra, 12(sp)
750 ; RV32IFD-NEXT: addi a0, zero, 1
751 ; RV32IFD-NEXT: bnez a0, .LBB16_2
752 ; RV32IFD-NEXT: # %bb.1: # %if.else
753 ; RV32IFD-NEXT: lw ra, 12(sp)
754 ; RV32IFD-NEXT: addi sp, sp, 16
756 ; RV32IFD-NEXT: .LBB16_2: # %if.then
757 ; RV32IFD-NEXT: call abort
759 ; RV64IFD-LABEL: br_fcmp_true:
761 ; RV64IFD-NEXT: addi sp, sp, -16
762 ; RV64IFD-NEXT: sd ra, 8(sp)
763 ; RV64IFD-NEXT: addi a0, zero, 1
764 ; RV64IFD-NEXT: bnez a0, .LBB16_2
765 ; RV64IFD-NEXT: # %bb.1: # %if.else
766 ; RV64IFD-NEXT: ld ra, 8(sp)
767 ; RV64IFD-NEXT: addi sp, sp, 16
769 ; RV64IFD-NEXT: .LBB16_2: # %if.then
770 ; RV64IFD-NEXT: call abort
771 %1 = fcmp true double %a, %b
772 br i1 %1, label %if.then, label %if.else
776 tail call void @abort()