Skip to main content

double_bits

Function double_bits 

Source
const fn double_bits(b: u8) -> u16
Expand description

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