unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Szabolcs Nagy <szabolcs.nagy@arm.com>
To: Joseph Myers <joseph@codesourcery.com>
Cc: nd@arm.com, Patrick McGehearty <patrick.mcgehearty@oracle.com>,
	libc-alpha@sourceware.org
Subject: Re: [PATCH] v11 Improves __ieee754_exp() performance by greater than 5x on sparc/x86.
Date: Fri, 2 Feb 2018 16:35:45 +0000	[thread overview]
Message-ID: <a03c1969-7833-d883-c1e4-cdf1f0e0c871@arm.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1802021530130.17793@digraph.polyomino.org.uk>

On 02/02/18 15:33, Joseph Myers wrote:
> On Fri, 2 Feb 2018, Szabolcs Nagy wrote:
> 
>> (i also removed the rounding mode settings in both cases
>> as that can be avoided at least on aarch64)
> 
> There is or was certainly code in the existing exp that gives completely
> wrong results in non-default rounding modes (that was bug 3976) - e.g.
> using precision-extension techniques that require round-to-nearest -
> though I don't know if that applies to the fast case code or if it's only
> in code for slow cases (or code for slow cases but using other rounding
> modes results in the slow cases getting used much more).
> 

that's because in the arg reduction rounding is done like

     y = x * log2e.x + three51.x;
     bexp = y - three51.x;
     ...
     y = t + three33.x;
     base = y - three33.x;

but if instead of x+shift-shift a rounding mode independent
instruction is used then there should be no huge error,
this should be possible at least on aarch64, but even on
other targets a rounding mode independent trunc(x+0.5) may
be faster than using fenv.

i think that exp can be implemented without fenv access
and with acceptable error in non-nearest rounding.



  reply	other threads:[~2018-02-02 16:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-29 21:44 [PATCH] v11 Improves __ieee754_exp() performance by greater than 5x on sparc/x86 Patrick McGehearty
2018-02-02 14:40 ` Szabolcs Nagy
2018-02-02 15:33   ` Joseph Myers
2018-02-02 16:35     ` Szabolcs Nagy [this message]
2018-02-07 19:19   ` Patrick McGehearty
  -- strict thread matches above, loose matches on Subject: below --
2018-02-08 11:40 Wilco Dijkstra
2018-02-14  1:18 ` Patrick McGehearty
2018-02-14 16:41   ` Joseph Myers
2018-02-14 20:05     ` Szabolcs Nagy
2018-02-22 19:22   ` Szabolcs Nagy

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

  List information: https://www.gnu.org/software/libc/involved.html

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

  git send-email \
    --in-reply-to=a03c1969-7833-d883-c1e4-cdf1f0e0c871@arm.com \
    --to=szabolcs.nagy@arm.com \
    --cc=joseph@codesourcery.com \
    --cc=libc-alpha@sourceware.org \
    --cc=nd@arm.com \
    --cc=patrick.mcgehearty@oracle.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).