diff --git a/Core/MIPS/MIPSIntVFPU.cpp b/Core/MIPS/MIPSIntVFPU.cpp index 1a8912bd50..7ea14a4930 100644 --- a/Core/MIPS/MIPSIntVFPU.cpp +++ b/Core/MIPS/MIPSIntVFPU.cpp @@ -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]; diff --git a/Core/MIPS/MIPSIntVFPU.h b/Core/MIPS/MIPSIntVFPU.h index cae6a5986a..df6ec891ed 100644 --- a/Core/MIPS/MIPSIntVFPU.h +++ b/Core/MIPS/MIPSIntVFPU.h @@ -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); } diff --git a/Core/MIPS/MIPSTables.cpp b/Core/MIPS/MIPSTables.cpp index 35bbca8acb..fd97c9c8b0 100644 --- a/Core/MIPS/MIPSTables.cpp +++ b/Core/MIPS/MIPSTables.cpp @@ -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;