mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-10 22:49:00 +01:00
Interpreter_FPUtils: Set FPSCR.VXSNAN if either operand to NI_sub is a signaling NaN
If either operand is a signaling NaN, we need to signify this by setting the VXSNAN bit. This fixes NaN flag setting for fsub, fsubs, and ps_sub instructions.
This commit is contained in:
parent
f4c5ceba1c
commit
b18dd442f7
@ -165,16 +165,22 @@ inline double NI_add(double a, double b)
|
|||||||
|
|
||||||
inline double NI_sub(double a, double b)
|
inline double NI_sub(double a, double b)
|
||||||
{
|
{
|
||||||
double t = a - b;
|
const double t = a - b;
|
||||||
|
|
||||||
if (std::isnan(t))
|
if (std::isnan(t))
|
||||||
{
|
{
|
||||||
|
if (Common::IsSNAN(a) || Common::IsSNAN(b))
|
||||||
|
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);
|
||||||
|
|
||||||
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