mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-08 21:53:31 +01:00
Interpreter: Avoid ppcState global (Interpreter_LoadStorePaired.cpp).
This commit is contained in:
parent
9af8410e4c
commit
514a7af473
@ -310,102 +310,110 @@ static void Helper_Dequantize(PowerPC::PowerPCState* ppcs, u32 addr, u32 instI,
|
|||||||
|
|
||||||
void Interpreter::psq_l(Interpreter& interpreter, UGeckoInstruction inst)
|
void Interpreter::psq_l(Interpreter& interpreter, UGeckoInstruction inst)
|
||||||
{
|
{
|
||||||
if (HID2(PowerPC::ppcState).LSQE == 0)
|
auto& ppc_state = interpreter.m_ppc_state;
|
||||||
|
if (HID2(ppc_state).LSQE == 0)
|
||||||
{
|
{
|
||||||
GenerateProgramException(ProgramExceptionCause::IllegalInstruction);
|
GenerateProgramException(ProgramExceptionCause::IllegalInstruction);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const u32 EA = inst.RA ? (PowerPC::ppcState.gpr[inst.RA] + u32(inst.SIMM_12)) : u32(inst.SIMM_12);
|
const u32 EA = inst.RA ? (ppc_state.gpr[inst.RA] + u32(inst.SIMM_12)) : u32(inst.SIMM_12);
|
||||||
Helper_Dequantize(&PowerPC::ppcState, EA, inst.I, inst.RD, inst.W);
|
Helper_Dequantize(&ppc_state, EA, inst.I, inst.RD, inst.W);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Interpreter::psq_lu(Interpreter& interpreter, UGeckoInstruction inst)
|
void Interpreter::psq_lu(Interpreter& interpreter, UGeckoInstruction inst)
|
||||||
{
|
{
|
||||||
if (HID2(PowerPC::ppcState).LSQE == 0)
|
auto& ppc_state = interpreter.m_ppc_state;
|
||||||
|
if (HID2(ppc_state).LSQE == 0)
|
||||||
{
|
{
|
||||||
GenerateProgramException(ProgramExceptionCause::IllegalInstruction);
|
GenerateProgramException(ProgramExceptionCause::IllegalInstruction);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const u32 EA = PowerPC::ppcState.gpr[inst.RA] + u32(inst.SIMM_12);
|
const u32 EA = ppc_state.gpr[inst.RA] + u32(inst.SIMM_12);
|
||||||
Helper_Dequantize(&PowerPC::ppcState, EA, inst.I, inst.RD, inst.W);
|
Helper_Dequantize(&ppc_state, EA, inst.I, inst.RD, inst.W);
|
||||||
|
|
||||||
if ((PowerPC::ppcState.Exceptions & EXCEPTION_DSI) != 0)
|
if ((ppc_state.Exceptions & EXCEPTION_DSI) != 0)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PowerPC::ppcState.gpr[inst.RA] = EA;
|
ppc_state.gpr[inst.RA] = EA;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Interpreter::psq_st(Interpreter& interpreter, UGeckoInstruction inst)
|
void Interpreter::psq_st(Interpreter& interpreter, UGeckoInstruction inst)
|
||||||
{
|
{
|
||||||
if (HID2(PowerPC::ppcState).LSQE == 0)
|
auto& ppc_state = interpreter.m_ppc_state;
|
||||||
|
if (HID2(ppc_state).LSQE == 0)
|
||||||
{
|
{
|
||||||
GenerateProgramException(ProgramExceptionCause::IllegalInstruction);
|
GenerateProgramException(ProgramExceptionCause::IllegalInstruction);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const u32 EA = inst.RA ? (PowerPC::ppcState.gpr[inst.RA] + u32(inst.SIMM_12)) : u32(inst.SIMM_12);
|
const u32 EA = inst.RA ? (ppc_state.gpr[inst.RA] + u32(inst.SIMM_12)) : u32(inst.SIMM_12);
|
||||||
Helper_Quantize(&PowerPC::ppcState, EA, inst.I, inst.RS, inst.W);
|
Helper_Quantize(&ppc_state, EA, inst.I, inst.RS, inst.W);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Interpreter::psq_stu(Interpreter& interpreter, UGeckoInstruction inst)
|
void Interpreter::psq_stu(Interpreter& interpreter, UGeckoInstruction inst)
|
||||||
{
|
{
|
||||||
if (HID2(PowerPC::ppcState).LSQE == 0)
|
auto& ppc_state = interpreter.m_ppc_state;
|
||||||
|
if (HID2(ppc_state).LSQE == 0)
|
||||||
{
|
{
|
||||||
GenerateProgramException(ProgramExceptionCause::IllegalInstruction);
|
GenerateProgramException(ProgramExceptionCause::IllegalInstruction);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const u32 EA = PowerPC::ppcState.gpr[inst.RA] + u32(inst.SIMM_12);
|
const u32 EA = ppc_state.gpr[inst.RA] + u32(inst.SIMM_12);
|
||||||
Helper_Quantize(&PowerPC::ppcState, EA, inst.I, inst.RS, inst.W);
|
Helper_Quantize(&ppc_state, EA, inst.I, inst.RS, inst.W);
|
||||||
|
|
||||||
if ((PowerPC::ppcState.Exceptions & EXCEPTION_DSI) != 0)
|
if ((ppc_state.Exceptions & EXCEPTION_DSI) != 0)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PowerPC::ppcState.gpr[inst.RA] = EA;
|
ppc_state.gpr[inst.RA] = EA;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Interpreter::psq_lx(Interpreter& interpreter, UGeckoInstruction inst)
|
void Interpreter::psq_lx(Interpreter& interpreter, UGeckoInstruction inst)
|
||||||
{
|
{
|
||||||
const u32 EA = inst.RA ? (PowerPC::ppcState.gpr[inst.RA] + PowerPC::ppcState.gpr[inst.RB]) :
|
auto& ppc_state = interpreter.m_ppc_state;
|
||||||
PowerPC::ppcState.gpr[inst.RB];
|
const u32 EA =
|
||||||
Helper_Dequantize(&PowerPC::ppcState, EA, inst.Ix, inst.RD, inst.Wx);
|
inst.RA ? (ppc_state.gpr[inst.RA] + ppc_state.gpr[inst.RB]) : ppc_state.gpr[inst.RB];
|
||||||
|
Helper_Dequantize(&ppc_state, EA, inst.Ix, inst.RD, inst.Wx);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Interpreter::psq_stx(Interpreter& interpreter, UGeckoInstruction inst)
|
void Interpreter::psq_stx(Interpreter& interpreter, UGeckoInstruction inst)
|
||||||
{
|
{
|
||||||
const u32 EA = inst.RA ? (PowerPC::ppcState.gpr[inst.RA] + PowerPC::ppcState.gpr[inst.RB]) :
|
auto& ppc_state = interpreter.m_ppc_state;
|
||||||
PowerPC::ppcState.gpr[inst.RB];
|
const u32 EA =
|
||||||
Helper_Quantize(&PowerPC::ppcState, EA, inst.Ix, inst.RS, inst.Wx);
|
inst.RA ? (ppc_state.gpr[inst.RA] + ppc_state.gpr[inst.RB]) : ppc_state.gpr[inst.RB];
|
||||||
|
Helper_Quantize(&ppc_state, EA, inst.Ix, inst.RS, inst.Wx);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Interpreter::psq_lux(Interpreter& interpreter, UGeckoInstruction inst)
|
void Interpreter::psq_lux(Interpreter& interpreter, UGeckoInstruction inst)
|
||||||
{
|
{
|
||||||
const u32 EA = PowerPC::ppcState.gpr[inst.RA] + PowerPC::ppcState.gpr[inst.RB];
|
auto& ppc_state = interpreter.m_ppc_state;
|
||||||
Helper_Dequantize(&PowerPC::ppcState, EA, inst.Ix, inst.RD, inst.Wx);
|
const u32 EA = ppc_state.gpr[inst.RA] + ppc_state.gpr[inst.RB];
|
||||||
|
Helper_Dequantize(&ppc_state, EA, inst.Ix, inst.RD, inst.Wx);
|
||||||
|
|
||||||
if ((PowerPC::ppcState.Exceptions & EXCEPTION_DSI) != 0)
|
if ((ppc_state.Exceptions & EXCEPTION_DSI) != 0)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PowerPC::ppcState.gpr[inst.RA] = EA;
|
ppc_state.gpr[inst.RA] = EA;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Interpreter::psq_stux(Interpreter& interpreter, UGeckoInstruction inst)
|
void Interpreter::psq_stux(Interpreter& interpreter, UGeckoInstruction inst)
|
||||||
{
|
{
|
||||||
const u32 EA = PowerPC::ppcState.gpr[inst.RA] + PowerPC::ppcState.gpr[inst.RB];
|
auto& ppc_state = interpreter.m_ppc_state;
|
||||||
Helper_Quantize(&PowerPC::ppcState, EA, inst.Ix, inst.RS, inst.Wx);
|
const u32 EA = ppc_state.gpr[inst.RA] + ppc_state.gpr[inst.RB];
|
||||||
|
Helper_Quantize(&ppc_state, EA, inst.Ix, inst.RS, inst.Wx);
|
||||||
|
|
||||||
if ((PowerPC::ppcState.Exceptions & EXCEPTION_DSI) != 0)
|
if ((ppc_state.Exceptions & EXCEPTION_DSI) != 0)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PowerPC::ppcState.gpr[inst.RA] = EA;
|
ppc_state.gpr[inst.RA] = EA;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user