Re: [Patch] Inline optimization for tanh(x)/sinh(x) -> 1.0/cosh(x)

2020-06-09 Thread Jeff Law via Gcc-patches
On Thu, 2020-06-04 at 11:09 +0200, Christophe Lyon wrote: > Hi, > > On Thu, 4 Jun 2020 at 01:03, Jeff Law via Gcc-patches > wrote: > > On Fri, 2020-01-31 at 15:50 -0300, Vitor Guidi wrote: > > > I took the required steps. The patch is attached to this email, I hope > > > I got it right this

Re: [Patch] Inline optimization for tanh(x)/sinh(x) -> 1.0/cosh(x)

2020-06-04 Thread Christophe Lyon via Gcc-patches
Hi, On Thu, 4 Jun 2020 at 01:03, Jeff Law via Gcc-patches wrote: > > On Fri, 2020-01-31 at 15:50 -0300, Vitor Guidi wrote: > > I took the required steps. The patch is attached to this email, I hope > > I got it right this time. I did not forward the patch to gcc-patches > > the first time, sorry

Re: [Patch] Inline optimization for tanh(x)/sinh(x) -> 1.0/cosh(x)

2020-06-03 Thread Jeff Law via Gcc-patches
On Fri, 2020-01-31 at 15:50 -0300, Vitor Guidi wrote: > I took the required steps. The patch is attached to this email, I hope > I got it right this time. I did not forward the patch to gcc-patches > the first time, sorry for the inconvenience. > > Thank you for your attention, > > Vitor. > >

Re: [Patch] Inline optimization for tanh(x)/sinh(x) -> 1.0/cosh(x)

2020-02-03 Thread Jeff Law
On Fri, 2020-01-31 at 15:50 -0300, Vitor Guidi wrote: > I took the required steps. The patch is attached to this email, I hope > I got it right this time. I did not forward the patch to gcc-patches > the first time, sorry for the inconvenience. > > Thank you for your attention, > > Vitor. > >

Re: [Patch] Inline optimization for tanh(x)/sinh(x) -> 1.0/cosh(x)

2020-01-31 Thread Vitor Guidi
I took the required steps. The patch is attached to this email, I hope I got it right this time. I did not forward the patch to gcc-patches the first time, sorry for the inconvenience. Thank you for your attention, Vitor. in gcc/ChangeLog: 2020-01-28 Vitor Guidi * match.pd: New

Re: [Patch] Inline optimization for tanh(x)/sinh(x) -> 1.0/cosh(x)

2020-01-31 Thread Richard Biener
On Fri, Jan 31, 2020 at 12:06 PM Marc Glisse wrote: > > On Thu, 30 Jan 2020, Vitor Guidi wrote: > > >> + /* Simplify tanh (x) / sinh (x) -> 1.0 / cosh (x). */ > >> + (simplify > >> + (rdiv (TANH @0) (SINH @0)) > >> + (rdiv {build_one_cst (type);} (COSH @0))) > > The existing > > (simplify >

Re: [Patch] Inline optimization for tanh(x)/sinh(x) -> 1.0/cosh(x)

2020-01-31 Thread Marc Glisse
On Thu, 30 Jan 2020, Vitor Guidi wrote: + /* Simplify tanh (x) / sinh (x) -> 1.0 / cosh (x). */ + (simplify + (rdiv (TANH @0) (SINH @0)) + (rdiv {build_one_cst (type);} (COSH @0))) The existing (simplify (rdiv (SINH:s @0) (COSH:s @0)) (TANH @0)) has :s (which AFAIK are ignored

Re: [Patch] Inline optimization for tanh(x)/sinh(x) -> 1.0/cosh(x)

2020-01-31 Thread Richard Biener
On Fri, Jan 31, 2020 at 12:53 AM Vitor Guidi wrote: > > Hi. > > This patch adds a new optimization to avoid the redundant calculation > tanh(x)/sinh(x) by replacing it for 1.0/cosh(x), for all cases where x is a > double, a long double or a float. > > There should be no need for numerical