Source-Changes-HG archive

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

[src/trunk]: src/common/lib/libc/arch/m68k/string With these changes, they no...



details:   https://anonhg.NetBSD.org/src/rev/d6e5c6d709cb
branches:  trunk
changeset: 788787:d6e5c6d709cb
user:      matt <matt%NetBSD.org@localhost>
date:      Fri Jul 19 16:42:12 2013 +0000

description:
With these changes, they now produce identical binary as before the coldfire
changes.

diffstat:

 common/lib/libc/arch/m68k/string/memset.S  |  26 +++++++++++---------------
 common/lib/libc/arch/m68k/string/strcmp.S  |  13 ++++++++-----
 common/lib/libc/arch/m68k/string/strncmp.S |  12 ++++++++----
 3 files changed, 27 insertions(+), 24 deletions(-)

diffs (132 lines):

diff -r 8cc3bf2ebea9 -r d6e5c6d709cb common/lib/libc/arch/m68k/string/memset.S
--- a/common/lib/libc/arch/m68k/string/memset.S Fri Jul 19 16:35:57 2013 +0000
+++ b/common/lib/libc/arch/m68k/string/memset.S Fri Jul 19 16:42:12 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: memset.S,v 1.5 2013/07/18 22:42:50 matt Exp $  */
+/*     $NetBSD: memset.S,v 1.6 2013/07/19 16:42:12 matt Exp $  */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
 #if 0
        RCSID("from: @(#)bzero.s        5.1 (Berkeley) 5/12/90")
 #else
-       RCSID("$NetBSD: memset.S,v 1.5 2013/07/18 22:42:50 matt Exp $")
+       RCSID("$NetBSD: memset.S,v 1.6 2013/07/19 16:42:12 matt Exp $")
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -76,11 +76,7 @@
        movl    %d2,-(%sp)
        movl    8(%sp),%a0              | destination
        movl    16(%sp),%d1             | count
-#ifdef __mcoldfire__
-       mvzb    15(%sp),%d2             | zero extend fill character
-#else
        movb    15(%sp),%d2             | get fill character
-#endif
 
        /* 
         * It isn't worth the overhead of aligning to {long}word boundries
@@ -89,15 +85,15 @@
        cmpl    #15,%d1
        jlt     Lbzbyte
 
-#ifndef __mcoldfire__
-       andb    0xff,%d2                | clear high bytes
-#endif
-       movl    %d2,%d0
-       lsll    #8,%d0                  | shift to 8-15
-       orl     %d0,%d2                 | merge so low word is done
-       movl    %d2,%d0                 | copy word
-       swap    %d0                     | swap it
-       orl     %d0,%d2                 | put it upper half
+       clrl %d0
+       moveb   %d2,%d0
+       movel   %d0,%d2
+       lsll    #8,%d0
+       orl     %d0,%d2
+       lsll    #8,%d0  
+       orl     %d0,%d2 
+       lsll    #8,%d0  
+       orl     %d0,%d2 
 
        /* word align */
        movl    %a0,%d0
diff -r 8cc3bf2ebea9 -r d6e5c6d709cb common/lib/libc/arch/m68k/string/strcmp.S
--- a/common/lib/libc/arch/m68k/string/strcmp.S Fri Jul 19 16:35:57 2013 +0000
+++ b/common/lib/libc/arch/m68k/string/strcmp.S Fri Jul 19 16:42:12 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: strcmp.S,v 1.5 2013/07/18 22:42:50 matt Exp $  */
+/*     $NetBSD: strcmp.S,v 1.6 2013/07/19 16:42:12 matt Exp $  */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #include <machine/asm.h>
 
 #if defined(LIBC_SCCS) && !defined(lint)
-       RCSID("$NetBSD: strcmp.S,v 1.5 2013/07/18 22:42:50 matt Exp $")
+       RCSID("$NetBSD: strcmp.S,v 1.6 2013/07/19 16:42:12 matt Exp $")
 #endif /* LIBC_SCCS and not lint */
 
 #ifdef __mcoldfire__
@@ -69,10 +69,13 @@
        jeq     L1
 
 L3:
-#ifndef __mcoldfire__
-       EXTBL(%d1)
+#ifdef __mcoldfire__
+       movl    %d1,%d0
+#else
+       scs     %d0
+       EXTBL(%d0)
+       movb    %d1,%d0
 #endif
-       movl    %d1,%d0
        rts
 
 L2:    movq    #0,%d0
diff -r 8cc3bf2ebea9 -r d6e5c6d709cb common/lib/libc/arch/m68k/string/strncmp.S
--- a/common/lib/libc/arch/m68k/string/strncmp.S        Fri Jul 19 16:35:57 2013 +0000
+++ b/common/lib/libc/arch/m68k/string/strncmp.S        Fri Jul 19 16:42:12 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: strncmp.S,v 1.5 2013/07/18 22:42:50 matt Exp $ */
+/*     $NetBSD: strncmp.S,v 1.6 2013/07/19 16:42:12 matt Exp $ */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #include <machine/asm.h>
 
 #if defined(LIBC_SCCS) && !defined(lint)
-       RCSID("$NetBSD: strncmp.S,v 1.5 2013/07/18 22:42:50 matt Exp $")
+       RCSID("$NetBSD: strncmp.S,v 1.6 2013/07/19 16:42:12 matt Exp $")
 #endif /* LIBC_SCCS and not lint */
 
 
@@ -50,7 +50,9 @@
        jeq     L4
        movl    4(%sp),%a0
        movl    8(%sp),%a1
+#ifdef __coldfire__
        movl    %d2,-(%sp)      | save temp
+#endif
 L1:                            /* unroll by 4 for m680[23]0's */
        GETC((%a0)+,%d1)
        jeq     L2
@@ -88,9 +90,11 @@
 L3:    
 #ifdef __mcoldfire__
        movl    (%sp)+,%d2              | restore temp
+       movl    %d1,%d0
 #else
-       EXTBL(%d1)
+       scs     %d0
+       EXTBL(%d0)
+       moveb   %d1,%d0
 #endif
-       movl    %d1,%d0
        rts
 END(strncmp)



Home | Main Index | Thread Index | Old Index