From 9ab816e6e9625bbbf3e5d6656b2eac821f8a1845 Mon Sep 17 00:00:00 2001 From: Fiora Date: Wed, 17 Sep 2014 21:43:44 -0700 Subject: [PATCH] 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. --- Source/Core/Core/PowerPC/Jit64/Jit_Paired.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_Paired.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_Paired.cpp index f148285468..f08fb6b863 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit_Paired.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit_Paired.cpp @@ -43,10 +43,11 @@ void Jit64::ps_sel(UGeckoInstruction inst) if (cpu_info.bSSE4_1) { - PXOR(XMM0, R(XMM0)); - CMPPD(XMM0, fpr.R(a), LT); // XMM0 = XMM0 >= 0 ? all 1s : all 0s - MOVAPD(XMM1, fpr.R(b)); - BLENDVPD(XMM1, fpr.R(c)); + MOVAPD(XMM0, fpr.R(a)); + PXOR(XMM1, R(XMM1)); + CMPPD(XMM0, R(XMM1), LT); // XMM0 = XMM0 < 0 ? all 1s : all 0s + MOVAPD(XMM1, fpr.R(c)); + BLENDVPD(XMM1, fpr.R(b)); } else {