File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
llvm/lib/Target/AArch64/Utils Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -306,6 +306,36 @@ inline static CondCode getInvertedCondCode(CondCode Code) {
306
306
return static_cast <CondCode>(static_cast <unsigned >(Code) ^ 0x1 );
307
307
}
308
308
309
+ // / getSwappedCondition - assume the flags are set by MI(a,b), return
310
+ // / the condition code if we modify the instructions such that flags are
311
+ // / set by MI(b,a).
312
+ inline static CondCode getSwappedCondition (CondCode CC) {
313
+ switch (CC) {
314
+ default :
315
+ return AL;
316
+ case EQ:
317
+ return EQ;
318
+ case NE:
319
+ return NE;
320
+ case HS:
321
+ return LS;
322
+ case LO:
323
+ return HI;
324
+ case HI:
325
+ return LO;
326
+ case LS:
327
+ return HS;
328
+ case GE:
329
+ return LE;
330
+ case LT:
331
+ return GT;
332
+ case GT:
333
+ return LT;
334
+ case LE:
335
+ return GE;
336
+ }
337
+ }
338
+
309
339
// / Given a condition code, return NZCV flags that would satisfy that condition.
310
340
// / The flag bits are in the format expected by the ccmp instructions.
311
341
// / Note that many different flag settings can satisfy a given condition code,
You can’t perform that action at this time.
0 commit comments