login
Header Space

 
 

Re: [PATCH] x86: generic versions of find_first_(zero_)bit, convert i386

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: dean gaudet <dean@...>, Alexander van Heukelum <heukelum@...>
Cc: Ingo Molnar <mingo@...>, Andi Kleen <andi@...>, LKML <linux-kernel@...>
Date: Sunday, April 6, 2008 - 2:51 pm

On Sun, 6 Apr 2008 10:03:43 -0700 (PDT), "dean gaudet" <dean@arctic.org>
said:

Hello Dean,

The current generic implementation of ffz is O(lg(n)) already, but
the version you suggest might indeed be a bit faster if the compiler
recognises that is can use conditional moves and the architecture
can handle large constants efficiently.

On the other had, the bit-search functions tend to be avoided as
much as possible, because they are often not implemented as a
hardware instruction and even if they are implemented in hardware,
they might be slow. The generic version is slow anyhow. That's
why the bitmap searches first test if a word in the bitmap is
all-0-bits/all-1-bits. The single-word version of ffz might even
be better off if it was optimized for size instead of being fully
unrolled!


Note: mask32 = ~0ul; mask16 = mask32 ^ (mask32 << 16), mask8 = ...

Greetings,
    Alexander
-- 
  Alexander van Heukelum
  heukelum@fastmail.fm

-- 
http://www.fastmail.fm - Or how I learned to stop worrying and
                          love email again

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] x86: generic versions of find_first_(zero_)bit, conv..., Alexander van Heukelum, (Mon Mar 31, 1:15 pm)
Re: [PATCH] x86: generic versions of find_first_(zero_)bit, ..., Alexander van Heukelum, (Tue Apr 1, 5:46 am)
Re: [PATCH] x86: generic versions of find_first_(zero_)bit, ..., Alexander van Heukelum, (Sun Apr 6, 2:51 pm)
Re: [PATCH] x86: generic versions of find_first_(zero_)bit, ..., Alexander van Heukelum, (Mon Apr 7, 6:25 am)
Alternative implementation of the generic __ffs, Alexander van Heukelum, (Fri Apr 18, 4:18 pm)
Re: Alternative implementation of the generic __ffs, dean gaudet, (Fri Apr 18, 7:46 pm)
Re: Alternative implementation of the generic __ffs, Harvey Harrison, (Fri Apr 18, 8:09 pm)
Re: Alternative implementation of the generic __ffs, dean gaudet, (Fri Apr 18, 8:20 pm)
Re: Alternative implementation of the generic __ffs, Joe Perches, (Fri Apr 18, 8:58 pm)
Re: Alternative implementation of the generic __ffs, Harvey Harrison, (Fri Apr 18, 9:04 pm)
Re: Alternative implementation of the generic __ffs, dean gaudet, (Fri Apr 18, 9:11 pm)
Re: Alternative implementation of the generic __ffs, Joe Perches, (Fri Apr 18, 10:55 pm)
Re: Alternative implementation of the generic __ffs, Matti Aarnio, (Sat Apr 19, 6:29 pm)
Re: Alternative implementation of the generic __ffs, Joe Perches, (Sat Apr 19, 11:06 pm)
Re: Alternative implementation of the generic __ffs, Alexander van Heukelum, (Sun Apr 20, 4:42 am)
Re: Alternative implementation of the generic __ffs, Matti Aarnio, (Sun Apr 20, 8:31 am)
Re: Alternative implementation of the generic __ffs, Alexander van Heukelum, (Mon Apr 21, 7:43 am)
Re: Alternative implementation of the generic __ffs, dean gaudet, (Sat Apr 19, 12:13 am)
Re: Alternative implementation of the generic __ffs, Alexander van Heukelum, (Sat Apr 19, 8:10 am)
Re: Alternative implementation of the generic __ffs, Joe Perches, (Sat Apr 19, 2:17 pm)
Re: Alternative implementation of the generic __ffs, Alexander van Heukelum, (Sat Apr 19, 4:26 pm)
Re: Alternative implementation of the generic __ffs, Mikael Pettersson, (Sat Apr 19, 6:05 am)
[PATCH] x86: switch x86_64 to generic find_first_bit, Alexander van Heukelum, (Tue Apr 1, 11:41 am)
[PATCH] x86: optimize find_first_bit for small bitmaps, Alexander van Heukelum, (Tue Apr 1, 11:42 am)
[PATCH] x86: remove x86-specific implementations of find_fir..., Alexander van Heukelum, (Tue Apr 1, 11:47 am)
Re: [PATCH] x86: remove x86-specific implementations of find..., Alexander van Heukelum, (Thu Apr 3, 5:34 am)
Re: [PATCH] x86: generic versions of find_first_(zero_)bit, ..., Stephen Hemminger, (Mon Mar 31, 1:22 pm)
Re: [PATCH] x86: generic versions of find_first_(zero_)bit, ..., Alexander van Heukelum, (Mon Mar 31, 3:38 pm)
speck-geostationary