From 48560135b34b4b9866daa870b3537dbe86eb953f Mon Sep 17 00:00:00 2001 From: "Admiral H. Curtiss" Date: Sat, 18 Dec 2021 06:05:08 +0100 Subject: [PATCH] Jit64: Put the exception exit in twX into farcode. As a byproduct, this fixes the dont_trap jump not having enough available jump distance to its target in some instances (eg. in Not64). --- Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp index 1435863eb5..ac16144d09 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp @@ -2559,9 +2559,11 @@ void Jit64::twX(UGeckoInstruction inst) fixups.push_back(f); } } - FixupBranch dont_trap = J(); + if (!fixups.empty()) { + SwitchToFarCode(); + RCForkGuard gpr_guard = gpr.Fork(); RCForkGuard fpr_guard = fpr.Fork(); @@ -2577,9 +2579,9 @@ void Jit64::twX(UGeckoInstruction inst) fpr.Flush(); WriteExceptionExit(); - } - SetJumpTarget(dont_trap); + SwitchToNearCode(); + } if (!analyzer.HasOption(PPCAnalyst::PPCAnalyzer::OPTION_CONDITIONAL_CONTINUE)) {