Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/newlib
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2009-12-14 23:50:53 +0300
committerJeff Johnston <jjohnstn@redhat.com>2009-12-14 23:50:53 +0300
commit531e23564b82e2b80121c7f92b47b37a31938e50 (patch)
treeaa52a6598be97ef3a471bcb8728b1afb2f6c9c35 /newlib
parenta3bb10f35691cb7cb23f2c2f3fff19c6df20116a (diff)
2009-12-14 Maxim Kuvyrkov <maxim@codesourcery.com>
* libc/machine/m68k/memcpy.S: Patch to support boards which do not support unaligned read/write.
Diffstat (limited to 'newlib')
-rw-r--r--newlib/ChangeLog5
-rw-r--r--newlib/libc/machine/m68k/memcpy.S16
2 files changed, 21 insertions, 0 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index c0b1a52f5..5f0bac989 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,8 @@
+2009-12-14 Maxim Kuvyrkov <maxim@codesourcery.com>
+
+ * libc/machine/m68k/memcpy.S: Patch to support
+ boards which do not support unaligned read/write.
+
2009-12-10 Conny Marco Menebrocker <c-m-m@gmx.de>
* configure.host: Add xc16x support.
diff --git a/newlib/libc/machine/m68k/memcpy.S b/newlib/libc/machine/m68k/memcpy.S
index 3badd58bf..e3df0037e 100644
--- a/newlib/libc/machine/m68k/memcpy.S
+++ b/newlib/libc/machine/m68k/memcpy.S
@@ -15,6 +15,12 @@
#include "m68kasm.h"
+#if defined (__mcoldfire__) || defined (__mcpu32__) || defined (__mc68010__) || defined (__mc68020__) || defined (__mc68030__) || defined (__mc68040__) || defined (__mc68060__)
+# define MISALIGNED_OK 1
+#else
+# define MISALIGNED_OK 0
+#endif
+
.text
.align 4
@@ -40,6 +46,15 @@ SYM(memcpy):
cmp.l #8,d1 | if fewer than 8 bytes to transfer,
blo .Lresidue | do not optimise
+#if !MISALIGNED_OK
+ /* Goto .Lresidue if either dest or src is not 4-byte aligned */
+ move.l a0,d0
+ and.l #3,d0
+ bne .Lresidue
+ move.l a1,d0
+ and.l #3,d0
+ bne .Lresidue
+#else /* MISALIGNED_OK */
/* align dest */
move.l a0,d0 | copy of dest
neg.l d0
@@ -54,6 +69,7 @@ SYM(memcpy):
bcc 2f
move.w (a1)+,(a0)+
2:
+#endif /* !MISALIGNED_OK */
/* long word transfers */
move.l d1,d0