This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 03/28] powerpc: Remove power4 mpa optimization
- From: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- To: "Gabriel F. T. Gomes" <gabriel at inconstante dot eti dot br>
- Cc: libc-alpha at sourceware dot org
- Date: Thu, 25 Apr 2019 09:19:54 -0300
- Subject: Re: [PATCH 03/28] powerpc: Remove power4 mpa optimization
- References: <20190329133529.22523-1-adhemerval.zanella@linaro.org> <20190329133529.22523-4-adhemerval.zanella@linaro.org> <20190424215144.pyv35t5ceovhfqxc@tereshkova>
On 24/04/2019 18:51, Gabriel F. T. Gomes wrote:
>
> On Fri, Mar 29 2019, Adhemerval Zanella wrote:
>> This patch removes the POWER4 optimized mpa optimization used for power4+
>> build. For newer chips, GCC generates *worse* code than generic
>> implementation as benchmaks result below.
>
> I don't think I have access to POWER4 hardware, but when running
> power4-targeted builds on newer processors, I saw no performance
> degradation even in that scenario.
My guess is the optimization was trying to overcome some compiler
missed optimization (POWER4 was released at same time as GCC 3.2.3
and mostly likely distributions were using even older releases to
build system libc).
>
>> One possibilty would to add
>> IFUNC variants for the mpa routines (as x86_64), but it will add complexity
>> only for older chips (and one would need to check if power5, power5+, and
>> power6 do benefict from this optimization), and only for specific
>> implementation (since most used ones such as sin, cos, exp, pow already
>> avoid calling the slow multiprecision path).
>
> I don't think it's worth the effort.
Agreed.
>
>> Checked on powerpc-linux-gnu (built without --with-cpu, with
>> --with-cpu=power4 and with --with-cpu=power5+ and --disable-multi-arch),
>> powerpc64-linux-gnu (built without --with-cp and with --with-cpu=power5+
>> and --disable-multi-arch).
>
> Thanks for the thorough checking.
>
>> * sysdeps/powerpc/power4/fpu/Makefile: Remove file.
>> * sysdeps/powerpc/power4/fpu/mpa-arch.h: Likewise.
>> * sysdeps/powerpc/power4/fpu/mpa.c: Likewise.
>
> Looks good to me.
>
> Reviewed-by: Gabriel F. T. Gomes <gabriel@inconstante.eti.br>
>
Thanks.