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