diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_LoadStorePaired.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_LoadStorePaired.cpp index bae5af75ec..9eec8286e9 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit_LoadStorePaired.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit_LoadStorePaired.cpp @@ -5,6 +5,7 @@ // Should give a very noticeable speed boost to paired single heavy code. #include "Core/PowerPC/Jit64/Jit.h" +#include "Core/PowerPC/Interpreter/ExceptionUtils.h" #include "Common/CommonTypes.h" #include "Common/x64Emitter.h" @@ -22,6 +23,17 @@ void Jit64::psq_stXX(UGeckoInstruction inst) INSTRUCTION_START JITDISABLE(bJITLoadStorePairedOff); + auto hid2 = HID2(m_ppc_state); + if (!hid2.LSQE || !hid2.PSE) { + gpr.Flush(); + fpr.Flush(); + MOV(32, PPCSTATE(pc), Imm32(js.compilerPC)); + LOCK(); + OR(32, PPCSTATE(Exceptions), Imm32(EXCEPTION_PROGRAM)); + MOV(32, PPCSTATE_SRR1, Imm32(static_cast(ProgramExceptionCause::IllegalInstruction))); + WriteExceptionExit(); + } + // For performance, the AsmCommon routines assume address translation is on. FALLBACK_IF(!m_ppc_state.msr.DR); @@ -111,6 +123,18 @@ void Jit64::psq_lXX(UGeckoInstruction inst) INSTRUCTION_START JITDISABLE(bJITLoadStorePairedOff); + auto hid2 = HID2(m_ppc_state); + if (!hid2.LSQE || !hid2.PSE) + { + gpr.Flush(); + fpr.Flush(); + MOV(32, PPCSTATE(pc), Imm32(js.compilerPC)); + LOCK(); + OR(32, PPCSTATE(Exceptions), Imm32(EXCEPTION_PROGRAM)); + MOV(32, PPCSTATE_SRR1, Imm32(static_cast(ProgramExceptionCause::IllegalInstruction))); + WriteExceptionExit(); + } + // For performance, the AsmCommon routines assume address translation is on. FALLBACK_IF(!m_ppc_state.msr.DR);