From 1f83fc4e9cc166264949b7d5d39f0bc83943579e Mon Sep 17 00:00:00 2001 From: raven02 Date: Thu, 20 Dec 2012 21:11:21 +0800 Subject: [PATCH] Implement Vdet --- Core/MIPS/MIPSIntVFPU.cpp | 21 ++++++++++++++++++++- Core/MIPS/MIPSIntVFPU.h | 1 + Core/MIPS/MIPSTables.cpp | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/Core/MIPS/MIPSIntVFPU.cpp b/Core/MIPS/MIPSIntVFPU.cpp index b3045b9a4..27d0fe5e5 100644 --- a/Core/MIPS/MIPSIntVFPU.cpp +++ b/Core/MIPS/MIPSIntVFPU.cpp @@ -906,7 +906,26 @@ namespace MIPSInt PC += 4; EatPrefixes(); } - + + void Int_Vdet(u32 op) + { + float s[4], t[4]; + float d[4]; + int vd = _VD; + int vs = _VS; + int vt = _VT; + VectorSize sz = GetVecSize(op); + if (sz != V_Pair) + _dbg_assert_msg_(CPU,0,"Trying to interpret instruction that can't be interpreted"); + ReadVector(s, sz, vs); + ReadVector(t, sz, vt); + d[0] = s[0] * t[1] - s[1] * t[0]; + ApplyPrefixD(d, sz); + WriteVector(d, sz, vd); + PC += 4; + EatPrefixes(); + } + void Int_Vfad(u32 op) { float s[4]; diff --git a/Core/MIPS/MIPSIntVFPU.h b/Core/MIPS/MIPSIntVFPU.h index 50e722936..c75b1ac18 100644 --- a/Core/MIPS/MIPSIntVFPU.h +++ b/Core/MIPS/MIPSIntVFPU.h @@ -50,6 +50,7 @@ namespace MIPSInt void Int_Vcmp(u32 op); void Int_Vminmax(u32 op); void Int_Vcrs(u32 op); + void Int_Vdet(u32 op); void Int_Vcmov(u32 op); void Int_CrossQuat(u32 op); void Int_VPFX(u32 op); diff --git a/Core/MIPS/MIPSTables.cpp b/Core/MIPS/MIPSTables.cpp index 67d9b70e9..c8fffe820 100644 --- a/Core/MIPS/MIPSTables.cpp +++ b/Core/MIPS/MIPSTables.cpp @@ -495,7 +495,7 @@ MIPSInstruction tableVFPU1[8] = INSTR("vhdp",&Jit::Comp_Generic, Dis_Generic, 0, IS_VFPU), {-2}, INSTR("vcrs",&Jit::Comp_Generic, Dis_Vcrs, Int_Vcrs, IS_VFPU), - INSTR("vdet",&Jit::Comp_Generic, Dis_Generic, 0, IS_VFPU), + INSTR("vdet",&Jit::Comp_Generic, Dis_Generic, Int_Vdet, IS_VFPU), {-2}, };