test1
Matthew Fluet
fluet@cs.cornell.edu
Tue, 5 Feb 2002 23:00:13 -0500 (EST)
> How are you going to get the label from C code?
That's easy; the c-codegen spits out things like:
Int_addCheck(RI(11), RI(7), 1, L_24);
So, you've got a token corresponding to the overflow label.
> Also how will gcc know
> about the funny control-flow?
Hadn't thought about that one. The GCC info pages say:
Speaking of labels, jumps from one `asm' to another are not
supported. The compiler's optimizers do not know about these jumps, and
therefore they cannot take account of them when deciding how to
optimize.
So, that's not too encouraging.
> I seem to remember reading about the bizzare
> flags you can specify on __asm__ things to indicate some of this, but I
> bit it would introduce more bugs.
Speaking of flags, I think that all the __asm__ from the PolySpace mods
nees to look like:
static inline Int Int_addCheckFast(Int n1, Int n2) {
__asm__ __volatile__ ("addl %1, %0\n\tjo MLton_overflow"
: "+r" (n1) : "g" (n2) : "cc");
return n1;
}
to indicate that these instructions also clobber the condition codes.