From 4ffbe0bbf918af257b10d65300a94030ad109612 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sun, 24 Dec 2023 21:09:33 +1000 Subject: [PATCH] x86/FPU: Always preserve sign in neg.s --- pcsx2/x86/iFPU.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pcsx2/x86/iFPU.cpp b/pcsx2/x86/iFPU.cpp index 5267fcfd71..aacd034ab5 100644 --- a/pcsx2/x86/iFPU.cpp +++ b/pcsx2/x86/iFPU.cpp @@ -1669,7 +1669,10 @@ void recNEG_S_xmm(int info) //xAND(ptr32[&fpuRegs.fprc[31]], ~(FPUflagO|FPUflagU)); // Clear O and U flags xXOR.PS(xRegisterSSE(EEREC_D), ptr[&s_neg[0]]); - ClampValues(EEREC_D); + + // Always preserve sign. Using float clamping here would result in + // +inf to become +fMax instead of -fMax, which is definitely wrong. + fpuFloat3(EEREC_D); } FPURECOMPILE_CONSTCODE(NEG_S, XMMINFO_WRITED | XMMINFO_READS);