From 782c68cf004c23dff5d1479a2ebcfe00041ccdde Mon Sep 17 00:00:00 2001 From: degasus Date: Sat, 14 May 2016 10:30:17 +0200 Subject: [PATCH] JitArm64: Clean up LWZ idle skipping. --- Source/Core/Core/PowerPC/JitArm64/Jit.cpp | 1 + .../Core/Core/PowerPC/JitArm64/JitArm64_LoadStore.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Source/Core/Core/PowerPC/JitArm64/Jit.cpp b/Source/Core/Core/PowerPC/JitArm64/Jit.cpp index 31031ef70c..903cfe9067 100644 --- a/Source/Core/Core/PowerPC/JitArm64/Jit.cpp +++ b/Source/Core/Core/PowerPC/JitArm64/Jit.cpp @@ -467,6 +467,7 @@ const u8* JitArm64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitB js.compilerPC = ops[i].address; js.op = &ops[i]; js.instructionNumber = i; + js.instructionsLeft = (code_block.m_num_instructions - 1) - i; const GekkoOPInfo *opinfo = ops[i].opinfo; js.downcountAmount += opinfo->numCycles; diff --git a/Source/Core/Core/PowerPC/JitArm64/JitArm64_LoadStore.cpp b/Source/Core/Core/PowerPC/JitArm64/JitArm64_LoadStore.cpp index b5ba689d21..7bdb250c20 100644 --- a/Source/Core/Core/PowerPC/JitArm64/JitArm64_LoadStore.cpp +++ b/Source/Core/Core/PowerPC/JitArm64/JitArm64_LoadStore.cpp @@ -446,11 +446,11 @@ void JitArm64::lXX(UGeckoInstruction inst) // LWZ idle skipping if (SConfig::GetInstance().bSkipIdle && - inst.OPCD == 32 && - (inst.hex & 0xFFFF0000) == 0x800D0000 && - (PowerPC::HostRead_U32(js.compilerPC + 4) == 0x28000000 || - (SConfig::GetInstance().bWii && PowerPC::HostRead_U32(js.compilerPC + 4) == 0x2C000000)) && - PowerPC::HostRead_U32(js.compilerPC + 8) == 0x4182fff8) + inst.OPCD == 32 && MergeAllowedNextInstructions(2) && + (inst.hex & 0xFFFF0000) == 0x800D0000 && // lwz r0, XXXX(r13) + (js.op[1].inst.hex == 0x28000000 || + (SConfig::GetInstance().bWii && js.op[1].inst.hex == 0x2C000000)) && // cmpXwi r0,0 + js.op[2].inst.hex == 0x4182fff8) // beq -8 { // if it's still 0, we can wait until the next event FixupBranch noIdle = CBNZ(gpr.R(d));