JIT: fix regression in ps_sel

My code didn't maintain correct semantics with floating-point NaNs (a < b is
not the same as "not a >= b" in float), which seems to have broken FIFA 12.
This commit is contained in:
Fiora 2014-09-17 21:43:44 -07:00
parent 8b151d6a61
commit 9ab816e6e9
1 changed files with 5 additions and 4 deletions

View File

@ -43,10 +43,11 @@ void Jit64::ps_sel(UGeckoInstruction inst)
if (cpu_info.bSSE4_1) if (cpu_info.bSSE4_1)
{ {
PXOR(XMM0, R(XMM0)); MOVAPD(XMM0, fpr.R(a));
CMPPD(XMM0, fpr.R(a), LT); // XMM0 = XMM0 >= 0 ? all 1s : all 0s PXOR(XMM1, R(XMM1));
MOVAPD(XMM1, fpr.R(b)); CMPPD(XMM0, R(XMM1), LT); // XMM0 = XMM0 < 0 ? all 1s : all 0s
BLENDVPD(XMM1, fpr.R(c)); MOVAPD(XMM1, fpr.R(c));
BLENDVPD(XMM1, fpr.R(b));
} }
else else
{ {