MCPcopy Create free account
hub / github.com/cwida/ALP / count_bits

Method count_bits

include/alp/encoder.hpp:92–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90
91 template <typename UT>
92 static uint8_t count_bits(UT x) {
93 if (x == 0) { return 0; }
94 if constexpr (std::is_same_v<UT, uint64_t>) {
95 return 64 - __builtin_clzll(x);
96 } else {
97 return 32 - __builtin_clz(x);
98 }
99 }
100
101 template <typename ST>
102 static uint8_t count_bits(ST max, ST min) {

Callers

nothing calls this directly

Calls 2

__builtin_clzllFunction · 0.50
__builtin_clzFunction · 0.50

Tested by

no test coverage detected