1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00

Restore getInvertedCondCode() from the phased-out backend, fixing disassembly for NV

llvm-svn: 209803
This commit is contained in:
Artyom Skrobov 2014-05-29 11:34:50 +00:00
parent ec5776d81a
commit f8a8cd09c7
2 changed files with 7 additions and 19 deletions

View File

@ -233,23 +233,9 @@ inline static const char *getCondCodeName(CondCode Code) {
}
inline static CondCode getInvertedCondCode(CondCode Code) {
switch (Code) {
default: llvm_unreachable("Unknown condition code");
case EQ: return NE;
case NE: return EQ;
case HS: return LO;
case LO: return HS;
case MI: return PL;
case PL: return MI;
case VS: return VC;
case VC: return VS;
case HI: return LS;
case LS: return HI;
case GE: return LT;
case LT: return GE;
case GT: return LE;
case LE: return GT;
}
// To reverse a condition it's necessary to only invert the low bit:
return static_cast<CondCode>(static_cast<unsigned>(Code) ^ 0x1);
}
/// Given a condition code, return NZCV flags that would satisfy that condition.

View File

@ -965,16 +965,18 @@
# CHECK: cinv w3, w5, gt
# CHECK: cinv wzr, w4, le
# CHECK: csetm w9, lt
# CHECK: csetm w9, lt
# CHECK: cinv x3, x5, gt
# CHECK: cinv xzr, x4, le
# CHECK: csetm x9, lt
# CHECK: csetm x9, lt
# CHECK: cinv x0, x0, nv
0xa3 0xd0 0x85 0x5a
0x9f 0xc0 0x84 0x5a
0xe9 0xa3 0x9f 0x5a
0xa3 0xd0 0x85 0xda
0x9f 0xc0 0x84 0xda
0xe9 0xa3 0x9f 0xda
0x00 0xe0 0x80 0xda
# CHECK: cneg w3, w5, gt
# CHECK: cneg wzr, w4, le