Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Small improvement to cmpli/cmpi in ARMJit.
  • Loading branch information
Sonicadvance1 committed Feb 27, 2013
1 parent f1d727c commit 9ff704f
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions Source/Core/Core/Src/PowerPC/JitArm32/JitArm_Integer.cpp
Expand Up @@ -193,11 +193,18 @@ void JitArm::cmpi(UGeckoInstruction inst)
JITDISABLE(Integer)

ARMReg RA = gpr.R(inst.RA);
ARMReg rA = gpr.GetReg();
int crf = inst.CRFD;
MOVI2R(rA, inst.SIMM_16);
CMP(RA, rA);
gpr.Unlock(rA);
if (inst.SIMM_16 >= 0 && inst.SIMM_16 < 256)
{
CMP(RA, inst.SIMM_16);
}
else
{
ARMReg rA = gpr.GetReg();
MOVI2R(rA, inst.SIMM_16);
CMP(RA, rA);
gpr.Unlock(rA);
}
ComputeRC(crf);
}
void JitArm::cmpli(UGeckoInstruction inst)
Expand All @@ -208,9 +215,16 @@ void JitArm::cmpli(UGeckoInstruction inst)
ARMReg RA = gpr.R(inst.RA);
ARMReg rA = gpr.GetReg();
int crf = inst.CRFD;
MOVI2R(rA, (u32)inst.UIMM);
CMP(RA, rA);

u32 uimm = (u32)inst.UIMM;
if (uimm < 256)
{
CMP(RA, uimm);
}
else
{
MOVI2R(rA, (u32)inst.UIMM);
CMP(RA, rA);
}
// Unsigned GenerateRC()

MOV(rA, 0x2); // Result == 0
Expand Down

0 comments on commit 9ff704f

Please sign in to comment.