Small improvement to cmpli/cmpi in ARMJit.

This commit is contained in:
Ryan Houdek 2013-02-27 15:17:23 -06:00
parent f1d727cf13
commit 9ff704f202
1 changed files with 21 additions and 7 deletions

View File

@ -193,11 +193,18 @@ void JitArm::cmpi(UGeckoInstruction inst)
JITDISABLE(Integer) JITDISABLE(Integer)
ARMReg RA = gpr.R(inst.RA); ARMReg RA = gpr.R(inst.RA);
ARMReg rA = gpr.GetReg();
int crf = inst.CRFD; int crf = inst.CRFD;
if (inst.SIMM_16 >= 0 && inst.SIMM_16 < 256)
{
CMP(RA, inst.SIMM_16);
}
else
{
ARMReg rA = gpr.GetReg();
MOVI2R(rA, inst.SIMM_16); MOVI2R(rA, inst.SIMM_16);
CMP(RA, rA); CMP(RA, rA);
gpr.Unlock(rA); gpr.Unlock(rA);
}
ComputeRC(crf); ComputeRC(crf);
} }
void JitArm::cmpli(UGeckoInstruction inst) void JitArm::cmpli(UGeckoInstruction inst)
@ -208,9 +215,16 @@ void JitArm::cmpli(UGeckoInstruction inst)
ARMReg RA = gpr.R(inst.RA); ARMReg RA = gpr.R(inst.RA);
ARMReg rA = gpr.GetReg(); ARMReg rA = gpr.GetReg();
int crf = inst.CRFD; int crf = inst.CRFD;
u32 uimm = (u32)inst.UIMM;
if (uimm < 256)
{
CMP(RA, uimm);
}
else
{
MOVI2R(rA, (u32)inst.UIMM); MOVI2R(rA, (u32)inst.UIMM);
CMP(RA, rA); CMP(RA, rA);
}
// Unsigned GenerateRC() // Unsigned GenerateRC()
MOV(rA, 0x2); // Result == 0 MOV(rA, 0x2); // Result == 0