public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <law@redhat.com>
To: Wilco Dijkstra <Wilco.Dijkstra@arm.com>,
	Richard Biener <richard.guenther@gmail.com>,
	Alexander Monakov <amonakov@ispras.ru>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>, nd <nd@arm.com>
Subject: Re: [PATCH v2] Simplify pow with constant
Date: Fri, 25 Aug 2017 00:31:00 -0000	[thread overview]
Message-ID: <57489640-3aed-85f8-c866-95f7d06cd7a4@redhat.com> (raw)
In-Reply-To: <DB6PR0801MB2053D71B2E2778D10399091E83830@DB6PR0801MB2053.eurprd08.prod.outlook.com>

On 08/17/2017 07:56 AM, Wilco Dijkstra wrote:
> This patch simplifies pow (C, x) into exp (x * C1) if C > 0, C1 = log (C).
> Do this only for fast-math as accuracy is reduced.  This is much faster
> since pow is more complex than exp - with current GLIBC the speedup is
> more than 7 times for this transformation.
Right.  exp is painful in glibc, but pow is *dramatically* more painful
and likely always will be.

Siddhesh did some great work in bringing those costs down in glibc but
the more code we can reasonably shunt into exp instead of pow, the better.

It's likely pow will always be significantly more expensive than exp.
It's also likely that predicting when these functions are going to go
off the fast paths is painful.

I think Richi already ack'd the V2 patch.  Just wanted to chime in given
I've been fairly deep on this in the past with customers on the glibc side.

jeff

  parent reply	other threads:[~2017-08-24 22:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-04 11:23 [PATCH] " Wilco Dijkstra
2017-08-04 12:26 ` Alexander Monakov
2017-08-04 12:44   ` Richard Biener
2017-08-04 15:28     ` Wilco Dijkstra
2017-08-17 14:19       ` [PATCH v2] " Wilco Dijkstra
2017-08-17 16:58         ` Alexander Monakov
2017-08-18  8:29           ` Richard Biener
2017-08-18 13:53           ` Wilco Dijkstra
2017-08-18 14:05             ` Richard Biener
2017-08-25  4:21           ` Jeff Law
2017-08-25  0:31         ` Jeff Law [this message]
2017-08-25 14:37           ` Wilco Dijkstra
2017-08-04 22:38     ` [PATCH] " Joseph Myers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57489640-3aed-85f8-c866-95f7d06cd7a4@redhat.com \
    --to=law@redhat.com \
    --cc=Wilco.Dijkstra@arm.com \
    --cc=amonakov@ispras.ru \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=nd@arm.com \
    --cc=richard.guenther@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).