[MLton-commit] r6247
Matthew Fluet
fluet at mlton.org
Sun Dec 9 11:49:43 PST 2007
Manually unroll loop to allow constant folding of small shifts
----------------------------------------------------------------------
U mlton/trunk/basis-library/integer/int-inf.sml
----------------------------------------------------------------------
Modified: mlton/trunk/basis-library/integer/int-inf.sml
===================================================================
--- mlton/trunk/basis-library/integer/int-inf.sml 2007-12-09 19:13:29 UTC (rev 6246)
+++ mlton/trunk/basis-library/integer/int-inf.sml 2007-12-09 19:49:43 UTC (rev 6247)
@@ -34,13 +34,14 @@
val maxShift = Word32.toWord maxShift32
fun make f (arg, shift) =
let
- fun loop (arg, shift) =
+ fun body loop (arg, shift) =
if Word.<= (shift, maxShift)
then f (arg, Word32.fromWord shift)
else loop (f (arg, maxShift32),
Word.- (shift, maxShift))
+ fun loop (arg, shift) = body loop (arg, shift)
in
- loop (arg, shift)
+ body loop (arg, shift)
end
in
val << = make <<
More information about the MLton-commit
mailing list