Re:Almost Always Unsigned
by kazinator on Monday July 13, 2026 @03:09PM
(#48897298)
The important thing isn't the flag (piece of CPU state) but the function which calculates it from the two inputs and result. That is a pure Boolean function: do these three values indicate signed overflow or unsigned carry?
The compiler could optimize that into accessing a flag, if the three inputs were just involved in an addition. In the general case, it has to emit the logic to test the bits of a, b, c.
[ Parent
| on HN ]
There are no comments on this comment yet.