Re: diff to speed up fdalloc using two-level bitmaps

Niels Provos <[email protected]>
Newsgroups gmane.os.netbsd.devel.performance
Message-ID <[email protected]>
On Tue, Oct 28, 2003 at 11:25:59AM -0500, Niels Provos wrote:
> It could need some fine tuning
> 
>  http://www.citi.umich.edu/u/provos/benchmark/netbsd-fdalloc-zoom.jpg
> 
> An inline assembly function for finding the first zero bit in a
> word would be a great thing to have across architectures.

The same benchmark with the following inline assembly

static __inline__ uint32_t ffz(uint32_t word)
{
        __asm__("bsfl %1,%0"
                :"=r" (word)
                :"r" (~word));
        return word;
}

looks much better:

  http://www.citi.umich.edu/u/provos/benchmark/netbsd-fdalloc-zoom.jpg

Now, it is faster than before in all cases.  It would be great if we
could have a

 <machine/bitops.h>

include file that would define similar inline assembly for all
architectures or the equivalent C code if there is no instruction
support.

Niels.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.