https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123175

--- Comment #6 from Richard Sandiford <rsandifo at gcc dot gnu.org> ---
On the VLA/VLS thing: few things are truly VLA-only.  We're likely to take the
same path for -msve-vector-bits=256 as -msve-vector-bits=scalable.

I agree with the description that nelts in:

      /* Create a vec_perm_indices for the integer vector.  */
      poly_uint64 nelts = TYPE_VECTOR_SUBPARTS (type);
      bool single_arg = (op0 == op1);
      vec_perm_indices sel (builder, single_arg ? 1 : 2, nelts);

should be taken from the input type rather than the output type:

/* Construct a permutation vector that selects between NINPUTS vector
   inputs that have NELTS_PER_INPUT elements each.  Take the elements of
   the new vector from ELEMENTS, clamping each one to be in range.  */

inline
vec_perm_indices::vec_perm_indices (const vec_perm_builder &elements,
                                    unsigned int ninputs,
                                    poly_uint64 nelts_per_input)
{
  new_vector (elements, ninputs, nelts_per_input);
}

Reply via email to