2 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
5 Desc: Copy aligned memory.
8 #include <aros/debug.h>
9 #include <aros/libcall.h>
10 #include <exec/types.h>
12 /*****************************************************************************
16 AROS_LH3I(void, CopyMemQuick
,
19 AROS_LHA(CONST_APTR
, source
, A0
),
20 AROS_LHA(APTR
, dest
, A1
),
21 AROS_LHA(IPTR
, size
, D0
),
24 struct ExecBase
*, SysBase
, 105, Exec
)
27 Copy some longwords from one destination in memory to another using
28 a fast copying method.
31 source - Pointer to source area (must be ULONG aligned)
32 dest - Pointer to destination (must be ULONG aligned)
33 size - number of bytes to copy (must be a multiple of sizeof(ULONG)).
39 The source and destination areas are not allowed to overlap.
49 64-bit sizes are not handled yet.
51 ******************************************************************************/
56 const ULONG
*src
= source
;
59 /* Calculate number of ULONGs to copy */
63 To minimize the loop overhead I copy more than one (eight) ULONG per
64 iteration. Therefore I need to split size into size/8 and the rest.
69 /* Then copy for both parts */
76 Partly unrolled copying loop. The predecrement helps the compiler to
77 find the best possible loop. The if is necessary to do this.