netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Stephen Hemminger <shemminger@linux-foundation.org>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
	netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH] - trivial - Improve appletalk checksum calculation
Date: Mon, 22 Oct 2007 20:39:59 -0700	[thread overview]
Message-ID: <1193110799.5132.48.camel@localhost> (raw)
In-Reply-To: <20071022203052.23725719@freepuppy.rosehill>

On Mon, 2007-10-22 at 20:30 -0700, Stephen Hemminger wrote:
> > Corrected fast code is:
> > 
> >         while (len--) {
> >                 sum += *data++;
> >                 sum <<= 1;
> >                 sum = (((sum & 0x10000) >> 16) + sum) & 0xffff;
> >         }
> > 
> > At least it is correct on the standalone random data test, and the
> > new code is 30% faster for the cached memory case (13.7 clks/byte vs 18 
> > clks/byte).
> Your code looks different...

Both are 16 bit rotate lefts.
Which looks clearer?


      reply	other threads:[~2007-10-23  3:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-22 19:36 [PATCH] - trivial - Improve appletalk checksum calculation Joe Perches
2007-10-23  0:35 ` David Miller
2007-10-23  1:36   ` Joe Perches
2007-10-23  1:43     ` David Miller
2007-10-23  1:53       ` Joe Perches
2007-10-23  3:51         ` Herbert Xu
2007-10-28 20:18           ` Urs Thuermann
2007-10-28 21:01             ` Joe Perches
2007-10-29  2:40               ` Joe Perches
2007-10-23  3:30 ` Stephen Hemminger
2007-10-23  3:39   ` Joe Perches [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1193110799.5132.48.camel@localhost \
    --to=joe@perches.com \
    --cc=acme@ghostprotocols.net \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).