Save a jmp for memcpy(3).
This commit is contained in:
parent
333f362341
commit
4c3981eea3
@ -36,7 +36,7 @@
|
|||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
|
|
||||||
#if defined(LIBC_SCCS)
|
#if defined(LIBC_SCCS)
|
||||||
RCSID("$NetBSD: bcopy.S,v 1.10 2002/10/29 06:53:18 junyoung Exp $")
|
RCSID("$NetBSD: bcopy.S,v 1.11 2002/10/29 07:01:44 junyoung Exp $")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -64,13 +64,15 @@ ENTRY(bcopy)
|
|||||||
movl 16(%esp),%edi
|
movl 16(%esp),%edi
|
||||||
#endif
|
#endif
|
||||||
movl 20(%esp),%ecx
|
movl 20(%esp),%ecx
|
||||||
#if !defined(MEMCOPY)
|
#if defined(MEMCOPY)
|
||||||
|
movl %ecx,%edx
|
||||||
|
#else
|
||||||
movl %edi,%edx
|
movl %edi,%edx
|
||||||
subl %esi,%edx
|
subl %esi,%edx
|
||||||
cmpl %ecx,%edx /* overlapping? */
|
cmpl %ecx,%edx /* overlapping? */
|
||||||
#endif
|
|
||||||
movl %ecx,%edx
|
movl %ecx,%edx
|
||||||
jb 1f
|
jb 1f
|
||||||
|
#endif
|
||||||
cld /* nope, copy forwards. */
|
cld /* nope, copy forwards. */
|
||||||
shrl $2,%ecx /* copy by words */
|
shrl $2,%ecx /* copy by words */
|
||||||
rep
|
rep
|
||||||
|
Loading…
Reference in New Issue
Block a user