On Wed, Mar 17, 2021 at 11:35:18AM +0800, Xionghu Luo wrote:
> +  machine_mode idx_mode = GET_MODE (idx);
> +  if (idx_mode != DImode)
> +    idx = convert_modes (DImode, idx_mode, idx, 1);

Segher mentioned you can remove the if (idx_mode != DImode) too,
convert_modes has an early if (mode == oldmode) return x;

> +
> +  /*  idx = idx * width.  */
> +  rtx tmp = gen_reg_rtx (DImode);
> +  emit_insn (gen_muldi3 (tmp, idx, GEN_INT (width)));

And I have to wonder, when rs6000_expand_vector_set_var_p9
uses here a left shift, can't rs6000_expand_vector_set_var_p8
do the same or is there some reason I'm missing?
gen_muldi3 will just emit a multiplication, are you hoping that
combiner or some other pass will optimize it away later (for width 1)
or change the multiplication into left shift otherwise?

        Jakub

Reply via email to