re new SML/NJ
Henry Cejtin
henry@sourcelight.com
Fri, 10 Aug 2001 02:46:00 -0500
I am not really arguing that we should switch to MLRisc, since as you say, it
would be very hard because of the non-standard aspects and very painful
because of the bugs that are almost certainly there. The point is though
that I am curious how much better, if any, their local-ish code generator is,
and how much that is buying them. If we knew it was a lot, it would be an
argument for us to fix ours up, while if they are getting squat, then we can
continue without worrying too much about it.
Speaking of which, I tried the silly floating point test that appeard in
comp.lang.functional
fun test (n, x) =
if n = 0
then x
else test (n - 1, x + Math.cos x)
and our code was definitely nicely faster than gcc:
gcc 278.9 nanoseconds
MLton 234.2 nanoseconds
so we are 20% faster. I looked at the code, and ours still does one floating
point load and one store per loop, but the C version is doming some really
funny stuff.
In the best of all worlds, the back end would figure out that the floating
point register only has to be stored when the loop finishes.