2 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
9 #include "aros/m68k/asm.h"
14 .globl AROS_SLIB_ENTRY(CopyMem_000,Exec,104)
15 .type AROS_SLIB_ENTRY(CopyMem_000,Exec,104),@function
16 AROS_SLIB_ENTRY(CopyMem_000,Exec,104):
28 // alignment mismatch?
30 movem.l %d2-%d7/%a2-%a6,-(%sp)
32 movem.l (%a0)+,%d1-%d7/%a2-%a6
33 movem.l %d1-%d7/%a2-%a6,(%a1)
39 movem.l (%sp)+,%d2-%d7/%a2-%a6
48 dbf %d1,copy_00_bytes_loop
49 dbf %d0,copy_00_bytes_loop
52 /* Optimized 020+ CopyMem by Matt Hey */
55 .globl AROS_SLIB_ENTRY(CopyMem_020,Exec,104)
56 .type AROS_SLIB_ENTRY(CopyMem_020,Exec,104),@function
57 AROS_SLIB_ENTRY(CopyMem_020,Exec,104):
58 subq.l #4,%d0 // size is 4 less than actual!
59 bls.b smallcopy // if size<=4 bytes
66 daligned2: // dest should be WORD aligned now
71 bcs.b last2 // if size<0
72 daligned4: // dest should be LONG aligned now
73 cmp.l #256-4,%d0 // min size for move16, less than 252 is dangerous!
78 bhi.b move4loop // if size>0
88 sub.l %d1,%d0 // size is now 128 less than actual
89 addq.l #4,%d1 // d1=128=bytes to move per loop
123 sub.l %d1,%d0 // d0=d0-128
124 bcc.b bigmove4 // if d0>=0
125 add.l %d1,%d0 // d0=d0+128, back to positive