Jit64: boolX - Mark locals as const

This commit is contained in:
Sintendo 2021-01-28 23:49:56 +01:00
parent 2d3c7fca8d
commit ecbf6fff74
1 changed files with 7 additions and 7 deletions

View File

@ -664,16 +664,16 @@ void Jit64::boolX(UGeckoInstruction inst)
} }
else if (gpr.IsImm(s) || gpr.IsImm(b)) else if (gpr.IsImm(s) || gpr.IsImm(b))
{ {
auto [i, j] = gpr.IsImm(s) ? std::pair(s, b) : std::pair(b, s); const auto [i, j] = gpr.IsImm(s) ? std::pair(s, b) : std::pair(b, s);
u32 imm = gpr.Imm32(i); u32 imm = gpr.Imm32(i);
bool complement_b = (inst.SUBOP10 == 60 /* andcx */) || (inst.SUBOP10 == 412 /* orcx */); bool complement_b = (inst.SUBOP10 == 60 /* andcx */) || (inst.SUBOP10 == 412 /* orcx */);
bool final_not = (inst.SUBOP10 == 476 /* nandx */) || (inst.SUBOP10 == 124 /* norx */); const bool final_not = (inst.SUBOP10 == 476 /* nandx */) || (inst.SUBOP10 == 124 /* norx */);
bool is_and = (inst.SUBOP10 == 28 /* andx */) || (inst.SUBOP10 == 60 /* andcx */) || const bool is_and = (inst.SUBOP10 == 28 /* andx */) || (inst.SUBOP10 == 60 /* andcx */) ||
(inst.SUBOP10 == 476 /* nandx */); (inst.SUBOP10 == 476 /* nandx */);
bool is_or = (inst.SUBOP10 == 444 /* orx */) || (inst.SUBOP10 == 412 /* orcx */) || const bool is_or = (inst.SUBOP10 == 444 /* orx */) || (inst.SUBOP10 == 412 /* orcx */) ||
(inst.SUBOP10 == 124 /* norx */); (inst.SUBOP10 == 124 /* norx */);
bool is_xor = (inst.SUBOP10 == 316 /* xorx */) || (inst.SUBOP10 == 284 /* eqvx */); const bool is_xor = (inst.SUBOP10 == 316 /* xorx */) || (inst.SUBOP10 == 284 /* eqvx */);
// Precompute complement when possible // Precompute complement when possible
if (complement_b && gpr.IsImm(b) || (inst.SUBOP10 == 284 /* eqvx */)) if (complement_b && gpr.IsImm(b) || (inst.SUBOP10 == 284 /* eqvx */))