Skip to main content

quad_bits_16_to_64

Function quad_bits_16_to_64 

Source
const fn quad_bits_16_to_64(b: u16) -> u64
Expand description

Expand a 16-bit row pattern to a 64-bit row pattern by quadrupling each bit: input bit i becomes output bits 4i, 4i+1, 4i+2, and 4i+3. Branchless SWAR so LLVM folds it to a single 64-bit immediate when b is a constant.