[PATCH 1/2] powerpc: Optimized strncpy for POWER9
Tulio Magno Quites Machado Filho
tuliom@ascii.art.br
Wed Sep 2 13:20:20 GMT 2020
Raphael Moreira Zinsly via Libc-alpha <libc-alpha@sourceware.org> writes:
> diff --git a/sysdeps/powerpc/powerpc64/le/power9/strncpy.S b/sysdeps/powerpc/powerpc64/le/power9/strncpy.S
> new file mode 100644
> index 0000000000..cde68384d4
> --- /dev/null
> +++ b/sysdeps/powerpc/powerpc64/le/power9/strncpy.S
> @@ -0,0 +1,276 @@
> ...
> +/* Implements the function
> +
> + char * [r3] strncpy (char *dest [r3], const char *src [r4], size_t n [r5])
> +
> + The implementation can load bytes past a null terminator, but only
> + up to the next 16B boundary, so it never crosses a page. */
> +
> +.machine power9
I don't think Binutils 2.26 supports .machine power9. Likewise for all P9
instructions. However, current glibc is expected to work with Binutils 2.26
(ppc64le), i.e. builds with Binutils 2.26 should not fail.
So, we either need to change this code (e.g. similar to strcmp) or we need
to bump the Binutils requirements.
The last time Binutils requirements was bumped was in 2017, so I think it's safe
to do this now.
Let me prepare a patch proposing this.
--
Tulio Magno
More information about the Libc-alpha
mailing list