This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: soft-fp patch: Use __builtin_clz*
- From: Roland McGrath <roland at redhat dot com>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Thu, 5 Jan 2006 00:06:00 -0800 (PST)
- Subject: Re: soft-fp patch: Use __builtin_clz*
> The soft-fp code has an inefficient generic default implementation of
> __FP_CLZ. GCC 3.4 and greater provide __builtin_clz which can be used for
> a better and simpler implementation. This patch makes soft-fp use these
> built-in functions.
>
> In fact the only non-default definitions of __FP_CLZ are those in
> sysdeps/i386/soft-fp/sfp-machine.h and
> sysdeps/x86_64/soft-fp/sfp-machine.h. GCC knows how to expand
> __builtin_clz/__builtin_clzl properly for both platforms, though on x86_64
> it seems this support isn't there until GCC 4.0.
>From these two statements it's not clear whether __builtin_clz{,l,ll}
actually work on all machines in GCC 3.4 or not. If they don't, then we
can't use them unconditionally here.
Thanks,
Roland