[PATCH v2 00/11] newlib: RISC-V: Optimize memory and string functions for code size

Jeff Johnston jjohnstn@redhat.com
Fri Apr 11 20:50:19 GMT 2025


With Kito's endorsement, patches have been pushed.  Thanks.

-- Jeff J.

On Fri, Apr 11, 2025 at 9:37 AM Kito Cheng <kito.cheng@gmail.com> wrote:

> Hi M Fally:
>
> V2 is LGTM, thanks!
>
> On Thu, Apr 10, 2025 at 7:27 PM m fally <marlene.fally@gmail.com> wrote:
> >
> > This is version two of the patch series that optimizes the size-optimized
> > versions of memset(), memcpy(), memmove(), and strcmp() for the RISC-V
> port.
> > The majority of instructions in each function will now be compressed when
> > compiled with the C and (optionally) Zcb extensions.
> >
> > The changes to the speed-optimized path of strcmp() introduced in the
> first
> > version of this series have been dropped, and only a small syntactic
> change
> > to this function (replacing add instructions with addi where applicable)
> has
> > been kept. Otherwhise, the patches in this series are identical to
> version one.
> >
> > This is the second patch series that is part of a three-month mentorship
> > to optimize the RISC-V port for speed and size.
> >
> > Eric Salem (1):
> >   RISC-V: memset() size optimized version: Use compressed registers
> >
> > Mahmoud Abumandour (2):
> >   RISC-V: memcpy() size optimized version: Replace lb with lbu
> >   RISC-V: memcpy() size optimized version: Use compressed registers
> >
> > m fally (8):
> >   RISC-V: memmove() size optimized version: Use compressed register
> >   RISC-V: memmove() size optimized version: Use compressed registers
> >     only
> >   RISC-V: memmove() size optimized version: Rename local labels
> >   RISC-V: memmove() size optimized version: Add comments
> >   RISC-V: memmove() size optimized version: Replace lb with lbu
> >   RISC-V: memmove() size optimized version: Relax RAW dependency
> >   RISC-V: memset() size optimized version: Rename local labels
> >   RISC-V: Size optimized versions: Replace add with addi
> >
> >  newlib/libc/machine/riscv/memcpy-asm.S | 12 +++++------
> >  newlib/libc/machine/riscv/memmove.S    | 28 +++++++++++++-------------
> >  newlib/libc/machine/riscv/memset.S     | 16 +++++++--------
> >  newlib/libc/machine/riscv/strcmp.S     |  4 ++--
> >  4 files changed, 30 insertions(+), 30 deletions(-)
> >
> > --
> > 2.49.0
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://sourceware.org/pipermail/newlib/attachments/20250411/3008bc13/attachment.htm>


More information about the Newlib mailing list