lkml.org 
[lkml]   [2003]   [Apr]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH] Faster generic_fls

On 30 Apr 2003, Falk Hueffner wrote:
> Linus Torvalds <torvalds@transmeta.com> writes:
>
> > There is _never_ any excuse to use a lookup table for something that
> > can be calculated with a few simple instructions. That's just
> > stupid.
>
> Well, the "few simple instructions" are 28 instructions on Alpha for
> example, including 6 data-dependent branches. So I don't think it's
> *that* stupid.

You're comparing apples to oranges.

Clearly you're not going to make _one_ load to get fls, since having a
4GB lookup array for a 32-bit fls would be "somewhat" wasteful.

So the lookup table would probably look up just the last 8 bits.

So the lookup table version is several instructions in itself, doing about
half of what the calculating version needs to do _anyway_. Including those
data-dependent branches.

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:35    [W:0.128 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site