[PATCH 0/4] newlib: riscv: Optimize string functions

Corinna Vinschen vinschen@redhat.com
Mon Mar 24 11:20:47 GMT 2025


Hi Eric,

On Mar 20 10:28, 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
> 
> -- 
> 2.49.0

Pushed.

Thanks,
Corinna



More information about the Newlib mailing list