Skip to content
Permalink
Browse files
Merge pull request #6966 from lioncash/fmul
Interpreter_FPUtils: Set FPSCR.VXSNAN if either operand to NI_mul() is a signaling NaN
  • Loading branch information
leoetlino committed May 26, 2018
2 parents f64cbc8 + 3da751f commit 98e288c
Showing 1 changed file with 5 additions and 1 deletion.
@@ -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;
}

0 comments on commit 98e288c

Please sign in to comment.