Re: [PATCH] RISC-V: Revert the convert from vmv.s.x to vmv.v.i

2024-02-22 Thread Jeff Law
On 2/19/24 21:15, Alexandre Oliva wrote: This backport is the first of two required for the pr111935 testcase, already backported to gcc-13, to pass on riscv64-elf and riscv32-elf. The V_VLS mode iterator, used in the original patch, is not available in gcc-13, and I thought that would be too

[PATCH] RISC-V: Revert the convert from vmv.s.x to vmv.v.i

2024-02-19 Thread Alexandre Oliva
This backport is the first of two required for the pr111935 testcase, already backported to gcc-13, to pass on riscv64-elf and riscv32-elf. The V_VLS mode iterator, used in the original patch, is not available in gcc-13, and I thought that would be too much to backport (and maybe so are these two

Re: [PATCH] RISC-V: Revert the convert from vmv.s.x to vmv.v.i

2023-08-11 Thread Lehua Ding
If we encounter a uarch where the other sequence is better, then I think we can do something like query costs or the like and select between the approaches -- but no need to do that now. So OK for the trunk. Thanks, patch will be committed soon.

Re: [PATCH] RISC-V: Revert the convert from vmv.s.x to vmv.v.i

2023-08-11 Thread Jeff Law via Gcc-patches
On 8/11/23 03:01, Lehua Ding wrote: Hi, This patch revert the convert from vmv.s.x to vmv.v.i and add new pattern optimize the special case when the scalar operand is zero. Currently, the broadcast pattern where the scalar operand is a imm will be converted to vmv.v.i from vmv.s.x and the

Re: [PATCH] RISC-V: Revert the convert from vmv.s.x to vmv.v.i

2023-08-11 Thread Jeff Law via Gcc-patches
On 8/11/23 09:43, Lehua Ding wrote: > I can't speak for other uarches, but as a guiding principle for Ventana > we're assuming vsetvl instructions are common and as a result need to be > very cheap in hardware.   It's likely a good tradeoff for us. > I could see other uarches making

Re: [PATCH] RISC-V: Revert the convert from vmv.s.x to vmv.v.i

2023-08-11 Thread Lehua Ding
I can't speak for other uarches, but as a guiding principle for Ventana we're assuming vsetvl instructions are common and as a result need to be very cheap in hardware. It's likely a good tradeoff for us. I could see other uarches making different design choices though. So at a high level,

Re: [PATCH] RISC-V: Revert the convert from vmv.s.x to vmv.v.i

2023-08-11 Thread Jeff Law via Gcc-patches
On 8/11/23 03:01, Lehua Ding wrote: Hi, This patch revert the convert from vmv.s.x to vmv.v.i and add new pattern optimize the special case when the scalar operand is zero. Currently, the broadcast pattern where the scalar operand is a imm will be converted to vmv.v.i from vmv.s.x and the

[PATCH] RISC-V: Revert the convert from vmv.s.x to vmv.v.i

2023-08-11 Thread Lehua Ding
Hi, This patch revert the convert from vmv.s.x to vmv.v.i and add new pattern optimize the special case when the scalar operand is zero. Currently, the broadcast pattern where the scalar operand is a imm will be converted to vmv.v.i from vmv.s.x and the mask operand will be converted from 00..01