This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


On Wed, Aug 14, 2019 at 04:10:56PM +0000, 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")
> > > > > >     (float_truncate:SF
> > > > > >       (plus:DF (match_operand:DF 1 "gpc_reg_operand" "%d,wa")
> > > > > >                (match_operand:DF 2 "gpc_reg_operand" "d,wa"))))]
> > 
> > but that is only meant for such explicit contraction.  This can then
> > happily be used to implement all such patterns.  Is there some issue
> > with that I overlook?
> 
> Yes, I think such a separate RTL code would work (as would an 
> architecture-specific UNSPEC) - it just needs to avoid the pattern 
> matching RTL that can arise other than from the built-in functions.
> 
> (Everything to do with needing -fno-math-errno to expand into such 
> instructions should be handled in the architecture-independent compiler.)

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?


Segher


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]