From d7f40afd9d0229fd0c673f80f1e22bb931dc142f Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Thu, 21 Feb 2019 19:02:16 -0800 Subject: [PATCH] interp: Correct vocp prefix handling. Also, guess that vsocp also applies prefixes. See #5549. --- Core/MIPS/ARM/ArmCompVFPU.cpp | 2 -- Core/MIPS/ARM64/Arm64CompVFPU.cpp | 2 -- Core/MIPS/IR/IRCompVFPU.cpp | 5 +++-- Core/MIPS/MIPSIntVFPU.cpp | 5 ++++- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Core/MIPS/ARM/ArmCompVFPU.cpp b/Core/MIPS/ARM/ArmCompVFPU.cpp index 9d2bcfe611e7..dc17a2be787d 100644 --- a/Core/MIPS/ARM/ArmCompVFPU.cpp +++ b/Core/MIPS/ARM/ArmCompVFPU.cpp @@ -2302,8 +2302,6 @@ namespace MIPSComp int n = GetNumVectorElements(sz); u8 sregs[4], dregs[4]; - // Actually, not sure that this instruction accepts an S prefix. We don't apply it in the - // interpreter. But whatever. GetVectorRegsPrefixS(sregs, sz, _VS); GetVectorRegsPrefixD(dregs, sz, _VD); diff --git a/Core/MIPS/ARM64/Arm64CompVFPU.cpp b/Core/MIPS/ARM64/Arm64CompVFPU.cpp index 88ba5df94a3c..a5e6a85fdc06 100644 --- a/Core/MIPS/ARM64/Arm64CompVFPU.cpp +++ b/Core/MIPS/ARM64/Arm64CompVFPU.cpp @@ -1953,8 +1953,6 @@ namespace MIPSComp { int n = GetNumVectorElements(sz); u8 sregs[4], dregs[4]; - // Actually, not sure that this instruction accepts an S prefix. We don't apply it in the - // interpreter. But whatever. GetVectorRegsPrefixS(sregs, sz, _VS); GetVectorRegsPrefixD(dregs, sz, _VD); diff --git a/Core/MIPS/IR/IRCompVFPU.cpp b/Core/MIPS/IR/IRCompVFPU.cpp index 0b61953b3c88..ef5f3d2282f4 100644 --- a/Core/MIPS/IR/IRCompVFPU.cpp +++ b/Core/MIPS/IR/IRCompVFPU.cpp @@ -1840,12 +1840,13 @@ namespace MIPSComp { DISABLE; } + // Vector one's complement + // d[N] = 1.0 - s[N] + VectorSize sz = GetVecSize(op); int n = GetNumVectorElements(sz); u8 sregs[4], dregs[4]; - // Actually, not sure that this instruction accepts an S prefix. We don't apply it in the - // interpreter. But whatever. GetVectorRegsPrefixS(sregs, sz, _VS); GetVectorRegsPrefixD(dregs, sz, _VD); diff --git a/Core/MIPS/MIPSIntVFPU.cpp b/Core/MIPS/MIPSIntVFPU.cpp index 174b21140052..b44cb3a92208 100644 --- a/Core/MIPS/MIPSIntVFPU.cpp +++ b/Core/MIPS/MIPSIntVFPU.cpp @@ -549,6 +549,7 @@ namespace MIPSInt int vs = _VS; VectorSize sz = GetVecSize(op); ReadVector(s, sz, vs); + ApplySwizzleS(s, sz); for (int i = 0; i < GetNumVectorElements(sz); i++) { // Always positive NaN. @@ -567,6 +568,7 @@ namespace MIPSInt int vs = _VS; VectorSize sz = GetVecSize(op); ReadVector(s, sz, vs); + ApplySwizzleS(s, sz); int n = GetNumVectorElements(sz); float x = s[0]; d[0] = nanclamp(1.0f - x, 0.0f, 1.0f); @@ -577,7 +579,8 @@ namespace MIPSInt d[2] = nanclamp(1.0f - y, 0.0f, 1.0f); d[3] = nanclamp(y, 0.0f, 1.0f); outSize = V_Quad; - } + } + ApplyPrefixD(d, sz); WriteVector(d, outSize, vd); PC += 4; EatPrefixes();