Re: Expansion of narrowing math built-ins into power instructions

2019-08-14 Thread Segher Boessenkool
On Wed, Aug 14, 2019 at 11:51:28AM +0530, Tejas Joshi wrote: > > The RTL needs to be something that > > does *not* match the combination of separate operations (just as fma has > > its own RTL, and a separate pass is responsible for converting separate > > So do I need to introduce fadd's own RTL

Re: Expansion of narrowing math built-ins into power instructions

2019-08-14 Thread Joseph Myers
On Wed, 14 Aug 2019, Segher Boessenkool wrote: > I think you can do one RTL code that replaces float_truncate in > > > > > > (define_insn "add_truncdfsf3" > > > > > [(set (match_operand:SF 0 "gpc_reg_operand" "=f,wa") > > > > > (float_truncate:SF > > > > > (plus:DF (match_operand:DF 1

Re: Expansion of narrowing math built-ins into power instructions

2019-08-14 Thread Segher Boessenkool
On Wed, Aug 14, 2019 at 04:10:56PM +, Joseph Myers wrote: > On Wed, 14 Aug 2019, Segher Boessenkool wrote: > > > I think you can do one RTL code that replaces float_truncate in > > > > > > > > (define_insn "add_truncdfsf3" > > > > > > [(set (match_operand:SF 0 "gpc_reg_operand" "=f,wa") > >

Re: Expansion of narrowing math built-ins into power instructions

2019-08-14 Thread Joseph Myers
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 simpli

Re: Expansion of narrowing math built-ins into power instructions

2019-08-14 Thread Segher Boessenkool
On Wed, Aug 14, 2019 at 08:23:27PM +, 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