This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] powerpc: Optimized strncat for POWER8


Rajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com> writes:

> With new optimized strnlen for POWER8 [1], this patch adds
> strncat for power8 to make use of optimized strlen and strnlen.
> This is faster than POWER7 current implementation for larger strings.
>
> Tested on powerpc64 and powerpc64le.
>
> [1] https://sourceware.org/ml/libc-alpha/2017-03/msg00491.html
>
> --
> 2017-04-10  Rajalakshmi Srinivasaraghavan  <raji@linux.vnet.ibm.com>
>
> 	* sysdeps/powerpc/powerpc64/multiarch/Makefile (sysdep_routines): Add
> 	strncat-power8.
> 	* sysdeps/powerpc/powerpc64/multiarch/strncat.c (strncat): Add
> 	__strncat_power8 to ifunc list.
> 	* sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
> 	(strncat): Add __strncat_power8 to list of strncat functions.
> 	* sysdeps/powerpc/powerpc64/multiarch/strncat-power8.c: New file.

> diff --git a/sysdeps/powerpc/powerpc64/multiarch/Makefile b/sysdeps/powerpc/powerpc64/multiarch/Makefile
> index 38233a7..0eb3d07 100644
> --- a/sysdeps/powerpc/powerpc64/multiarch/Makefile
> +++ b/sysdeps/powerpc/powerpc64/multiarch/Makefile
> @@ -15,7 +15,8 @@ sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
>  		   strchrnul-power8 strchrnul-power7 strchrnul-ppc64 \
>  		   strcpy-power8 strcpy-power7 strcpy-ppc64 stpcpy-power8 \
>  		   stpcpy-power7 stpcpy-ppc64 \
> -		   strrchr-power7 strrchr-ppc64 strncat-power7 strncat-ppc64 \
> +		   strrchr-power7 strrchr-ppc64 \
> +		   strncat-power8 strncat-power7 strncat-ppc64 \

I wonder if these C optimizations should be forced to build using -mcpu and
-mtune.  At least for those processors supported by the minimum required GCC
version.
Anyway, it shouldn't affect your patch as -mcpu=power8 isn't available on
GCC 4.7

LGTM.

-- 
Tulio Magno


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]