Merge pull request #205 from raven02/vscmp-new

Implement Vscmp
This commit is contained in:
Henrik Rydgård
2012-12-20 06:09:06 -08:00
3 changed files with 28 additions and 2 deletions
+26 -1
View File
@@ -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;
+1
View File
@@ -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);
+1 -1
View File
@@ -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),
};