|
From: | Scott Wood |
Subject: | Re: [Qemu-devel] [PATCH 12/15] openpic: IRQ_check: search the queue a word at a time |
Date: | Thu, 3 Jan 2013 14:07:21 -0600 |
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 <address@hidden>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?).
-Scott
[Prev in Thread] | Current Thread | [Next in Thread] |