[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: glibc - capaibility control mechanism



At Fri, 1 Apr 2005 21:56:03 -0500,
Daniel Jacobowitz wrote:
> > >                        it will not disable SSE.
> > 
> > SSE is masked off by default, I asked for how to enable it.
> 
> Build a glibc which considers it a relevant capability for library
> selection.  It's just a matter of setting the bit in HWCAP_IMPORTANT.

Note that another way is to use LD_HWCAP_MASK.  LD_HWCAP_MASK
overwrites the default HWCAP_IMPORTANT mask in rtld.c.

However it just changes HWCAP value - so we need to make ld.so to
search library path using some library search path modifying
environment variable (ex: LD_LIBRARY_PATH).

I think the simple shell script wrapper controlling HWCAP_MASK can
achieve the original request by Bastian.  The script also controls to
set LD_ASSUME_KERNEL automatically from the current running kernel
version.  If an application (ex: UML and Xen) is sensitive to the
glibc's tls and so on, it should be wrapped by a script, and the
script calls (or includes) our wrapper script that controls
HWCAP_MASK.



BTW, I think various hwcap like "sse" should not be encouraged to use
by users and developers.  Sometimes speed-crazy developers want to
play with optimized libraries only changing gcc optimized options.
However in most case they don't provide any performance gain value.  I
also think it's the same situation with the glibc optimized libraries
(alpha, sparcv9/v9b) (note that i686 optimized library has the exact
merit).

If gcc will have good support of automatic optimization using SSE that
sometimes gets much performance gain (ex: intel compiler -ip option),
it's nice to consider such generic searching path mechanism for "sse".
However, that possibly degrades the precision of the computed result.
So we should be care to enable SSE everytime as well.

Regards,
-- gotom



Reply to: