JitArm64: Implement divwux

This commit is contained in:
degasus 2015-08-23 12:11:21 +02:00
parent 9e4366963c
commit 4722a69fd0
3 changed files with 31 additions and 2 deletions

View File

@ -103,6 +103,7 @@ public:
void subfcx(UGeckoInstruction inst);
void subfic(UGeckoInstruction inst);
void addex(UGeckoInstruction inst);
void divwux(UGeckoInstruction inst);
// System Registers
void mtmsr(UGeckoInstruction inst);

View File

@ -935,6 +935,34 @@ void JitArm64::addcx(UGeckoInstruction inst)
}
}
void JitArm64::divwux(UGeckoInstruction inst)
{
INSTRUCTION_START
JITDISABLE(bJITIntegerOff);
FALLBACK_IF(inst.OE);
int a = inst.RA, b = inst.RB, d = inst.RD;
if (gpr.IsImm(a) && gpr.IsImm(b))
{
u32 i = gpr.GetImm(a), j = gpr.GetImm(b);
gpr.SetImmediate(d, j == 0 ? 0 : i / j);
if (inst.Rc)
ComputeRC(gpr.GetImm(d), 0);
}
else
{
gpr.BindToRegister(d, d == a || d == b);
// d = a / b
UDIV(gpr.R(d), gpr.R(a), gpr.R(b));
if (inst.Rc)
ComputeRC(gpr.R(d), 0);
}
}
void JitArm64::slwx(UGeckoInstruction inst)
{
INSTRUCTION_START

View File

@ -182,8 +182,8 @@ static GekkoOPTemplate table31[] =
{714, &JitArm64::addzex}, // addzeox
{491, &JitArm64::FallBackToInterpreter}, // divwx
{1003, &JitArm64::FallBackToInterpreter}, // divwox
{459, &JitArm64::FallBackToInterpreter}, // divwux
{971, &JitArm64::FallBackToInterpreter}, // divwuox
{459, &JitArm64::divwux}, // divwux
{971, &JitArm64::divwux}, // divwuox
{75, &JitArm64::FallBackToInterpreter}, // mulhwx
{11, &JitArm64::FallBackToInterpreter}, // mulhwux
{235, &JitArm64::mullwx}, // mullwx