Implement vrexp2 VFPU opcode

This commit is contained in:
Henrik Rydgard 2012-11-07 15:42:34 +01:00
parent f44a207638
commit a1de133d3e
3 changed files with 21 additions and 1 deletions

View File

@ -515,6 +515,24 @@ namespace MIPSInt
EatPrefixes();
}
void Int_VRexp2(u32 op)
{
float s[4], d[4];
int vd = _VD;
int vs = _VS;
VectorSize sz = GetVecSize(op);
ReadVector(s, sz, vs);
ApplySwizzleS(s, sz);
for (int i = 0; i < GetNumVectorElements(sz); i++)
{
d[i] = 1.0f / expf(s[i] * (float)M_LOG2E);
}
ApplyPrefixD(d, sz);
WriteVector(d, sz, vd);
PC += 4;
EatPrefixes();
}
void Int_Vf2i(u32 op)
{
float s[4];

View File

@ -62,5 +62,6 @@ namespace MIPSInt
void Int_VrndX(u32 op);
void Int_ColorConv(u32 op);
void Int_Vh2f2h(u32 op);
void Int_VRexp2(u32 op);
}

View File

@ -566,7 +566,7 @@ MIPSInstruction tableVFPU7[32] =
{-2},
INSTR("vlgb", &Jit::Comp_Generic, Dis_Generic, 0, IS_VFPU),
//24
{-2}, // Seen in BraveStory, initialization
INSTR("vrexp2", &Jit::Comp_Generic, Dis_Generic, Int_VRexp2, IS_VFPU), // vrexp2 Seen in BraveStory, initialization 110100 00001110000 000 0001 0000 0000
{-2},
INSTR("vus2i", &Jit::Comp_Generic, Dis_Generic, 0, IS_VFPU),
INSTR("vs2i", &Jit::Comp_Generic, Dis_Generic, 0, IS_VFPU),
@ -854,6 +854,7 @@ const MIPSInstruction *MIPSGetInstruction(u32 op)
if (instr->altEncoding == -2)
{
//BAD!!
//ERROR_LOG(CPU, "Invalid instruction %08x in table %i, entry %i", op, (int)encoding, subop);
return 0; //invalid instruction
}
encoding = (MipsEncoding)instr->altEncoding;