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 committed 2022-12-21 04:17:00 -06:00
1 parent d853da3b0b
commit 05bebee802
8 files changed
+15 -119

No files matched your search

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