MCPcopy Create free account
hub / github.com/ElementsProject/lightning / bitops_clz64

Function bitops_clz64

ccan/ccan/bitops/bitops.h:64–71  ·  view source on GitHub ↗

* bitops_clz64: count leading zeros in a uint64_t (must not be 0) * * Returns 0 if most significant bit is set, 63 if only least * significant bit is set. */

Source from the content-addressed store, hash-verified

62 * significant bit is set.
63 */
64static inline int bitops_clz64(uint64_t u)
65{
66 BITOPS_ASSERT_NONZERO(u);
67 if (sizeof(u) == sizeof(long))
68 return __builtin_clzl(u);
69 else
70 return __builtin_clzll(u);
71}
72#else
73int bitops_clz32(uint32_t u);
74int bitops_clz64(uint64_t u);

Callers 4

bitops_hs64Function · 0.70
bitops_hc64Function · 0.70
test_against_naive64Function · 0.50
mainFunction · 0.50

Calls

no outgoing calls

Tested by 2

test_against_naive64Function · 0.40
mainFunction · 0.40