Merge pull request #209 from raven02/vsocp-new

Implement Vsocp
This commit is contained in:
Henrik Rydgård committed 2012-12-21 04:57:38 -08:00
commit df12802a5a
3 files changed
+25 -1

No files matched your search

+23
View File
@@ -506,6 +506,29 @@ namespace MIPSInt
PC += 4;
EatPrefixes();
}
void Int_Vsocp(u32 op)
{
float s[4], d[4];
int vd = _VD;
int vs = _VS;
VectorSize sz = GetVecSize(op);
ReadVector(s, sz, vs);
ApplySwizzleS(s, sz);
int n=GetNumVectorElements(sz);
float x = s[0];
d[0] = std::min(std::max(0.0f, 1.0f - x), 1.0f);
d[1] = std::min(std::max(0.0f, x), 1.0f);
if (n > 1) {
float y = s[1];
d[2] = std::min(std::max(0.0f, 1.0f - y), 1.0f);
d[3] = std::min(std::max(0.0f, y), 1.0f);
}
ApplyPrefixD(d, sz);
WriteVector(d, sz, vd);
PC += 4;
EatPrefixes();
}
void Int_Vsgn(u32 op)
{
+1
View File
@@ -43,6 +43,7 @@ namespace MIPSInt
void Int_Vavg(u32 op);
void Int_Vfad(u32 op);
void Int_Vocp(u32 op);
void Int_Vsocp(u32 op);
void Int_Vsgn(u32 op);
void Int_Vtfm(u32 op);
void Int_Viim(u32 op);
+1 -1
View File
@@ -691,7 +691,7 @@ MIPSInstruction tableVFPU9[32] = //110100 00010 xxxxx
INSTR("vbfy2", &Jit::Comp_Generic, Dis_Vbfy, Int_Vbfy, IS_VFPU),
//4
INSTR("vocp", &Jit::Comp_Generic, Dis_Vbfy, Int_Vocp, IS_VFPU), // one's complement
INSTR("vsocp", &Jit::Comp_Generic, Dis_Generic, 0, IS_VFPU),
INSTR("vsocp", &Jit::Comp_Generic, Dis_Vbfy, Int_Vsocp, IS_VFPU),
INSTR("vfad", &Jit::Comp_Generic, Dis_Vfad, Int_Vfad, IS_VFPU),
INSTR("vavg", &Jit::Comp_Generic, Dis_Vfad, Int_Vavg, IS_VFPU),
//8