From 42fce74f390d9701b99f16a265c4b84a7d03c820 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 22 Mar 2018 15:20:45 -0400 Subject: [PATCH] Jit_Integer: Handle NOP case where RA == RS for ori ori can be used as a NOP if the two register operands are the same, and the immediate is zero, not only if the two register operands are r0. Also removes the check for !inst.Rc, as ori only has one encoding, and said encoding doesn't even have a record bit in it. --- Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp | 4 ++-- Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp index d7fea23464..333956b202 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp @@ -304,8 +304,8 @@ void Jit64::reg_imm(UGeckoInstruction inst) case 15: // addis regimmop(d, a, false, (u32)inst.SIMM_16 << 16, Add, &XEmitter::ADD); break; - case 24: // ori - if (a == 0 && s == 0 && inst.UIMM == 0 && !inst.Rc) // check for nop + case 24: // ori + if (a == s && inst.UIMM == 0) // check for nop { // Make the nop visible in the generated code. not much use but interesting if we see one. NOP(); diff --git a/Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp b/Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp index 14a9562568..e78c9e984c 100644 --- a/Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp +++ b/Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp @@ -121,8 +121,9 @@ void JitArm64::arith_imm(UGeckoInstruction inst) switch (inst.OPCD) { - case 24: // ori - if (a == 0 && s == 0 && inst.UIMM == 0 && !inst.Rc) // check for nop + case 24: // ori + // check for nop + if (a == s && inst.UIMM == 0) { // NOP return;