Interpreter_Integer: Use Common::CountLeadingZeros in cntlzwx

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

View File

@ -236,17 +236,7 @@ void Interpreter::cmpl(UGeckoInstruction inst)
void Interpreter::cntlzwx(UGeckoInstruction inst)
{
u32 val = rGPR[inst.RS];
u32 mask = 0x80000000;
int i = 0;
for (; i < 32; i++, mask >>= 1)
{
if (val & mask)
break;
}
rGPR[inst.RA] = i;
rGPR[inst.RA] = Common::CountLeadingZeros(rGPR[inst.RS]);
if (inst.Rc)
Helper_UpdateCR0(rGPR[inst.RA]);