1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64 -run-pass=instruction-select -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: successors: %bb.1(0x50000000), %bb.2(0x30000000)
19 ; CHECK: liveins: $s0, $s1, $w0, $w1
20 ; CHECK: %cmp_lhs:fpr32 = COPY $s0
21 ; CHECK: %cmp_rhs:fpr32 = COPY $s1
22 ; CHECK: FCMPSrr %cmp_lhs, %cmp_rhs, implicit-def $nzcv
23 ; CHECK: Bcc 0, %bb.2, implicit $nzcv
26 ; CHECK: $s0 = COPY %cmp_lhs
27 ; CHECK: RET_ReallyLR implicit $s0
29 ; CHECK: $s1 = COPY %cmp_rhs
30 ; CHECK: RET_ReallyLR implicit $s1
32 successors: %bb.1(0x50000000), %bb.2(0x30000000)
33 liveins: $s0, $s1, $w0, $w1
35 %cmp_lhs:fpr(s32) = COPY $s0
36 %cmp_rhs:fpr(s32) = COPY $s1
37 %fcmp:gpr(s32) = G_FCMP floatpred(oeq), %cmp_lhs(s32), %cmp_rhs
38 %trunc:gpr(s1) = G_TRUNC %fcmp(s32)
39 G_BRCOND %trunc(s1), %bb.2
43 RET_ReallyLR implicit $s0
46 RET_ReallyLR implicit $s1
53 tracksRegLiveness: true
55 ; CHECK-LABEL: name: ogt
57 ; CHECK: successors: %bb.1(0x50000000), %bb.2(0x30000000)
58 ; CHECK: liveins: $s0, $s1, $w0, $w1
59 ; CHECK: %cmp_lhs:fpr32 = COPY $s0
60 ; CHECK: %cmp_rhs:fpr32 = COPY $s1
61 ; CHECK: FCMPSrr %cmp_lhs, %cmp_rhs, implicit-def $nzcv
62 ; CHECK: Bcc 12, %bb.2, implicit $nzcv
65 ; CHECK: $s0 = COPY %cmp_lhs
66 ; CHECK: RET_ReallyLR implicit $s0
68 ; CHECK: $s1 = COPY %cmp_rhs
69 ; CHECK: RET_ReallyLR implicit $s1
71 successors: %bb.1(0x50000000), %bb.2(0x30000000)
72 liveins: $s0, $s1, $w0, $w1
74 %cmp_lhs:fpr(s32) = COPY $s0
75 %cmp_rhs:fpr(s32) = COPY $s1
76 %fcmp:gpr(s32) = G_FCMP floatpred(ogt), %cmp_lhs(s32), %cmp_rhs
77 %trunc:gpr(s1) = G_TRUNC %fcmp(s32)
78 G_BRCOND %trunc(s1), %bb.2
82 RET_ReallyLR implicit $s0
85 RET_ReallyLR implicit $s1
92 tracksRegLiveness: true
94 ; CHECK-LABEL: name: oge
96 ; CHECK: successors: %bb.1(0x50000000), %bb.2(0x30000000)
97 ; CHECK: liveins: $s0, $s1, $w0, $w1
98 ; CHECK: %cmp_lhs:fpr32 = COPY $s0
99 ; CHECK: %cmp_rhs:fpr32 = COPY $s1
100 ; CHECK: FCMPSrr %cmp_lhs, %cmp_rhs, implicit-def $nzcv
101 ; CHECK: Bcc 10, %bb.2, implicit $nzcv
104 ; CHECK: $s0 = COPY %cmp_lhs
105 ; CHECK: RET_ReallyLR implicit $s0
107 ; CHECK: $s1 = COPY %cmp_rhs
108 ; CHECK: RET_ReallyLR implicit $s1
110 successors: %bb.1(0x50000000), %bb.2(0x30000000)
111 liveins: $s0, $s1, $w0, $w1
113 %cmp_lhs:fpr(s32) = COPY $s0
114 %cmp_rhs:fpr(s32) = COPY $s1
115 %fcmp:gpr(s32) = G_FCMP floatpred(oge), %cmp_lhs(s32), %cmp_rhs
116 %trunc:gpr(s1) = G_TRUNC %fcmp(s32)
117 G_BRCOND %trunc(s1), %bb.2
121 RET_ReallyLR implicit $s0
124 RET_ReallyLR implicit $s1
130 regBankSelected: true
131 tracksRegLiveness: true
133 ; CHECK-LABEL: name: olt
135 ; CHECK: successors: %bb.1(0x50000000), %bb.2(0x30000000)
136 ; CHECK: liveins: $s0, $s1, $w0, $w1
137 ; CHECK: %cmp_lhs:fpr32 = COPY $s0
138 ; CHECK: %cmp_rhs:fpr32 = COPY $s1
139 ; CHECK: FCMPSrr %cmp_lhs, %cmp_rhs, implicit-def $nzcv
140 ; CHECK: Bcc 4, %bb.2, implicit $nzcv
143 ; CHECK: $s0 = COPY %cmp_lhs
144 ; CHECK: RET_ReallyLR implicit $s0
146 ; CHECK: $s1 = COPY %cmp_rhs
147 ; CHECK: RET_ReallyLR implicit $s1
149 successors: %bb.1(0x50000000), %bb.2(0x30000000)
150 liveins: $s0, $s1, $w0, $w1
152 %cmp_lhs:fpr(s32) = COPY $s0
153 %cmp_rhs:fpr(s32) = COPY $s1
154 %fcmp:gpr(s32) = G_FCMP floatpred(olt), %cmp_lhs(s32), %cmp_rhs
155 %trunc:gpr(s1) = G_TRUNC %fcmp(s32)
156 G_BRCOND %trunc(s1), %bb.2
160 RET_ReallyLR implicit $s0
163 RET_ReallyLR implicit $s1
169 regBankSelected: true
170 tracksRegLiveness: true
172 ; CHECK-LABEL: name: ole
174 ; CHECK: successors: %bb.1(0x50000000), %bb.2(0x30000000)
175 ; CHECK: liveins: $s0, $s1, $w0, $w1
176 ; CHECK: %cmp_lhs:fpr32 = COPY $s0
177 ; CHECK: %cmp_rhs:fpr32 = COPY $s1
178 ; CHECK: FCMPSrr %cmp_lhs, %cmp_rhs, implicit-def $nzcv
179 ; CHECK: Bcc 9, %bb.2, implicit $nzcv
182 ; CHECK: $s0 = COPY %cmp_lhs
183 ; CHECK: RET_ReallyLR implicit $s0
185 ; CHECK: $s1 = COPY %cmp_rhs
186 ; CHECK: RET_ReallyLR implicit $s1
188 successors: %bb.1(0x50000000), %bb.2(0x30000000)
189 liveins: $s0, $s1, $w0, $w1
191 %cmp_lhs:fpr(s32) = COPY $s0
192 %cmp_rhs:fpr(s32) = COPY $s1
193 %fcmp:gpr(s32) = G_FCMP floatpred(ole), %cmp_lhs(s32), %cmp_rhs
194 %trunc:gpr(s1) = G_TRUNC %fcmp(s32)
195 G_BRCOND %trunc(s1), %bb.2
199 RET_ReallyLR implicit $s0
202 RET_ReallyLR implicit $s1
208 regBankSelected: true
209 tracksRegLiveness: true
211 ; CHECK-LABEL: name: one
213 ; CHECK: successors: %bb.1(0x50000000), %bb.2(0x30000000)
214 ; CHECK: liveins: $s0, $s1, $w0, $w1
215 ; CHECK: %cmp_lhs:fpr32 = COPY $s0
216 ; CHECK: %cmp_rhs:fpr32 = COPY $s1
217 ; CHECK: FCMPSrr %cmp_lhs, %cmp_rhs, implicit-def $nzcv
218 ; CHECK: Bcc 4, %bb.2, implicit $nzcv
219 ; CHECK: Bcc 12, %bb.2, implicit $nzcv
222 ; CHECK: $s0 = COPY %cmp_lhs
223 ; CHECK: RET_ReallyLR implicit $s0
225 ; CHECK: $s1 = COPY %cmp_rhs
226 ; CHECK: RET_ReallyLR implicit $s1
228 successors: %bb.1(0x50000000), %bb.2(0x30000000)
229 liveins: $s0, $s1, $w0, $w1
231 %cmp_lhs:fpr(s32) = COPY $s0
232 %cmp_rhs:fpr(s32) = COPY $s1
233 %fcmp:gpr(s32) = G_FCMP floatpred(one), %cmp_lhs(s32), %cmp_rhs
234 %trunc:gpr(s1) = G_TRUNC %fcmp(s32)
235 G_BRCOND %trunc(s1), %bb.2
239 RET_ReallyLR implicit $s0
242 RET_ReallyLR implicit $s1
248 regBankSelected: true
249 tracksRegLiveness: true
251 ; CHECK-LABEL: name: ord
253 ; CHECK: successors: %bb.1(0x50000000), %bb.2(0x30000000)
254 ; CHECK: liveins: $s0, $s1, $w0, $w1
255 ; CHECK: %cmp_lhs:fpr32 = COPY $s0
256 ; CHECK: %cmp_rhs:fpr32 = COPY $s1
257 ; CHECK: FCMPSrr %cmp_lhs, %cmp_rhs, implicit-def $nzcv
258 ; CHECK: Bcc 7, %bb.2, implicit $nzcv
261 ; CHECK: $s0 = COPY %cmp_lhs
262 ; CHECK: RET_ReallyLR implicit $s0
264 ; CHECK: $s1 = COPY %cmp_rhs
265 ; CHECK: RET_ReallyLR implicit $s1
267 successors: %bb.1(0x50000000), %bb.2(0x30000000)
268 liveins: $s0, $s1, $w0, $w1
270 %cmp_lhs:fpr(s32) = COPY $s0
271 %cmp_rhs:fpr(s32) = COPY $s1
272 %fcmp:gpr(s32) = G_FCMP floatpred(ord), %cmp_lhs(s32), %cmp_rhs
273 %trunc:gpr(s1) = G_TRUNC %fcmp(s32)
274 G_BRCOND %trunc(s1), %bb.2
278 RET_ReallyLR implicit $s0
281 RET_ReallyLR implicit $s1
287 regBankSelected: true
288 tracksRegLiveness: true
290 ; CHECK-LABEL: name: uno
292 ; CHECK: successors: %bb.1(0x50000000), %bb.2(0x30000000)
293 ; CHECK: liveins: $s0, $s1, $w0, $w1
294 ; CHECK: %cmp_lhs:fpr32 = COPY $s0
295 ; CHECK: %cmp_rhs:fpr32 = COPY $s1
296 ; CHECK: FCMPSrr %cmp_lhs, %cmp_rhs, implicit-def $nzcv
297 ; CHECK: Bcc 6, %bb.2, implicit $nzcv
300 ; CHECK: $s0 = COPY %cmp_lhs
301 ; CHECK: RET_ReallyLR implicit $s0
303 ; CHECK: $s1 = COPY %cmp_rhs
304 ; CHECK: RET_ReallyLR implicit $s1
306 successors: %bb.1(0x50000000), %bb.2(0x30000000)
307 liveins: $s0, $s1, $w0, $w1
309 %cmp_lhs:fpr(s32) = COPY $s0
310 %cmp_rhs:fpr(s32) = COPY $s1
311 %fcmp:gpr(s32) = G_FCMP floatpred(uno), %cmp_lhs(s32), %cmp_rhs
312 %trunc:gpr(s1) = G_TRUNC %fcmp(s32)
313 G_BRCOND %trunc(s1), %bb.2
317 RET_ReallyLR implicit $s0
320 RET_ReallyLR implicit $s1
326 regBankSelected: true
327 tracksRegLiveness: true
329 ; CHECK-LABEL: name: ueq
331 ; CHECK: successors: %bb.1(0x50000000), %bb.2(0x30000000)
332 ; CHECK: liveins: $s0, $s1, $w0, $w1
333 ; CHECK: %cmp_lhs:fpr32 = COPY $s0
334 ; CHECK: %cmp_rhs:fpr32 = COPY $s1
335 ; CHECK: FCMPSrr %cmp_lhs, %cmp_rhs, implicit-def $nzcv
336 ; CHECK: Bcc 0, %bb.2, implicit $nzcv
337 ; CHECK: Bcc 6, %bb.2, implicit $nzcv
340 ; CHECK: $s0 = COPY %cmp_lhs
341 ; CHECK: RET_ReallyLR implicit $s0
343 ; CHECK: $s1 = COPY %cmp_rhs
344 ; CHECK: RET_ReallyLR implicit $s1
346 successors: %bb.1(0x50000000), %bb.2(0x30000000)
347 liveins: $s0, $s1, $w0, $w1
349 %cmp_lhs:fpr(s32) = COPY $s0
350 %cmp_rhs:fpr(s32) = COPY $s1
351 %fcmp:gpr(s32) = G_FCMP floatpred(ueq), %cmp_lhs(s32), %cmp_rhs
352 %trunc:gpr(s1) = G_TRUNC %fcmp(s32)
353 G_BRCOND %trunc(s1), %bb.2
357 RET_ReallyLR implicit $s0
360 RET_ReallyLR implicit $s1
366 regBankSelected: true
367 tracksRegLiveness: true
369 ; CHECK-LABEL: name: ugt
371 ; CHECK: successors: %bb.1(0x50000000), %bb.2(0x30000000)
372 ; CHECK: liveins: $s0, $s1, $w0, $w1
373 ; CHECK: %cmp_lhs:fpr32 = COPY $s0
374 ; CHECK: %cmp_rhs:fpr32 = COPY $s1
375 ; CHECK: FCMPSrr %cmp_lhs, %cmp_rhs, implicit-def $nzcv
376 ; CHECK: Bcc 8, %bb.2, implicit $nzcv
379 ; CHECK: $s0 = COPY %cmp_lhs
380 ; CHECK: RET_ReallyLR implicit $s0
382 ; CHECK: $s1 = COPY %cmp_rhs
383 ; CHECK: RET_ReallyLR implicit $s1
385 successors: %bb.1(0x50000000), %bb.2(0x30000000)
386 liveins: $s0, $s1, $w0, $w1
388 %cmp_lhs:fpr(s32) = COPY $s0
389 %cmp_rhs:fpr(s32) = COPY $s1
390 %fcmp:gpr(s32) = G_FCMP floatpred(ugt), %cmp_lhs(s32), %cmp_rhs
391 %trunc:gpr(s1) = G_TRUNC %fcmp(s32)
392 G_BRCOND %trunc(s1), %bb.2
396 RET_ReallyLR implicit $s0
399 RET_ReallyLR implicit $s1
405 regBankSelected: true
406 tracksRegLiveness: true
408 ; CHECK-LABEL: name: uge
410 ; CHECK: successors: %bb.1(0x50000000), %bb.2(0x30000000)
411 ; CHECK: liveins: $s0, $s1, $w0, $w1
412 ; CHECK: %cmp_lhs:fpr32 = COPY $s0
413 ; CHECK: %cmp_rhs:fpr32 = COPY $s1
414 ; CHECK: FCMPSrr %cmp_lhs, %cmp_rhs, implicit-def $nzcv
415 ; CHECK: Bcc 5, %bb.2, implicit $nzcv
418 ; CHECK: $s0 = COPY %cmp_lhs
419 ; CHECK: RET_ReallyLR implicit $s0
421 ; CHECK: $s1 = COPY %cmp_rhs
422 ; CHECK: RET_ReallyLR implicit $s1
424 successors: %bb.1(0x50000000), %bb.2(0x30000000)
425 liveins: $s0, $s1, $w0, $w1
427 %cmp_lhs:fpr(s32) = COPY $s0
428 %cmp_rhs:fpr(s32) = COPY $s1
429 %fcmp:gpr(s32) = G_FCMP floatpred(uge), %cmp_lhs(s32), %cmp_rhs
430 %trunc:gpr(s1) = G_TRUNC %fcmp(s32)
431 G_BRCOND %trunc(s1), %bb.2
435 RET_ReallyLR implicit $s0
438 RET_ReallyLR implicit $s1
444 regBankSelected: true
445 tracksRegLiveness: true
447 ; CHECK-LABEL: name: ult
449 ; CHECK: successors: %bb.1(0x50000000), %bb.2(0x30000000)
450 ; CHECK: liveins: $s0, $s1, $w0, $w1
451 ; CHECK: %cmp_lhs:fpr32 = COPY $s0
452 ; CHECK: %cmp_rhs:fpr32 = COPY $s1
453 ; CHECK: FCMPSrr %cmp_lhs, %cmp_rhs, implicit-def $nzcv
454 ; CHECK: Bcc 11, %bb.2, implicit $nzcv
457 ; CHECK: $s0 = COPY %cmp_lhs
458 ; CHECK: RET_ReallyLR implicit $s0
460 ; CHECK: $s1 = COPY %cmp_rhs
461 ; CHECK: RET_ReallyLR implicit $s1
463 successors: %bb.1(0x50000000), %bb.2(0x30000000)
464 liveins: $s0, $s1, $w0, $w1
466 %cmp_lhs:fpr(s32) = COPY $s0
467 %cmp_rhs:fpr(s32) = COPY $s1
468 %fcmp:gpr(s32) = G_FCMP floatpred(ult), %cmp_lhs(s32), %cmp_rhs
469 %trunc:gpr(s1) = G_TRUNC %fcmp(s32)
470 G_BRCOND %trunc(s1), %bb.2
474 RET_ReallyLR implicit $s0
477 RET_ReallyLR implicit $s1
483 regBankSelected: true
484 tracksRegLiveness: true
486 ; CHECK-LABEL: name: ule
488 ; CHECK: successors: %bb.1(0x50000000), %bb.2(0x30000000)
489 ; CHECK: liveins: $s0, $s1, $w0, $w1
490 ; CHECK: %cmp_lhs:fpr32 = COPY $s0
491 ; CHECK: %cmp_rhs:fpr32 = COPY $s1
492 ; CHECK: FCMPSrr %cmp_lhs, %cmp_rhs, implicit-def $nzcv
493 ; CHECK: Bcc 13, %bb.2, implicit $nzcv
496 ; CHECK: $s0 = COPY %cmp_lhs
497 ; CHECK: RET_ReallyLR implicit $s0
499 ; CHECK: $s1 = COPY %cmp_rhs
500 ; CHECK: RET_ReallyLR implicit $s1
502 successors: %bb.1(0x50000000), %bb.2(0x30000000)
503 liveins: $s0, $s1, $w0, $w1
505 %cmp_lhs:fpr(s32) = COPY $s0
506 %cmp_rhs:fpr(s32) = COPY $s1
507 %fcmp:gpr(s32) = G_FCMP floatpred(ule), %cmp_lhs(s32), %cmp_rhs
508 %trunc:gpr(s1) = G_TRUNC %fcmp(s32)
509 G_BRCOND %trunc(s1), %bb.2
513 RET_ReallyLR implicit $s0
516 RET_ReallyLR implicit $s1
522 regBankSelected: true
523 tracksRegLiveness: true
525 ; CHECK-LABEL: name: une
527 ; CHECK: successors: %bb.1(0x50000000), %bb.2(0x30000000)
528 ; CHECK: liveins: $s0, $s1, $w0, $w1
529 ; CHECK: %cmp_lhs:fpr32 = COPY $s0
530 ; CHECK: %cmp_rhs:fpr32 = COPY $s1
531 ; CHECK: FCMPSrr %cmp_lhs, %cmp_rhs, implicit-def $nzcv
532 ; CHECK: Bcc 1, %bb.2, implicit $nzcv
535 ; CHECK: $s0 = COPY %cmp_lhs
536 ; CHECK: RET_ReallyLR implicit $s0
538 ; CHECK: $s1 = COPY %cmp_rhs
539 ; CHECK: RET_ReallyLR implicit $s1
541 successors: %bb.1(0x50000000), %bb.2(0x30000000)
542 liveins: $s0, $s1, $w0, $w1
544 %cmp_lhs:fpr(s32) = COPY $s0
545 %cmp_rhs:fpr(s32) = COPY $s1
546 %fcmp:gpr(s32) = G_FCMP floatpred(une), %cmp_lhs(s32), %cmp_rhs
547 %trunc:gpr(s1) = G_TRUNC %fcmp(s32)
548 G_BRCOND %trunc(s1), %bb.2
552 RET_ReallyLR implicit $s0
555 RET_ReallyLR implicit $s1