Re: Re: glibc recompile - optimized for G5 cpu target
On Mon, Jan 11, 2016 at 08:31:39PM +1100, Peter Saisanas wrote:
> Hi Brock,
> I have tried lmbench and recompiled glibc 2.21-6 with -O3 and -O2
> optimizations with the cflags below:
> extra_cflags = -mcpu=G5 -mtune=G5 -maltivec -mabi=altivec
>
> I haven't actually seen any marked difference to the results coming out of
> lmbench when using the default Debian glibc and my recompiled glibc with
> cflags above and -O2 and O3 optimization levels.
>
> In other words, i can equate my naive attempts at ricing out glibc the
> equivalent of just adding a sports muffler and big spoiler. :)
>
> My Debian install does seem to be running quite well, it does seem to
> perform a just that little bit better, but perhaps it is just a placebo
> effect!
>
> So unless I'm using the wrong benchmark, or the chosen cflags have no effect
> on the compilers output of glibc, i have nothing to show for my efforts! :(
>
> Am i doing something wrong, or is there simply no extra performance to be
> had just by playing with the cflags and recompiling glibc?
glibc already has optimized versions of key functions and will pick the
right one based on the CPU it is running on.
So no I would actually not expect to see any noticeable change.
For example strcpy does:
libc_ifunc (__stpcpy,
(hwcap2 & PPC_FEATURE2_ARCH_2_07)
? __stpcpy_power8 :
(hwcap & PPC_FEATURE_HAS_VSX)
? __stpcpy_power7
: __stpcpy_ppc);
So if on a power8 it calls the power8 optimized function, otherwise on
a power7 it calls the next best one, and otherwise it uses the generic
ppc one.
--
Len Sorensen
Reply to: