[PATCH] x86: Don't left shift negative values

Collin Funk collin.funk1@gmail.com
Fri Mar 13 01:08:37 GMT 2026


Andrew Pinski <pinskia@gmail.com> writes:

>> -                          count_mask = ~(-1 << (count_mask + 1));
>> +                          count_mask
>> +                            = ~((unsigned int) -1 << (count_mask + 1));
>
> Why not just:
> count_mask = ~(-1u << (count_mask + 1));

I agree that is better, thanks. Let me send a v2.

Collin


More information about the Libc-alpha mailing list