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

2022-11-13 Thread Philipp Tomsich
Applied to master. Thanks! Note that the multiply-by-200 (in the testcase) originates from Dhrystone. Philipp. On Sun, 13 Nov 2022 at 02:23, Jeff Law wrote: > > > On 11/10/22 14:34, Philipp Tomsich wrote: > > The strength-reduction implementation in expmed.cc will assess the > > profitability

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

2022-11-12 Thread Jeff Law via Gcc-patches
On 11/10/22 14:34, Philipp Tomsich wrote: The strength-reduction implementation in expmed.cc 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]

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

2022-11-10 Thread Philipp Tomsich
The strength-reduction implementation in expmed.cc 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 co