English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
RE: [Caml-list] 32 bit floats, SSE instructions
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-06-08 (08:11)
From: Ennals, Robert <robert.ennals@i...>
Subject: RE: [Caml-list] 32 bit floats, SSE instructions


> The main problem with float's - whatever if they are 32 or 64 bits -
> their boxing . OCaml runtime value representation is efficient but a
> -
> even 32 bits - cannot be carried in a register as it could be in C.
> (actually some unboxing can be performed locally by ocamlopt). This is
> mainly because OCaml is an high-level language, with a garbage
> and so needs to keep the track of what is being allocated in an
> way. 

I assume you are referring to the way in which OCaml reserves one bit in
each word to use as a tag that indicates whether the word represents a
pointer or not (which is also the reason for ints being 31 bits).

While a GC does need to have some way to distinguish between pointers
and data, this is not the only way that this can be done. Another
approach (used by GHC) is to dispense with tag bits and instead store a
bitmask for each datatype and each stack layout, indicating which fields
are pointers.

I don't know much about the relative advantages/disadvantages of the two
approaches, but there is definitely a design space to be explored, and
it is definitely possible to have native 32 bit floats in a garbage
collected language.



To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners