commit | 64b2391e174bb029322d6e9c88cc52003dd62839 | [log] [tgz] |
---|---|---|
author | H. Peter Anvin <hpa@zytor.com> | Wed Apr 05 22:21:38 2006 -0700 |
committer | H. Peter Anvin <hpa@zytor.com> | Wed Apr 05 22:21:38 2006 -0700 |
tree | cc470cab2ecc293566ddcb5cf89f80d588058788 | |
parent | 1cc44330a42c56e40f893f576b8090be598f29e3 [diff] |
[klibc] If we have gcc4, use __builtin_clz() to do a binary logarithm If we have gcc4, we can use __builtin_clz() to do the binary logarithm necessary to compute __page_shift. Do foo^31 instead of 32-foo since that seems to be how gcc is implemented; this means gcc can figure out how to properly optimize the result afterwards. Signed-off-by: H. Peter Anvin <hpa@zytor.com>