Am I missing something, or what's the difference between ineg and bnot? With ineg being two's complement aka. a bitwise invert, shouldn't they both be the same operation?
In aarch64 lowering, I see ineg lowered into 0 - x whereas bnot turns into orr_not(...). I'd guessisub affects processor flags for eg. nz, overflow, whereas bnot doesn't. But flags aren't modelled in clif, so why make the difference on that level?
Two's complement negation is ~x + 1 (negation and bitwise invert are equivalent in ones-complement) -- so they're distinct
Thanks... now I feel kinda silly for asking this question, but oh well
no worries! it's definitely not intuitive at first
Last updated: Aug 30 2026 at 09:07 UTC