diff options
| author | Markus Wick <degasus@users.noreply.github.com> | 2016-11-16 10:24:29 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-11-16 10:24:29 +0100 |
| commit | 71be84e0740aaad9fa0de759abf84e56dffcd4c6 (patch) | |
| tree | 766725edba6cdb8ca3542f3db38fa443c4f811fe /Source/Core | |
| parent | e21aa1d990b9b6a37f594018b1f035b95f0b85da (diff) | |
| parent | e83bf5705a173e80c2d83d29dab1e41c8a41bd19 (diff) | |
Merge pull request #4452 from stenzek/jmp-self-idle-loop
Jit64: Treat branch-to-self instruction as an idle loop
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Core/PowerPC/Jit64/Jit_Branch.cpp | 12 | ||||
| -rw-r--r-- | Source/Core/Core/PowerPC/JitArm64/JitArm64_Branch.cpp | 1 |
2 files changed, 8 insertions, 5 deletions
diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_Branch.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_Branch.cpp index f83acd8991..ce22493fa4 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit_Branch.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit_Branch.cpp @@ -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" @@ -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); } diff --git a/Source/Core/Core/PowerPC/JitArm64/JitArm64_Branch.cpp b/Source/Core/Core/PowerPC/JitArm64/JitArm64_Branch.cpp index 307ea6e220..7ed396fb77 100644 --- a/Source/Core/Core/PowerPC/JitArm64/JitArm64_Branch.cpp +++ b/Source/Core/Core/PowerPC/JitArm64/JitArm64_Branch.cpp @@ -105,6 +105,7 @@ void JitArm64::bx(UGeckoInstruction inst) gpr.Unlock(WA); WriteExceptionExit(js.compilerPC); + return; } WriteExit(destination); |
