Source-Changes-HG archive

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

[src/trunk]: src/sys/lib/libkern/arch/mips R5900 miss-prediction of branch ta...



details:   https://anonhg.NetBSD.org/src/rev/5b90b4672191
branches:  trunk
changeset: 516119:5b90b4672191
user:      uch <uch%NetBSD.org@localhost>
date:      Tue Oct 16 15:40:53 2001 +0000

description:
R5900 miss-prediction of branch targets for short-loop.

diffstat:

 sys/lib/libkern/arch/mips/memcpy.S |  16 +++++++++++++++-
 sys/lib/libkern/arch/mips/memset.S |  14 +++++++++++++-
 2 files changed, 28 insertions(+), 2 deletions(-)

diffs (86 lines):

diff -r 6686068d028e -r 5b90b4672191 sys/lib/libkern/arch/mips/memcpy.S
--- a/sys/lib/libkern/arch/mips/memcpy.S        Tue Oct 16 15:38:29 2001 +0000
+++ b/sys/lib/libkern/arch/mips/memcpy.S        Tue Oct 16 15:40:53 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: memcpy.S,v 1.6 2000/10/10 20:29:03 jeffs Exp $ */
+/*     $NetBSD: memcpy.S,v 1.7 2001/10/16 15:40:53 uch Exp $   */
 /* XXXX We need to define this in a way which supports multiple architectures */
 
 #include <machine/cdefs.h>     /* Get SZREG correct */
@@ -126,6 +126,10 @@
        lw      t3,0(a1)
        addu    a1,4
        sw      t3,0(a0)
+#ifdef MIPS3_5900      
+       nop
+       nop
+#endif 
        bne     a1,t0,1b
        addu    a0,4            # BDSLOT
 
@@ -137,6 +141,9 @@
        addu    a1,1
        sb      t3,0(a0)
        subu    a2,1
+#ifdef MIPS3_5900      
+       nop
+#endif 
        bgtz    a2,2b
        addu    a0,1            # BDSLOT
 
@@ -158,6 +165,9 @@
        LWLO    t3,3(a1)
        addi    a1,4
        sw      t3,0(a0)
+#ifdef MIPS3_5900
+       nop
+#endif 
        bne     a1,a3,3b
        addi    a0,4            # BDSLOT
 
@@ -175,6 +185,10 @@
        lb      t3,-1(t0)       
        subu    t0,1
        sb      t3,-1(t1)
+#ifdef MIPS3_5900
+       nop
+       nop
+#endif 
        bne     t0,a1,4b
        subu    t1,1            # BDSLOT
        j       ra
diff -r 6686068d028e -r 5b90b4672191 sys/lib/libkern/arch/mips/memset.S
--- a/sys/lib/libkern/arch/mips/memset.S        Tue Oct 16 15:38:29 2001 +0000
+++ b/sys/lib/libkern/arch/mips/memset.S        Tue Oct 16 15:40:53 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: memset.S,v 1.2 1999/03/15 06:34:10 jonathan Exp $      */
+/*     $NetBSD: memset.S,v 1.3 2001/10/16 15:40:53 uch Exp $   */
 #include <machine/cdefs.h>
 #include <mips/asm.h>
 #include <machine/endian.h>
@@ -32,6 +32,12 @@
        addu    t0, t0, a0              # compute ending address
 2:
        addu    a0, a0, 4               # clear words
+#ifdef MIPS3_5900
+       nop
+       nop
+       nop
+       nop
+#endif 
        bne     a0, t0, 2b              #  unrolling loop does not help
        sw      t1, -4(a0)              #  since we are limited by memory speed
 
@@ -40,6 +46,12 @@
        addu    t0, a2, a0              # compute ending address
 1:
        addu    a0, a0, 1               # clear bytes
+#ifdef MIPS3_5900      
+       nop
+       nop
+       nop
+       nop
+#endif 
        bne     a0, t0, 1b
        sb      a1, -1(a0)
 2:



Home | Main Index | Thread Index | Old Index