Version française
Home     About     Download     Resources     Contact us    
Browse thread
64-bit OCaml?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Sven Luther <sven.luther@w...>
Subject: Re: [Caml-list] 64-bit OCaml?
On Sat, Nov 06, 2004 at 11:06:30AM +0100, Xavier Leroy wrote:
> > I just obtained a new iMac G5 here. My cursory understanding is that this is
> > a 64 bit core processor. However, when I attempted to run config for
> > rebuilding the OCaml system, it reports a 32 bit system. What can or must I
> > do to coax OCaml to become a 64 bit system for this processor?
> 
> As others have explained, the first thing you need is a 64-bit kernel
> and a development environment (C compiler, linker, libraries) that
> handles 64-bit code.  The next release of Mac OS X is rumored to offer
> all this.
> 
> Once this is available, you should be able to compile the bytecoded
> part of OCaml to 64-bit code using e.g. configure -cc "gcc -m64"
> or whatever gcc options that select the generation of 64-bit apps.
> 
> However, ocamlopt will not work out of the box.  Some changes to the
> asm code generator are required to produce 64-bit code.  In the case
> of the PowerPC, the changes are relatively small.  Still, I can't
> perform them until we have G5 machines at INRIA, which may take a while.
> (Pretty much the only Apple hardware we buy are Powerbooks, and it's
> unclear when G5 Powerbooks will be mainstream.)
> 
> Also, the only situations where 64-bit code is beneficial are 1- large
> integer arithmetic (bignums, crypto), and 2- exploiting more than 4 Gb
> of RAM.  In all other cases, 64-bit code is actually a waste,
> since pointers occupy twice as much memory as with 32-bit code.
> 
> So, I expect 64-bit computing to take off when machines commonly have
> 4 Gb of RAM or more, which should take a few more years.  Caml will
> have no problems adapting to this trend, since it's 64-bit clean from
> the start.  (Caml Special Light, the ancestor of OCaml, was developed
> circa 1995 on a 64-bit Alpha, then backported to 32-bit
> architectures.)  I expect that at that time our "tier 1" architectures
> will be x86-64 and PPC-64.

On this topic, is it imaginable that there will some day be some way to take
advantage of altivec (or other vector units on other cpus) in ocaml ? This
would be a much bigger advantage for powerpc than 64bit, altough i believe
that if you had a native code target for a power3/power4/ppc970 cpu, you could
tweak it to obtain an around 20-30 % spead increase, or that is what i hear
from the linux ppc64 folk.

Friendly,

Sven Luther