Skip to main content

compress_portable

Function compress_portable 

Source
fn compress_portable(value: u64, mask: u64) -> u64
Expand description

compress without pext, by the number of kept bits k:

  • k <= 2: the two lowest kept bits, tested directly
  • k <= 16: one step per kept bit
  • k >= 62: value with its at most two dropped bits removed
  • otherwise compress_bytes

The two ends need no loop, so no loop exit to mispredict when k varies from word to word.