Tracking Issue for `uint_gather_scatter_bits`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Feature gate: #![feature(uint_gather_scatter_bits)]
This is a tracking issue for two functions that operate on masked bits: extract_bits consolidates masked bits into the least significant bits of an integer, and deposit_bits distributes bits from the least significant bits of an integer to the bits specified by a mask.
The functions are implemented on unsigned integers and correspond to the hardware instructions known on some platforms as "bit extract" and "bit deposit" (PEXT/PDEP).
Public API
impl uint {
pub const fn extract_bits(self, mask: Self) -> Self;
pub const fn deposit_bits(self, mask: Self) -> Self;
}
Steps / History
- ACP: https://github.com/rust-lang/libs-team/issues/695
- Implementation: https://github.com/rust-lang/rust/pull/149097
- Final comment period (FCP)^1
- Stabilization PR
Unresolved Questions
- No stabilization before the existence of explicit LLVM support:
As of November 2025, there is currently no LLVM intrinsic to guarantee that the code generated is optimal for the target or generates the target architecture instruction if present and the target feature is specified.This is a roadblock for stabilization. Update(2026-June): LLVM intrinsics are implemented, waiting for next LLVM bump before we can use them. Naming: The libs team prefersThe functions have been renamed according to the libs decision in https://github.com/rust-lang/rust/issues/149069#issuecomment-3633691777gather/scatter_bitswhile that is at odds with how SIMD instructions use the termsgather/scatter. https://github.com/rust-lang/libs-team/issues/695#issuecomment-3549356128:...by analogy to SIMD, SIMD gather/scatter allows you to arbitrarily reorder elements (it is a fully-general load/store to independently-determined addresses for each element), whereas SIMD compress/expand does not allow reordering the loaded/stored elements, just inserting/removing elements.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the public API and feature-gate sections, then read the linked std-dev-guide stabilization guidance and the unresolved LLVM-support question. Check the listed implementation PRs and whether the required LLVM bump has landed; done means the final comment period and stabilization PR can proceed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100