[MLton-user] power of 2 optimisation

Franck Arnaud franck@nenie.org
17 Jul 2003 20:39:47 GMT


Hello,

Does mlton optimise for div/mod by constant powers of 2?
that is:

 val const = 16
 fun div16 x = x div const

would compile to a bit shift by 4 bits rather than a division.
(mlton's excellent profiler tells me I'm spending 1/4 of my 
time in div and mod, despite my having selected powers of 2s)

If it does not, maybe an interesting question is whether it 
should or is it better that the programmer uses shifts 
explicitely?

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