This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Improves __ieee754_exp() performance by greater than 5x on sparc/x86.
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Patrick McGehearty <patrick dot mcgehearty at oracle dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Thu, 26 Oct 2017 17:19:52 +0000
- Subject: Re: [PATCH] Improves __ieee754_exp() performance by greater than 5x on sparc/x86.
- Authentication-results: sourceware.org; auth=none
- References: <1509036263-113745-1-git-send-email-patrick.mcgehearty@oracle.com>
On Thu, 26 Oct 2017, Patrick McGehearty wrote:
> Replaced tables of double float constants with hex constants, taking special
> attention to correctly handle little endian and big endian versions.
> Using hex initialization also required changing variables to be declared
> as unions. Tables moved from e_exp.c to sysdeps/ieee754/dbl-64/eexp.tbl.
There should be no endian-dependent constants or tables of constants.
See my comments in the commit message for commit
60f435bb0c097ead2d4609aa7e45a203eb24e43c where I cleaned up some such
existing endian-dependent definitions.
Unless a particular constant, table etc. is needed in the code both as
integers and as double, just define it as double and initialize with a C99
hex float constant, without involving unions at all. This certainly
applies to some of your constants, possibly all of them.
If both the double and int parts of a union are actually referenced (and
while the code certainly references both parts for *variables*, it seems
less likely the integer parts are of use for *constants*), use C99
designated initializers to initialize the double part of the union, again
using a C99 hex float constant.
--
Joseph S. Myers
joseph@codesourcery.com