Merge pull request #7005 from lioncash/div

Interpreter_FPUtils: Correct setting the FPSCR's zero divide exception flag in the 0/0 case in NI_div()
This commit is contained in:
Mat M 2018-05-31 11:22:45 -04:00 committed by GitHub
commit dd77ace56a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -132,10 +132,17 @@ inline double NI_div(double a, double b)
if (b == 0.0) if (b == 0.0)
{ {
SetFPException(FPSCR_ZX);
if (a == 0.0) if (a == 0.0)
{
SetFPException(FPSCR_VXZDZ); SetFPException(FPSCR_VXZDZ);
} }
else
{
SetFPException(FPSCR_ZX);
FPSCR.FI = 0;
FPSCR.FR = 0;
}
}
else if (std::isinf(a) && std::isinf(b)) else if (std::isinf(a) && std::isinf(b))
{ {
SetFPException(FPSCR_VXIDI); SetFPException(FPSCR_VXIDI);