Lines Matching refs:first
66 * Extract the bitfield from position 'first' to 'last' (inclusive)
72 bits(T val, int first, int last)
74 int nbits = first - last + 1;
96 mbits(T val, int first, int last)
98 return val & (mask(first+1) & ~mask(last));
102 mask(int first, int last)
104 return mbits((uint64_t)-1LL, first, last);
120 * Return val with bits first to last set to bit_val
125 insertBits(T val, int first, int last, B bit_val)
128 T bmask = mask(first - last + 1) << last;
144 * A convenience function to replace bits first to last of val with bit_val
150 replaceBits(T& val, int first, int last, B bit_val)
152 val = insertBits(val, first, last, bit_val);