Rust recently added a nightly feature that adds methods to integer types to enable use of PEXT/PDEP intrinsics: [`uint_gather_scatter_bits`][1] I did a quick benchmark encoding a `[u16; 2]` and it's ~20x faster ([code][2]) [1]: https://github.com/rust-lang/rust/issues/149069#issuecomment-3633691777 [2]: https://github.com/jgraef/sandvox/blob/morton-intrinsics/morton/src/lib.rs