aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMaxim Sobolev <sobomax@FreeBSD.org>2002-10-15 09:50:07 +0000
committerMaxim Sobolev <sobomax@FreeBSD.org>2002-10-15 09:50:07 +0000
commitf927dfabc9c0bb0ef7b607a6e7004ad91405eed1 (patch)
tree8be11b12f2e43fdf75e9b5aa9200c6477abfdbde /lib
parent616e099e5c4664adc444ccfcc511118f62c07eee (diff)
Notes
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/i386/string/bcopy.S21
1 files changed, 8 insertions, 13 deletions
diff --git a/lib/libc/i386/string/bcopy.S b/lib/libc/i386/string/bcopy.S
index 0c571349f089..1050ed2de7a4 100644
--- a/lib/libc/i386/string/bcopy.S
+++ b/lib/libc/i386/string/bcopy.S
@@ -59,27 +59,25 @@ ENTRY(bcopy)
#if defined(MEMCOPY) || defined(MEMMOVE)
movl 12(%esp),%edi
movl 16(%esp),%esi
+ movl %edi,%eax
#else
movl 12(%esp),%esi
movl 16(%esp),%edi
#endif
movl 20(%esp),%ecx
- movl %edi,%eax
- subl %esi,%eax
- cmpl %ecx,%eax /* overlapping? */
+ movl %edi,%edx
+ subl %esi,%edx
+ cmpl %ecx,%edx /* overlapping? */
jb 1f
cld /* nope, copy forwards. */
- movl %ecx,%eax
+ movl %ecx,%edx
shrl $2,%ecx /* copy by words */
rep
movsl
- movl %eax,%ecx
+ movl %edx,%ecx
andl $3,%ecx /* any bytes left? */
rep
movsb
-#if defined(MEMCOPY) || defined(MEMMOVE)
- movl 12(%esp),%eax
-#endif
popl %edi
popl %esi
ret
@@ -87,21 +85,18 @@ ENTRY(bcopy)
addl %ecx,%edi /* copy backwards. */
addl %ecx,%esi
std
- movl %ecx,%eax
+ movl %ecx,%edx
andl $3,%ecx /* any fractional bytes? */
decl %edi
decl %esi
rep
movsb
- movl %eax,%ecx /* copy remainder by words */
+ movl %edx,%ecx /* copy remainder by words */
shrl $2,%ecx
subl $3,%esi
subl $3,%edi
rep
movsl
-#if defined(MEMCOPY) || defined(MEMMOVE)
- movl 12(%esp),%eax
-#endif
popl %edi
popl %esi
cld