Permalink
Browse files

Interpreter_FPUtils: Set FPSCR.VXSNAN if either operand to NI_mul() i…

…s a signaling NaN

If either of the operands are signaling NaNs, then an invalid operation
exception needs to be indicated within the FPSCR.

This corrects SNaN flag setting for fmul, fmuls, ps_mul, ps_muls0, and
ps_muls1.
  • Loading branch information...
lioncash committed May 25, 2018
1 parent 3d44dc3 commit 3da751f054eea1da4113be7917c6832835051bd1
Showing with 5 additions and 1 deletion.
  1. +5 −1 Source/Core/Core/PowerPC/Interpreter/Interpreter_FPUtils.h
@@ -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 3da751f

Please sign in to comment.