EE: RSQRT.S raised D on every zero divisor

It never looked at the dividend, which is what decides the cause.

Both single-precision tiers move together: the differential fuzzer in
ee_rec_fpu_rsqrt_tests.cpp diffs the interpreter against the fast path
on exactly this operand class, so neither passes alone.
This commit is contained in:
pstef
2026-08-09 11:21:25 +02:00
parent a6a760f194
commit 38e1611862
2 changed files with 23 additions and 7 deletions
+5 -1
View File
@@ -1091,7 +1091,11 @@ void RSQRT_S() {
clearFPUFlags(FPUflagD | FPUflagI);
if ( ( _FtValUl_ & 0x7F800000 ) == 0 ) { // Ft is zero (Denormals are Zero)
_ContVal_ |= FPUflagD | FPUflagSD;
// The dividend decides the cause: zero over zero is invalid, anything
// else over zero is a divide by zero. Same test checkDivideByZero
// makes, so a denormal Fs counts as zero here too.
_ContVal_ |= ( ( _FsValUl_ & 0x7F800000 ) == 0 ) ? ( FPUflagI | FPUflagSI )
: ( FPUflagD | FPUflagSD );
// The EE maximum, and the sign of Fs alone -- no xor, unlike DIV.S:
// rsqrt takes |Ft|, so the divisor has no sign left to contribute by the
// time the division happens. Console rows 59 and 63: rsqrt(+0, -0) is