Lines Matching refs:bit0
222 * Transform v such that only bits [bit0, bitN) may be set. Generates a
223 * bitmask covering the number of bits, then shifts so +bit0+ is the first.
226 bitmask_range(uint64_t v, uint64_t bit0, uint64_t bitN)
228 if (bit0 == 0 && bitN == BITS_IN(v))
231 return (v & (((1ULL << (bitN - bit0)) - 1ULL) << bit0));
236 * given base, from bit0 to bitN. bit0 may be non-zero in the case of
240 popcount_bytes(uint64_t *addr, uint32_t bit0, uint32_t bitN)
242 uint32_t res = bitN - bit0;
247 if ((bit0 % BITS_IN(*addr)) != 0) {
248 bound = MIN(bitN, roundup2(bit0, BITS_IN(*addr)));
249 count += __bitcount64(bitmask_range(*addr, bit0, bound));
250 res -= (bound - bit0);