[PATCH][powerpc] Fix stpcpy performance for power8

Adhemerval Zanella adhemerval.zanella@linaro.org
Mon Jul 27 13:25:00 GMT 2015


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)
> 



More information about the Libc-alpha mailing list