summaryrefslogtreecommitdiffstats
path: root/libc/string/generic/memmove.c
diff options
context:
space:
mode:
authorCarmelo Amoroso <carmelo.amoroso@st.com>2007-11-21 17:29:48 +0000
committerCarmelo Amoroso <carmelo.amoroso@st.com>2007-11-21 17:29:48 +0000
commitef03156d712bf652b458c2cfd11090777d924591 (patch)
treea3d611e30fd197986aeb4e21e8e71958ddbdc114 /libc/string/generic/memmove.c
parentf1957ec57dd1667021d7ee4c801f4662c45beb4f (diff)
downloaduClibc-alpine-ef03156d712bf652b458c2cfd11090777d924591.tar.bz2
uClibc-alpine-ef03156d712bf652b458c2cfd11090777d924591.tar.xz
Added optmized memcpy implementation for SH4
(backward memcpy algorithm) Modified libc/string/generic/Makefile.in to handle subtarget implementations. Fixed generic memmove code to handle backward memcpy by using a selectable config option __ARCH_HAS_BWD_MEMCPY__ This option is on for SH4 arch Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Diffstat (limited to 'libc/string/generic/memmove.c')
-rw-r--r--libc/string/generic/memmove.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/libc/string/generic/memmove.c b/libc/string/generic/memmove.c
index 68caacd78..febf014ca 100644
--- a/libc/string/generic/memmove.c
+++ b/libc/string/generic/memmove.c
@@ -29,7 +29,8 @@ libc_hidden_proto(memcpy)
static void _wordcopy_bwd_aligned (long int dstp, long int srcp, size_t len)
{
- op_t a0, a1;
+ op_t a0 = 0;
+ op_t a1 = 0;
switch (len % 8)
{
@@ -133,7 +134,10 @@ static void _wordcopy_bwd_aligned (long int dstp, long int srcp, size_t len)
static void _wordcopy_bwd_dest_aligned (long int dstp, long int srcp, size_t len)
{
- op_t a0, a1, a2, a3;
+ op_t a0 = 0;
+ op_t a1 = 0;
+ op_t a2 = 0;
+ op_t a3 = 0;
int sh_1, sh_2;
/* Calculate how to shift a word read at the memory operation
@@ -218,8 +222,8 @@ void *memmove (void *dest, const void *src, size_t len)
Reduces the working set. */
if (dstp - srcp >= len) /* *Unsigned* compare! */
{
-#if 1
-#warning REMINDER: generic-opt memmove assumes memcpy does forward copying!
+#ifndef __ARCH_HAS_BWD_MEMCPY__
+ /* generic-opt memmove assumes memcpy does forward copying! */
memcpy(dest, src, len);
#else
/* Copy from the beginning to the end. */