mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-22 22:05:38 +00:00
CPU/PGXP: sub rd, rs, 0 => move rd, rs
This commit is contained in:
parent
bbac7a60a0
commit
5672b0da95
|
@ -975,6 +975,13 @@ void CPU::PGXP::CPU_SUB(u32 instr, u32 rsVal, u32 rtVal)
|
||||||
Validate(&g_state.pgxp_gpr[rs(instr)], rsVal);
|
Validate(&g_state.pgxp_gpr[rs(instr)], rsVal);
|
||||||
Validate(&g_state.pgxp_gpr[rt(instr)], rtVal);
|
Validate(&g_state.pgxp_gpr[rt(instr)], rtVal);
|
||||||
|
|
||||||
|
PGXP_value ret;
|
||||||
|
if (rtVal == 0)
|
||||||
|
{
|
||||||
|
ret = g_state.pgxp_gpr[rs(instr)];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
// iCB: Only require one valid input
|
// iCB: Only require one valid input
|
||||||
if (((g_state.pgxp_gpr[rt(instr)].flags & VALID_XY) != VALID_XY) !=
|
if (((g_state.pgxp_gpr[rt(instr)].flags & VALID_XY) != VALID_XY) !=
|
||||||
((g_state.pgxp_gpr[rs(instr)].flags & VALID_XY) != VALID_XY))
|
((g_state.pgxp_gpr[rs(instr)].flags & VALID_XY) != VALID_XY))
|
||||||
|
@ -983,8 +990,7 @@ void CPU::PGXP::CPU_SUB(u32 instr, u32 rsVal, u32 rtVal)
|
||||||
MakeValid(&g_state.pgxp_gpr[rt(instr)], rtVal);
|
MakeValid(&g_state.pgxp_gpr[rt(instr)], rtVal);
|
||||||
}
|
}
|
||||||
|
|
||||||
PGXP_value ret = g_state.pgxp_gpr[rs(instr)];
|
ret = g_state.pgxp_gpr[rs(instr)];
|
||||||
|
|
||||||
ret.x = (float)f16Unsign(ret.x);
|
ret.x = (float)f16Unsign(ret.x);
|
||||||
ret.x -= (float)f16Unsign(g_state.pgxp_gpr[rt(instr)].x);
|
ret.x -= (float)f16Unsign(g_state.pgxp_gpr[rt(instr)].x);
|
||||||
|
|
||||||
|
@ -1000,6 +1006,7 @@ void CPU::PGXP::CPU_SUB(u32 instr, u32 rsVal, u32 rtVal)
|
||||||
ret.flags &= (g_state.pgxp_gpr[rt(instr)].flags & VALID_XY) | ~VALID_XY;
|
ret.flags &= (g_state.pgxp_gpr[rt(instr)].flags & VALID_XY) | ~VALID_XY;
|
||||||
|
|
||||||
ret.value = rsVal - rtVal;
|
ret.value = rsVal - rtVal;
|
||||||
|
}
|
||||||
|
|
||||||
if (!(ret.flags & VALID_Z) && (g_state.pgxp_gpr[rt(instr)].flags & VALID_Z))
|
if (!(ret.flags & VALID_Z) && (g_state.pgxp_gpr[rt(instr)].flags & VALID_Z))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue