mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 08:09:26 +01:00
DSP LLE Recompiler: Apply saturation to LOOP and BLOOP with $ac0.m and $ac1.m
This commit is contained in:
parent
bc206b7a27
commit
e7f78379ec
@ -286,8 +286,6 @@ private:
|
|||||||
void dsp_op_write_reg_imm(int reg, u16 val);
|
void dsp_op_write_reg_imm(int reg, u16 val);
|
||||||
void dsp_conditional_extend_accum(int reg);
|
void dsp_conditional_extend_accum(int reg);
|
||||||
void dsp_conditional_extend_accum_imm(int reg, u16 val);
|
void dsp_conditional_extend_accum_imm(int reg, u16 val);
|
||||||
void dsp_op_read_reg_dont_saturate(int reg, Gen::X64Reg host_dreg,
|
|
||||||
RegisterExtension extend = RegisterExtension::None);
|
|
||||||
void dsp_op_read_reg(int reg, Gen::X64Reg host_dreg,
|
void dsp_op_read_reg(int reg, Gen::X64Reg host_dreg,
|
||||||
RegisterExtension extend = RegisterExtension::None);
|
RegisterExtension extend = RegisterExtension::None);
|
||||||
|
|
||||||
|
@ -358,8 +358,7 @@ void DSPEmitter::loop(const UDSPInstruction opc)
|
|||||||
{
|
{
|
||||||
u16 reg = opc & 0x1f;
|
u16 reg = opc & 0x1f;
|
||||||
// u16 cnt = g_dsp.r[reg];
|
// u16 cnt = g_dsp.r[reg];
|
||||||
// todo: check if we can use normal variant here
|
dsp_op_read_reg(reg, RDX, RegisterExtension::Zero);
|
||||||
dsp_op_read_reg_dont_saturate(reg, RDX, RegisterExtension::Zero);
|
|
||||||
u16 loop_pc = m_compile_pc + 1;
|
u16 loop_pc = m_compile_pc + 1;
|
||||||
|
|
||||||
TEST(16, R(EDX), R(EDX));
|
TEST(16, R(EDX), R(EDX));
|
||||||
@ -429,8 +428,7 @@ void DSPEmitter::bloop(const UDSPInstruction opc)
|
|||||||
{
|
{
|
||||||
const u16 reg = opc & 0x1f;
|
const u16 reg = opc & 0x1f;
|
||||||
// u16 cnt = g_dsp.r[reg];
|
// u16 cnt = g_dsp.r[reg];
|
||||||
// todo: check if we can use normal variant here
|
dsp_op_read_reg(reg, RDX, RegisterExtension::Zero);
|
||||||
dsp_op_read_reg_dont_saturate(reg, RDX, RegisterExtension::Zero);
|
|
||||||
const u16 loop_pc = m_dsp_core.DSPState().ReadIMEM(m_compile_pc + 1);
|
const u16 loop_pc = m_dsp_core.DSPState().ReadIMEM(m_compile_pc + 1);
|
||||||
|
|
||||||
TEST(16, R(EDX), R(EDX));
|
TEST(16, R(EDX), R(EDX));
|
||||||
|
@ -196,35 +196,6 @@ void DSPEmitter::dsp_conditional_extend_accum_imm(int reg, u16 val)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DSPEmitter::dsp_op_read_reg_dont_saturate(int reg, Gen::X64Reg host_dreg,
|
|
||||||
RegisterExtension extend)
|
|
||||||
{
|
|
||||||
switch (reg & 0x1f)
|
|
||||||
{
|
|
||||||
case DSP_REG_ST0:
|
|
||||||
case DSP_REG_ST1:
|
|
||||||
case DSP_REG_ST2:
|
|
||||||
case DSP_REG_ST3:
|
|
||||||
dsp_reg_load_stack(static_cast<StackRegister>(reg - DSP_REG_ST0), host_dreg);
|
|
||||||
switch (extend)
|
|
||||||
{
|
|
||||||
case RegisterExtension::Sign:
|
|
||||||
MOVSX(64, 16, host_dreg, R(host_dreg));
|
|
||||||
break;
|
|
||||||
case RegisterExtension::Zero:
|
|
||||||
MOVZX(64, 16, host_dreg, R(host_dreg));
|
|
||||||
break;
|
|
||||||
case RegisterExtension::None:
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
default:
|
|
||||||
m_gpr.ReadReg(reg, host_dreg, extend);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void DSPEmitter::dsp_op_read_reg(int reg, Gen::X64Reg host_dreg, RegisterExtension extend)
|
void DSPEmitter::dsp_op_read_reg(int reg, Gen::X64Reg host_dreg, RegisterExtension extend)
|
||||||
{
|
{
|
||||||
switch (reg & 0x1f)
|
switch (reg & 0x1f)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user