Jit_Integer: Use Common::CountLeadingZeros in cntlzwx

This commit is contained in:
MerryMage 2020-12-28 01:05:33 +00:00
parent 7e9824611e
commit e415580f54
1 changed files with 1 additions and 8 deletions

View File

@ -1956,14 +1956,7 @@ void Jit64::cntlzwx(UGeckoInstruction inst)
if (gpr.IsImm(s)) if (gpr.IsImm(s))
{ {
u32 mask = 0x80000000; gpr.SetImmediate32(a, Common::CountLeadingZeros(gpr.Imm32(s)));
u32 i = 0;
for (; i < 32; i++, mask >>= 1)
{
if (gpr.Imm32(s) & mask)
break;
}
gpr.SetImmediate32(a, i);
} }
else else
{ {