lkml.org 
[lkml]   [2008]   [Mar]   [10]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateMon, 10 Mar 2008 07:29:45 +0100
FromIngo Molnar <>
SubjectRe: [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


\
 
 \ /
  Last update: 2008-03-10 07:33    [from the cache]
©2003-2008