JitArm64: Implement subfcx

This commit is contained in:
degasus 2015-08-23 11:22:46 +02:00
parent 550a90e691
commit 025e7c835a
3 changed files with 35 additions and 2 deletions

View File

@ -100,6 +100,7 @@ public:
void slwx(UGeckoInstruction inst);
void rlwimix(UGeckoInstruction inst);
void subfex(UGeckoInstruction inst);
void subfcx(UGeckoInstruction inst);
// System Registers
void mtmsr(UGeckoInstruction inst);

View File

@ -784,6 +784,38 @@ void JitArm64::subfex(UGeckoInstruction inst)
ComputeRC(gpr.R(d), 0);
}
void JitArm64::subfcx(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 a_imm = gpr.GetImm(a), b_imm = gpr.GetImm(b);
gpr.SetImmediate(d, b_imm - a_imm);
ComputeCarry(a_imm == 0 || Interpreter::Helper_Carry(b_imm, 0u - a_imm));
if (inst.Rc)
ComputeRC(gpr.GetImm(d), 0);
}
else
{
gpr.BindToRegister(d, d == a || d == b);
// d = b - a
SUBS(gpr.R(d), gpr.R(b), gpr.R(a));
ComputeCarry();
if (inst.Rc)
ComputeRC(gpr.R(d), 0);
}
}
void JitArm64::addcx(UGeckoInstruction inst)
{
INSTRUCTION_START

View File

@ -192,8 +192,8 @@ static GekkoOPTemplate table31[] =
{616, &JitArm64::negx}, // negox
{40, &JitArm64::subfx}, // subfx
{552, &JitArm64::subfx}, // subfox
{8, &JitArm64::FallBackToInterpreter}, // subfcx
{520, &JitArm64::FallBackToInterpreter}, // subfcox
{8, &JitArm64::subfcx}, // subfcx
{520, &JitArm64::subfcx}, // subfcox
{136, &JitArm64::subfex}, // subfex
{648, &JitArm64::subfex}, // subfeox
{232, &JitArm64::FallBackToInterpreter}, // subfmex