1
Fork 0

require simd_insert, simd_extract indices to be constants

This commit is contained in:
Ralf Jung 2024-02-17 09:57:24 +01:00
parent 0b9f6ad994
commit 396cf1e1f5
4 changed files with 29 additions and 9 deletions

View file

@ -864,8 +864,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
.map(|(i, arg)| {
// The indices passed to simd_shuffle in the
// third argument must be constant. This is
// checked by const-qualification, which also
// promotes any complex rvalues to constants.
// checked by the type-checker.
if i == 2 && intrinsic == sym::simd_shuffle {
if let mir::Operand::Constant(constant) = &arg.node {
let (llval, ty) = self.simd_shuffle_indices(bx, constant);