Skip to main content

double_bits_16_to_32

Function double_bits_16_to_32 

Source
const fn double_bits_16_to_32(b: u16) -> u32
Expand description

Expand a 16-bit row pattern to a 32-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 32-bit immediate when b is a constant.