Skip to content

Commit

Permalink
x86/FPU: Always preserve sign in neg.s
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Dec 24, 2023
1 parent 4608579 commit 601f1d7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pcsx2/x86/iFPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 601f1d7

Please sign in to comment.