Skip to content
Permalink
Browse files
Merge pull request #6977 from lioncash/add
Interpreter_FPUtils: Set FPSCR.VXSNAN if either operand to NI_add() is a signaling NaN
  • Loading branch information
leoetlino committed May 27, 2018
2 parents 8f003f9 + 054c1b3 commit e9ce75c
Showing 1 changed file with 7 additions and 1 deletion.
@@ -137,16 +137,22 @@ inline double NI_div(double a, double b)

inline double NI_add(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_VXISI);
return PPC_NAN;
}

return t;
}

0 comments on commit e9ce75c

Please sign in to comment.