From 69b0b622bebcbd8993bc77e064e7e0fc7d34c19f Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Fri, 16 May 2014 00:36:05 -0700 Subject: [PATCH] armjit: Fix D-prefix sat clamp NAN handling. They should leave NAN alone. --- Core/MIPS/ARM/ArmCompVFPU.cpp | 4 ++-- Core/MIPS/MIPSIntVFPU.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Core/MIPS/ARM/ArmCompVFPU.cpp b/Core/MIPS/ARM/ArmCompVFPU.cpp index e58d394be2..6810d1550e 100644 --- a/Core/MIPS/ARM/ArmCompVFPU.cpp +++ b/Core/MIPS/ARM/ArmCompVFPU.cpp @@ -194,7 +194,7 @@ namespace MIPSComp MOVI2F(S1, 1.0f, SCRATCHREG1); VCMP(fpr.V(vregs[i]), S0); VMRS_APSR(); // Move FP flags from FPSCR to APSR (regular flags). - SetCC(CC_LE); + SetCC(CC_LS); VMOV(fpr.V(vregs[i]), S0); SetCC(CC_AL); VCMP(fpr.V(vregs[i]), S1); @@ -209,7 +209,7 @@ namespace MIPSComp MOVI2F(S1, 1.0f, SCRATCHREG1); VCMP(fpr.V(vregs[i]), S0); VMRS_APSR(); // Move FP flags from FPSCR to APSR (regular flags). - SetCC(CC_LT); + SetCC(CC_LO); VMOV(fpr.V(vregs[i]), S0); SetCC(CC_AL); VCMP(fpr.V(vregs[i]), S1); diff --git a/Core/MIPS/MIPSIntVFPU.cpp b/Core/MIPS/MIPSIntVFPU.cpp index bfbe74150d..a8828144d9 100644 --- a/Core/MIPS/MIPSIntVFPU.cpp +++ b/Core/MIPS/MIPSIntVFPU.cpp @@ -512,7 +512,7 @@ namespace MIPSInt case 0: d[i] = s[i]; break; //vmov case 1: d[i] = fabsf(s[i]); break; //vabs case 2: d[i] = -s[i]; break; //vneg - // vsat0 changes -0.0 to +0.0. + // vsat0 changes -0.0 to +0.0, both retain NAN. case 4: if (s[i] <= 0) d[i] = 0; else {if(s[i] > 1.0f) d[i] = 1.0f; else d[i] = s[i];} break; // vsat0 case 5: if (s[i] < -1.0f) d[i] = -1.0f; else {if(s[i] > 1.0f) d[i] = 1.0f; else d[i] = s[i];} break; // vsat1 case 16: d[i] = 1.0f / s[i]; break; //vrcp