On x86-64 platforms, we can rely on BSR not changing the destination operand when the input is zero. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Add ilog2_{32,64}() and alignlog2_{32,64}() ... the latter is intended for alignment statements and return -1 for non-power-of-2 other than 0 (which returns 0). Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>