This is the mail archive of the gcc-patches@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: [PATCH v4] Add sinh(atanh(x)) and cosh(atanh(x)) optimizations


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


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