Expansion of narrowing math built-ins into power instructions

Segher Boessenkool segher@kernel.crashing.org
Wed Aug 14 21:00:00 GMT 2019


On Wed, Aug 14, 2019 at 08:23:27PM +0000, Joseph Myers wrote:
> On Wed, 14 Aug 2019, Segher Boessenkool wrote:
> 
> > Does something like
> >   float d; double a, b, x;
> >   ...
> >   d = fadd (a + x, b - x);
> > work as wanted, with such a representation?  It would simplify (does it?) to
> >   d = fadd (a, b);
> > but is that allowed?
> 
> It's not allowed, but neither is simplifying (a + x) + (b - x) into (a + 
> b), when contraction isn't allowed.

Ah of course.  And we already should not do such simplification on RTL,
when contraction is disallowed.

So yeah it should work fine I think.  A new RTL code would be best (it
would be silly to have to make an unspec for it in every port separately),
but an unspec is of course easiest for now.


Segher



More information about the Gcc mailing list