From 0282fa7adbeea737bfdb8f11570d6d17ea94d47b Mon Sep 17 00:00:00 2001 From: mitaclaw <140017135+mitaclaw@users.noreply.github.com> Date: Sat, 20 Apr 2024 05:16:05 -0700 Subject: [PATCH] CachedInterpreter: Exception Check Callback Micro-Optimization This saves two register pushes / pops. --- .../Core/PowerPC/CachedInterpreter/CachedInterpreter.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Core/Core/PowerPC/CachedInterpreter/CachedInterpreter.cpp b/Source/Core/Core/PowerPC/CachedInterpreter/CachedInterpreter.cpp index 7e740b5de9..82b8058e7a 100644 --- a/Source/Core/Core/PowerPC/CachedInterpreter/CachedInterpreter.cpp +++ b/Source/Core/Core/PowerPC/CachedInterpreter/CachedInterpreter.cpp @@ -135,9 +135,9 @@ s32 CachedInterpreter::CheckFPU(PowerPC::PowerPCState& ppc_state, const CheckHal const auto& [power_pc, downcount] = operands; if (!ppc_state.msr.FP) { + ppc_state.downcount -= downcount; ppc_state.Exceptions |= EXCEPTION_FPU_UNAVAILABLE; power_pc.CheckExceptions(); - ppc_state.downcount -= downcount; return 0; } return sizeof(AnyCallback) + sizeof(operands); @@ -148,8 +148,8 @@ s32 CachedInterpreter::CheckDSI(PowerPC::PowerPCState& ppc_state, const CheckHal const auto& [power_pc, downcount] = operands; if ((ppc_state.Exceptions & EXCEPTION_DSI) != 0) { - power_pc.CheckExceptions(); ppc_state.downcount -= downcount; + power_pc.CheckExceptions(); return 0; } return sizeof(AnyCallback) + sizeof(operands); @@ -161,8 +161,8 @@ s32 CachedInterpreter::CheckProgramException(PowerPC::PowerPCState& ppc_state, const auto& [power_pc, downcount] = operands; if ((ppc_state.Exceptions & EXCEPTION_PROGRAM) != 0) { - power_pc.CheckExceptions(); ppc_state.downcount -= downcount; + power_pc.CheckExceptions(); return 0; } return sizeof(AnyCallback) + sizeof(operands);