MCPcopy Create free account
hub / github.com/AliveToolkit/alive2 / ilog2

Function ilog2

util/compiler.cpp:28–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26namespace util {
27
28unsigned ilog2(uint64_t n) {
29 return n == 0 ? 0 : bit_width(n) - 1;
30}
31
32unsigned ilog2_ceil(uint64_t n, bool up_power2) {
33 auto log = ilog2(n);

Callers 7

mkAxiomsMethod · 0.85
allocMethod · 0.85
zeroBitsShortOffsetMethod · 0.85
isBlockAlignedMethod · 0.85
isAlignedMethod · 0.85
ilog2_ceilFunction · 0.85
is_power2Function · 0.85

Calls 1

bit_widthFunction · 0.85

Tested by

no test coverage detected