RFR (XS) 8238909: x86_32 fails gtest:power_of_2

Stefan Karlsson stefan.karlsson at oracle.com
Thu Feb 13 11:18:24 UTC 2020


On 2020-02-13 12:04, Claes Redestad wrote:
> 
> 
> On 2020-02-12 21:30, Aleksey Shipilev wrote:
>> On 2/12/20 7:45 PM, Aleksey Shipilev wrote:
>>> Bug:
>>>    https://bugs.openjdk.java.net/browse/JDK-8238909
>>>
>>> Fix:
>>>    https://cr.openjdk.java.net/~shade/8238909/webrev.01/
>>
>> Scratch that, Stefan suggested a cleaner version:
>>    https://cr.openjdk.java.net/~shade/8238909/webrev.02/
> 
> Looks good, and nice catch. The use of is_power_of_2 was carried
> forward from a z-only helper method that is 64-bit only, so we all
> missed that it might be problematic on 32-bit.
> 
> As a follow-up RFE (that I can volunteer to take care of) I'd suggest
> moving is_power_of_2_t from align.hpp to powerOfTwo.hpp and invert the
> dependency.

I have a patch with this that I'm testing right now.

> 
> The methods in globalDefinitions are hard to disentangle. And my gut
> feeling is that we should move away from any operations that uses
> intptr_t as a type for arithmetic operations in favor of template
> functions.

My proposal is to move exact_log2 and exact_log2_log to powerOfTwo.hpp. 
Their semantics is "log2 of an is_power_of_2 value", so I think it 
sort-of makes sense to group them together with the other power-of-2 
functions.

StefanK

> 
> /Claes


More information about the hotspot-dev mailing list