Merge pull request #4452 from stenzek/jmp-self-idle-loop

Jit64: Treat branch-to-self instruction as an idle loop
This commit is contained in:
Markus Wick 2016-11-16 10:24:29 +01:00 committed by GitHub
commit 71be84e074
2 changed files with 8 additions and 5 deletions

View File

@ -7,6 +7,7 @@
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/x64Emitter.h" #include "Common/x64Emitter.h"
#include "Core/ConfigManager.h" #include "Core/ConfigManager.h"
#include "Core/CoreTiming.h"
#include "Core/PowerPC/Gekko.h" #include "Core/PowerPC/Gekko.h"
#include "Core/PowerPC/Jit64/JitRegCache.h" #include "Core/PowerPC/Jit64/JitRegCache.h"
#include "Core/PowerPC/PPCAnalyst.h" #include "Core/PowerPC/PPCAnalyst.h"
@ -90,11 +91,12 @@ void Jit64::bx(UGeckoInstruction inst)
#endif #endif
if (destination == js.compilerPC) if (destination == js.compilerPC)
{ {
// PanicAlert("Idle loop detected at %08x", destination); ABI_PushRegistersAndAdjustStack({}, 0);
// CALL(ProtectFunction(&CoreTiming::Idle, 0)); ABI_CallFunction(CoreTiming::Idle);
// JMP(Asm::testExceptions, true); ABI_PopRegistersAndAdjustStack({}, 0);
// make idle loops go faster MOV(32, PPCSTATE(pc), Imm32(destination));
js.downcountAmount += 8; WriteExceptionExit();
return;
} }
WriteExit(destination, inst.LK, js.compilerPC + 4); WriteExit(destination, inst.LK, js.compilerPC + 4);
} }

View File

@ -105,6 +105,7 @@ void JitArm64::bx(UGeckoInstruction inst)
gpr.Unlock(WA); gpr.Unlock(WA);
WriteExceptionExit(js.compilerPC); WriteExceptionExit(js.compilerPC);
return;
} }
WriteExit(destination); WriteExit(destination);