Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/i386/i386 Optimize a little more for the case where...



details:   https://anonhg.NetBSD.org/src/rev/f552e9bb21d9
branches:  trunk
changeset: 506850:f552e9bb21d9
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Tue Mar 06 19:20:51 2001 +0000

description:
Optimize a little more for the case where `off' is entirely covered by one
mbuf -- which is always is.

diffstat:

 sys/arch/i386/i386/in_cksum.s |  13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diffs (30 lines):

diff -r 9c7f45c57d6e -r f552e9bb21d9 sys/arch/i386/i386/in_cksum.s
--- a/sys/arch/i386/i386/in_cksum.s     Tue Mar 06 19:14:37 2001 +0000
+++ b/sys/arch/i386/i386/in_cksum.s     Tue Mar 06 19:20:51 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: in_cksum.s,v 1.11 2001/03/06 19:14:37 mycroft Exp $    */
+/*     $NetBSD: in_cksum.s,v 1.12 2001/03/06 19:20:51 mycroft Exp $    */
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -139,15 +139,14 @@
 mbuf_loop_0:
        testl   %ebp, %ebp
        jz      out_of_mbufs
+
+       movl    M_DATA(%ebp), %ebx      /* %ebx = m_data */
        movl    M_LEN(%ebp), %ecx       /* %ecx = m_len */
-       subl    %ecx, %edx              /* %edx = off - m_len */
-       jb      skip_done
        movl    M_NEXT(%ebp), %ebp
-       jmp     mbuf_loop_0
 
-skip_done:
-       movl    M_DATA(%ebp), %ebx      /* %ebx = m_data */
-       movl    M_NEXT(%ebp), %ebp
+       subl    %ecx, %edx              /* %edx = off - m_len */
+       jnb     mbuf_loop_0
+
        addl    %edx, %ebx              /* %ebx = m_data + off - m_len */
        negl    %edx                    /* %edx = m_len - off */
        addl    %ecx, %ebx              /* %ebx = m_data + off */



Home | Main Index | Thread Index | Old Index