mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-27 08:15:33 +01:00
Interpreter_FPUtils: Set FPSCR.VXSNAN if any operand to NI_msub is a signaling NaN
If any operand is a signaling NaN, we need to signify this by setting the VXSNAN bit. Fixes NaN flag setting for fmsub, fmsubs, fnmsub, fnmsubs, ps_msub, and ps_nmsub instructions.
This commit is contained in:
parent
3ebd713c33
commit
a4cc854351
@ -227,26 +227,37 @@ inline double NI_madd(double a, double c, double b)
|
|||||||
inline double NI_msub(double a, double c, double b)
|
inline double NI_msub(double a, double c, double b)
|
||||||
{
|
{
|
||||||
double t = a * c;
|
double t = a * c;
|
||||||
|
|
||||||
if (std::isnan(t))
|
if (std::isnan(t))
|
||||||
{
|
{
|
||||||
|
if (Common::IsSNAN(a) || Common::IsSNAN(b) || Common::IsSNAN(c))
|
||||||
|
SetFPException(FPSCR_VXSNAN);
|
||||||
|
|
||||||
if (std::isnan(a))
|
if (std::isnan(a))
|
||||||
return MakeQuiet(a);
|
return MakeQuiet(a);
|
||||||
if (std::isnan(b))
|
if (std::isnan(b))
|
||||||
return MakeQuiet(b); // !
|
return MakeQuiet(b); // !
|
||||||
if (std::isnan(c))
|
if (std::isnan(c))
|
||||||
return MakeQuiet(c);
|
return MakeQuiet(c);
|
||||||
|
|
||||||
SetFPException(FPSCR_VXIMZ);
|
SetFPException(FPSCR_VXIMZ);
|
||||||
return PPC_NAN;
|
return PPC_NAN;
|
||||||
}
|
}
|
||||||
|
|
||||||
t -= b;
|
t -= b;
|
||||||
|
|
||||||
if (std::isnan(t))
|
if (std::isnan(t))
|
||||||
{
|
{
|
||||||
|
if (Common::IsSNAN(b))
|
||||||
|
SetFPException(FPSCR_VXSNAN);
|
||||||
|
|
||||||
if (std::isnan(b))
|
if (std::isnan(b))
|
||||||
return MakeQuiet(b);
|
return MakeQuiet(b);
|
||||||
|
|
||||||
SetFPException(FPSCR_VXISI);
|
SetFPException(FPSCR_VXISI);
|
||||||
return PPC_NAN;
|
return PPC_NAN;
|
||||||
}
|
}
|
||||||
|
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user