[PATCH 0/4] newlib: riscv: Optimize string functions
Eric Salem
ericsalem@gmail.com
Thu Mar 20 15:32:34 GMT 2025
Forgot to include [1] and [2]:
[1] https://sourceware.org/newlib/faq.html#q8
[2] https://sourceware.org/pipermail/newlib/2025/021500.html
On 3/20/25 10:28 AM, Eric Salem wrote:
> This patch series optimizes a few string functions for the RISC-V port.
> The original implementations were added several years ago, and in the
> time since there have been many extensions ratified that can be used for
> faster performance.
>
> The updated implementations take advantage of a few intrinsic functions
> that use the bit manipulation extension. An implementation of stpcpy()
> for the port was missing, so one was added.
>
> These changes are part of a three-month mentorship to optimize the
> Newlib RISC-V port for both speed and size, and more will follow.
>
> The final commit in this series is for regenerating configuration files.
> As described elsewhere,[1][2] these files don't need to be part of the
> series. They're included only to aid in testing the changes without
> having to manually regenerate the files.
>
> Eric Salem (4):
> newlib: riscv: Add XLEN typedef and clean up types
> newlib: riscv: Optimize strlen()
> newlib: riscv: Add stpcpy() port
> newlib: Regenerate configuration files
>
> newlib/Makefile.in | 22 ++++-
> newlib/configure | 14 +---
> newlib/libc/machine/riscv/Makefile.inc | 2 +-
> newlib/libc/machine/riscv/stpcpy.c | 7 ++
> newlib/libc/machine/riscv/strcpy.c | 52 +-----------
> newlib/libc/machine/riscv/strlen.c | 48 ++++++-----
> newlib/libc/machine/riscv/sys/asm.h | 4 +
> newlib/libc/machine/riscv/sys/string.h | 107 ++++++++++++++++++++++++-
> 8 files changed, 169 insertions(+), 87 deletions(-)
> create mode 100644 newlib/libc/machine/riscv/stpcpy.c
>
More information about the Newlib
mailing list