mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 17:49:48 -06:00
Replace BitUtils with C++20: Counting Zeroes
With the upgrade to C++20, std::countl_zero and std::countr_zero can replace these home-spun implementations from the BitUtil.h library.
This commit is contained in:
@ -209,7 +209,7 @@ void Interpreter::cmpl(UGeckoInstruction inst)
|
||||
|
||||
void Interpreter::cntlzwx(UGeckoInstruction inst)
|
||||
{
|
||||
rGPR[inst.RA] = u32(Common::CountLeadingZeros(rGPR[inst.RS]));
|
||||
rGPR[inst.RA] = u32(std::countl_zero(rGPR[inst.RS]));
|
||||
|
||||
if (inst.Rc)
|
||||
Helper_UpdateCR0(rGPR[inst.RA]);
|
||||
|
@ -2660,7 +2660,7 @@ void Jit64::cntlzwx(UGeckoInstruction inst)
|
||||
|
||||
if (gpr.IsImm(s))
|
||||
{
|
||||
gpr.SetImmediate32(a, Common::CountLeadingZeros(gpr.Imm32(s)));
|
||||
gpr.SetImmediate32(a, static_cast<u32>(std::countl_zero(gpr.Imm32(s))));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -528,7 +528,7 @@ void JitArm64::cntlzwx(UGeckoInstruction inst)
|
||||
|
||||
if (gpr.IsImm(s))
|
||||
{
|
||||
gpr.SetImmediate(a, Common::CountLeadingZeros(gpr.GetImm(s)));
|
||||
gpr.SetImmediate(a, static_cast<u32>(std::countl_zero(gpr.GetImm(s))));
|
||||
if (inst.Rc)
|
||||
ComputeRC0(gpr.GetImm(a));
|
||||
}
|
||||
|
Reference in New Issue
Block a user