[MLton-devel] detecting overflow with the C codegen

Henry Cejtin henry@sourcelight.com
Thu, 21 Nov 2002 00:20:09 -0600


It is true that the long long code is pretty bad in gcc 2.96.  I don't have
a gcc 3.* around to test what it looks like there.  Still, I would think that
using the overflow flag would be the fastest when you get it.
Testing for overflow in C could be done by something like
	long long	tmp;

	tmp = x * y;		/* or x + y, ... */
	if (tmp != (int)tmp)
		--- overflow ---;
The generated code is probably bad but I would guess not too horrible and
the best you can get out of C.


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel