From: Matthias Andree <matthias.andree@stud.uni-dortmund.de>
To: antirez <antirez@invece.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: * 4 converted to << 2 for networking code
Date: Wed, 10 Jan 2001 23:21:23 +0100 [thread overview]
Message-ID: <20010110232123.A9585@emma1.emma.line.org> (raw)
In-Reply-To: <20010110174859.R7498@prosa.it>
In-Reply-To: <20010110174859.R7498@prosa.it>; from antirez@invece.org on Wed, Jan 10, 2001 at 17:48:59 +0100
On Wed, 10 Jan 2001, antirez wrote:
> Hi all,
>
> The attached patch converts many occurences of '* 4' in the networking code
> (often used to convert in bytes the TCP data offset and the IP header len)
> to the faster '<< 2'. Since this was a quite repetitive work it's better
> if someone double-check it before to apply the patch.
> The patch is for linux-2.4.
>
> Please, CC: me for replies since I'm not subscribed to the list.
You'd better be. As Alan Cox pointed out some time ago, this is the
compiler's duty, to be more precise, it's the peephole (local)
optimizer's task, if it's actually implemented in the core or the
backend, I cannot currently tell, and I don't care.
But see a minimal program
main(int argc) {
j(argc * 4);
}
run gcc -O2 -S thissource.c and then -O0 and compare. On an
amigaos-m68k configured gcc 2.7.2.3, this directly throws asll #2,d0
(arithmetic shift left by 2 positions, fill with trailing zeroes), -O2
saves some moving around. (I cannot read 386 assembly language, thus
m68k ;)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
prev parent reply other threads:[~2001-01-10 22:21 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-01-10 16:48 antirez
2001-01-10 14:38 ` David S. Miller
2001-01-10 14:54 ` Brian Gerst
2001-01-10 17:03 ` antirez
2001-01-10 15:11 ` Jakob Østergaard
2001-01-10 15:18 ` Mike Harrold
2001-01-10 15:31 ` Chris Jones
2001-01-10 16:23 ` Jamie Lokier
2001-01-10 16:26 ` Mike Harrold
2001-01-10 17:25 ` antirez
2001-01-10 16:25 ` Pauline Middelink
2001-01-11 0:29 ` H. Peter Anvin
2001-01-10 22:21 ` Matthias Andree [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=20010110232123.A9585@emma1.emma.line.org \
--to=matthias.andree@stud.uni-dortmund.de \
--cc=antirez@invece.org \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®