This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Improves __ieee754_exp() performance by greater than 5x on sparc/x86.

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]