Messages in this thread |  | | | Date | Mon, 10 Mar 2008 07:29:45 +0100 | | From | Ingo Molnar <> | | Subject | Re: [PATCH] x86: Change x86 to use generic find_next_bit | |
* Alexander van Heukelum <heukelum@fastmail.fm> wrote:
> > ok, that's rather convincing.
> >
> > the generic version in lib/find_next_bit.c is open-coded C which gcc
> > can optimize pretty nicely.
> >
> > the hand-coded assembly versions in arch/x86/lib/bitops_32.c mostly
> > use the special x86 'bit search forward' (BSF) instruction - which i
> > know from the days when the scheduler relied on it has some
> > non-trivial setup costs. So especially when there's _small_ bitmasks
> > involved, it's more expensive.
>
> Hi,
>
> BSF is fine, it doesn't need any special setup. [...]
under "setup costs" i mean cycles spent by the CPU itself - the
instruction itself is simple (of course) and needs no setup. If you look
at BSF performance you'll see that it has nontrivial overhead.
Ingo
|  |