This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] Tree level sin, cos -> sincos transformation
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Geoffrey Keating <geoffk at geoffk dot org>
- Cc: Richard Guenther <rguenther at suse dot de>, gcc-patches at gcc dot gnu dot org
- Date: Mon, 19 Dec 2005 10:15:05 +0100
- Subject: Re: [RFC] Tree level sin, cos -> sincos transformation
- References: <Pine.LNX.4.63.0512151317070.6048@t148.fhfr.qr> <m2slss6532.fsf@greed.local>
On 16 Dec 2005 14:37:53 -0800, Geoffrey Keating <geoffk@geoffk.org> wrote:
>
> Richard Guenther <rguenther@suse.de> writes:
>
> > The patch below implements sin and cos fusion to sincos using
> > canonicalization to __imag/__real cexp ({0, x}) and relying on
> > PRE to CSE them. At expand time this canonicalization is
> > undone either to sin, cos or sincos, depending on the expression
> > generated by TER (that's a hack, a separate pass for this is
> > needed, see also the related hack in out-of-ssa to mark the
> > target of c = cexp ({0, x}) addressable). Further a new
> > expand_builtin_sincos is provided to make use of f.i. the
> > i387 fsincos instruction (we didn't expand calls to sincos
> > to fsincos before).
> >
> > With this patch we can do the sin, cos to sincos transformation
> > on targets other than i387.
> >
> > Comments?
>
> That's clever!
>
> Yes, this sounds like an excellent idea. I don't see anything
> particularly wrong with the patch. Did you want an approval or just
> comments?
Just comments. For sure I need to factor out the expand part into some
helper functions. But if you like it, I'll continue down this road and clean
up the patch until I like it myself ;)
Thanks!
Richard.