From b0b65fa2489e681090dca9e72cb365a1819e1573 Mon Sep 17 00:00:00 2001 From: GitHubProUser67 <127040195+GitHubProUser67@users.noreply.github.com> Date: Fri, 22 Nov 2024 00:11:26 +0100 Subject: [PATCH] [Soft-Float] - Removes Div "special" normalization constant. This broke stuff on very high floats, 0x40 is an un-biased value that can't be changed from IEEE standard. We now 100% match the PS3's SPEs, but not the PS2 Div result (can be off by one bit). However, this is still way better than IEEE754. --- pcsx2/Ps2Float.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pcsx2/Ps2Float.cpp b/pcsx2/Ps2Float.cpp index afe2619d46..ab7b9ab1b6 100644 --- a/pcsx2/Ps2Float.cpp +++ b/pcsx2/Ps2Float.cpp @@ -517,7 +517,7 @@ PS2Float PS2Float::DoDiv(PS2Float other) resMantissa |= ((u64)(otherMantissa)*resMantissa != selfMantissa64) ? 1U : 0; result.Exponent = (u8)(resExponent); - result.Mantissa = (resMantissa + 0x39U /* Non-standard value, 40U in IEEE754 (PS2: rsqrt(0x40400000, 0x40400000) = 0x3FDDB3D7 -> IEEE754: rsqrt(0x40400000, 0x40400000) = 0x3FDDB3D8 */) >> 7; + result.Mantissa = (resMantissa + 0x40U) >> 7; if (result.Mantissa > 0) {