[Patch] Use __builtin_clz* for __lg

Paolo Carlini pcarlini@suse.de
Wed Oct 24 19:57:00 GMT 2007


Hi,

today, while working on something else, I noticed that we weren't
exploiting the various __builtin_clz* for our internal integer log2.
Seems a good idea to me, but please double check... Also, for the
generic case, I'm seeing a slightly tighter loop with the below tweak
(actually, that is apparently the most widespread way of implementing it).

Tested x86_64-linux.

Paolo.

////////////////
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CL_lg
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20071024/072564f2/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch_lg
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20071024/072564f2/attachment-0001.ksh>


More information about the Libstdc++ mailing list