Actually, __builtin_clz:
http://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html
Not having a gcc 2.4 handy, I couldn't test it, but I did notice that the
built-in ffs is very fast. Perhaps all such standard functions will end up
as built-ins instead of kernel library functions, some very long time in the
future. If old compilers ever do finally fade away, that is.
It's somewhat annoying that __builtin_clz leaves the all-ones case dangling
instead of returning -1.
Regards,
Daniel
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/