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
[Caml-list] POSIX Threads: kill
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Xavier Leroy <xavier.leroy@i...>
Subject: Re: [Caml-list] register windows
> On the other hand, ocaml does not use register windows on SPARC and
> fixing that would be a big change.  Did somebody determine that the
> "flat" model was faster, or was it just easier to implement?

I experimented both approaches (with and without register windows) on
the SPARC a long time ago, in the Gallium experimental compiler
(which, after a complete rewrite, became the OCaml native-code compiler).
IIRC, there was one test where register windows were slightly faster;
on most tests, they were somewhat slower; and on a few tests involving
deep recursion, the code using register windows was 10-50 times slower
than the code that didn't use them.  I believe the Chez Scheme people
conducted similar experiments, with the same conclusions.

> SPARC v9 may change the equation because it was designed to make
> save and restore instructions fast, reducing window overflow traps
> to under 50 cycles.

A fixed-size register window is always going to save and restore too
many registers.  Even with variable-sized windows like on the IA64,
I believe it's more efficient to schedule explicit spills and reloads in
between regular instructions than rely on the hardware and OS to move
window contents to and from the stack.

- Xavier Leroy

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: