Skip to content

Commit

Permalink
Merge pull request #4452 from stenzek/jmp-self-idle-loop
Browse files Browse the repository at this point in the history
Jit64: Treat branch-to-self instruction as an idle loop
  • Loading branch information
degasus committed Nov 16, 2016
2 parents e21aa1d + e83bf57 commit 71be84e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Source/Core/Core/PowerPC/Jit64/Jit_Branch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "Common/CommonTypes.h"
#include "Common/x64Emitter.h"
#include "Core/ConfigManager.h"
#include "Core/CoreTiming.h"
#include "Core/PowerPC/Gekko.h"
#include "Core/PowerPC/Jit64/JitRegCache.h"
#include "Core/PowerPC/PPCAnalyst.h"
Expand Down Expand Up @@ -90,11 +91,12 @@ void Jit64::bx(UGeckoInstruction inst)
#endif
if (destination == js.compilerPC)
{
// PanicAlert("Idle loop detected at %08x", destination);
// CALL(ProtectFunction(&CoreTiming::Idle, 0));
// JMP(Asm::testExceptions, true);
// make idle loops go faster
js.downcountAmount += 8;
ABI_PushRegistersAndAdjustStack({}, 0);
ABI_CallFunction(CoreTiming::Idle);
ABI_PopRegistersAndAdjustStack({}, 0);
MOV(32, PPCSTATE(pc), Imm32(destination));
WriteExceptionExit();
return;
}
WriteExit(destination, inst.LK, js.compilerPC + 4);
}
Expand Down
1 change: 1 addition & 0 deletions Source/Core/Core/PowerPC/JitArm64/JitArm64_Branch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ void JitArm64::bx(UGeckoInstruction inst)
gpr.Unlock(WA);

WriteExceptionExit(js.compilerPC);
return;
}

WriteExit(destination);
Expand Down

0 comments on commit 71be84e

Please sign in to comment.