On 27.08.2024 14:01, Andrew Cooper wrote:
> On 26/08/2024 11:30 am, Jan Beulich wrote:
>> On 23.08.2024 01:06, Andrew Cooper wrote:
>>> --- a/xen/common/bitops.c
>>> +++ b/xen/common/bitops.c
>>> @@ -84,8 +84,32 @@ static void __init test_fls(void)
>>> CHECK(fls64, 0x8000000000000001ULL, 64);
>>> }
>>>
>>> +static void __init test_multiple_bits_set(void)
>>> +{
>>> + /*
>>> + * multiple_bits_set() is generic on the type of it's parameter, as the
>>> + * internal expression is so simple.
>>> + */
>>> +
>>> + CHECK(multiple_bits_set, 0, false);
>>> + CHECK(multiple_bits_set, 1, false);
>>> + CHECK(multiple_bits_set, 2, false);
>>> + CHECK(multiple_bits_set, 3, true);
>>> +
>>> + CHECK(multiple_bits_set, 1 | (1UL << (BITS_PER_LONG - 1)), true);
>> This is really the same as ...
>>
>>> +#if BITS_PER_LONG > 32
>>> + CHECK(multiple_bits_set, 1 | (1UL << 32), true);
>>> + CHECK(multiple_bits_set, 1 | (1UL << 63), true);
>> ... this, at least as long as BITS_PER_LONG > 32 in practice means
>> BITS_PER_LONG == 64. Perhaps not really worth keeping that line?
>
> I suppose not. I'll drop it.
>
> However, It occurs to me that I do need a test of 0x8000000000000001ULL
> mostly for 32bit builds to check that even when the argument is split,
> the answer is still accurate.
IOW you'll insert an #else in the middle. Fine with me; keep the R-b.
Jan