Permalink
Browse files

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.
  • Loading branch information...
lioncash committed Jun 3, 2018
1 parent 468efb7 commit 83774f72adbdf48f51afe1891ea2c6c4d4c5a65c
Showing with 4 additions and 0 deletions.
  1. +4 −0 Source/Core/Core/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp
@@ -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);

0 comments on commit 83774f7

Please sign in to comment.