On 01/05/2010 04:55 PM, Paolo Bonzini wrote:
I see no other way to fixup the underflow. Some comments below:
You can always subtract (or XOR) the sign bit to turn an unsigned
value to the corresponding signed value. The attached patch (on top of
the code before H.J.'s patch) fixes the C testcase in the PR, but I
didn't test it further and I don't have time unfortunately.
It will work until you change the sign bit of 0x80000000, either of an
input operand or an intermediate result of subtraction. For the
reference of interested readers, this problem is described in [1].