diff options
Diffstat (limited to 'newlib/libc/machine/m68k/memcpy.S')
-rw-r--r-- | newlib/libc/machine/m68k/memcpy.S | 64 |
1 files changed, 31 insertions, 33 deletions
diff --git a/newlib/libc/machine/m68k/memcpy.S b/newlib/libc/machine/m68k/memcpy.S index 3badd58bf..ed9e7b2a1 100644 --- a/newlib/libc/machine/m68k/memcpy.S +++ b/newlib/libc/machine/m68k/memcpy.S @@ -13,13 +13,11 @@ * they apply. */ -#include "m68kasm.h" - .text .align 4 - .globl SYM(memcpy) - .type SYM(memcpy), @function + .globl memcpy + .type memcpy, @function /* memcpy, optimised * @@ -33,64 +31,64 @@ * to further improve speed. */ -SYM(memcpy): - move.l 4(sp),a0 | dest ptr - move.l 8(sp),a1 | src ptr - move.l 12(sp),d1 | len - cmp.l #8,d1 | if fewer than 8 bytes to transfer, +memcpy: + move.l 4(%sp),%a0 | dest ptr + move.l 8(%sp),%a1 | src ptr + move.l 12(%sp),%d1 | len + cmp.l #8,%d1 | if fewer than 8 bytes to transfer, blo .Lresidue | do not optimise /* align dest */ - move.l a0,d0 | copy of dest - neg.l d0 - and.l #3,d0 | look for the lower two only + move.l %a0,%d0 | copy of dest + neg.l %d0 + and.l #3,%d0 | look for the lower two only beq 2f | is aligned? - sub.l d0,d1 - lsr.l #1,d0 | word align needed? + sub.l %d0,%d1 + lsr.l #1,%d0 | word align needed? bcc 1f - move.b (a1)+,(a0)+ + move.b (%a1)+,(%a0)+ 1: - lsr.l #1,d0 | long align needed? + lsr.l #1,%d0 | long align needed? bcc 2f - move.w (a1)+,(a0)+ + move.w (%a1)+,(%a0)+ 2: /* long word transfers */ - move.l d1,d0 - and.l #3,d1 | byte residue - lsr.l #3,d0 + move.l %d1,%d0 + and.l #3,%d1 | byte residue + lsr.l #3,%d0 bcc 1f | carry set for 4-byte residue - move.l (a1)+,(a0)+ + move.l (%a1)+,(%a0)+ 1: - lsr.l #1,d0 | number of 16-byte transfers + lsr.l #1,%d0 | number of 16-byte transfers bcc .Lcopy | carry set for 8-byte residue bra .Lcopy8 1: - move.l (a1)+,(a0)+ - move.l (a1)+,(a0)+ + move.l (%a1)+,(%a0)+ + move.l (%a1)+,(%a0)+ .Lcopy8: - move.l (a1)+,(a0)+ - move.l (a1)+,(a0)+ + move.l (%a1)+,(%a0)+ + move.l (%a1)+,(%a0)+ .Lcopy: #if !defined (__mcoldfire__) - dbra d0,1b - sub.l #0x10000,d0 + dbra %d0,1b + sub.l #0x10000,%d0 #else - subq.l #1,d0 + subq.l #1,%d0 #endif bpl 1b bra .Lresidue 1: - move.b (a1)+,(a0)+ | move residue bytes + move.b (%a1)+,(%a0)+ | move residue bytes .Lresidue: #if !defined (__mcoldfire__) - dbra d1,1b | loop until done + dbra %d1,1b | loop until done #else - subq.l #1,d1 + subq.l #1,%d1 bpl 1b #endif - move.l 4(sp),d0 | return value + move.l 4(%sp),%d0 | return value rts |