Commit Graph

4 Commits

Author SHA1 Message Date
H. Peter Anvin
c138e6a4b2 ilog2: optimize use of bsr for x86-64
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>
2010-04-22 11:02:56 -07:00
Cyrill Gorcunov
641ca7fd6a ilog2: Use ROUND helper
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-04-22 19:03:39 +04:00
Cyrill Gorcunov
c8fd6fdae4 ilog2: Get rid of tabs
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-04-22 19:02:35 +04:00
H. Peter Anvin
084b13227e Add generic ilog2 functions
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>
2010-04-21 16:43:20 -07:00