Re: Re: [PATCH] riscv: Add vectorized binops and insn_expander helpers.

2023-05-10 Thread 钟居哲
ght be confusing here. >> Would an additional parameter like "bool set_op2_mode" make it clearer? >> Another option is to separate this into another function altogether like >> emit_len_binop_scalar or so. No, you just use op2mode which you pass throu

Re: [PATCH] riscv: Add vectorized binops and insn_expander helpers.

2023-05-10 Thread Robin Dapp via Gcc-patches
> +  machine_mode op2mode = Pmode; > +  if (inner == E_QImode || inner == E_HImode || inner == E_SImode) > + op2mode = inner; This I added in order to match the scalar variants like [(set (match_operand:VI_QHS 0 "register_operand" "=vd,vd, vr, vr") (if_then_else:VI_QHS

Re: [PATCH] riscv: Add vectorized binops and insn_expander helpers.

2023-05-10 Thread 钟居哲
Thanks Robin. A couple comments here: + machine_mode op2mode = Pmode; + if (inner == E_QImode || inner == E_HImode || inner == E_SImode) + op2mode = inner; Remove it. + change it into + e.add_input_operand (src2, op2mode == VOIDmode ? GET_MODE (src2) : op2mode); Very confusing