Merge pull request #6966 from lioncash/fmul

Interpreter_FPUtils: Set FPSCR.VXSNAN if either operand to NI_mul() is a signaling NaN
This commit is contained in:
Léo Lam 2018-05-26 11:43:11 +02:00 committed by GitHub
commit 98e288cb4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -94,13 +94,17 @@ inline double MakeQuiet(double d)
inline double NI_mul(double a, double b)
{
double t = a * b;
const double t = a * b;
if (std::isnan(t))
{
if (Common::IsSNAN(a) || Common::IsSNAN(b))
SetFPException(FPSCR_VXSNAN);
if (std::isnan(a))
return MakeQuiet(a);
if (std::isnan(b))
return MakeQuiet(b);
SetFPException(FPSCR_VXIMZ);
return PPC_NAN;
}