[aarch64] assert(is_power_of_2(x)) failed: x must be a power of 2: 0xffffffff80000000
Andrew Haley
aph at redhat.com
Fri Feb 28 09:02:47 UTC 2020
On 2/27/20 2:39 PM, Stuart Monteith wrote:
> The majority of the uses of "exact_log2" aren't concerned so with
> arithmetic as such, but bit manipulation. In other words it is being
> used to get the number of the most-significant bit. Likewise,
> is_power_of_2 is being used in much the same way.
All of them, I believe, are used to do this.
> Would it be appropriate to have two sets of functions for these quite
> distinct purposes? "exact_log2" is being used for the number of the most
> significant bit, and is_power_of_2 is being used to test is only one bit
> is set.
If anyone actually wanted to do something different for negative integers
then we'd want to do that, but I don't think there are any such cases.
--
Andrew Haley (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671
More information about the hotspot-compiler-dev
mailing list