mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-29 01:05:50 +01:00
72e21bc679
According to PEM 3.3.6.1, if a division by zero occurs and FPSCR.ZE is set, then the result of the instruction operation is unchanged (see table 3-13). Similarly, if an invalid operation occurs and FPSCR.VE is set, then the destination should also remain unchanged (see table 3-12). Hardware also matches this behavior. We were handling this for other relevant instructions, but we weren't doing so for the arithmetic instructions. This corrects that. This also alters our NI_* functions to return an FPResult type, which allows us to see which kind of exception in particular is set in exceptional cases. This is necessary for cases like the fdiv instructions, which requires handling both ZE and VE being potentially set.