Fixed JIT error with Conjugate/Inverse

These need to be compiler intrinsics since faux types aren't supported with self.
This commit is contained in:
Boondorl 2025-05-28 15:36:20 -04:00 committed by Ricardo Luís Vaz Silva
commit e7d0991798
8 changed files with 54 additions and 39 deletions

View file

@ -1908,6 +1908,13 @@ static int ExecScriptFunc(VMFrameStack *stack, VMReturn *ret, int numret)
reinterpret_cast<DQuaternion&>(reg.f[A]) = q1 * q2;
}
NEXTOP;
OP(CONJQ):
ASSERTF(a + 3); ASSERTF(B + 3);
{
const DQuaternion& q = reinterpret_cast<DQuaternion&>(reg.f[B]);
reinterpret_cast<DQuaternion&>(reg.f[A]) = q.Conjugate();
}
NEXTOP;
OP(ADDA_RR):
ASSERTA(a); ASSERTA(B); ASSERTD(C);
c = reg.d[C];

View file

@ -281,6 +281,7 @@ xx(EQV4_K, beqv4, CVRK, NOP, 0, 0) // this will never be used.
// Quaternion math
xx(MULQQ_RR, mulqq, RVRVRV, NOP, 0, 0) // qA = qB * qC
xx(MULQV3_RR, mulqv3, RVRVRV, NOP, 0, 0) // qA = qB * vC
xx(CONJQ, conjq, RVRVRV, NOP, 0, 0) // qA = qB.Conjugate
// Pointer math.
xx(ADDA_RR, add, RPRPRI, NOP, 0, 0) // pA = pB + dkC