1/* 2** Copyright 2001, Travis Geiselbrecht. All rights reserved. 3** Distributed under the terms of the NewOS License. 4*/ 5 6#warning M68K: optimize memcpy 7#if 0 8#define FUNCTION(x) .global x; .type x,@function; x 9 10/* that should be enough for now */ 11 12.align 4 13FUNCTION(memcpy): 14/* void *memcpy(void *dest, const void *src, size_t count) */ 15 move.l (4,%a7),%a1 16 move.l (8,%a7),%a0 17 move.l (12,%a7),%d0 18 addi.l #-1,%d0 19 blt _memcpy_out 20_memcpy_loop: 21 move.b (%a0)+,(%a1)+ 22 dbf %d0,_memcpy_loop 23_memcpy_out: 24 move.l (4,%a7),%a0 25 move.l %a0,%d0 26 rts 27#endif 28