mirror of https://github.com/PCSX2/pcsx2.git
iR5900: Use unsigned math for constant prop of add/sub
Signed overflow is undefined.
This commit is contained in:
parent
8d38e97c0b
commit
08ecf3f582
|
@ -57,7 +57,7 @@ REC_FUNC_DEL(SLTU, _Rd_);
|
|||
//// ADD
|
||||
void recADD_const()
|
||||
{
|
||||
g_cpuConstRegs[_Rd_].SD[0] = g_cpuConstRegs[_Rs_].SL[0] + g_cpuConstRegs[_Rt_].SL[0];
|
||||
g_cpuConstRegs[_Rd_].SD[0] = s64(s32(g_cpuConstRegs[_Rs_].UL[0] + g_cpuConstRegs[_Rt_].UL[0]));
|
||||
}
|
||||
|
||||
void recADD_constv(int info, int creg, u32 vreg)
|
||||
|
@ -108,7 +108,7 @@ void recADDU(void)
|
|||
//// DADD
|
||||
void recDADD_const(void)
|
||||
{
|
||||
g_cpuConstRegs[_Rd_].SD[0] = g_cpuConstRegs[_Rs_].SD[0] + g_cpuConstRegs[_Rt_].SD[0];
|
||||
g_cpuConstRegs[_Rd_].UD[0] = g_cpuConstRegs[_Rs_].UD[0] + g_cpuConstRegs[_Rt_].UD[0];
|
||||
}
|
||||
|
||||
void recDADD_constv(int info, int creg, u32 vreg)
|
||||
|
@ -248,7 +248,7 @@ void recDADDU(void)
|
|||
|
||||
void recSUB_const()
|
||||
{
|
||||
g_cpuConstRegs[_Rd_].SD[0] = g_cpuConstRegs[_Rs_].SL[0] - g_cpuConstRegs[_Rt_].SL[0];
|
||||
g_cpuConstRegs[_Rd_].SD[0] = s64(s32(g_cpuConstRegs[_Rs_].UL[0] - g_cpuConstRegs[_Rt_].UL[0]));
|
||||
}
|
||||
|
||||
void recSUB_consts(int info)
|
||||
|
@ -305,7 +305,7 @@ void recSUBU(void)
|
|||
//// DSUB
|
||||
void recDSUB_const()
|
||||
{
|
||||
g_cpuConstRegs[_Rd_].SD[0] = g_cpuConstRegs[_Rs_].SD[0] - g_cpuConstRegs[_Rt_].SD[0];
|
||||
g_cpuConstRegs[_Rd_].UD[0] = g_cpuConstRegs[_Rs_].UD[0] - g_cpuConstRegs[_Rt_].UD[0];
|
||||
}
|
||||
|
||||
void recDSUB_consts(int info)
|
||||
|
|
|
@ -51,7 +51,7 @@ REC_FUNC_DEL(SLTIU, _Rt_);
|
|||
//// ADDI
|
||||
void recADDI_const(void)
|
||||
{
|
||||
g_cpuConstRegs[_Rt_].SD[0] = (s64)(g_cpuConstRegs[_Rs_].SL[0] + (s32)_Imm_);
|
||||
g_cpuConstRegs[_Rt_].SD[0] = s64(s32(g_cpuConstRegs[_Rs_].UL[0] + u32(s32(_Imm_))));
|
||||
}
|
||||
|
||||
void recADDI_(int info)
|
||||
|
@ -86,7 +86,7 @@ void recADDIU()
|
|||
////////////////////////////////////////////////////
|
||||
void recDADDI_const()
|
||||
{
|
||||
g_cpuConstRegs[_Rt_].SD[0] = g_cpuConstRegs[_Rs_].SD[0] + (s64)_Imm_;
|
||||
g_cpuConstRegs[_Rt_].UD[0] = g_cpuConstRegs[_Rs_].UD[0] + u64(s64(_Imm_));
|
||||
}
|
||||
|
||||
void recDADDI_(int info)
|
||||
|
|
Loading…
Reference in New Issue