Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/arch/m68k/string On the 68010, don't bother with th...



details:   https://anonhg.NetBSD.org/src/rev/662312e9297b
branches:  trunk
changeset: 514644:662312e9297b
user:      fredette <fredette%NetBSD.org@localhost>
date:      Fri Sep 07 12:50:01 2001 +0000

description:
On the 68010, don't bother with the by-8-longwords loop, instead
only 16-bit align the region and use loop mode with longwords
to do the bulk of the work.

On the 68020+, fixed an optimization bug where all regions that start
on odd addresses would not be properly longword aligned.

diffstat:

 lib/libc/arch/m68k/string/memset.S |  12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diffs (48 lines):

diff -r beb5293299aa -r 662312e9297b lib/libc/arch/m68k/string/memset.S
--- a/lib/libc/arch/m68k/string/memset.S        Fri Sep 07 11:04:35 2001 +0000
+++ b/lib/libc/arch/m68k/string/memset.S        Fri Sep 07 12:50:01 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: memset.S,v 1.12 1999/10/25 23:48:15 thorpej Exp $      */
+/*     $NetBSD: memset.S,v 1.13 2001/09/07 12:50:01 fredette Exp $     */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -79,7 +79,7 @@
 #if 0
        RCSID("from: @(#)bzero.s        5.1 (Berkeley) 5/12/90")
 #else
-       RCSID("$NetBSD: memset.S,v 1.12 1999/10/25 23:48:15 thorpej Exp $")
+       RCSID("$NetBSD: memset.S,v 1.13 2001/09/07 12:50:01 fredette Exp $")
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -112,7 +112,9 @@
        jeq     Lbzalgndw               | 
        movb    %d2,%a0@+               |       *(char *)dst++ = X
        subql   #1,%d1                  |       len--
+       addql   #1,%d0
 Lbzalgndw:
+#ifndef        __mc68010__
        /* long word align */
        btst    #1,%d0                  | if (dst & 2)
        jeq     Lbzalgndl               |
@@ -138,6 +140,7 @@
        clrw    %d0
        subql   #1,%d0
        jcc     Lbz32loop
+#endif /* !__mc68010__ */
 
 Lbzlong:
        /* set by longwords */
@@ -148,6 +151,11 @@
 Lbzlloop:
        movl    %d2,%a0@+               |       clear longwords
        dbf     %d0,Lbzlloop            |       till done
+#ifdef __mc68010__
+       clrw    %d0
+       subql   #1,%d0
+       jcc     Lbzlloop
+#endif /* __mc68010__ */
        andl    #3,%d1                  |       len %= 4
        jeq     Lbzdone
 



Home | Main Index | Thread Index | Old Index