Jit64: Treat branch-to-self instruction as an idle loop

This commit is contained in:
Stenzek 2016-11-15 00:26:08 +10:00
parent 017ab71fcf
commit c657134c86
1 changed files with 7 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);
} }