2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: Copy aligned memory.
8 #include <aros/libcall.h>
9 #include <exec/types.h>
11 /*****************************************************************************
15 AROS_LH3I(void, CopyMemQuick
,
18 AROS_LHA(CONST_APTR
, source
, A0
),
19 AROS_LHA(APTR
, dest
, A1
),
20 AROS_LHA(ULONG
, size
, D0
),
23 struct ExecBase
*, SysBase
, 105, Exec
)
26 Copy some longwords from one destination in memory to another using
27 a fast copying method.
30 source - Pointer to source area (must be ULONG aligned)
31 dest - Pointer to destination (must be ULONG aligned)
32 size - number of bytes to copy (must be a multiple of sizeof(ULONG))
37 The source and destination area are not allowed to overlap.
48 ******************************************************************************/
53 const ULONG
*src
= source
;
56 /* Calculate number of ULONGs to copy */
60 To minimize the loop overhead I copy more than one (eight) ULONG per
61 iteration. Therefore I need to split size into size/8 and the rest.
66 /* Then copy for both parts */
73 Partly unrolled copying loop. The predecrement helps the compiler to
74 find the best possible loop. The if is necessary to do this.