This is the mail archive of the
mailing list for the glibc project.
Re: PATCH: Use __builtin_clzll in 64-bit __logb
On Mon, 14 May 2012, Jakub Jelinek wrote:
> On Mon, May 14, 2012 at 09:13:05PM +0200, Andreas Jaeger wrote:
> > On 05/11/2012 02:22 PM, H.J. Lu wrote:
> > >X32 uses 64-bit math function. But its long is 32bit. 64-bit __logb
> > >should use __builtin_clzll instead of __builtin_clzl. Testd on Linux/x32
> > >and Linux/x86-64. OK to install?
> It seems very weird to use wordsize-64/ directories for non-wordsize-64
This gets into the general issue of the two meanings, "64-bit ABI - long,
off_t etc. are always 64-bit" (so various "long" and "long long" functions
can be aliases, for example) and "64-bit is the native size for various
operations, so use 64-bit types internally". Hitherto wordsize-64 has
been the former (which implies the latter). We haven't really had a way
to configure the latter in sysdeps directories, although you can make
gmp-mparam.h use a 64-bit type for the GMP code (and that, and soft-fp, is
the only way MIPS n32 really uses 64-bit internally in glibc).
Like MIPS n32, x32 is a case of 64-bit registers but 32-bit ABI; logically
we should maybe have separate sysdeps directories for this case, and if
necessary an associated define separate from __WORDSIZE. Most of the
dbl-64/wordsize-64 code is the "register size" case - except for lround /
llround where the size of "long" comes into it.
Joseph S. Myers