Interpreter_FloatingPoint: Clear FPSCR.FI and FPSCR.FR if an SNaN is an input to fres

In the PEM manual, within Table 3-12, which lists what should occur for
invalid operation exceptions, the FPSCR.FI and FPSCR.FR bits are listed
as "Cleared" for when FPSCR.VE is unset and set. So we clear these bits
as well to match hardware behavior.
This commit is contained in:
Lioncash 2018-06-01 19:05:43 -04:00
parent a08ad82ace
commit 179d73ac0d
1 changed files with 2 additions and 0 deletions

View File

@ -404,6 +404,8 @@ void Interpreter::fresx(UGeckoInstruction inst)
else if (Common::IsSNAN(b))
{
SetFPException(FPSCR_VXSNAN);
FPSCR.FI = 0;
FPSCR.FR = 0;
if (FPSCR.VE == 0)
compute_result(b);