fn word_index_and_mask<T: Idx>(elem: T) -> (usize, Word)