[MLton] IntInf implementation questions

Wesley W. Terpstra wesley@terpstra.ca
Tue, 7 Feb 2006 00:27:00 +0100


On Feb 6, 2006, at 11:45 PM, Henry Cejtin wrote:
> Do you really have code where 32*32->64 would be a big win compared  
> to the
> Appel hack which would avoid the expensive call to C?  It can only  
> be a win
> if you have things that fit in 31 bits and are frequently  
> multiplying them
> together and the product often does NOT fit in 31 bits.  Obviously  
> one can
> construct bad cases, but I would think that it would be VERY rare  
> in practice.

Might you be asking for a link to my very first post on this list?
I think you might be! ;-)

http://terpstra.ca/lurker/message/20041021.222851.4139646f.en.html

Admittedly, in my case I wanted to store the thing in a Word32.
However, since it is modulo 2^31-1, I could have stored it in an 'int'.

Of course, I don't really expect normal int*int multiplication to do  
this.
I just heard Stephen say 'primitive' near the words 32*32->64 mul,
and my heart jumped into my throat. ;-)

There is still no way to get MLton to output the pretty 'MUL:' assembler
that I detailed in my post. I've been hoping for some time.