Re: [PATCH] RISC-V: Add conditional sign/zero extension and truncation autovec patterns

2023-08-24 Thread Lehua Ding
On 2023/8/24 18:20, Robin Dapp wrote: Yes, it's better to call it one_quad. I'd suggest to go with quarter as before or quarter_width_op or something. OK for quarter. Is this necessary for recognizing a different pattern? Are you saying that the testcases xxx-1 and xxx-2 are duplicate

Re: [PATCH] RISC-V: Add conditional sign/zero extension and truncation autovec patterns

2023-08-24 Thread Robin Dapp via Gcc-patches
> Yes, it's better to call it one_quad. I'd suggest to go with quarter as before or quarter_width_op or something. >> Is this necessary for recognizing a different pattern? > > Are you saying that the testcases xxx-1 and xxx-2 are duplicated? If > so, I have no problem removing it and just kee

Re: [PATCH] RISC-V: Add conditional sign/zero extension and truncation autovec patterns

2023-08-24 Thread Lehua Ding
Hi Robin, On 2023/8/24 17:59, Robin Dapp wrote: Hi Lehua, thanks, just tiny non-functional nits. - rtx ops[] = {operands[0], quarter}; - icode = code_for_pred_trunc (mode); - riscv_vector::emit_vlmax_insn (icode, riscv_vector::RVV_UNOP, ops); + rtx half = gen_reg_rtx (mode); Not really

Re: [PATCH] RISC-V: Add conditional sign/zero extension and truncation autovec patterns

2023-08-24 Thread Robin Dapp via Gcc-patches
Hi Lehua, thanks, just tiny non-functional nits. > - rtx ops[] = {operands[0], quarter}; > - icode = code_for_pred_trunc (mode); > - riscv_vector::emit_vlmax_insn (icode, riscv_vector::RVV_UNOP, ops); > + rtx half = gen_reg_rtx (mode); Not really a half anymore now? :) > +#include > + > +#

[PATCH] RISC-V: Add conditional sign/zero extension and truncation autovec patterns

2023-08-23 Thread Lehua Ding
Hi, This patch adds conditional sign/zero extension and truncation autovec patterns by combining EXTENSION/TRUNCATION and VCOND_MASK patterns. For quad truncation, two vncvt instructions are generated. This patch combine the second vncvt and vmerge to form a masked vncvt, while the first vncvt re