[AArch64] Makes some integer instructions more clear what they're doing.

ComputeRC was a bit unclear by using 64bit registers for setting the immediate and then calling SXTW on a 6b4it register which is just a bit obscure.
When the source register is an immediate in cntlzwx, just use the built in GCC function instead of our own implementing for counting leading zeros.
This commit is contained in:
Ryan Houdek 2014-12-02 19:16:03 -06:00
parent 8dfb8d8ad5
commit 71b77f3173
1 changed files with 3 additions and 14 deletions

View File

@ -22,8 +22,8 @@ void JitArm64::ComputeRC(u32 d)
if (gpr.IsImm(d)) if (gpr.IsImm(d))
{ {
MOVI2R(XA, gpr.GetImm(d)); MOVI2R(WA, gpr.GetImm(d));
SXTW(XA, XA); SXTW(XA, WA);
} }
else else
{ {
@ -252,20 +252,9 @@ void JitArm64::cntlzwx(UGeckoInstruction inst)
int s = inst.RS; int s = inst.RS;
if (gpr.IsImm(s)) if (gpr.IsImm(s))
{ gpr.SetImmediate(a, __builtin_clz(gpr.GetImm(s)));
u32 mask = 0x80000000;
u32 i = 0;
for (; i < 32; i++, mask >>= 1)
{
if ((u32)gpr.GetImm(s) & mask)
break;
}
gpr.SetImmediate(a, i);
}
else else
{
CLZ(gpr.R(a), gpr.R(s)); CLZ(gpr.R(a), gpr.R(s));
}
if (inst.Rc) if (inst.Rc)
ComputeRC(a); ComputeRC(a);