From 3677a5035c56072a179fb0f424452b5d8b84ebb7 Mon Sep 17 00:00:00 2001 From: Sintendo Date: Thu, 28 Jan 2021 23:06:00 +0100 Subject: [PATCH] Jit64: boolX - Precompute complement for eqvx In the case of eqvx, the final complement can always be baked directly into the immediate value. Before: 45 8B EF mov r13d,r15d 41 F7 D5 not r13d 41 83 F5 04 xor r13d,4 After: 45 8B EF mov r13d,r15d 41 83 F5 FB xor r13d,0FFFFFFFBh --- Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp index 53a55ccf31..6fadcebb48 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp @@ -668,8 +668,7 @@ void Jit64::boolX(UGeckoInstruction inst) u32 imm = gpr.Imm32(i); bool complement_b = (inst.SUBOP10 == 60 /* andcx */) || (inst.SUBOP10 == 412 /* orcx */); - bool final_not = (inst.SUBOP10 == 476 /* nandx */) || (inst.SUBOP10 == 124 /* norx */) || - (inst.SUBOP10 == 284 /* eqvx */); + bool final_not = (inst.SUBOP10 == 476 /* nandx */) || (inst.SUBOP10 == 124 /* norx */); bool is_and = (inst.SUBOP10 == 28 /* andx */) || (inst.SUBOP10 == 60 /* andcx */) || (inst.SUBOP10 == 476 /* nandx */); bool is_or = (inst.SUBOP10 == 444 /* orx */) || (inst.SUBOP10 == 412 /* orcx */) || @@ -677,7 +676,7 @@ void Jit64::boolX(UGeckoInstruction inst) bool is_xor = (inst.SUBOP10 == 316 /* xorx */) || (inst.SUBOP10 == 284 /* eqvx */); // Precompute complement when possible - if (complement_b && gpr.IsImm(b)) + if (complement_b && gpr.IsImm(b) || (inst.SUBOP10 == 284 /* eqvx */)) { imm = ~imm; complement_b = false; @@ -692,12 +691,6 @@ void Jit64::boolX(UGeckoInstruction inst) if (a != j) MOV(32, Ra, Rj); XOR(32, Ra, Imm32(imm)); - - if (final_not) - { - NOT(32, Ra); - needs_test = true; - } } else if (is_and) {