[PATCH] powerpc64le: Optimized strcat for POWER10Peter Bergner <bergner@linux.ibm.com>
MAHESH BODAPATI
bmahi496@linux.ibm.com
Mon Nov 11 05:23:32 GMT 2024
On 09/11/24 12:42 am, Peter Bergner wrote:
> On 11/8/24 8:01 AM, Mahesh Bodapati wrote:
>> With the new optimized strcpy and strlen implementation, this patch adds an
>> --- a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
>> +++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
>> @@ -406,6 +406,11 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
>>
>> /* Support sysdeps/powerpc/powerpc64/multiarch/strcat.c. */
>> IFUNC_IMPL (i, name, strcat,
>> +#ifdef __LITTLE_ENDIAN__
>> + IFUNC_IMPL_ADD (array, i, strcpy, hwcap2 & PPC_FEATURE2_ARCH_3_1
>> + && hwcap & PPC_FEATURE_HAS_VSX,
>> + __strcat_power10)
>> +#endif
>> IFUNC_IMPL_ADD (array, i, strcat,
>> hwcap2 & PPC_FEATURE2_ARCH_2_07
>> && hwcap & PPC_FEATURE_HAS_VSX,
> Why the limitation here and in the other files of this being guarded
> by #ifdef __LITTLE_ENDIAN__ ? The strcat-power8.c optimization is not
> guarded by that, so why the Power10 version? If it can be used on
> big-endian too, then please remove the #ifdef tests and enable it
> everywhere.
strcat uses strlen and strcpy library functions and these functions are
optimized for little endian so guarded with
#ifdef __LITTLE_ENDIAN__ where as power8 versions of strlen and strcpy
are optimized for both little endian and big endian.
>
>> + IFUNC_IMPL_ADD (array, i, strcpy, hwcap2 & PPC_FEATURE2_ARCH_3_1
> I believe the strcpy in the line above should be strcat like the entry
> just below it?
yes,you are right. I will update.
>
>
>
>
>
>
>> --- a/sysdeps/powerpc/powerpc64/multiarch/strcat.c
>> +++ b/sysdeps/powerpc/powerpc64/multiarch/strcat.c
>> @@ -25,14 +25,23 @@
>> extern __typeof (strcat) __strcat_ppc attribute_hidden;
>> extern __typeof (strcat) __strcat_power7 attribute_hidden;
>> extern __typeof (strcat) __strcat_power8 attribute_hidden;
>> +#ifdef __LITTLE_ENDIAN__
>> +extern __typeof (strcat) __strcat_power10 attribute_hidden;
>> +#endif
>> # undef strcat
>>
>> +
> Stray whitespace.
I will update.
>
> Peter
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20241111/a080ec92/attachment.htm>
More information about the Libc-alpha
mailing list