Description
simd_shuffle
requires its last parameter, the array defining the shuffling, to be a constant:
Currently (after #85110), this is enforced by an ad-hoc hack in compiler/rustc_mir/src/transform/lower_intrinsics.rs
.
But I think it'd be better to instead change the type of simd_shuffle
to make the shuffle array a const generic parameter. I am not doing this yet since const generic arrays require enabling an incomplete_feature
which is not great, but once const generic arrays are sufficiently stable we could use them as a more principled way to ensure that simd_shuffle
is called in the right way.
Update (2024-02-17): A const-generic version of simd_shuffle now exists, but using it in stdarch would require generic_const_exprs and that's too experimental for such uses.
Cc @rust-lang/project-const-generics