> +  /* Use xt.vile/xt.vilo + vrgather when XXTVarith is available.  */

Is this always better than our regular sequence for your uarch, also 
with LMUL > 1 (i.e. in case the gather scales badly)?

> +  if (TARGET_XXTVARITH)
> +    {
> +      rtx tmp = gen_reg_rtx (vmode);
> +      insn_code vil_icode = even ? code_for_xt_pred (UNSPEC_XT_VILE, vmode)
> +                              : code_for_xt_pred (UNSPEC_XT_VILO, vmode);
> +      rtx vil_ops[] = {tmp, d->op0, d->op1};
> +      emit_vlmax_insn (vil_icode, (unsigned) __NORMAL_OP_TA2 | BINARY_OP_P,
> +                    vil_ops);
> +
> +      machine_mode sel_mode = related_int_vector_mode (vmode).require ();
> +      machine_mode idx_mode = GET_MODE_INNER (sel_mode);
> +      rvv_builder v (sel_mode, vlen, 1);
> +      for (int i = 0; i < vlen / 2; i++)
> +     v.quick_push (gen_int_mode (i * 2, idx_mode));
> +      for (int i = 0; i < vlen / 2; i++)
> +     v.quick_push (gen_int_mode (i * 2 + 1, idx_mode));
> +      rtx idx = v.build ();
> +
> +      emit_vlmax_gather_insn (d->target, tmp, idx);

Does get_gather_index_mode work here?

-- 
Regards
 Robin

Reply via email to