rust-lang / stdarch

Rust's standard library vendor-specific APIs and run-time feature detection
https://doc.rust-lang.org/stable/core/arch/
Apache License 2.0
598 stars 260 forks source link

put the idx arguments of simd_insert and simd_extract into const blocks #1530

Closed RalfJung closed 5 months ago

RalfJung commented 5 months ago

In https://github.com/rust-lang/rust/issues/77477 the general consensus seems to be that these arguments should always be consts. So I have a patch for rustc that enforces them to be const. This is the stdarch side of this, adding const-blocks everywhere to ensure these arguments are const. I decided to follow the same pattern as simd_shuffle and add a macro that adds the const block.

However, there's one use of non-constant indices that can't be easily ported to use inline const blocks: the extract method on SIMD types, which is used (at least) by PowerPC tests. Also see here.

rustbot commented 5 months ago

r? @Amanieu

rustbot has assigned @Amanieu. They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

bors commented 5 months ago

:umbrella: The latest upstream changes (presumably 4d9c0bb591336792c4c4baf293d0acc944e57e28) made this pull request unmergeable. Please resolve the merge conflicts.