Followup to: <[EMAIL PROTECTED]>
By author:=?iso-8859-1?Q?Jakob_=D8stergaard?= <[EMAIL PROTECTED]>
In newsgroup: linux.dev.kernel
>
> On most processors <<2 is slower than *4.
>
That's a funny statement. Which processors do you include in "most"?
That has not been my experience.
> It's o
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 doubl
On Wed, 10 Jan 2001 around 18:25:46 +0100, antirez wrote:
> 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 archite
Mike Harrold wrote:
> Be careful. *4 is not a simple <<2 substitution (by the compiler) if
> the variable is signed. *4 translates to 3 instructions (on x86) if
> it's an int.
I think you mean /4 is not the same as >>2 if the variable is signed.
In general, non-widening multiplies give the same
Mike Harrold <[EMAIL PROTECTED]> writes:
[...]
My feeling is that it shouldn't matter if you use <<2 or *4 even if the
compiler optimises - one would hope that the compiler would optimise to
the fastest in both directions.
I agree this should be left to the compiler. The programmer shoul
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 <<
>
> On Wed, Jan 10, 2001 at 06:03:22PM +0100, antirez wrote:
> > On Wed, Jan 10, 2001 at 09:54:04AM -0500, Brian Gerst wrote:
> > > This patch isn't really necessary, because GCC will automatically
> > > convert multiplications and divisions by powers of two to use shifts.
> >
> > Sure, but sinc
On Wed, Jan 10, 2001 at 06:03:22PM +0100, antirez wrote:
> On Wed, Jan 10, 2001 at 09:54:04AM -0500, Brian Gerst wrote:
> > This patch isn't really necessary, because GCC will automatically
> > convert multiplications and divisions by powers of two to use shifts.
>
> Sure, but since many << 2 alr
On Wed, Jan 10, 2001 at 09:54:04AM -0500, Brian Gerst wrote:
> This patch isn't really necessary, because GCC will automatically
> convert multiplications and divisions by powers of two to use shifts.
Sure, but since many << 2 already exists in the net kernel code
I feel it's better to use just a
Date:Wed, 10 Jan 2001 17:48:59 +0100
From: antirez <[EMAIL PROTECTED]>
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'.
The compiler does this for yo
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 t
11 matches
Mail list logo