[MLton] Re: Bug? print statement makes program terminate /
Wesley W. Terpstra
wesley at terpstra.ca
Wed Jun 24 12:16:24 PDT 2009
On Wed, Jun 24, 2009 at 9:06 PM, Vesa Karvonen <vesa.a.j.k at gmail.com> wrote:
> > MLton 20061107 works. So does 20070826.
Strange that this didn't used to happen.
> Did you try this on a x86 platform?
This was only on x86, yes.
> If so, did you try with -ieee-fp true?
With this flag it terminates.
> Here is my theory. On x86, the
> print in the loop has the effect of forcing the y' value out of FP
> registers. This allows the loop to terminate. Otherwise, with the
> 80-bit registers of the x86, and the 80-bit value of y' in a register
> at the time of the comparison, the loop will never terminate as the
> 64-bit value of y and the 80-bit value of y' will never be equal.
Actually it seems the two 80-bit values never become equal:
fdivr %st, %st(1)
fadd %st, %st(1)
The comparison is indeed happening in a floating point register, which means
it might behave differently than when truncated in/out of memory for the C
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the MLton