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:
Minty-Meeo
2022-10-10 04:03:15 -05:00
parent d853da3b0b
commit 05bebee802
8 changed files with 15 additions and 119 deletions

View File

@ -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]);

View File

@ -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
{

View File

@ -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));
}