mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -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:
@ -4,12 +4,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <algorithm>
|
||||
#include <bit>
|
||||
#include <cmath>
|
||||
#include <limits>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
|
||||
#include "Common/BitUtils.h"
|
||||
#include "Common/CommonTypes.h"
|
||||
|
||||
namespace MathUtil
|
||||
@ -193,5 +193,5 @@ float MathFloatVectorSum(const std::vector<float>&);
|
||||
// Rounds down. 0 -> undefined
|
||||
constexpr int IntLog2(u64 val)
|
||||
{
|
||||
return 63 - Common::CountLeadingZeros(val);
|
||||
return 63 - std::countl_zero(val);
|
||||
}
|
||||
|
Reference in New Issue
Block a user