Evo bit manipulation helpers.
More...
Evo bit manipulation helpers.
◆ bits_clz()
uint evo::bits_clz |
( |
T |
mask | ) |
|
|
inline |
Get leading zero count on bitmask.
- Caution: Different input sizes can give different results on same value so fixed-size functions like bits_clz32() are often preferred
- Template Parameters
-
T | Mask type, inferred by param mask |
- Parameters
-
- Returns
- Leading zero count, NONE if mask is 0
- See also
- bits_clz8(), bits_clz16(), bits_clz32(), bits_clz64()
◆ bits_clz16()
uint evo::bits_clz16 |
( |
uint16 |
mask | ) |
|
|
inline |
◆ bits_clz32()
uint evo::bits_clz32 |
( |
uint32 |
mask | ) |
|
|
inline |
◆ bits_clz64()
uint evo::bits_clz64 |
( |
uint64 |
mask | ) |
|
|
inline |
◆ bits_clz8()
uint evo::bits_clz8 |
( |
uint8 |
mask | ) |
|
|
inline |
◆ bits_cpu_popcnt()
bool evo::bits_cpu_popcnt |
( |
| ) |
|
|
inline |
Runtime check whether current CPU supports the POPCNT instruction.
- MSVC: Checks whether CPU for this instruction
- Other compilers: Always returns false
- Returns
- Whether POPCNT instruction is supported
- See also
- bits_popcount()
◆ bits_popcount()
int evo::bits_popcount |
( |
T |
mask | ) |
|
|
inline |
Get population count (number of bits set) for value.
- Template Parameters
-
T | Mask type (inferred from argument) |
- Parameters
-
- Returns
- Number of bits set in mask