Re: * 4 converted to << 2 for networking code

From: antirez (antirez@invece.org)
Date: Wed Jan 10 2001 - 12:25:46 EST


On Wed, Jan 10, 2001 at 04:11:46PM +0100, Jakob ?stergaard wrote:
> On most processors <<2 is slower than *4. It's outright stupid to
> write <<2 when we mean *4 in order to optimize for one out of a
> gazillion supported architectures - even more so when the compiler
> for the one CPU where <<2 is faster, will actually generate a shift
> instead of a multiply as a part of the standard optimization.

Hug, ok, so all the << 2 already in should be changed in *4.
My point is that it is better to use only << 2 or *4, selecting
the better form.

-- 
Salvatore Sanfilippo              |                      <antirez@invece.org>
http://www.kyuzz.org/antirez      |      PGP: finger antirez@tella.alicom.com
-
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/



This archive was generated by hypermail 2b29 : Mon Jan 15 2001 - 21:00:26 EST