From 8a888bad96a9eade941be572667cf2118c575d5d Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 30 Mar 2019 11:19:08 -0700 Subject: [PATCH] interp: Handle abs/neg on nan values better. `fabsf` was altering other bits. --- Core/MIPS/MIPSIntVFPU.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/MIPS/MIPSIntVFPU.cpp b/Core/MIPS/MIPSIntVFPU.cpp index 7c2e4c76cc..19adbdc32b 100644 --- a/Core/MIPS/MIPSIntVFPU.cpp +++ b/Core/MIPS/MIPSIntVFPU.cpp @@ -122,7 +122,7 @@ void ApplyPrefixST(float *r, u32 data, VectorSize size, float invalid = 0.0f) { r[i] = origV[regnum]; if (abs) - r[i] = fabs(r[i]); + ((u32 *)r)[i] = ((u32 *)r)[i] & 0x7FFFFFFF; } else { @@ -130,7 +130,7 @@ void ApplyPrefixST(float *r, u32 data, VectorSize size, float invalid = 0.0f) } if (negate) - r[i] = -r[i]; + ((u32 *)r)[i] = ((u32 *)r)[i] ^ 0x80000000; } }