let all_ones v =
let b = v.bits in
let n = Array.length b in
let rec test i =
if i == n - 1 then
let m = v.length mod bpi in
(Array.unsafe_get b i) == (if m == 0 then max_int else low_mask.(m))
else
((Array.unsafe_get b i) == max_int) && test (succ i)
in
test 0