19 if (u64 >= (UINT64_C(1)<<32)) {
23 if (u64 >= (UINT64_C(1)<<16)) {
27 if (u64 >= (UINT64_C(1)<<8)) {
31 if (u64 >= (UINT64_C(1)<<4)) {
35 if (u64 >= (UINT64_C(1)<<2)) {
39 if (u64 >= (UINT64_C(1)<<1)) {
58 low = UINT64_C(1) << lg2;
63 high = UINT64_C(1) << (lg2+1);
64 if (high - u64 < u64 - low)
74 static const int nybble_table[] = {
93 return nybble_table[v & 15] + nybble_table[v>>4];
int n_bits_set_u8(uint8_t v)
int tor_log2(uint64_t u64)
uint64_t round_to_power_of_2(uint64_t u64)