This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH][powerpc] Fix stpcpy performance for power8
- From: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- To: libc-alpha at sourceware dot org
- Date: Mon, 27 Jul 2015 10:25:42 -0300
- Subject: Re: [PATCH][powerpc] Fix stpcpy performance for power8
- Authentication-results: sourceware.org; auth=none
- References: <20150727124637 dot GA12017 at domone>
LGTM, thanks for checking on that.
On 27-07-2015 09:46, OndÅej BÃlka wrote:
> Hi,
>
> I decided to read powerpc code that according to statements only people
> with good intuition could understand so I was curious what these experts
> do to get good performance.
>
> Here its most elementary problem, it wasn't turned on. Fixing that is
> obvious, add implementation to ifunc.
>
> * sysdeps/powerpc/powerpc64/multiarch/stpcpy.c: Fix ifunc.
>
> diff --git a/sysdeps/powerpc/powerpc64/multiarch/stpcpy.c b/sysdeps/powerpc/powerpc64/multiarch/stpcpy.c
> index a5e1c03..3a25cf8 100644
> --- a/sysdeps/powerpc/powerpc64/multiarch/stpcpy.c
> +++ b/sysdeps/powerpc/powerpc64/multiarch/stpcpy.c
> @@ -24,10 +24,13 @@
>
> extern __typeof (__stpcpy) __stpcpy_ppc attribute_hidden;
> extern __typeof (__stpcpy) __stpcpy_power7 attribute_hidden;
> +extern __typeof (__stpcpy) __stpcpy_power8 attribute_hidden;
>
> libc_ifunc (__stpcpy,
> - (hwcap & PPC_FEATURE_HAS_VSX)
> - ? __stpcpy_power7
> + (hwcap2 & PPC_FEATURE2_ARCH_2_07)
> + ? __stpcpy_power8 :
> + (hwcap & PPC_FEATURE_HAS_VSX)
> + ? __stpcpy_power7
> : __stpcpy_ppc);
>
> weak_alias (__stpcpy, stpcpy)
>