[MLton-commit] r5794

Matthew Fluet fluet at mlton.org
Thu Jul 26 18:17:06 PDT 2007


Changed the Kind.t of floating point yielding operations from
Functional to DependsOnState; such operations depend on the rounding
mode and it is not correct to common-subexpression-eliminate such
operations (in the presence of changes to the rounding mode).

Changing the kind of floating point yielding operations had a
negligible effect on floating-point intensive benchmarks:

MLton0 -- ~/devel/mlton/mlton.svn.trunk/build/bin/mlton
MLton1 -- ~/devel/mlton/mlton.svn.trunk.fpops/build/bin/mlton
run time ratio
benchmark       MLton0 MLton1
barnes-hut        1.00   1.02
fft               1.00   0.96
hamlet            1.00   1.00
mandelbrot        1.00   1.00
matrix-multiply   1.00   1.03
nucleic           1.00   1.00
ray               1.00   1.01
raytrace          1.00   1.01
simple            1.00   1.00
tensor            1.00   1.00
tsp               1.00   1.03
tyan              1.00   1.00
vliw              1.00   0.99
zern              1.00   1.00
size
benchmark          MLton0    MLton1
barnes-hut        165,070   165,086
fft               116,965   116,965
hamlet          1,513,493 1,513,493
mandelbrot         95,457    95,457
matrix-multiply    97,521    97,521
nucleic           271,440   271,440
ray               256,302   256,350
raytrace          386,562   386,962
simple            328,425   328,457
tensor            159,203   159,203
tsp               137,131   137,451
tyan              205,020   205,020
vliw              527,974   527,974
zern              135,842   135,842
compile time
benchmark       MLton0 MLton1
barnes-hut        9.51   9.35
fft               7.59   7.47
hamlet           46.29  46.42
mandelbrot        7.07   7.30
matrix-multiply   7.54   7.48
nucleic          11.31  11.29
ray              11.48  11.44
raytrace         15.57  15.62
simple           12.47  12.89
tensor            9.92   9.99
tsp               8.25   8.16
tyan             10.47  10.22
vliw             19.52  19.14
zern              8.30   8.29
run time
benchmark       MLton0 MLton1
barnes-hut       16.99  17.37
fft              15.67  15.04
hamlet           31.56  31.57
mandelbrot       21.21  21.19
matrix-multiply   2.91   3.00
nucleic          18.10  18.04
ray              14.74  14.92
raytrace         18.18  18.30
simple           28.68  28.67
tensor           22.81  22.80
tsp              21.70  22.28
tyan             28.57  28.66
vliw             32.13  31.96
zern             22.26  22.24



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

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

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

Modified: mlton/trunk/mlton/atoms/prim.fun
===================================================================
--- mlton/trunk/mlton/atoms/prim.fun	2007-07-27 01:04:57 UTC (rev 5793)
+++ mlton/trunk/mlton/atoms/prim.fun	2007-07-27 01:17:05 UTC (rev 5794)
@@ -823,34 +823,34 @@
        | MLton_share => SideEffect
        | MLton_size => DependsOnState
        | MLton_touch => SideEffect
-       | Real_Math_acos _ => Functional
-       | Real_Math_asin _ => Functional
-       | Real_Math_atan _ => Functional
-       | Real_Math_atan2 _ => Functional
-       | Real_Math_cos _ => Functional
-       | Real_Math_exp _ => Functional
-       | Real_Math_ln _ => Functional
-       | Real_Math_log10 _ => Functional
-       | Real_Math_sin _ => Functional
-       | Real_Math_sqrt _ => Functional
-       | Real_Math_tan _ => Functional
-       | Real_abs _ => Functional
-       | Real_add _ => Functional
+       | Real_Math_acos _ => DependsOnState (* depends on rounding mode *)
+       | Real_Math_asin _ => DependsOnState (* depends on rounding mode *)
+       | Real_Math_atan _ => DependsOnState (* depends on rounding mode *)
+       | Real_Math_atan2 _ => DependsOnState (* depends on rounding mode *)
+       | Real_Math_cos _ => DependsOnState (* depends on rounding mode *)
+       | Real_Math_exp _ => DependsOnState (* depends on rounding mode *)
+       | Real_Math_ln _ => DependsOnState (* depends on rounding mode *)
+       | Real_Math_log10 _ => DependsOnState (* depends on rounding mode *)
+       | Real_Math_sin _ => DependsOnState (* depends on rounding mode *)
+       | Real_Math_sqrt _ => DependsOnState (* depends on rounding mode *)
+       | Real_Math_tan _ => DependsOnState (* depends on rounding mode *)
+       | Real_abs _ => DependsOnState (* depends on rounding mode *)
+       | Real_add _ => DependsOnState (* depends on rounding mode *)
        | Real_castToWord _ => Functional
-       | Real_div _ => Functional
+       | Real_div _ => DependsOnState (* depends on rounding mode *)
        | Real_equal _ => Functional
-       | Real_ldexp _ => Functional
+       | Real_ldexp _ => DependsOnState (* depends on rounding mode *)
        | Real_le _ => Functional
        | Real_lt _ => Functional
-       | Real_mul _ => Functional
-       | Real_muladd _ => Functional
-       | Real_mulsub _ => Functional
-       | Real_neg _ => Functional
+       | Real_mul _ => DependsOnState (* depends on rounding mode *)
+       | Real_muladd _ => DependsOnState (* depends on rounding mode *)
+       | Real_mulsub _ => DependsOnState (* depends on rounding mode *)
+       | Real_neg _ => DependsOnState (* depends on rounding mode *)
        | Real_qequal _ => Functional
-       | Real_rndToReal _ => Functional
+       | Real_rndToReal _ => DependsOnState (* depends on rounding mode *)
        | Real_rndToWord _ => Functional
-       | Real_round _ => DependsOnState  (* depends on rounding mode *)
-       | Real_sub _ => Functional
+       | Real_round _ => DependsOnState (* depends on rounding mode *)
+       | Real_sub _ => DependsOnState (* depends on rounding mode *)
        | Ref_assign => SideEffect
        | Ref_deref => DependsOnState
        | Ref_ref => Moveable
@@ -892,7 +892,7 @@
        | Word_orb _ => Functional
        | Word_quot _ => Functional
        | Word_rem _ => Functional
-       | Word_rndToReal _ => Functional
+       | Word_rndToReal _ => DependsOnState (* depends on rounding mode *)
        | Word_rol _ => Functional
        | Word_ror _ => Functional
        | Word_rshift _ => Functional




More information about the MLton-commit mailing list