On 5/16/23 14:29, Eric Blake wrote:
>
> On Tue, May 16, 2023 at 01:12:17PM +0100, Richard W.M. Jones wrote:
>>
>> It takes a 64 bit integer and finds the next power of 2,
>> eg. next_power_of_2 (510) => 512 (2^9)
>>
>> Taken from https://jameshfisher.com/2018/03/30/round-up-power-2/
>> with some f
On Tue, May 16, 2023 at 07:29:45AM -0500, Eric Blake wrote:
>
> On Tue, May 16, 2023 at 01:12:17PM +0100, Richard W.M. Jones wrote:
> >
> > It takes a 64 bit integer and finds the next power of 2,
> > eg. next_power_of_2 (510) => 512 (2^9)
> >
> > Taken from https://jameshfisher.com/2018/03/30/r
On Tue, May 16, 2023 at 01:12:17PM +0100, Richard W.M. Jones wrote:
>
> It takes a 64 bit integer and finds the next power of 2,
> eg. next_power_of_2 (510) => 512 (2^9)
>
> Taken from https://jameshfisher.com/2018/03/30/round-up-power-2/
> with some fixes.
> ---
> common/include/ispowerof2.h
It takes a 64 bit integer and finds the next power of 2,
eg. next_power_of_2 (510) => 512 (2^9)
Taken from https://jameshfisher.com/2018/03/30/round-up-power-2/
with some fixes.
---
common/include/ispowerof2.h | 9 +
common/include/test-ispowerof2.c | 14 ++
2 files chan