bignums and native back end

Stephen Weeks MLton@sourcelight.com
Wed, 8 Nov 2000 16:47:53 -0800 (PST)


> I'm slightly confused how the cps phase can do this optimization.  In int-inf.h
> the function InfInt_areSmall is defined (it is a primitive) which checks if
> its two arguments are both small (by anding them together with 1 and seeing if
> it is 0).  Since it is in a primitive, no higher levels see this and.
> Did you just instruct the shrinker that
> 	IntInf_areSmall(x, small-constant) = IntInf_isSmall(x)
> and similarly for the reverse order?

Yes.

> Also just how much do the upper levels know about small things?

They know about IntInf_isSmall and IntInf_areSmall.  What else were you thinking 
about?

> Any way, all of this (and the re-associating so that
> 	x + constant + constant
> turns into `x + (constant + constant)') is very fine. 

I didn't do the re-associating stuff.  It doesn't fit very well into the current 
shrinker.