[ARM] ps_madds0 and ps_madds1 implementations.

This commit is contained in:
Ryan Houdek 2013-09-14 04:12:57 +00:00
parent 4512813cf9
commit ef2ea31eac
3 changed files with 71 additions and 3 deletions

View File

@ -210,6 +210,8 @@ public:
void ps_sum0(UGeckoInstruction _inst); void ps_sum0(UGeckoInstruction _inst);
void ps_sum1(UGeckoInstruction _inst); void ps_sum1(UGeckoInstruction _inst);
void ps_madd(UGeckoInstruction _inst); void ps_madd(UGeckoInstruction _inst);
void ps_madds0(UGeckoInstruction _inst);
void ps_madds1(UGeckoInstruction _inst);
void ps_sub(UGeckoInstruction _inst); void ps_sub(UGeckoInstruction _inst);
void ps_mul(UGeckoInstruction _inst); void ps_mul(UGeckoInstruction _inst);
void ps_muls0(UGeckoInstruction _inst); void ps_muls0(UGeckoInstruction _inst);

View File

@ -47,7 +47,6 @@ void JitArm::ps_add(UGeckoInstruction inst)
VADD(vD1, vA1, vB1); VADD(vD1, vA1, vB1);
} }
// Wrong, THP videos like SMS and Ikaruga show artifacts
void JitArm::ps_madd(UGeckoInstruction inst) void JitArm::ps_madd(UGeckoInstruction inst)
{ {
INSTRUCTION_START INSTRUCTION_START
@ -83,6 +82,73 @@ void JitArm::ps_madd(UGeckoInstruction inst)
fpr.Unlock(V1); fpr.Unlock(V1);
} }
void JitArm::ps_madds0(UGeckoInstruction inst)
{
INSTRUCTION_START
JITDISABLE(bJITPairedOff)
u32 a = inst.FA, b = inst.FB, c = inst.FC, d = inst.FD;
if (inst.Rc) {
Default(inst); return;
}
ARMReg vA0 = fpr.R0(a);
ARMReg vA1 = fpr.R1(a);
ARMReg vB0 = fpr.R0(b);
ARMReg vB1 = fpr.R1(b);
ARMReg vC0 = fpr.R0(c);
ARMReg vD0 = fpr.R0(d, false);
ARMReg vD1 = fpr.R1(d, false);
ARMReg V0 = fpr.GetReg();
ARMReg V1 = fpr.GetReg();
VMOV(V0, vB0);
VMOV(V1, vB1);
VMLA(V0, vA0, vC0);
VMLA(V1, vA1, vC0);
VMOV(vD0, V0);
VMOV(vD1, V1);
fpr.Unlock(V0);
fpr.Unlock(V1);
}
void JitArm::ps_madds1(UGeckoInstruction inst)
{
INSTRUCTION_START
JITDISABLE(bJITPairedOff)
u32 a = inst.FA, b = inst.FB, c = inst.FC, d = inst.FD;
if (inst.Rc) {
Default(inst); return;
}
ARMReg vA0 = fpr.R0(a);
ARMReg vA1 = fpr.R1(a);
ARMReg vB0 = fpr.R0(b);
ARMReg vB1 = fpr.R1(b);
ARMReg vC1 = fpr.R1(c);
ARMReg vD0 = fpr.R0(d, false);
ARMReg vD1 = fpr.R1(d, false);
ARMReg V0 = fpr.GetReg();
ARMReg V1 = fpr.GetReg();
VMOV(V0, vB0);
VMOV(V1, vB1);
VMLA(V0, vA0, vC1);
VMLA(V1, vA1, vC1);
VMOV(vD0, V0);
VMOV(vD1, V1);
fpr.Unlock(V0);
fpr.Unlock(V1);
}
void JitArm::ps_sum0(UGeckoInstruction inst) void JitArm::ps_sum0(UGeckoInstruction inst)
{ {
INSTRUCTION_START INSTRUCTION_START

View File

@ -147,8 +147,8 @@ static GekkoOPTemplate table4_2[] =
{11, &JitArm::ps_sum1}, //"ps_sum1", OPTYPE_PS, 0}}, {11, &JitArm::ps_sum1}, //"ps_sum1", OPTYPE_PS, 0}},
{12, &JitArm::ps_muls0}, //"ps_muls0", OPTYPE_PS, 0}}, {12, &JitArm::ps_muls0}, //"ps_muls0", OPTYPE_PS, 0}},
{13, &JitArm::ps_muls1}, //"ps_muls1", OPTYPE_PS, 0}}, {13, &JitArm::ps_muls1}, //"ps_muls1", OPTYPE_PS, 0}},
{14, &JitArm::Default}, //"ps_madds0", OPTYPE_PS, 0}}, {14, &JitArm::ps_madds0}, //"ps_madds0", OPTYPE_PS, 0}},
{15, &JitArm::Default}, //"ps_madds1", OPTYPE_PS, 0}}, {15, &JitArm::ps_madds1}, //"ps_madds1", OPTYPE_PS, 0}},
{18, &JitArm::Default}, //"ps_div", OPTYPE_PS, 0, 16}}, {18, &JitArm::Default}, //"ps_div", OPTYPE_PS, 0, 16}},
{20, &JitArm::ps_sub}, //"ps_sub", OPTYPE_PS, 0}}, {20, &JitArm::ps_sub}, //"ps_sub", OPTYPE_PS, 0}},
{21, &JitArm::ps_add}, //"ps_add", OPTYPE_PS, 0}}, {21, &JitArm::ps_add}, //"ps_add", OPTYPE_PS, 0}},