This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: inhibit the sincos optimization when the target has sin and cos instructions
- From: Andrew Pinski <pinskia at gmail dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: Cesar Philippidis <cesar at codesourcery dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 13 May 2016 13:13:19 -0700
- Subject: Re: inhibit the sincos optimization when the target has sin and cos instructions
- Authentication-results: sourceware.org; auth=none
- References: <573628A1 dot 1030501 at codesourcery dot com> <862033F1-A268-4236-B908-558C102199B5 at gmail dot com>
On Fri, May 13, 2016 at 12:58 PM, Richard Biener
<richard.guenther@gmail.com> wrote:
> On May 13, 2016 9:18:57 PM GMT+02:00, Cesar Philippidis <cesar@codesourcery.com> wrote:
>>The cse_sincos pass tries to optimize sequences such as
>>
>> sin (x);
>> cos (x);
>>
>>into a single call to sincos, or cexpi, when available. However, the
>>nvptx target has sin and cos instructions, albeit with some loss of
>>precision (so it's only enabled with -ffast-math). This patch teaches
>>cse_sincos pass to ignore sin, cos and cexpi instructions when the
>>target can expand those calls. This yields a 6x speedup in 314.omriq
>>from spec accel when running on Nvidia accelerators.
>>
>>Is this OK for trunk?
>
> Isn't there an optab for sincos?
This is exactly what I was going to suggest. This transformation
should be done in the back-end back to sin/cos instructions.
Thanks,
Andrew
> ISTR x87 handles this pass just fine and also can do sin and cos.
>
> Richard.
>
>>Cesar
>
>