On Mon, Jul 25, 2011 at 02:01:31PM -0700, Eliot Miranda wrote:
Hi David,
The issue does not exist in VMMaker trunk, which uses a simpler and presumably faster implementation.
Alas, no, it still exists. The expression 0 - value is still undefined for overflow (i.e. undefined for max neg int) and hence, depending on compiler, the following statement value >= 0 may be assumed to be always true. This is the case for the intel compiler that we used at Qwaq/Teleplace, and is the reason I made the change in the first place. So yes, one does need the shift expression to be able to rely on different compilers generating correct code in this edge case.
Thanks Eliot.
Dave