Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Ocamlopt code generator question
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-05-05 (16:26)
From: Dmitry Bely <dmitry.bely@g...>
Subject: Re: [Caml-list] Re: Ocamlopt code generator question
On Tue, May 5, 2009 at 8:06 PM, Jean-Marc Eber <> wrote:
> Hi Dimitry,
> Firstly thanks for looking again at the sse2 stuff!
> A difference may occur, if I'm not wrong, from the intermediate results
> precision:
> in sse2, eveything is done on 8 bytes (if you "do" doubles at least), while,
> in x87, intermdiate results (kept on the stack) are 10 bytes precision.
> This may result in differences (and the bytecode runtime never uses x87
> intermediate storage, so it behaves _numerically_ like the sse2 code
> generator, I guess).

I wouldn't be so sure. Bytecode runtime is C compiler-dependent (that
does use x87 for floating-point calculations), so rounding errors can
lead to different results. Floating point is always approximate...

- Dmitry Bely