Lines Matching refs:bytes
24 unsigned bytes = DIV_ROUND_UP(bits, 7); in bch2_varint_encode() local
27 if (likely(bytes < 9)) { in bch2_varint_encode()
28 v <<= bytes; in bch2_varint_encode()
29 v |= ~(~0 << (bytes - 1)); in bch2_varint_encode()
31 memcpy(out, &v_le, bytes); in bch2_varint_encode()
34 bytes = 9; in bch2_varint_encode()
38 return bytes; in bch2_varint_encode()
51 unsigned bytes = likely(in < end) in bch2_varint_decode() local
56 if (unlikely(in + bytes > end)) in bch2_varint_decode()
59 if (likely(bytes < 9)) { in bch2_varint_decode()
62 memcpy(&v_le, in, bytes); in bch2_varint_decode()
64 v >>= bytes; in bch2_varint_decode()
70 return bytes; in bch2_varint_decode()
85 unsigned bytes = DIV_ROUND_UP(bits, 7); in bch2_varint_encode_fast() local
87 if (likely(bytes < 9)) { in bch2_varint_encode_fast()
88 v <<= bytes; in bch2_varint_encode_fast()
89 v |= ~(~0U << (bytes - 1)); in bch2_varint_encode_fast()
92 bytes = 9; in bch2_varint_encode_fast()
96 return bytes; in bch2_varint_encode_fast()
116 unsigned bytes = ffz(*in) + 1; in bch2_varint_decode_fast() local
118 if (unlikely(in + bytes > end)) in bch2_varint_decode_fast()
121 if (likely(bytes < 9)) { in bch2_varint_decode_fast()
122 v >>= bytes; in bch2_varint_decode_fast()
123 v &= ~(~0ULL << (7 * bytes)); in bch2_varint_decode_fast()
129 return bytes; in bch2_varint_decode_fast()