This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 1/9 v3] Optimized generic expf and exp2f with wrappers
- From: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: nd at arm dot com, GNU C Library <libc-alpha at sourceware dot org>
- Date: Fri, 22 Sep 2017 17:26:18 +0100
- Subject: Re: [PATCH 1/9 v3] Optimized generic expf and exp2f with wrappers
- 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: <59C1123F.9080003@arm.com> <59C11310.5000004@arm.com> <alpine.DEB.2.20.1709212332370.15042@digraph.polyomino.org.uk>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
On 22/09/17 00:44, Joseph Myers wrote:
> On Tue, 19 Sep 2017, Szabolcs Nagy wrote:
>> + /* x = k/N + r with r in [-1/(2N), 1/(2N)] and int k. */
>> + kd = (double) (xd + SHIFT); /* Rounding to double precision is required. */
>
> Remark (not an issue while this code isn't used for 32-bit x86): a cast
> may not achieve that rounding with the default -fexcess-precision=fast so
> using this code for 32-bit x86 might require math_narrow_eval here.
>
it seems the generated code for i686 happens to be correct
with gcc-7, but i will add math_narrow_eval if that is
needed for guaranteed rounding here (in case it later gets
enabled for i686).