RFR: 8240829: Use a fast O(1) algorithm for exact_log2
Claes Redestad
claes.redestad at oracle.com
Tue Mar 10 18:31:46 UTC 2020
On 2020-03-10 19:19, Andrew Haley 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?
>
Feel free!
I added count_leading_zeros early last year to speed up some hot pieces
of code in C2. I did briefly look at re-implementing exact_log2 using
it, but since that was firmly embedded inside globalDefinitions I wasn't
sure I could pull off the code shuffle necessary to do so at the time
(and exact_log2 wasn't a bottleneck in the things I was looking at)
/Claes
More information about the hotspot-dev
mailing list