-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
simd_shuffle, simd_insert, simd_extract should use const generics #85229
Copy link
Copy link
Open
Labels
A-SIMDArea: SIMD (Single Instruction Multiple Data)Area: SIMD (Single Instruction Multiple Data)A-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)A-intrinsicsArea: IntrinsicsArea: IntrinsicsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-SIMDArea: SIMD (Single Instruction Multiple Data)Area: SIMD (Single Instruction Multiple Data)A-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)A-intrinsicsArea: IntrinsicsArea: IntrinsicsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
simd_shufflerequires its last parameter, the array defining the shuffling, to be a constant:rust/compiler/rustc_codegen_llvm/src/intrinsic.rs
Line 888 in 487e273
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_shuffleto make the shuffle array a const generic parameter. I am not doing this yet since const generic arrays require enabling anincomplete_featurewhich is not great, but once const generic arrays are sufficiently stable we could use them as a more principled way to ensure thatsimd_shuffleis 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