mesa: Add a _mesa_fls() function to find the last bit set in a word.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 12 Sep 2012 05:14:58 +0000 (22:14 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Fri, 14 Sep 2012 09:02:53 +0000 (02:02 -0700)
commit66e8f863d34fc8b8f7602c45bb3230fe663d4eb0
tree7747a2aad7a6c93475e11ebb8ef3d046e52f779c
parentc586fce4fb537e904e35cb5197b6b7fe02217acb
mesa: Add a _mesa_fls() function to find the last bit set in a word.

ffs() finds the least significant bit set; _mesa_fls() finds the /most/
significant bit.

v2: Make it an inline function in imports.h, per Brian's suggestion.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 0fc163408e6b9521d545daba19f70631011d5752)
src/mesa/main/imports.h