Subject: Re: [PATCH] remove powerpc bitops infavor of existing generic bitops

From: jschopp <[email-masked]>
Date: Mon, 15 May 2006 14:56:13 -0500

> There already exists a big endian safe bitops implementation in
> lib/find_next_bit.c.  The code in it is 90%+ common with the powerpc
> specific version, so the powerpc version is redundant.  This patch
> makes the necessary changes to use the generic bitops in powerpc, and
> removes the powerpc specific version.

I like generic as much as the next guy, but I'm also a big fan of fast bitops.  And the 
function below is fast.  You'll have to explain to me how the generic code is going to 
find the first zero as fast without explicit calls to ppc assembly.

> -static inline unsigned int ext2_ilog2(unsigned int x)
> -{
> -	int lz;
> -
> -	asm("cntlzw %0,%1": "=r"(lz):"r"(x));
> -	return 31 - lz;
> -}