Core: improve the accuracy of COP1_S_SUB

This commit is contained in:
zilmar 2023-03-06 20:58:47 +10:30
parent 306f21b5fa
commit 9093b42d47
1 changed files with 15 additions and 1 deletions

View File

@ -2127,8 +2127,22 @@ void R4300iOp::COP1_S_SUB()
{ {
return; return;
} }
_FPCR[31] &= ~0x0003F000;
fesetround(*_RoundingModel);
feclearexcept(FE_ALL_EXCEPT);
if (!CheckFPUInput32(*(float *)_FPR_S[m_Opcode.fs]) || !CheckFPUInput32(*(float *)_FPR_S[m_Opcode.ft]))
{
return;
}
float Result = (*(float *)_FPR_S[m_Opcode.fs] - *(float *)_FPR_S[m_Opcode.ft]);
if (CheckFPUException() || CheckFPUResult32(Result))
{
return;
}
*(uint32_t *)_FPR_S[m_Opcode.fd] = *(uint32_t *)&Result;
fesetround(*_RoundingModel); fesetround(*_RoundingModel);
*(float *)_FPR_S[m_Opcode.fd] = (*(float *)_FPR_S[m_Opcode.fs] - *(float *)_FPR_S[m_Opcode.ft]);
} }
void R4300iOp::COP1_S_MUL() void R4300iOp::COP1_S_MUL()