Re: [PATCH] RISC-V: costs: support shift-and-add in strength-reduction

2022-11-10 Thread Philipp Tomsich
On Thu, 10 Nov 2022 at 21:47, Palmer Dabbelt wrote: > > On Thu, 10 Nov 2022 07:09:35 PST (-0800), philipp.toms...@vrull.eu wrote: > > On Thu, 10 Nov 2022 at 02:46, Palmer Dabbelt wrote: > >> > >> On Tue, 08 Nov 2022 11:54:34 PST (-0800), philipp.toms...@vrull.eu wrote: > >> > The strength-reducti

Re: [PATCH] RISC-V: costs: support shift-and-add in strength-reduction

2022-11-10 Thread Palmer Dabbelt
On Thu, 10 Nov 2022 07:09:35 PST (-0800), philipp.toms...@vrull.eu wrote: On Thu, 10 Nov 2022 at 02:46, Palmer Dabbelt wrote: On Tue, 08 Nov 2022 11:54:34 PST (-0800), philipp.toms...@vrull.eu wrote: > The strength-reduction implementation in expmed.c will assess the > profitability of using s

Re: [PATCH] RISC-V: costs: support shift-and-add in strength-reduction

2022-11-10 Thread Philipp Tomsich
On Thu, 10 Nov 2022 at 02:46, Palmer Dabbelt wrote: > > On Tue, 08 Nov 2022 11:54:34 PST (-0800), philipp.toms...@vrull.eu wrote: > > The strength-reduction implementation in expmed.c will assess the > > profitability of using shift-and-add using a RTL expression that wraps > > a MULT (with a powe

Re: [PATCH] RISC-V: costs: support shift-and-add in strength-reduction

2022-11-09 Thread Palmer Dabbelt
On Tue, 08 Nov 2022 11:54:34 PST (-0800), philipp.toms...@vrull.eu wrote: The strength-reduction implementation in expmed.c will assess the profitability of using shift-and-add using a RTL expression that wraps a MULT (with a power-of-2) in a PLUS. Unless the RISC-V rtx_costs function recognizes

[PATCH] RISC-V: costs: support shift-and-add in strength-reduction

2022-11-08 Thread Philipp Tomsich
The strength-reduction implementation in expmed.c will assess the profitability of using shift-and-add using a RTL expression that wraps a MULT (with a power-of-2) in a PLUS. Unless the RISC-V rtx_costs function recognizes this as expressing a sh[123]add instruction, we will return an inflated cos