From ab1461facadf522500f9a7577200d159039f3c2c Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 15 May 2016 13:16:03 -0700 Subject: [PATCH] Add prefix handling to vfpu color conv per tests. --- Core/MIPS/IR/IRCompVFPU.cpp | 3 ++- Core/MIPS/MIPSIntVFPU.cpp | 2 ++ Core/MIPS/x86/CompVFPU.cpp | 5 +++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Core/MIPS/IR/IRCompVFPU.cpp b/Core/MIPS/IR/IRCompVFPU.cpp index 676b1d098..dab8e97e7 100644 --- a/Core/MIPS/IR/IRCompVFPU.cpp +++ b/Core/MIPS/IR/IRCompVFPU.cpp @@ -1830,7 +1830,8 @@ namespace MIPSComp { void IRFrontend::Comp_ColorConv(MIPSOpcode op) { CONDITIONAL_DISABLE; - // TODO: Verify if this ignores prefixes? + if (js.HasUnknownPrefix()) + DISABLE; // Vector color conversion // d[N] = ConvertTo16(s[N*2]) | (ConvertTo16(s[N*2+1]) << 16) diff --git a/Core/MIPS/MIPSIntVFPU.cpp b/Core/MIPS/MIPSIntVFPU.cpp index a787e1f76..2d2c8f18f 100644 --- a/Core/MIPS/MIPSIntVFPU.cpp +++ b/Core/MIPS/MIPSIntVFPU.cpp @@ -928,6 +928,7 @@ namespace MIPSInt u32 s[4]; VectorSize sz = V_Quad; ReadVector(reinterpret_cast(s), sz, vs); + ApplySwizzleS(reinterpret_cast(s), sz); u16 colors[4]; for (int i = 0; i < 4; i++) { @@ -965,6 +966,7 @@ namespace MIPSInt colors[i] = col; } u32 ov[2] = {(u32)colors[0] | (colors[1] << 16), (u32)colors[2] | (colors[3] << 16)}; + ApplyPrefixD(reinterpret_cast(ov), V_Pair); WriteVector((const float *)ov, V_Pair, vd); PC += 4; EatPrefixes(); diff --git a/Core/MIPS/x86/CompVFPU.cpp b/Core/MIPS/x86/CompVFPU.cpp index ec95760d5..50176066f 100644 --- a/Core/MIPS/x86/CompVFPU.cpp +++ b/Core/MIPS/x86/CompVFPU.cpp @@ -3468,6 +3468,10 @@ void Jit::Comp_VRot(MIPSOpcode op) { } void Jit::Comp_ColorConv(MIPSOpcode op) { + CONDITIONAL_DISABLE; + if (js.HasUnknownPrefix()) + DISABLE; + int vd = _VD; int vs = _VS; @@ -3485,6 +3489,7 @@ void Jit::Comp_ColorConv(MIPSOpcode op) { u8 sregs[4]; u8 dregs[1]; + // WARNING: Prefixes. GetVectorRegs(sregs, sz, vs); GetVectorRegs(dregs, V_Pair, vd);