This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] v11 Improves __ieee754_exp() performance by greater than 5x on sparc/x86.
- From: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: nd at arm dot com, Patrick McGehearty <patrick dot mcgehearty at oracle dot com>, libc-alpha at sourceware dot org
- Date: Fri, 2 Feb 2018 16:35:45 +0000
- Subject: Re: [PATCH] v11 Improves __ieee754_exp() performance by greater than 5x on sparc/x86.
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Szabolcs dot Nagy at arm dot com;
- Nodisclaimer: True
- References: <1517262265-79445-1-git-send-email-patrick.mcgehearty@oracle.com> <361bac88-5538-227f-b6dc-76416178192c@arm.com> <alpine.DEB.2.20.1802021530130.17793@digraph.polyomino.org.uk>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
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.