JitArm64: Implement subfic

This commit is contained in:
degasus 2015-08-23 12:00:20 +02:00
parent 95be17772f
commit 9e4366963c
3 changed files with 37 additions and 1 deletions

View File

@ -101,6 +101,7 @@ public:
void rlwimix(UGeckoInstruction inst);
void subfex(UGeckoInstruction inst);
void subfcx(UGeckoInstruction inst);
void subfic(UGeckoInstruction inst);
void addex(UGeckoInstruction inst);
// System Registers

View File

@ -816,6 +816,41 @@ void JitArm64::subfcx(UGeckoInstruction inst)
}
}
void JitArm64::subfic(UGeckoInstruction inst)
{
INSTRUCTION_START
JITDISABLE(bJITIntegerOff);
int a = inst.RA, d = inst.RD;
s32 imm = inst.SIMM_16;
if (gpr.IsImm(a))
{
u32 a_imm = gpr.GetImm(a);
gpr.SetImmediate(d, imm - a_imm);
ComputeCarry(a_imm == 0 || Interpreter::Helper_Carry(imm, 0u - a_imm));
if (inst.Rc)
ComputeRC(gpr.GetImm(d), 0);
}
else
{
gpr.BindToRegister(d, d == a);
// d = imm - a
ARM64Reg WA = gpr.GetReg();
MOVI2R(WA, imm);
SUBS(gpr.R(d), WA, gpr.R(a));
gpr.Unlock(WA);
ComputeCarry();
if (inst.Rc)
ComputeRC(gpr.R(d), 0);
}
}
void JitArm64::addex(UGeckoInstruction inst)
{
INSTRUCTION_START

View File

@ -44,7 +44,7 @@ static GekkoOPTemplate primarytable[] =
{17, &JitArm64::sc}, // sc
{7, &JitArm64::mulli}, // mulli
{8, &JitArm64::FallBackToInterpreter}, // subfic
{8, &JitArm64::subfic}, // subfic
{10, &JitArm64::cmpli}, // cmpli
{11, &JitArm64::cmpi}, // cmpi
{12, &JitArm64::addic}, // addic