Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Nov 16, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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));

This comment was marked as off-topic.

This comment was marked as off-topic.

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