This adds known bits support for the unsigned saturating add/sub intrinsics. The procedure is basically:
- Compute known bits for a normal add/sub with one extra bit to capture the carry-out.
- If known overflow, use the saturation value (all ones or zero).
- If known no overflow, use the add/sub result.
- If unknown overflow: For additions we can preserve leading ones, because either there is no carry into the ones and they stay, or there is one, the result overflows and all ones is used (which also has leading ones). Additionally we preserve ones in the add result, as we're selecting between the add result and all ones. For subtractions the situation is the same but with zeros instead of ones.
I'm only handling the unsigned case here as it is simpler. It's likely not worthwhile having known bits for the signed cases at all, as we just can't get a lot of information there.
This is more accurate than what we currently do in computeOverflowForUnsignedAdd(), right? Can we adjust that existing API to use this method and then call it?