Re: [PATCH 2/8] [RS6000] rs6000_rtx_costs for AND

2020-10-23 Thread Alan Modra via Gcc-patches
On Fri, Oct 23, 2020 at 07:18:44PM -0400, Hans-Peter Nilsson wrote: > On Thu, 22 Oct 2020, Alan Modra via Gcc-patches wrote: > > /* (reg) is costed at zero by rtlanal.c:rtx_cost. That sets a > > baseline for rtx costs: If a constant is valid in an insn, > > it is free. */ > > >F

Re: [PATCH 2/8] [RS6000] rs6000_rtx_costs for AND

2020-10-23 Thread Hans-Peter Nilsson
On Thu, 22 Oct 2020, Alan Modra via Gcc-patches wrote: Hi! > On Wed, Oct 21, 2020 at 03:29:11PM -0500, Segher Boessenkool wrote: > > Anyway: > > > > + || (outer_code == AND > > + && rs6000_is_valid_2insn_and (x, mode))) > > { > > *total = COSTS_N_IN

Re: [PATCH 2/8] [RS6000] rs6000_rtx_costs for AND

2020-10-22 Thread Segher Boessenkool
On Thu, Oct 22, 2020 at 08:41:50AM +1030, Alan Modra wrote: > On Wed, Oct 21, 2020 at 03:29:11PM -0500, Segher Boessenkool wrote: > > Anyway: > > > > + || (outer_code == AND > > + && rs6000_is_valid_2insn_and (x, mode))) > > { > > *total = COSTS_N_IN

Re: [PATCH 2/8] [RS6000] rs6000_rtx_costs for AND

2020-10-21 Thread Alan Modra via Gcc-patches
On Wed, Oct 21, 2020 at 03:29:11PM -0500, Segher Boessenkool wrote: > Anyway: > > + || (outer_code == AND > + && rs6000_is_valid_2insn_and (x, mode))) > { > *total = COSTS_N_INSNS (1); > return true; > > It should return COSTS_N_INSNS (2)

Re: [PATCH 2/8] [RS6000] rs6000_rtx_costs for AND

2020-10-21 Thread Segher Boessenkool
On Wed, Oct 21, 2020 at 01:27:42PM +1030, Alan Modra wrote: > On Tue, Oct 20, 2020 at 01:55:56PM -0500, Segher Boessenkool wrote: > > On Thu, Oct 08, 2020 at 09:27:54AM +1030, Alan Modra wrote: > > > The existing "case AND" in this function is not sufficient for > > > optabs.c:avoid_expensive_const

Re: [PATCH 2/8] [RS6000] rs6000_rtx_costs for AND

2020-10-20 Thread Alan Modra via Gcc-patches
On Tue, Oct 20, 2020 at 01:55:56PM -0500, Segher Boessenkool wrote: > On Thu, Oct 08, 2020 at 09:27:54AM +1030, Alan Modra wrote: > > The existing "case AND" in this function is not sufficient for > > optabs.c:avoid_expensive_constant usage, where the AND is passed in > > outer_code. We'd like to

Re: [PATCH 2/8] [RS6000] rs6000_rtx_costs for AND

2020-10-20 Thread Segher Boessenkool
On Thu, Oct 08, 2020 at 09:27:54AM +1030, Alan Modra wrote: > The existing "case AND" in this function is not sufficient for > optabs.c:avoid_expensive_constant usage, where the AND is passed in > outer_code. We'd like to cost AND of rs6000_is_valid_and_mask > or rs6000_is_valid_2insn_and variety

[PATCH 2/8] [RS6000] rs6000_rtx_costs for AND

2020-10-07 Thread Alan Modra via Gcc-patches
The existing "case AND" in this function is not sufficient for optabs.c:avoid_expensive_constant usage, where the AND is passed in outer_code. We'd like to cost AND of rs6000_is_valid_and_mask or rs6000_is_valid_2insn_and variety there, so that those masks aren't seen as expensive (ie. better to l