2 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
5 Desc: Optimized CopyMemQuick by Matt Hey.
9 #include "aros/m68k/asm.h"
11 #define UNALIGNEDWARNING 1
16 .globl AROS_SLIB_ENTRY(CopyMemQuick,Exec,105)
17 .type AROS_SLIB_ENTRY(CopyMemQuick,Exec,105),@function
18 AROS_SLIB_ENTRY(CopyMemQuick,Exec,105):
24 movem.l %d0-%d1/%a0-%a1,-(%sp)
31 movem.l (%sp)+,%d0-%d1/%a0-%a1
35 subq.l #4,%d0 // size is 4.b less than actual
36 bls.b ism4or0 // if d0<=0
38 cmp.l #256-4,%d0 // min size for bigmove loop, less than 128 is dangerous!
43 subq.w #8,%d0 // 8 less bytes to MOVE
44 bhi.b m4loop // if d0>0
56 bhi.b lastloop // if d0>=0
62 sub.l %d1,%d0 // size is now 128 less than actual
63 addq.l #4,%d1 // d1=128=bytes to move per loop
97 sub.l %d1,%d0 // d0=d0-128
98 bcc.b bigmov4 // if d0>=0
99 add.l %d1,%d0 // d0=d0+128, back to positive
105 .string "CopyMemQuick(%p,%p,%08x) unaligned size\n"