[MLton-commit] r7104

Vesa Karvonen vesak at mlton.org
Sun May 31 05:59:21 PDT 2009


Fixed bug in FP divide optimization.  When one of the arguments to FP
divide was known to be 0.5, a FP add (multiply by two) was generated
without checking whether 0.5 was the divisor or not.

Thanks to John Reppy for reporting the bug.

----------------------------------------------------------------------

U   mlton/trunk/mlton/atoms/prim.fun

----------------------------------------------------------------------

Modified: mlton/trunk/mlton/atoms/prim.fun
===================================================================
--- mlton/trunk/mlton/atoms/prim.fun	2009-04-22 11:36:54 UTC (rev 7103)
+++ mlton/trunk/mlton/atoms/prim.fun	2009-05-31 12:59:20 UTC (rev 7104)
@@ -1836,7 +1836,7 @@
                                then realAdd (s, x, x)
                             else Unknown
                           | Real_div s =>
-                            if not signBit andalso exp = 0
+                            if inOrder andalso not signBit andalso exp = 0
                                then realAdd (s, x, x)
                             else Unknown
                           | _ => Unknown)




More information about the MLton-commit mailing list