From e104a28b7137c167fc6a32f00b171db47c08531b Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 24 Sep 2023 23:03:25 -0700 Subject: [PATCH] irjit: Handle VDet. --- Core/MIPS/IR/IRCompVFPU.cpp | 15 ++++++++++++++- Core/MIPS/MIPSIntVFPU.cpp | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Core/MIPS/IR/IRCompVFPU.cpp b/Core/MIPS/IR/IRCompVFPU.cpp index e42ac78d25..b6f42b237f 100644 --- a/Core/MIPS/IR/IRCompVFPU.cpp +++ b/Core/MIPS/IR/IRCompVFPU.cpp @@ -1771,7 +1771,20 @@ namespace MIPSComp { // d[0] = s[0]*t[1] - s[1]*t[0] // Note: this operates on two vectors, not a 2x2 matrix. - DISABLE; + VectorSize sz = GetVecSize(op); + if (sz != V_Pair) + DISABLE; + + u8 sregs[4], dregs[4], tregs[4]; + GetVectorRegsPrefixS(sregs, sz, _VS); + GetVectorRegsPrefixT(tregs, sz, _VT); + GetVectorRegsPrefixD(dregs, V_Single, _VD); + + ir.Write(IROp::FMul, IRVTEMP_0, sregs[1], tregs[0]); + ir.Write(IROp::FMul, dregs[0], sregs[0], tregs[1]); + ir.Write(IROp::FSub, dregs[0], dregs[0], IRVTEMP_0); + + ApplyPrefixD(dregs, V_Single, _VD); } void IRFrontend::Comp_Vi2x(MIPSOpcode op) { diff --git a/Core/MIPS/MIPSIntVFPU.cpp b/Core/MIPS/MIPSIntVFPU.cpp index 35d3caa56a..9fcc409419 100644 --- a/Core/MIPS/MIPSIntVFPU.cpp +++ b/Core/MIPS/MIPSIntVFPU.cpp @@ -1446,7 +1446,7 @@ namespace MIPSInt d[0] += s[2] * t[2] + s[3] * t[3]; } - ApplyPrefixD(d, sz); + ApplyPrefixD(d, V_Single); WriteVector(d, V_Single, vd); PC += 4; EatPrefixes();