From fb3937fade3487b7bd181bc6ab50c74637b6757f Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Thu, 3 May 2007 19:45:26 +0000 Subject: [PATCH] * libc/machine/m68k/Makefile.am (lib_a_SOURCES): Add memcpy.S and memset.S. * libc/machine/m68k/Makefile.in: Regenerate. * libc/machine/m68k/memcpy.S: Use sub.l followed by dbra. * libc/machine/m68k/memset.S: Likewise. --- newlib/ChangeLog | 8 ++++++++ newlib/libc/machine/m68k/Makefile.am | 2 +- newlib/libc/machine/m68k/Makefile.in | 17 +++++++++++++++-- newlib/libc/machine/m68k/memcpy.S | 3 ++- newlib/libc/machine/m68k/memset.S | 3 ++- 5 files changed, 28 insertions(+), 5 deletions(-) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 0d7930fcc..628c8be8f 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,11 @@ +2007-05-03 Kazu Hirata + + * libc/machine/m68k/Makefile.am (lib_a_SOURCES): Add memcpy.S + and memset.S. + * libc/machine/m68k/Makefile.in: Regenerate. + * libc/machine/m68k/memcpy.S: Use sub.l followed by dbra. + * libc/machine/m68k/memset.S: Likewise. + 2007-05-01 Eric Blake * libc/stdio64/local64.h: Delete, move contents to... diff --git a/newlib/libc/machine/m68k/Makefile.am b/newlib/libc/machine/m68k/Makefile.am index d2a19f1fa..11d78eb3c 100644 --- a/newlib/libc/machine/m68k/Makefile.am +++ b/newlib/libc/machine/m68k/Makefile.am @@ -8,7 +8,7 @@ AM_CCASFLAGS = $(INCLUDES) noinst_LIBRARIES = lib.a -lib_a_SOURCES = setjmp.S strcpy.c strlen.c +lib_a_SOURCES = setjmp.S strcpy.c strlen.c memcpy.S memset.S lib_a_CCASFLAGS=$(AM_CCASFLAGS) lib_a_CFLAGS=$(AM_CFLAGS) diff --git a/newlib/libc/machine/m68k/Makefile.in b/newlib/libc/machine/m68k/Makefile.in index b812487f2..0615e51d4 100644 --- a/newlib/libc/machine/m68k/Makefile.in +++ b/newlib/libc/machine/m68k/Makefile.in @@ -56,7 +56,8 @@ ARFLAGS = cru lib_a_AR = $(AR) $(ARFLAGS) lib_a_LIBADD = am_lib_a_OBJECTS = lib_a-setjmp.$(OBJEXT) lib_a-strcpy.$(OBJEXT) \ - lib_a-strlen.$(OBJEXT) + lib_a-strlen.$(OBJEXT) lib_a-memcpy.$(OBJEXT) \ + lib_a-memset.$(OBJEXT) lib_a_OBJECTS = $(am_lib_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) depcomp = @@ -181,7 +182,7 @@ AUTOMAKE_OPTIONS = cygnus INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) AM_CCASFLAGS = $(INCLUDES) noinst_LIBRARIES = lib.a -lib_a_SOURCES = setjmp.S strcpy.c strlen.c +lib_a_SOURCES = setjmp.S strcpy.c strlen.c memcpy.S memset.S lib_a_CCASFLAGS = $(AM_CCASFLAGS) lib_a_CFLAGS = $(AM_CFLAGS) ACLOCAL_AMFLAGS = -I ../../.. @@ -249,6 +250,18 @@ lib_a-setjmp.o: setjmp.S lib_a-setjmp.obj: setjmp.S $(CCAS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-setjmp.obj `if test -f 'setjmp.S'; then $(CYGPATH_W) 'setjmp.S'; else $(CYGPATH_W) '$(srcdir)/setjmp.S'; fi` +lib_a-memcpy.o: memcpy.S + $(CCAS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-memcpy.o `test -f 'memcpy.S' || echo '$(srcdir)/'`memcpy.S + +lib_a-memcpy.obj: memcpy.S + $(CCAS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-memcpy.obj `if test -f 'memcpy.S'; then $(CYGPATH_W) 'memcpy.S'; else $(CYGPATH_W) '$(srcdir)/memcpy.S'; fi` + +lib_a-memset.o: memset.S + $(CCAS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-memset.o `test -f 'memset.S' || echo '$(srcdir)/'`memset.S + +lib_a-memset.obj: memset.S + $(CCAS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-memset.obj `if test -f 'memset.S'; then $(CYGPATH_W) 'memset.S'; else $(CYGPATH_W) '$(srcdir)/memset.S'; fi` + .c.o: $(COMPILE) -c $< diff --git a/newlib/libc/machine/m68k/memcpy.S b/newlib/libc/machine/m68k/memcpy.S index 300397102..ed9e7b2a1 100644 --- a/newlib/libc/machine/m68k/memcpy.S +++ b/newlib/libc/machine/m68k/memcpy.S @@ -73,10 +73,11 @@ memcpy: .Lcopy: #if !defined (__mcoldfire__) dbra %d0,1b + sub.l #0x10000,%d0 #else subq.l #1,%d0 - bpl 1b #endif + bpl 1b bra .Lresidue 1: diff --git a/newlib/libc/machine/m68k/memset.S b/newlib/libc/machine/m68k/memset.S index 10e3c3e2c..545bf7e7d 100644 --- a/newlib/libc/machine/m68k/memset.S +++ b/newlib/libc/machine/m68k/memset.S @@ -76,10 +76,11 @@ memset: .Llset: #if !defined (__mcoldfire__) dbra %d2,1b | loop until done + sub.l #0x10000,%d2 #else subq.l #1,%d2 - bpl 1b #endif + bpl 1b and.l #3,%d1 | residue byte transfers, fixed move.l (%sp)+,%d2 | restore d2 bra .Lbset