The expression (~0 >> x) will always yield all-ones, because the right
shift is an arithmetic right shift that will always shift ones in.
Accordingly ~(~0 >> x) will always be zero.
Hence 'mask' will always be zero in this case.
Fix this by forcing a logical right shift instead of an arithmetic
ri
On Wed, 17 Jun 2015 20:47:17 -0400
Ilia Mirkin wrote:
> On Wed, Jun 17, 2015 at 1:05 PM, Michael Büsch wrote:
> > The expression (~0 >> x) will always yield all-ones, because the right
> > shift is an arithmetic right shift that will always shift ones in.
> > Accordingly ~(~0 >> x) will always
On Wed, Jun 17, 2015 at 1:05 PM, Michael Büsch wrote:
> The expression (~0 >> x) will always yield all-ones, because the right
> shift is an arithmetic right shift that will always shift ones in.
> Accordingly ~(~0 >> x) will always be zero.
> Hence 'mask' will always be zero in this case.
>
> Fi
The expression (~0 >> x) will always yield all-ones, because the right
shift is an arithmetic right shift that will always shift ones in.
Accordingly ~(~0 >> x) will always be zero.
Hence 'mask' will always be zero in this case.
Fix this by forcing a logical right shift instead of an arithmetic
ri