summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorMike Silbersack <silby@FreeBSD.org>2002-06-27 03:55:36 +0000
committerMike Silbersack <silby@FreeBSD.org>2002-06-27 03:55:36 +0000
commit1228a1c6341a0fabe6012d4dcf562b49574bc6a0 (patch)
treec222e3d016e1af1014e25f8021bf168299381563 /lib/libc
parent80536ead7f09bc6aaf66701e946b78df892b8b25 (diff)
Notes
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/i386/string/bcopy.S6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libc/i386/string/bcopy.S b/lib/libc/i386/string/bcopy.S
index aaa701b82c0c..0046e57a4294 100644
--- a/lib/libc/i386/string/bcopy.S
+++ b/lib/libc/i386/string/bcopy.S
@@ -69,10 +69,11 @@ ENTRY(bcopy)
cmpl %ecx,%eax /* overlapping? */
jb 1f
cld /* nope, copy forwards. */
+ movl %ecx, %eax
shrl $2,%ecx /* copy by words */
rep
movsl
- movl 20(%esp),%ecx
+ movl %eax, %ecx
andl $3,%ecx /* any bytes left? */
rep
movsb
@@ -86,12 +87,13 @@ ENTRY(bcopy)
addl %ecx,%edi /* copy backwards. */
addl %ecx,%esi
std
+ movl %ecx, %eax
andl $3,%ecx /* any fractional bytes? */
decl %edi
decl %esi
rep
movsb
- movl 20(%esp),%ecx /* copy remainder by words */
+ movl %eax, %ecx /* copy remainder by words */
shrl $2,%ecx
subl $3,%esi
subl $3,%edi