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>
Thu, 13 Sep 2012 05:13:05 +0000 (22:13 -0700)
commit0fc163408e6b9521d545daba19f70631011d5752
tree0a3423252f2e3be95c90cff3bb364eead7f7545d
parent1a5d4f7cb2367c7863b28efbd78e9169114baf42
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>
src/mesa/main/imports.h