dolphin/Source/Core
Lioncash 3deadd1fff Interpreter_FPUtils: Correct setting the FPSCR's zero divide exception flag in the 0/0 case
FPSCR[ZX] is the bit defined to represent the zero divide exception
condition bit, and is defined as (according to PowerPC Microprocessor
Family: The Programming Environments Manual for 32 and 64-bit
Microprocessors, which will be referred to as "PEM" for the rest of this
commit message) at section 3.3.6.1:

"
A zero divide exception condition occurs when a divide instructions is
executed with a zero divisor value and a finite, nonzero dividend value
or when a floating reciprocal estimate single (fres) or a floating
reciprocal square root estimate (frsqrte) instruction is executed with a
zero operand value.
"

Note that it states the divisor must be zero and the dividend must be
nonzero in order for ZX to be set. This means that the interpreter was
performing the wrong behavior for the case where 0/0 (with any sign on
the zeros) is performed. We would incorrectly set the ZX bit when only
the VXZDZ bit should be set.

It's also worth pointing out that N/0 (where N is any finite nonzero
value) and 0/0 are not within the same exception class. N/0 is a zero
divide exception case, while 0/0 is considered an invalid operation
exception case, which is also indicated in the PEM section 3.3.6.1 as
well where it lists the criteria for invalid operation exceptions.

Therefore we should only be setting the VXZDZ bit in the 0/0 case, not
VXZDZ and ZX. This was also verified via hardware tests to ensure that
this behavior indeed holds.
2018-05-28 16:00:23 -04:00
..
AudioCommon AudioCommon: Implement WASAPI 2018-05-26 13:08:10 +02:00
Common Common: Move host communication enum to Host.h 2018-05-28 14:34:59 -04:00
Core Interpreter_FPUtils: Correct setting the FPSCR's zero divide exception flag in the 0/0 case 2018-05-28 16:00:23 -04:00
DiscIO ColorUtil: Amend function name casing 2018-05-27 21:04:48 -04:00
DolphinNoGUI Common: Move host communication enum to Host.h 2018-05-28 14:34:59 -04:00
DolphinQt2 Merge pull request #7003 from lioncash/host 2018-05-28 20:57:34 +02:00
DolphinWX Common: Move host communication enum to Host.h 2018-05-28 14:34:59 -04:00
InputCommon THis fixes issue #08 and #16, the rumble test and slider 2018-04-19 17:48:55 -04:00
UICommon UICommon: fix m_cached_files pruning (partial revert of 68152faf43) 2018-05-27 22:15:16 +01:00
Updater Updater: Show error when trying to launch directly 2018-05-05 23:32:08 +02:00
VideoBackends VideoConfig: Add a field for indicating logic op support in the backend 2018-05-26 00:07:20 +10:00
VideoCommon BPMemory: Silence a -Wmissing-braces warning 2018-05-28 14:52:59 -04:00
CMakeLists.txt Moved NoGUI out of DolphinWx. 2017-03-08 01:24:18 -08:00