On 2026-07-27 08:32:12+0100, David Laight wrote:
> On Sun, 26 Jul 2026 18:01:11 +0200
> Willy Tarreau <[email protected]> wrote:
> > On Sun, Jul 26, 2026 at 03:13:34PM +0100, David Laight wrote:
> > > On Sun, 26 Jul 2026 17:13:03 +0700
> > > Ammar Faizi <[email protected]> wrote:

(...)

> > but ~(j - 1) would work, just like
> > (~j + 1). However here the benefit of the casts in Ammar's
> > version is that it's obvious that it's only playing with same
> > size casts with no extra operation.
> 
> They only work for 2s compliment.
> While that is normal (and required for the next? C version)
> it isn't actually required by C.
> (Not that gcc supports '1s compliment' or 'sign overpunch'.)

nolibc only supports Linux, which in turn only supports 2s
complement. We already have code in nolibc which relies on this.


Thomas

Reply via email to