Re: [PATCH v3] Add sinh(atanh(x)) and cosh(atanh(x)) optimizations

2018-11-23 Thread Wilco Dijkstra
Hi, > I checked it. They are all the same on x86_64: > https://pastebin.com/e63FxDAy > I even forced to call the glibc sinh and atanh, but use the sqrtsd > instruction. > But I do agree that there may be an arch that sets an errno for sinh > or cosh but not for sqrt, implying in a unexpected beha

Re: [PATCH v3] Add sinh(atanh(x)) and cosh(atanh(x)) optimizations

2018-11-22 Thread Giuliano Augusto Faulin Belinassi
Hi, Sorry, but I am a little confused. On Wed, Nov 14, 2018 at 11:28 AM Wilco Dijkstra wrote: > > Hi, > > > > Indeed. After plotting the graph of both functions, it is very clear > > that this check isn't required. Sorry about that. > > It wouldn't be clear from the graph, you need to check that

Re: [PATCH v3] Add sinh(atanh(x)) and cosh(atanh(x)) optimizations

2018-11-14 Thread Wilco Dijkstra
Hi, > Indeed. After plotting the graph of both functions, it is very clear > that this check isn't required. Sorry about that. It wouldn't be clear from the graph, you need to check that +0.0, -0.0, out of range values, infinities, NaNs give the same answer before/after your transformation. If s

Re: [PATCH v3] Add sinh(atanh(x)) and cosh(atanh(x)) optimizations

2018-11-14 Thread Giuliano Augusto Faulin Belinassi
On Wed, Nov 14, 2018 at 7:41 AM Richard Biener wrote: > > On Tue, Nov 13, 2018 at 10:25 PM Giuliano Augusto Faulin Belinassi > wrote: > > > > Only do the optimization if flag_signed_zeros && > > !flag_finite_math_only is set, as suggested in the previous iteration. > > > > Before, the patch did t

Re: [PATCH v3] Add sinh(atanh(x)) and cosh(atanh(x)) optimizations

2018-11-14 Thread Richard Biener
On Tue, Nov 13, 2018 at 10:25 PM Giuliano Augusto Faulin Belinassi wrote: > > Only do the optimization if flag_signed_zeros && > !flag_finite_math_only is set, as suggested in the previous iteration. > > Before, the patch did the optimization even when -fno-signed-zeros and > -ffinite-math-only wa

[PATCH v3] Add sinh(atanh(x)) and cosh(atanh(x)) optimizations

2018-11-13 Thread Giuliano Augusto Faulin Belinassi
Only do the optimization if flag_signed_zeros && !flag_finite_math_only is set, as suggested in the previous iteration. Before, the patch did the optimization even when -fno-signed-zeros and -ffinite-math-only was set. This could generate badly incorrect results for targets that do not support inf