re new SML/NJ

Matthew Fluet mfluet@intertrust.com
Mon, 13 Aug 2001 13:59:19 -0700 (PDT)


> > You are right.  Although I thought that there was a no-threads hack to
> > avoid inserting these limit checks.
>
> There is.

Hmm.  This is my input program:

fun test (n, x)
  = if n = 0
      then x
      else test (n - 1, x + Math.cos x)

val x = test (10, 0.0)

val _ = print (Real.toString x)
val _ = print "\n"

Here is the assembly I get using the 20010806 release:

skipGC_12:
	movl (80*1)(%edi),%esp
	cmpl $0,%esp
	je L_28
	decl %esp
	jo L_94
	movl %esp,(80*1)(%edi)
	fldl (72*1)(%edi)
	fld %st
	fcos
	faddp %st, %st(1)
	fstpl (72*1)(%edi)
	jmp statementLimitCheckLoop_12
statementLimitCheckLoop_12:
	cmpl (gcState+8),%esi
	jbe skipGC_12

> I vaguely recall some bug from a while ago in Program.hasPrim, which is used in
> limit-check.fun.  Maybe that didn't get propagated to your version of the
> backend.

Program.hasPrim is in the cps tree structure, so I'm up to date on all
those.