Interpreter_FloatingPoint: Unset FPSCR.FI and FPSCR.FR if a division by zero exception occurs in fres and frsqrte

Within the programming environments manual, part of the behavior of a
zero divide exception condition is that FI and FR be cleared.
This commit is contained in:
Lioncash 2018-06-02 20:26:18 -04:00
parent 468efb7243
commit 83774f72ad
1 changed files with 4 additions and 0 deletions

View File

@ -397,6 +397,8 @@ void Interpreter::fresx(UGeckoInstruction inst)
if (b == 0.0)
{
SetFPException(FPSCR_ZX);
FPSCR.FI = 0;
FPSCR.FR = 0;
if (FPSCR.ZE == 0)
compute_result(b);
@ -441,6 +443,8 @@ void Interpreter::frsqrtex(UGeckoInstruction inst)
else if (b == 0.0)
{
SetFPException(FPSCR_ZX);
FPSCR.FI = 0;
FPSCR.FR = 0;
if (FPSCR.ZE == 0)
compute_result(b);