This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH v4] Add sinh(atanh(x)) and cosh(atanh(x)) optimizations
- From: Jeff Law <law at redhat dot com>
- To: Giuliano Augusto Faulin Belinassi <giuliano dot belinassi at usp dot br>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Wilco dot Dijkstra at arm dot com, Richard Biener <richard dot guenther at gmail dot com>
- Date: Wed, 28 Nov 2018 21:37:19 -0700
- Subject: Re: [PATCH v4] Add sinh(atanh(x)) and cosh(atanh(x)) optimizations
- References: <CAEFO=4CcNCq2NWqx1THCw7C5AU23UkRdO0O=UN71=hKF1CsVZA@mail.gmail.com>
On 11/27/18 12:38 PM, Giuliano Augusto Faulin Belinassi wrote:
> Only do this optimization if funsafe-math and -fno-math-errno are
> enabled, as pointed in the previous iteration.
>
> Also added one more test case to ensure that fno-math-errno is
> required for the optimization.
>
> Special thanks for Wilco Dijsktra for all his help :-)
>
> gcc/ChangeLog
> 2018-11-27 Giuliano Belinassi <giuliano.belinassi@usp.br>
>
> * match.pd (sinh (atanh (x))): New simplification rules.
> (cosh (atanh (x))): Likewise.
>
> gcc/testsuite/ChangeLog
> 2018-11-27 Giuliano Belinassi <giuliano.belinassi@usp.br>
>
> * gcc.dg/sinhatanh-1.c: New test.
> * gcc.dg/sinhatanh-2.c: New test.
> * gcc.dg/sinhatanh-3.c: New test.
>
>
> sinhatanhv4.patch
>
> Index: gcc/match.pd
> ===================================================================
> --- gcc/match.pd (revision 266469)
> +++ gcc/match.pd (working copy)
> @@ -4342,6 +4342,25 @@
> (rdiv { t_one; } (sqrts (plus (mult @0 @0) { t_one; })))
> (copysigns { t_zero; } @0))))))
>
> + (if (!flag_errno_math)
You're missing the flag_unsafe_math_optimizations check AFAICT. Right?
jeff