Re: How do I stop gcc from loading data into registers when that's not needed?

2018-05-24 Thread Segher Boessenkool
On Wed, May 23, 2018 at 08:33:13PM -0400, Paul Koning wrote: > > On May 23, 2018, at 5:46 AM, Richard Biener > > wrote: > >> 2. The reported costs for the various insns are > >> r22:HI=['x']6 > >> cmp(r22:HI,r23:HI) 4 > >> cmp(['x'],['y'])16 > >>

Re: How do I stop gcc from loading data into registers when that's not needed?

2018-05-23 Thread Paul Koning
> On May 23, 2018, at 5:46 AM, Richard Biener > wrote: > > ... > >> 2. The reported costs for the various insns are >> r22:HI=['x']6 >> cmp(r22:HI,r23:HI) 4 >> cmp(['x'],['y'])16 >>so the added cost for the memory argument in the cmp is 6 -

Re: How do I stop gcc from loading data into registers when that's not needed?

2018-05-23 Thread Richard Biener
On Wed, May 23, 2018 at 2:50 AM Paul Koning wrote: > > On May 22, 2018, at 3:26 PM, Segher Boessenkool < seg...@kernel.crashing.org> wrote: > > > > > > -fdump-rtl-combine-all (or just -da or -dap), and then look at the dump > > file. Does combine try this combination? If so, it will tell you

Re: How do I stop gcc from loading data into registers when that's not needed?

2018-05-22 Thread Paul Koning
> On May 22, 2018, at 3:26 PM, Segher Boessenkool > wrote: > > > -fdump-rtl-combine-all (or just -da or -dap), and then look at the dump > file. Does combine try this combination? If so, it will tell you what > the resulting costs are. If not, why does it not try it? > >> Sorry, I'm not v

Re: How do I stop gcc from loading data into registers when that's not needed?

2018-05-22 Thread Segher Boessenkool
On Tue, May 22, 2018 at 10:49:35AM +0200, Richard Biener wrote: > On Tue, May 22, 2018 at 2:19 AM Paul Koning wrote: > > > On May 18, 2018, at 2:07 PM, Richard Biener > wrote: > > > On May 18, 2018 8:03:05 PM GMT+02:00, Paul Koning < > paulkon...@comcast.net> wrote: > > >> In some targets, like p

Re: How do I stop gcc from loading data into registers when that's not needed?

2018-05-22 Thread Richard Biener
On Tue, May 22, 2018 at 2:19 AM Paul Koning wrote: > > On May 18, 2018, at 2:07 PM, Richard Biener wrote: > > > > On May 18, 2018 8:03:05 PM GMT+02:00, Paul Koning < paulkon...@comcast.net> wrote: > >> Gents, > >> > >> In some targets, like pdp11 and vax, most instructions can reference > >> d

Re: How do I stop gcc from loading data into registers when that's not needed?

2018-05-18 Thread Richard Biener
On May 18, 2018 8:03:05 PM GMT+02:00, Paul Koning wrote: >Gents, > >In some targets, like pdp11 and vax, most instructions can reference >data in memory directly. > >So when I have "if (x < y) ..." I would expect something like this: > > cmpw x, y > bgeq 1f > ... > >What I act

How do I stop gcc from loading data into registers when that's not needed?

2018-05-18 Thread Paul Koning
Gents, In some targets, like pdp11 and vax, most instructions can reference data in memory directly. So when I have "if (x < y) ..." I would expect something like this: cmpw x, y bgeq 1f ... What I actually see, with -O2 and/or -Os, is: movw x, r0 mo