RFR: 8240829: Use a fast O(1) algorithm for exact_log2

John Rose john.r.rose at oracle.com
Tue Mar 10 23:24:25 UTC 2020


On Mar 10, 2020, at 11:19 AM, Andrew Haley <aph at redhat.com> wrote:
> 
> On 3/10/20 6:14 PM, Andrew Haley wrote:
>> On 3/10/20 6:05 PM, Andrew Haley wrote:
>>> TL/DR: prefer portable code when possible.
>> 
>> And -- of course -- I never saw the count_leading_zeros() !
> 
> And finally: unless you have a burning desire to do it yourself, I'll make
> another patch using count_leading_zeros(). OK?

Yes, please build exact_log2 on top of count_leading_zeroes,
which (in turn) resorts to DeB multiply if necessary.


More information about the hotspot-dev mailing list