Skip to content

Commit

Permalink
RISCVX: libc: Add optimized memchr/memcmp
Browse files Browse the repository at this point in the history
Add memchr and memcmp functions that require bit manipulation extension
Regenerated makefiles accordingly

Signed-off-by: BrunoASMauricio <brunoasmauricio@gmail.com>
  • Loading branch information
Bruno Mauricio committed Nov 16, 2023
1 parent c2d2bf3 commit 2fed78d
Show file tree
Hide file tree
Showing 6 changed files with 553 additions and 3 deletions.
81 changes: 79 additions & 2 deletions newlib/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,8 @@ check_PROGRAMS =

@HAVE_LIBC_MACHINE_PRU_TRUE@am__append_113 = libc/machine/pru/setjmp.s
@HAVE_LIBC_MACHINE_RISCV_TRUE@am__append_114 = \
@HAVE_LIBC_MACHINE_RISCV_TRUE@ libc/machine/riscv/memmove.S libc/machine/riscv/memmove-stub.c libc/machine/riscv/memset.S libc/machine/riscv/memcpy-asm.S libc/machine/riscv/memcpy.c libc/machine/riscv/strlen.c \
@HAVE_LIBC_MACHINE_RISCV_TRUE@ libc/machine/riscv/memcmp-stub.c libc/machine/riscv/memchr-stub.c \
@HAVE_LIBC_MACHINE_RISCV_TRUE@ libc/machine/riscv/memchr.S libc/machine/riscv/memcmp.S libc/machine/riscv/memmove.S libc/machine/riscv/memmove-stub.c libc/machine/riscv/memset.S libc/machine/riscv/memcpy-asm.S libc/machine/riscv/memcpy.c libc/machine/riscv/strlen.c \
@HAVE_LIBC_MACHINE_RISCV_TRUE@ libc/machine/riscv/strcpy.c libc/machine/riscv/strcmp.S libc/machine/riscv/setjmp.S libc/machine/riscv/ieeefp.c libc/machine/riscv/ffs.c

@HAVE_LIBC_MACHINE_RL78_TRUE@am__append_115 = libc/machine/rl78/setjmp.S
Expand Down Expand Up @@ -2098,7 +2099,11 @@ am__objects_51 = libc/ssp/libc_a-chk_fail.$(OBJEXT) \
@HAVE_LIBC_MACHINE_POWERPC_TRUE@@HAVE_POWERPC_SPE_TRUE@ libc/machine/powerpc/libc_a-vfprintf.$(OBJEXT) \
@HAVE_LIBC_MACHINE_POWERPC_TRUE@@HAVE_POWERPC_SPE_TRUE@ libc/machine/powerpc/libc_a-vfscanf.$(OBJEXT)
@HAVE_LIBC_MACHINE_PRU_TRUE@am__objects_123 = libc/machine/pru/libc_a-setjmp.$(OBJEXT)
@HAVE_LIBC_MACHINE_RISCV_TRUE@am__objects_124 = libc/machine/riscv/libc_a-memmove.$(OBJEXT) \
@HAVE_LIBC_MACHINE_RISCV_TRUE@am__objects_124 = libc/machine/riscv/libc_a-memcmp-stub.$(OBJEXT) \
@HAVE_LIBC_MACHINE_RISCV_TRUE@ libc/machine/riscv/libc_a-memchr-stub.$(OBJEXT) \
@HAVE_LIBC_MACHINE_RISCV_TRUE@ libc/machine/riscv/libc_a-memchr.$(OBJEXT) \
@HAVE_LIBC_MACHINE_RISCV_TRUE@ libc/machine/riscv/libc_a-memcmp.$(OBJEXT) \
@HAVE_LIBC_MACHINE_RISCV_TRUE@ libc/machine/riscv/libc_a-memmove.$(OBJEXT) \
@HAVE_LIBC_MACHINE_RISCV_TRUE@ libc/machine/riscv/libc_a-memmove-stub.$(OBJEXT) \
@HAVE_LIBC_MACHINE_RISCV_TRUE@ libc/machine/riscv/libc_a-memset.$(OBJEXT) \
@HAVE_LIBC_MACHINE_RISCV_TRUE@ libc/machine/riscv/libc_a-memcpy-asm.$(OBJEXT) \
Expand Down Expand Up @@ -9023,6 +9028,18 @@ libc/machine/riscv/$(am__dirstamp):
libc/machine/riscv/$(DEPDIR)/$(am__dirstamp):
@$(MKDIR_P) libc/machine/riscv/$(DEPDIR)
@: > libc/machine/riscv/$(DEPDIR)/$(am__dirstamp)
libc/machine/riscv/libc_a-memcmp-stub.$(OBJEXT): \
libc/machine/riscv/$(am__dirstamp) \
libc/machine/riscv/$(DEPDIR)/$(am__dirstamp)
libc/machine/riscv/libc_a-memchr-stub.$(OBJEXT): \
libc/machine/riscv/$(am__dirstamp) \
libc/machine/riscv/$(DEPDIR)/$(am__dirstamp)
libc/machine/riscv/libc_a-memchr.$(OBJEXT): \
libc/machine/riscv/$(am__dirstamp) \
libc/machine/riscv/$(DEPDIR)/$(am__dirstamp)
libc/machine/riscv/libc_a-memcmp.$(OBJEXT): \
libc/machine/riscv/$(am__dirstamp) \
libc/machine/riscv/$(DEPDIR)/$(am__dirstamp)
libc/machine/riscv/libc_a-memmove.$(OBJEXT): \
libc/machine/riscv/$(am__dirstamp) \
libc/machine/riscv/$(DEPDIR)/$(am__dirstamp)
Expand Down Expand Up @@ -12979,6 +12996,10 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@libc/machine/powerpc/$(DEPDIR)/libc_a-vfscanf.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libc/machine/riscv/$(DEPDIR)/libc_a-ffs.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libc/machine/riscv/$(DEPDIR)/libc_a-ieeefp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libc/machine/riscv/$(DEPDIR)/libc_a-memchr-stub.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libc/machine/riscv/$(DEPDIR)/libc_a-memchr.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libc/machine/riscv/$(DEPDIR)/libc_a-memcmp-stub.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libc/machine/riscv/$(DEPDIR)/libc_a-memcmp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libc/machine/riscv/$(DEPDIR)/libc_a-memcpy-asm.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libc/machine/riscv/$(DEPDIR)/libc_a-memcpy.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libc/machine/riscv/$(DEPDIR)/libc_a-memmove-stub.Po@am__quote@
Expand Down Expand Up @@ -18867,6 +18888,34 @@ libc/machine/powerpc/libc_a-setjmp.obj: libc/machine/powerpc/setjmp.S
@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CCASFLAGS) $(CCASFLAGS) -c -o libc/machine/powerpc/libc_a-setjmp.obj `if test -f 'libc/machine/powerpc/setjmp.S'; then $(CYGPATH_W) 'libc/machine/powerpc/setjmp.S'; else $(CYGPATH_W) '$(srcdir)/libc/machine/powerpc/setjmp.S'; fi`

libc/machine/riscv/libc_a-memchr.o: libc/machine/riscv/memchr.S
@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CCASFLAGS) $(CCASFLAGS) -MT libc/machine/riscv/libc_a-memchr.o -MD -MP -MF libc/machine/riscv/$(DEPDIR)/libc_a-memchr.Tpo -c -o libc/machine/riscv/libc_a-memchr.o `test -f 'libc/machine/riscv/memchr.S' || echo '$(srcdir)/'`libc/machine/riscv/memchr.S
@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) libc/machine/riscv/$(DEPDIR)/libc_a-memchr.Tpo libc/machine/riscv/$(DEPDIR)/libc_a-memchr.Po
@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='libc/machine/riscv/memchr.S' object='libc/machine/riscv/libc_a-memchr.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CCASFLAGS) $(CCASFLAGS) -c -o libc/machine/riscv/libc_a-memchr.o `test -f 'libc/machine/riscv/memchr.S' || echo '$(srcdir)/'`libc/machine/riscv/memchr.S

libc/machine/riscv/libc_a-memchr.obj: libc/machine/riscv/memchr.S
@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CCASFLAGS) $(CCASFLAGS) -MT libc/machine/riscv/libc_a-memchr.obj -MD -MP -MF libc/machine/riscv/$(DEPDIR)/libc_a-memchr.Tpo -c -o libc/machine/riscv/libc_a-memchr.obj `if test -f 'libc/machine/riscv/memchr.S'; then $(CYGPATH_W) 'libc/machine/riscv/memchr.S'; else $(CYGPATH_W) '$(srcdir)/libc/machine/riscv/memchr.S'; fi`
@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) libc/machine/riscv/$(DEPDIR)/libc_a-memchr.Tpo libc/machine/riscv/$(DEPDIR)/libc_a-memchr.Po
@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='libc/machine/riscv/memchr.S' object='libc/machine/riscv/libc_a-memchr.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CCASFLAGS) $(CCASFLAGS) -c -o libc/machine/riscv/libc_a-memchr.obj `if test -f 'libc/machine/riscv/memchr.S'; then $(CYGPATH_W) 'libc/machine/riscv/memchr.S'; else $(CYGPATH_W) '$(srcdir)/libc/machine/riscv/memchr.S'; fi`

libc/machine/riscv/libc_a-memcmp.o: libc/machine/riscv/memcmp.S
@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CCASFLAGS) $(CCASFLAGS) -MT libc/machine/riscv/libc_a-memcmp.o -MD -MP -MF libc/machine/riscv/$(DEPDIR)/libc_a-memcmp.Tpo -c -o libc/machine/riscv/libc_a-memcmp.o `test -f 'libc/machine/riscv/memcmp.S' || echo '$(srcdir)/'`libc/machine/riscv/memcmp.S
@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) libc/machine/riscv/$(DEPDIR)/libc_a-memcmp.Tpo libc/machine/riscv/$(DEPDIR)/libc_a-memcmp.Po
@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='libc/machine/riscv/memcmp.S' object='libc/machine/riscv/libc_a-memcmp.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CCASFLAGS) $(CCASFLAGS) -c -o libc/machine/riscv/libc_a-memcmp.o `test -f 'libc/machine/riscv/memcmp.S' || echo '$(srcdir)/'`libc/machine/riscv/memcmp.S

libc/machine/riscv/libc_a-memcmp.obj: libc/machine/riscv/memcmp.S
@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CCASFLAGS) $(CCASFLAGS) -MT libc/machine/riscv/libc_a-memcmp.obj -MD -MP -MF libc/machine/riscv/$(DEPDIR)/libc_a-memcmp.Tpo -c -o libc/machine/riscv/libc_a-memcmp.obj `if test -f 'libc/machine/riscv/memcmp.S'; then $(CYGPATH_W) 'libc/machine/riscv/memcmp.S'; else $(CYGPATH_W) '$(srcdir)/libc/machine/riscv/memcmp.S'; fi`
@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) libc/machine/riscv/$(DEPDIR)/libc_a-memcmp.Tpo libc/machine/riscv/$(DEPDIR)/libc_a-memcmp.Po
@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='libc/machine/riscv/memcmp.S' object='libc/machine/riscv/libc_a-memcmp.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CCASFLAGS) $(CCASFLAGS) -c -o libc/machine/riscv/libc_a-memcmp.obj `if test -f 'libc/machine/riscv/memcmp.S'; then $(CYGPATH_W) 'libc/machine/riscv/memcmp.S'; else $(CYGPATH_W) '$(srcdir)/libc/machine/riscv/memcmp.S'; fi`

libc/machine/riscv/libc_a-memmove.o: libc/machine/riscv/memmove.S
@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CCASFLAGS) $(CCASFLAGS) -MT libc/machine/riscv/libc_a-memmove.o -MD -MP -MF libc/machine/riscv/$(DEPDIR)/libc_a-memmove.Tpo -c -o libc/machine/riscv/libc_a-memmove.o `test -f 'libc/machine/riscv/memmove.S' || echo '$(srcdir)/'`libc/machine/riscv/memmove.S
@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) libc/machine/riscv/$(DEPDIR)/libc_a-memmove.Tpo libc/machine/riscv/$(DEPDIR)/libc_a-memmove.Po
Expand Down Expand Up @@ -34283,6 +34332,34 @@ libc/machine/powerpc/libc_a-ufix64toa.obj: libc/machine/powerpc/ufix64toa.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/machine/powerpc/libc_a-ufix64toa.obj `if test -f 'libc/machine/powerpc/ufix64toa.c'; then $(CYGPATH_W) 'libc/machine/powerpc/ufix64toa.c'; else $(CYGPATH_W) '$(srcdir)/libc/machine/powerpc/ufix64toa.c'; fi`

libc/machine/riscv/libc_a-memcmp-stub.o: libc/machine/riscv/memcmp-stub.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/machine/riscv/libc_a-memcmp-stub.o -MD -MP -MF libc/machine/riscv/$(DEPDIR)/libc_a-memcmp-stub.Tpo -c -o libc/machine/riscv/libc_a-memcmp-stub.o `test -f 'libc/machine/riscv/memcmp-stub.c' || echo '$(srcdir)/'`libc/machine/riscv/memcmp-stub.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/machine/riscv/$(DEPDIR)/libc_a-memcmp-stub.Tpo libc/machine/riscv/$(DEPDIR)/libc_a-memcmp-stub.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/machine/riscv/memcmp-stub.c' object='libc/machine/riscv/libc_a-memcmp-stub.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/machine/riscv/libc_a-memcmp-stub.o `test -f 'libc/machine/riscv/memcmp-stub.c' || echo '$(srcdir)/'`libc/machine/riscv/memcmp-stub.c

libc/machine/riscv/libc_a-memcmp-stub.obj: libc/machine/riscv/memcmp-stub.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/machine/riscv/libc_a-memcmp-stub.obj -MD -MP -MF libc/machine/riscv/$(DEPDIR)/libc_a-memcmp-stub.Tpo -c -o libc/machine/riscv/libc_a-memcmp-stub.obj `if test -f 'libc/machine/riscv/memcmp-stub.c'; then $(CYGPATH_W) 'libc/machine/riscv/memcmp-stub.c'; else $(CYGPATH_W) '$(srcdir)/libc/machine/riscv/memcmp-stub.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/machine/riscv/$(DEPDIR)/libc_a-memcmp-stub.Tpo libc/machine/riscv/$(DEPDIR)/libc_a-memcmp-stub.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/machine/riscv/memcmp-stub.c' object='libc/machine/riscv/libc_a-memcmp-stub.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/machine/riscv/libc_a-memcmp-stub.obj `if test -f 'libc/machine/riscv/memcmp-stub.c'; then $(CYGPATH_W) 'libc/machine/riscv/memcmp-stub.c'; else $(CYGPATH_W) '$(srcdir)/libc/machine/riscv/memcmp-stub.c'; fi`

libc/machine/riscv/libc_a-memchr-stub.o: libc/machine/riscv/memchr-stub.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/machine/riscv/libc_a-memchr-stub.o -MD -MP -MF libc/machine/riscv/$(DEPDIR)/libc_a-memchr-stub.Tpo -c -o libc/machine/riscv/libc_a-memchr-stub.o `test -f 'libc/machine/riscv/memchr-stub.c' || echo '$(srcdir)/'`libc/machine/riscv/memchr-stub.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/machine/riscv/$(DEPDIR)/libc_a-memchr-stub.Tpo libc/machine/riscv/$(DEPDIR)/libc_a-memchr-stub.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/machine/riscv/memchr-stub.c' object='libc/machine/riscv/libc_a-memchr-stub.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/machine/riscv/libc_a-memchr-stub.o `test -f 'libc/machine/riscv/memchr-stub.c' || echo '$(srcdir)/'`libc/machine/riscv/memchr-stub.c

libc/machine/riscv/libc_a-memchr-stub.obj: libc/machine/riscv/memchr-stub.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/machine/riscv/libc_a-memchr-stub.obj -MD -MP -MF libc/machine/riscv/$(DEPDIR)/libc_a-memchr-stub.Tpo -c -o libc/machine/riscv/libc_a-memchr-stub.obj `if test -f 'libc/machine/riscv/memchr-stub.c'; then $(CYGPATH_W) 'libc/machine/riscv/memchr-stub.c'; else $(CYGPATH_W) '$(srcdir)/libc/machine/riscv/memchr-stub.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/machine/riscv/$(DEPDIR)/libc_a-memchr-stub.Tpo libc/machine/riscv/$(DEPDIR)/libc_a-memchr-stub.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/machine/riscv/memchr-stub.c' object='libc/machine/riscv/libc_a-memchr-stub.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/machine/riscv/libc_a-memchr-stub.obj `if test -f 'libc/machine/riscv/memchr-stub.c'; then $(CYGPATH_W) 'libc/machine/riscv/memchr-stub.c'; else $(CYGPATH_W) '$(srcdir)/libc/machine/riscv/memchr-stub.c'; fi`

libc/machine/riscv/libc_a-memmove-stub.o: libc/machine/riscv/memmove-stub.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/machine/riscv/libc_a-memmove-stub.o -MD -MP -MF libc/machine/riscv/$(DEPDIR)/libc_a-memmove-stub.Tpo -c -o libc/machine/riscv/libc_a-memmove-stub.o `test -f 'libc/machine/riscv/memmove-stub.c' || echo '$(srcdir)/'`libc/machine/riscv/memmove-stub.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/machine/riscv/$(DEPDIR)/libc_a-memmove-stub.Tpo libc/machine/riscv/$(DEPDIR)/libc_a-memmove-stub.Po
Expand Down
3 changes: 2 additions & 1 deletion newlib/libc/machine/riscv/Makefile.inc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
libc_a_SOURCES += \
%D%/memmove.S %D%/memmove-stub.c %D%/memset.S %D%/memcpy-asm.S %D%/memcpy.c %D%/strlen.c \
%D%/memcmp-stub.c %D%/memchr-stub.c \
%D%/memchr.S %D%/memcmp.S %D%/memmove.S %D%/memmove-stub.c %D%/memset.S %D%/memcpy-asm.S %D%/memcpy.c %D%/strlen.c \
%D%/strcpy.c %D%/strcmp.S %D%/setjmp.S %D%/ieeefp.c %D%/ffs.c
36 changes: 36 additions & 0 deletions newlib/libc/machine/riscv/memchr-stub.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
Copyright (c) 2023, Synopsys, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1) Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2) Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3) Neither the name of the Synopsys, Inc., nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/

#if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) \
|| __riscv_xlen == 64 || !defined(__riscv_zbb)
# include "../../string/memchr.c"
#else
/* See memchr.S */
#endif
Loading

0 comments on commit 2fed78d

Please sign in to comment.