Re: bignums and native back end

Top Pagina
Bijlagen:
Bericht als e-mail
+ (text/plain)
Delete this message
Reply to this message
Auteur: Stephen Weeks
Datum:  
Aan: MLton
CC: MLton
Onderwerp: Re: bignums and native back end

> 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.