[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:
parent
8dfb8d8ad5
commit
71b77f3173
|
@ -22,8 +22,8 @@ void JitArm64::ComputeRC(u32 d)
|
|||
|
||||
if (gpr.IsImm(d))
|
||||
{
|
||||
MOVI2R(XA, gpr.GetImm(d));
|
||||
SXTW(XA, XA);
|
||||
MOVI2R(WA, gpr.GetImm(d));
|
||||
SXTW(XA, WA);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -252,20 +252,9 @@ void JitArm64::cntlzwx(UGeckoInstruction inst)
|
|||
int s = inst.RS;
|
||||
|
||||
if (gpr.IsImm(s))
|
||||
{
|
||||
u32 mask = 0x80000000;
|
||||
u32 i = 0;
|
||||
for (; i < 32; i++, mask >>= 1)
|
||||
{
|
||||
if ((u32)gpr.GetImm(s) & mask)
|
||||
break;
|
||||
}
|
||||
gpr.SetImmediate(a, i);
|
||||
}
|
||||
gpr.SetImmediate(a, __builtin_clz(gpr.GetImm(s)));
|
||||
else
|
||||
{
|
||||
CLZ(gpr.R(a), gpr.R(s));
|
||||
}
|
||||
|
||||
if (inst.Rc)
|
||||
ComputeRC(a);
|
||||
|
|
Loading…
Reference in New Issue