From 7e9824611e94eedaaa88e4dc45fe5c5b8d0d2504 Mon Sep 17 00:00:00 2001 From: MerryMage Date: Mon, 28 Dec 2020 01:05:20 +0000 Subject: [PATCH] Interpreter_Integer: Use Common::CountLeadingZeros in cntlzwx --- .../Core/PowerPC/Interpreter/Interpreter_Integer.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/Source/Core/Core/PowerPC/Interpreter/Interpreter_Integer.cpp b/Source/Core/Core/PowerPC/Interpreter/Interpreter_Integer.cpp index 0f57158c98..bd08ae5578 100644 --- a/Source/Core/Core/PowerPC/Interpreter/Interpreter_Integer.cpp +++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter_Integer.cpp @@ -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]);