Am 03.01.2013 um 21:07 schrieb Scott Wood <scottw...@freescale.com>:
> On 01/03/2013 12:53:13 PM, Alexander Graf wrote: >> On 22.12.2012, at 03:15, Scott Wood wrote: >> > Search the queue more efficiently by first looking for a non-zero word, >> > and then using the common bit-searching function to find the bit within >> > the word. It would be even nicer if bitops_ffsl() could be hooked up >> > to the compiler intrinsic so that bit-searching instructions could be >> > used, but that's another matter. >> > >> > Signed-off-by: Scott Wood <scottw...@freescale.com> >> What we really want is a bitmap wide ffs() bipops helper function that >> returns the first set bit in a bitmap and can optimize the hell out of that >> operation inside of itself. I don't think this belongs to the OpenPIC code. > > Well, we do have find_next_bit() in bitops.c, but it looks comparitively > complicated in order to be generic and simply return a value rather than > perform an action on each bit set. I suspect that the code in this patch > would be faster, and avoids the need for me to follow all the twists and > turns of find_next_bit() to figure out whether the undocumented interface is > actually exactly what I guess it to be (e.g. what does it return when no bit > is found?). I would just call it bit_ffs and follow the same semantics. Alex > > -Scott