[MLton-user] power of 2 optimisation

Franck Arnaud franck@nenie.org
17 Jul 2003 22:14:02 GMT


Matthew Fluet:

> MLton will optimize quot/rem (corresponding to the machine instructions)
...
> Note that performing div/mod requires some additional tests [...]

Thank you, that was my problem. After replacing div/mod with quot/rem,
things look much nicer, all these routines are gone from the profiler's 
output.

Tom 7:

> If you don't care about negative numbers, you should probably use Word32
> since then you won't have bounds checks, either!

I try to avoid using special types unless really necessary (and 
practically I have the problem that Moscow ML, the other compiler 
I use for type checking etc, does not have Word32, although in 
that case I guess Word would work for both even if they are of 
different sizes).

Thanks for the tip about the assembler output.

--
franck@nenie.org


-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
MLton-user mailing list
MLton-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-user