1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64 -run-pass=instruction-select -global-isel-abort=1 -verify-machineinstrs %s -o - | FileCheck %s
4 # Test that we don't have to emit a CSINC when emitting a G_FCMP being used by
7 # Condition codes which require more than one instruction should have two Bccs.
14 tracksRegLiveness: true
16 ; CHECK-LABEL: name: oeq
18 ; CHECK-NEXT: successors: %bb.1(0x50000000), %bb.2(0x30000000)
19 ; CHECK-NEXT: liveins: $s0, $s1, $w0, $w1
21 ; CHECK-NEXT: %cmp_lhs:fpr32 = COPY $s0
22 ; CHECK-NEXT: %cmp_rhs:fpr32 = COPY $s1
23 ; CHECK-NEXT: nofpexcept FCMPSrr %cmp_lhs, %cmp_rhs, implicit-def $nzcv
24 ; CHECK-NEXT: Bcc 0, %bb.2, implicit $nzcv
28 ; CHECK-NEXT: $s0 = COPY %cmp_lhs
29 ; CHECK-NEXT: RET_ReallyLR implicit $s0
32 ; CHECK-NEXT: $s1 = COPY %cmp_rhs
33 ; CHECK-NEXT: RET_ReallyLR implicit $s1
35 successors: %bb.1(0x50000000), %bb.2(0x30000000)
36 liveins: $s0, $s1, $w0, $w1
38 %cmp_lhs:fpr(s32) = COPY $s0
39 %cmp_rhs:fpr(s32) = COPY $s1
40 %fcmp:gpr(s32) = G_FCMP floatpred(oeq), %cmp_lhs(s32), %cmp_rhs
45 RET_ReallyLR implicit $s0
48 RET_ReallyLR implicit $s1
55 tracksRegLiveness: true
57 ; CHECK-LABEL: name: ogt
59 ; CHECK-NEXT: successors: %bb.1(0x50000000), %bb.2(0x30000000)
60 ; CHECK-NEXT: liveins: $s0, $s1, $w0, $w1
62 ; CHECK-NEXT: %cmp_lhs:fpr32 = COPY $s0
63 ; CHECK-NEXT: %cmp_rhs:fpr32 = COPY $s1
64 ; CHECK-NEXT: nofpexcept FCMPSrr %cmp_lhs, %cmp_rhs, implicit-def $nzcv
65 ; CHECK-NEXT: Bcc 12, %bb.2, implicit $nzcv
69 ; CHECK-NEXT: $s0 = COPY %cmp_lhs
70 ; CHECK-NEXT: RET_ReallyLR implicit $s0
73 ; CHECK-NEXT: $s1 = COPY %cmp_rhs
74 ; CHECK-NEXT: RET_ReallyLR implicit $s1
76 successors: %bb.1(0x50000000), %bb.2(0x30000000)
77 liveins: $s0, $s1, $w0, $w1
79 %cmp_lhs:fpr(s32) = COPY $s0
80 %cmp_rhs:fpr(s32) = COPY $s1
81 %fcmp:gpr(s32) = G_FCMP floatpred(ogt), %cmp_lhs(s32), %cmp_rhs
86 RET_ReallyLR implicit $s0
89 RET_ReallyLR implicit $s1
96 tracksRegLiveness: true
98 ; CHECK-LABEL: name: oge
100 ; CHECK-NEXT: successors: %bb.1(0x50000000), %bb.2(0x30000000)
101 ; CHECK-NEXT: liveins: $s0, $s1, $w0, $w1
103 ; CHECK-NEXT: %cmp_lhs:fpr32 = COPY $s0
104 ; CHECK-NEXT: %cmp_rhs:fpr32 = COPY $s1
105 ; CHECK-NEXT: nofpexcept FCMPSrr %cmp_lhs, %cmp_rhs, implicit-def $nzcv
106 ; CHECK-NEXT: Bcc 10, %bb.2, implicit $nzcv
107 ; CHECK-NEXT: B %bb.1
110 ; CHECK-NEXT: $s0 = COPY %cmp_lhs
111 ; CHECK-NEXT: RET_ReallyLR implicit $s0
114 ; CHECK-NEXT: $s1 = COPY %cmp_rhs
115 ; CHECK-NEXT: RET_ReallyLR implicit $s1
117 successors: %bb.1(0x50000000), %bb.2(0x30000000)
118 liveins: $s0, $s1, $w0, $w1
120 %cmp_lhs:fpr(s32) = COPY $s0
121 %cmp_rhs:fpr(s32) = COPY $s1
122 %fcmp:gpr(s32) = G_FCMP floatpred(oge), %cmp_lhs(s32), %cmp_rhs
123 G_BRCOND %fcmp, %bb.2
127 RET_ReallyLR implicit $s0
130 RET_ReallyLR implicit $s1
136 regBankSelected: true
137 tracksRegLiveness: true
139 ; CHECK-LABEL: name: olt
141 ; CHECK-NEXT: successors: %bb.1(0x50000000), %bb.2(0x30000000)
142 ; CHECK-NEXT: liveins: $s0, $s1, $w0, $w1
144 ; CHECK-NEXT: %cmp_lhs:fpr32 = COPY $s0
145 ; CHECK-NEXT: %cmp_rhs:fpr32 = COPY $s1
146 ; CHECK-NEXT: nofpexcept FCMPSrr %cmp_lhs, %cmp_rhs, implicit-def $nzcv
147 ; CHECK-NEXT: Bcc 4, %bb.2, implicit $nzcv
148 ; CHECK-NEXT: B %bb.1
151 ; CHECK-NEXT: $s0 = COPY %cmp_lhs
152 ; CHECK-NEXT: RET_ReallyLR implicit $s0
155 ; CHECK-NEXT: $s1 = COPY %cmp_rhs
156 ; CHECK-NEXT: RET_ReallyLR implicit $s1
158 successors: %bb.1(0x50000000), %bb.2(0x30000000)
159 liveins: $s0, $s1, $w0, $w1
161 %cmp_lhs:fpr(s32) = COPY $s0
162 %cmp_rhs:fpr(s32) = COPY $s1
163 %fcmp:gpr(s32) = G_FCMP floatpred(olt), %cmp_lhs(s32), %cmp_rhs
164 G_BRCOND %fcmp, %bb.2
168 RET_ReallyLR implicit $s0
171 RET_ReallyLR implicit $s1
177 regBankSelected: true
178 tracksRegLiveness: true
180 ; CHECK-LABEL: name: ole
182 ; CHECK-NEXT: successors: %bb.1(0x50000000), %bb.2(0x30000000)
183 ; CHECK-NEXT: liveins: $s0, $s1, $w0, $w1
185 ; CHECK-NEXT: %cmp_lhs:fpr32 = COPY $s0
186 ; CHECK-NEXT: %cmp_rhs:fpr32 = COPY $s1
187 ; CHECK-NEXT: nofpexcept FCMPSrr %cmp_lhs, %cmp_rhs, implicit-def $nzcv
188 ; CHECK-NEXT: Bcc 9, %bb.2, implicit $nzcv
189 ; CHECK-NEXT: B %bb.1
192 ; CHECK-NEXT: $s0 = COPY %cmp_lhs
193 ; CHECK-NEXT: RET_ReallyLR implicit $s0
196 ; CHECK-NEXT: $s1 = COPY %cmp_rhs
197 ; CHECK-NEXT: RET_ReallyLR implicit $s1
199 successors: %bb.1(0x50000000), %bb.2(0x30000000)
200 liveins: $s0, $s1, $w0, $w1
202 %cmp_lhs:fpr(s32) = COPY $s0
203 %cmp_rhs:fpr(s32) = COPY $s1
204 %fcmp:gpr(s32) = G_FCMP floatpred(ole), %cmp_lhs(s32), %cmp_rhs
205 G_BRCOND %fcmp, %bb.2
209 RET_ReallyLR implicit $s0
212 RET_ReallyLR implicit $s1
218 regBankSelected: true
219 tracksRegLiveness: true
221 ; CHECK-LABEL: name: one
223 ; CHECK-NEXT: successors: %bb.1(0x50000000), %bb.2(0x30000000)
224 ; CHECK-NEXT: liveins: $s0, $s1, $w0, $w1
226 ; CHECK-NEXT: %cmp_lhs:fpr32 = COPY $s0
227 ; CHECK-NEXT: %cmp_rhs:fpr32 = COPY $s1
228 ; CHECK-NEXT: nofpexcept FCMPSrr %cmp_lhs, %cmp_rhs, implicit-def $nzcv
229 ; CHECK-NEXT: Bcc 4, %bb.2, implicit $nzcv
230 ; CHECK-NEXT: Bcc 12, %bb.2, implicit $nzcv
231 ; CHECK-NEXT: B %bb.1
234 ; CHECK-NEXT: $s0 = COPY %cmp_lhs
235 ; CHECK-NEXT: RET_ReallyLR implicit $s0
238 ; CHECK-NEXT: $s1 = COPY %cmp_rhs
239 ; CHECK-NEXT: RET_ReallyLR implicit $s1
241 successors: %bb.1(0x50000000), %bb.2(0x30000000)
242 liveins: $s0, $s1, $w0, $w1
244 %cmp_lhs:fpr(s32) = COPY $s0
245 %cmp_rhs:fpr(s32) = COPY $s1
246 %fcmp:gpr(s32) = G_FCMP floatpred(one), %cmp_lhs(s32), %cmp_rhs
247 G_BRCOND %fcmp, %bb.2
251 RET_ReallyLR implicit $s0
254 RET_ReallyLR implicit $s1
260 regBankSelected: true
261 tracksRegLiveness: true
263 ; CHECK-LABEL: name: ord
265 ; CHECK-NEXT: successors: %bb.1(0x50000000), %bb.2(0x30000000)
266 ; CHECK-NEXT: liveins: $s0, $s1, $w0, $w1
268 ; CHECK-NEXT: %cmp_lhs:fpr32 = COPY $s0
269 ; CHECK-NEXT: %cmp_rhs:fpr32 = COPY $s1
270 ; CHECK-NEXT: nofpexcept FCMPSrr %cmp_lhs, %cmp_rhs, implicit-def $nzcv
271 ; CHECK-NEXT: Bcc 7, %bb.2, implicit $nzcv
272 ; CHECK-NEXT: B %bb.1
275 ; CHECK-NEXT: $s0 = COPY %cmp_lhs
276 ; CHECK-NEXT: RET_ReallyLR implicit $s0
279 ; CHECK-NEXT: $s1 = COPY %cmp_rhs
280 ; CHECK-NEXT: RET_ReallyLR implicit $s1
282 successors: %bb.1(0x50000000), %bb.2(0x30000000)
283 liveins: $s0, $s1, $w0, $w1
285 %cmp_lhs:fpr(s32) = COPY $s0
286 %cmp_rhs:fpr(s32) = COPY $s1
287 %fcmp:gpr(s32) = G_FCMP floatpred(ord), %cmp_lhs(s32), %cmp_rhs
288 G_BRCOND %fcmp, %bb.2
292 RET_ReallyLR implicit $s0
295 RET_ReallyLR implicit $s1
301 regBankSelected: true
302 tracksRegLiveness: true
304 ; CHECK-LABEL: name: uno
306 ; CHECK-NEXT: successors: %bb.1(0x50000000), %bb.2(0x30000000)
307 ; CHECK-NEXT: liveins: $s0, $s1, $w0, $w1
309 ; CHECK-NEXT: %cmp_lhs:fpr32 = COPY $s0
310 ; CHECK-NEXT: %cmp_rhs:fpr32 = COPY $s1
311 ; CHECK-NEXT: nofpexcept FCMPSrr %cmp_lhs, %cmp_rhs, implicit-def $nzcv
312 ; CHECK-NEXT: Bcc 6, %bb.2, implicit $nzcv
313 ; CHECK-NEXT: B %bb.1
316 ; CHECK-NEXT: $s0 = COPY %cmp_lhs
317 ; CHECK-NEXT: RET_ReallyLR implicit $s0
320 ; CHECK-NEXT: $s1 = COPY %cmp_rhs
321 ; CHECK-NEXT: RET_ReallyLR implicit $s1
323 successors: %bb.1(0x50000000), %bb.2(0x30000000)
324 liveins: $s0, $s1, $w0, $w1
326 %cmp_lhs:fpr(s32) = COPY $s0
327 %cmp_rhs:fpr(s32) = COPY $s1
328 %fcmp:gpr(s32) = G_FCMP floatpred(uno), %cmp_lhs(s32), %cmp_rhs
329 G_BRCOND %fcmp, %bb.2
333 RET_ReallyLR implicit $s0
336 RET_ReallyLR implicit $s1
342 regBankSelected: true
343 tracksRegLiveness: true
345 ; CHECK-LABEL: name: ueq
347 ; CHECK-NEXT: successors: %bb.1(0x50000000), %bb.2(0x30000000)
348 ; CHECK-NEXT: liveins: $s0, $s1, $w0, $w1
350 ; CHECK-NEXT: %cmp_lhs:fpr32 = COPY $s0
351 ; CHECK-NEXT: %cmp_rhs:fpr32 = COPY $s1
352 ; CHECK-NEXT: nofpexcept FCMPSrr %cmp_lhs, %cmp_rhs, implicit-def $nzcv
353 ; CHECK-NEXT: Bcc 0, %bb.2, implicit $nzcv
354 ; CHECK-NEXT: Bcc 6, %bb.2, implicit $nzcv
355 ; CHECK-NEXT: B %bb.1
358 ; CHECK-NEXT: $s0 = COPY %cmp_lhs
359 ; CHECK-NEXT: RET_ReallyLR implicit $s0
362 ; CHECK-NEXT: $s1 = COPY %cmp_rhs
363 ; CHECK-NEXT: RET_ReallyLR implicit $s1
365 successors: %bb.1(0x50000000), %bb.2(0x30000000)
366 liveins: $s0, $s1, $w0, $w1
368 %cmp_lhs:fpr(s32) = COPY $s0
369 %cmp_rhs:fpr(s32) = COPY $s1
370 %fcmp:gpr(s32) = G_FCMP floatpred(ueq), %cmp_lhs(s32), %cmp_rhs
371 G_BRCOND %fcmp, %bb.2
375 RET_ReallyLR implicit $s0
378 RET_ReallyLR implicit $s1
384 regBankSelected: true
385 tracksRegLiveness: true
387 ; CHECK-LABEL: name: ugt
389 ; CHECK-NEXT: successors: %bb.1(0x50000000), %bb.2(0x30000000)
390 ; CHECK-NEXT: liveins: $s0, $s1, $w0, $w1
392 ; CHECK-NEXT: %cmp_lhs:fpr32 = COPY $s0
393 ; CHECK-NEXT: %cmp_rhs:fpr32 = COPY $s1
394 ; CHECK-NEXT: nofpexcept FCMPSrr %cmp_lhs, %cmp_rhs, implicit-def $nzcv
395 ; CHECK-NEXT: Bcc 8, %bb.2, implicit $nzcv
396 ; CHECK-NEXT: B %bb.1
399 ; CHECK-NEXT: $s0 = COPY %cmp_lhs
400 ; CHECK-NEXT: RET_ReallyLR implicit $s0
403 ; CHECK-NEXT: $s1 = COPY %cmp_rhs
404 ; CHECK-NEXT: RET_ReallyLR implicit $s1
406 successors: %bb.1(0x50000000), %bb.2(0x30000000)
407 liveins: $s0, $s1, $w0, $w1
409 %cmp_lhs:fpr(s32) = COPY $s0
410 %cmp_rhs:fpr(s32) = COPY $s1
411 %fcmp:gpr(s32) = G_FCMP floatpred(ugt), %cmp_lhs(s32), %cmp_rhs
412 G_BRCOND %fcmp, %bb.2
416 RET_ReallyLR implicit $s0
419 RET_ReallyLR implicit $s1
425 regBankSelected: true
426 tracksRegLiveness: true
428 ; CHECK-LABEL: name: uge
430 ; CHECK-NEXT: successors: %bb.1(0x50000000), %bb.2(0x30000000)
431 ; CHECK-NEXT: liveins: $s0, $s1, $w0, $w1
433 ; CHECK-NEXT: %cmp_lhs:fpr32 = COPY $s0
434 ; CHECK-NEXT: %cmp_rhs:fpr32 = COPY $s1
435 ; CHECK-NEXT: nofpexcept FCMPSrr %cmp_lhs, %cmp_rhs, implicit-def $nzcv
436 ; CHECK-NEXT: Bcc 5, %bb.2, implicit $nzcv
437 ; CHECK-NEXT: B %bb.1
440 ; CHECK-NEXT: $s0 = COPY %cmp_lhs
441 ; CHECK-NEXT: RET_ReallyLR implicit $s0
444 ; CHECK-NEXT: $s1 = COPY %cmp_rhs
445 ; CHECK-NEXT: RET_ReallyLR implicit $s1
447 successors: %bb.1(0x50000000), %bb.2(0x30000000)
448 liveins: $s0, $s1, $w0, $w1
450 %cmp_lhs:fpr(s32) = COPY $s0
451 %cmp_rhs:fpr(s32) = COPY $s1
452 %fcmp:gpr(s32) = G_FCMP floatpred(uge), %cmp_lhs(s32), %cmp_rhs
453 G_BRCOND %fcmp, %bb.2
457 RET_ReallyLR implicit $s0
460 RET_ReallyLR implicit $s1
466 regBankSelected: true
467 tracksRegLiveness: true
469 ; CHECK-LABEL: name: ult
471 ; CHECK-NEXT: successors: %bb.1(0x50000000), %bb.2(0x30000000)
472 ; CHECK-NEXT: liveins: $s0, $s1, $w0, $w1
474 ; CHECK-NEXT: %cmp_lhs:fpr32 = COPY $s0
475 ; CHECK-NEXT: %cmp_rhs:fpr32 = COPY $s1
476 ; CHECK-NEXT: nofpexcept FCMPSrr %cmp_lhs, %cmp_rhs, implicit-def $nzcv
477 ; CHECK-NEXT: Bcc 11, %bb.2, implicit $nzcv
478 ; CHECK-NEXT: B %bb.1
481 ; CHECK-NEXT: $s0 = COPY %cmp_lhs
482 ; CHECK-NEXT: RET_ReallyLR implicit $s0
485 ; CHECK-NEXT: $s1 = COPY %cmp_rhs
486 ; CHECK-NEXT: RET_ReallyLR implicit $s1
488 successors: %bb.1(0x50000000), %bb.2(0x30000000)
489 liveins: $s0, $s1, $w0, $w1
491 %cmp_lhs:fpr(s32) = COPY $s0
492 %cmp_rhs:fpr(s32) = COPY $s1
493 %fcmp:gpr(s32) = G_FCMP floatpred(ult), %cmp_lhs(s32), %cmp_rhs
494 G_BRCOND %fcmp, %bb.2
498 RET_ReallyLR implicit $s0
501 RET_ReallyLR implicit $s1
507 regBankSelected: true
508 tracksRegLiveness: true
510 ; CHECK-LABEL: name: ule
512 ; CHECK-NEXT: successors: %bb.1(0x50000000), %bb.2(0x30000000)
513 ; CHECK-NEXT: liveins: $s0, $s1, $w0, $w1
515 ; CHECK-NEXT: %cmp_lhs:fpr32 = COPY $s0
516 ; CHECK-NEXT: %cmp_rhs:fpr32 = COPY $s1
517 ; CHECK-NEXT: nofpexcept FCMPSrr %cmp_lhs, %cmp_rhs, implicit-def $nzcv
518 ; CHECK-NEXT: Bcc 13, %bb.2, implicit $nzcv
519 ; CHECK-NEXT: B %bb.1
522 ; CHECK-NEXT: $s0 = COPY %cmp_lhs
523 ; CHECK-NEXT: RET_ReallyLR implicit $s0
526 ; CHECK-NEXT: $s1 = COPY %cmp_rhs
527 ; CHECK-NEXT: RET_ReallyLR implicit $s1
529 successors: %bb.1(0x50000000), %bb.2(0x30000000)
530 liveins: $s0, $s1, $w0, $w1
532 %cmp_lhs:fpr(s32) = COPY $s0
533 %cmp_rhs:fpr(s32) = COPY $s1
534 %fcmp:gpr(s32) = G_FCMP floatpred(ule), %cmp_lhs(s32), %cmp_rhs
535 G_BRCOND %fcmp, %bb.2
539 RET_ReallyLR implicit $s0
542 RET_ReallyLR implicit $s1
548 regBankSelected: true
549 tracksRegLiveness: true
551 ; CHECK-LABEL: name: une
553 ; CHECK-NEXT: successors: %bb.1(0x50000000), %bb.2(0x30000000)
554 ; CHECK-NEXT: liveins: $s0, $s1, $w0, $w1
556 ; CHECK-NEXT: %cmp_lhs:fpr32 = COPY $s0
557 ; CHECK-NEXT: %cmp_rhs:fpr32 = COPY $s1
558 ; CHECK-NEXT: nofpexcept FCMPSrr %cmp_lhs, %cmp_rhs, implicit-def $nzcv
559 ; CHECK-NEXT: Bcc 1, %bb.2, implicit $nzcv
560 ; CHECK-NEXT: B %bb.1
563 ; CHECK-NEXT: $s0 = COPY %cmp_lhs
564 ; CHECK-NEXT: RET_ReallyLR implicit $s0
567 ; CHECK-NEXT: $s1 = COPY %cmp_rhs
568 ; CHECK-NEXT: RET_ReallyLR implicit $s1
570 successors: %bb.1(0x50000000), %bb.2(0x30000000)
571 liveins: $s0, $s1, $w0, $w1
573 %cmp_lhs:fpr(s32) = COPY $s0
574 %cmp_rhs:fpr(s32) = COPY $s1
575 %fcmp:gpr(s32) = G_FCMP floatpred(une), %cmp_lhs(s32), %cmp_rhs
576 G_BRCOND %fcmp, %bb.2
580 RET_ReallyLR implicit $s0
583 RET_ReallyLR implicit $s1