Skip to content

Commit

Permalink
Interpreter_FPUtils: Properly update the FPSCR's FEX bit in UpdateFPS…
Browse files Browse the repository at this point in the history
…CR()

FPSCR.FEX is supposed to be a logical OR of all floating-point exception
bits masked by their respective enable bits.

Currently UpdateFPSCR() isn't called by anything in the interpreter
except for mcrfs and mffs, so this doesn't alter existing behavior that much.
However, this will be necessary in future PRs when making the interpreter more
accurate in how it sets flags.
  • Loading branch information
lioncash committed May 7, 2018
1 parent c3d88a6 commit 64d1865
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Source/Core/Core/PowerPC/Interpreter/Interpreter_FPUtils.h
Expand Up @@ -46,7 +46,8 @@ inline void SetFI(int FI)
inline void UpdateFPSCR()
{
FPSCR.VX = (FPSCR.Hex & FPSCR_VX_ANY) != 0;
FPSCR.FEX = 0; // we assume that "?E" bits are always 0
FPSCR.FEX = (FPSCR.VX & FPSCR.VE) | (FPSCR.OX & FPSCR.OE) | (FPSCR.UX & FPSCR.UE) |
(FPSCR.ZX & FPSCR.ZE) | (FPSCR.XX & FPSCR.XE);
}

inline double ForceSingle(double value)
Expand Down

0 comments on commit 64d1865

Please sign in to comment.