diff --git a/Core/MIPS/MIPSIntVFPU.cpp b/Core/MIPS/MIPSIntVFPU.cpp index 61f48e55d6..e98ada4bfb 100644 --- a/Core/MIPS/MIPSIntVFPU.cpp +++ b/Core/MIPS/MIPSIntVFPU.cpp @@ -1365,7 +1365,32 @@ namespace MIPSInt PC += 4; EatPrefixes(); } - + + void Int_Vscmp(u32 op) { + int vt = _VT; + int vs = _VS; + int vd = _VD; + VectorSize sz = GetVecSize(op); + float s[4]; + float t[4]; + float d[4]; + ReadVector(s, sz, vs); + ApplySwizzleS(s, sz); + ReadVector(t, sz, vt); + ApplySwizzleT(t, sz); + int n = GetNumVectorElements(sz); + for (int i = 0; i < n ; i++) { + int a=s[i] - t[i]; + if (a > 0) d[i]=1; + else if (a < 0) d[i]=-1; + else d[i]=0; + } + ApplyPrefixD(d, sz); + WriteVector(d, sz, vd); + PC += 4; + EatPrefixes(); + } + void Int_Vsge(u32 op) { int vt = _VT; int vs = _VS; diff --git a/Core/MIPS/MIPSIntVFPU.h b/Core/MIPS/MIPSIntVFPU.h index 422a056d5b..118bf14b28 100644 --- a/Core/MIPS/MIPSIntVFPU.h +++ b/Core/MIPS/MIPSIntVFPU.h @@ -50,6 +50,7 @@ namespace MIPSInt void Int_Vidt(u32 op); void Int_Vcmp(u32 op); void Int_Vminmax(u32 op); + void Int_Vscmp(u32 op); void Int_Vcrs(u32 op); void Int_Vdet(u32 op); void Int_Vcmov(u32 op); diff --git a/Core/MIPS/MIPSTables.cpp b/Core/MIPS/MIPSTables.cpp index bbcce26945..82ff5e8ffb 100644 --- a/Core/MIPS/MIPSTables.cpp +++ b/Core/MIPS/MIPSTables.cpp @@ -506,7 +506,7 @@ MIPSInstruction tableVFPU3[8] = //011011 xxx INSTR("vmin",&Jit::Comp_Generic, Dis_VectorSet3, Int_Vminmax, IS_VFPU), INSTR("vmax",&Jit::Comp_Generic, Dis_VectorSet3, Int_Vminmax, IS_VFPU), {-2}, - INSTR("vscmp",&Jit::Comp_Generic, Dis_Generic, 0, IS_VFPU), + INSTR("vscmp",&Jit::Comp_Generic, Dis_VectorSet3, Int_Vscmp, IS_VFPU), INSTR("vsge",&Jit::Comp_Generic, Dis_VectorSet3, Int_Vsge, IS_VFPU), INSTR("vslt",&Jit::Comp_Generic, Dis_VectorSet3, Int_Vslt, IS_VFPU), };