mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-01 21:58:48 +00:00
Common: Move BitSet helper functions into the Common namespace
This commit is contained in:
parent
2ce0f42c14
commit
d68f437e67
2 changed files with 9 additions and 9 deletions
|
@ -7,12 +7,12 @@
|
|||
#include <type_traits>
|
||||
#include "CommonTypes.h"
|
||||
|
||||
// Helper functions:
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
#include <intrin.h>
|
||||
|
||||
namespace Common
|
||||
{
|
||||
template <typename T>
|
||||
constexpr int CountSetBits(T v)
|
||||
{
|
||||
|
@ -49,6 +49,8 @@ inline int LeastSignificantSetBit(u64 val)
|
|||
return (int)index;
|
||||
}
|
||||
#else
|
||||
namespace Common
|
||||
{
|
||||
constexpr int CountSetBits(u8 val)
|
||||
{
|
||||
return __builtin_popcount(val);
|
||||
|
@ -83,8 +85,6 @@ inline int LeastSignificantSetBit(u64 val)
|
|||
}
|
||||
#endif
|
||||
|
||||
namespace Common
|
||||
{
|
||||
// Similar to std::bitset, this is a class which encapsulates a bitset, i.e.
|
||||
// using the set bits of an integer to represent a set of integers. Like that
|
||||
// class, it acts like an array of bools:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue