caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* 64-bit OCaml?
@ 2004-11-06  4:02 David McClain
  2004-11-06  5:05 ` [Caml-list] " David Brown
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: David McClain @ 2004-11-06  4:02 UTC (permalink / raw)
  To: caml

Hi,

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?

Thanks,

David McClain
Senior Corporate Scientist
Avisere, Inc.

+1.520.390.7738 (USA)
david.mcclain@avisere.com




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Caml-list] 64-bit OCaml?
  2004-11-06  4:02 64-bit OCaml? David McClain
@ 2004-11-06  5:05 ` David Brown
  2004-11-06  9:43   ` Sven Luther
  2004-11-06  5:15 ` David Brown
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: David Brown @ 2004-11-06  5:05 UTC (permalink / raw)
  To: David McClain; +Cc: caml

On Fri, Nov 05, 2004 at 09:02:11PM -0700, David McClain 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?

Install a 64-bit OS on the machine.  Mac OSX is still a 32-bit OS.  You can
enable -mcpu=G5 to make use of the 64-bit registers and such, the pointers
are still 32-bits, which means that ocaml words will still be 32 bits.

I don't know what Apple's plans are as far as 64-bit support in the OS.

PPC linux runs native 64-bit on the G5, but it isn't all that stable, yet.

Dave


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Caml-list] 64-bit OCaml?
  2004-11-06  4:02 64-bit OCaml? David McClain
  2004-11-06  5:05 ` [Caml-list] " David Brown
@ 2004-11-06  5:15 ` David Brown
  2004-11-06  9:41 ` Sven Luther
  2004-11-06 10:06 ` Xavier Leroy
  3 siblings, 0 replies; 9+ messages in thread
From: David Brown @ 2004-11-06  5:15 UTC (permalink / raw)
  To: David McClain; +Cc: caml

On Fri, Nov 05, 2004 at 09:02:11PM -0700, David McClain 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?

BTW, I just found: <http://developer.apple.com/macosx/tiger/?ht> where one
of the features of the Tiger release of OSX will be 64-bit development.
So, it should be doable at that time.

Dave Brown


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Caml-list] 64-bit OCaml?
  2004-11-06  4:02 64-bit OCaml? David McClain
  2004-11-06  5:05 ` [Caml-list] " David Brown
  2004-11-06  5:15 ` David Brown
@ 2004-11-06  9:41 ` Sven Luther
  2004-11-06 10:06 ` Xavier Leroy
  3 siblings, 0 replies; 9+ messages in thread
From: Sven Luther @ 2004-11-06  9:41 UTC (permalink / raw)
  To: David McClain; +Cc: caml

On Fri, Nov 05, 2004 at 09:02:11PM -0700, David McClain wrote:
> Hi,
> 
> 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?

This one i can reply, well, sort off.

The G5, which is really the ppc970 cpu from ibm, is a derivative of the power3
and power4 ibm processors. As thus, it can run both 32bit and 64bit code.

The you need to know what operating system you are running on it, but you
probably run mac os x, but in the linux case, you can have both a 32bit kernel
or a 64bit kernel. Of the linux distributions out there, not all support a
64bit kernel. on top of a 32bit kernel, you can run a 32bit userland only,
while on a 64bit kernel, you can run a 32bit or a true 64bit userland.

So, to take advantage of the 64bitness of the ppc970, you need a 64bit kernel,
and either a pure 64bit userland, or a dual userland, that is one which is
able to run both 32bit and 64bit code, but which is mostly 32bit usually.

Now, and here i believe it applies also to the mac os x case, in all case that
support 64bit userland, the actual programs, and among them ocaml, need to :

  1) detect that they are on a 64bit capable system.

  2) take advantage of the 64bitness of the system.

In the ocaml case, 1) should be rather easy, an adaptation of the configure
scripts probably only, as ocaml already supports 64bit. 2) is needs more work
though, and i don't believe there is already ppc 64bit support.

Friendly,

Sven LUther


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Caml-list] 64-bit OCaml?
  2004-11-06  5:05 ` [Caml-list] " David Brown
@ 2004-11-06  9:43   ` Sven Luther
  0 siblings, 0 replies; 9+ messages in thread
From: Sven Luther @ 2004-11-06  9:43 UTC (permalink / raw)
  To: David Brown; +Cc: David McClain, caml

On Fri, Nov 05, 2004 at 09:05:18PM -0800, David Brown wrote:
> On Fri, Nov 05, 2004 at 09:02:11PM -0700, David McClain 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?
> 
> Install a 64-bit OS on the machine.  Mac OSX is still a 32-bit OS.  You can
> enable -mcpu=G5 to make use of the 64-bit registers and such, the pointers
> are still 32-bits, which means that ocaml words will still be 32 bits.
> 
> I don't know what Apple's plans are as far as 64-bit support in the OS.
> 
> PPC linux runs native 64-bit on the G5, but it isn't all that stable, yet.

I think only gentoo has real 64bit (all packages built as 64bit), but you
don't really want to run gentoo.

Most other powerpc linux (debian, YDL, suze, mandrake seems to have dropped
ppc lately i think) are either pure 32bit only, or use a 64bit kernel with a
mixed 32/64 bit userland.

Friendly,

Sven Luther


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Caml-list] 64-bit OCaml?
  2004-11-06  4:02 64-bit OCaml? David McClain
                   ` (2 preceding siblings ...)
  2004-11-06  9:41 ` Sven Luther
@ 2004-11-06 10:06 ` Xavier Leroy
  2004-11-06 12:16   ` Sven Luther
                     ` (2 more replies)
  3 siblings, 3 replies; 9+ messages in thread
From: Xavier Leroy @ 2004-11-06 10:06 UTC (permalink / raw)
  To: David McClain; +Cc: caml

> 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.

- Xavier Leroy


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Caml-list] 64-bit OCaml?
  2004-11-06 10:06 ` Xavier Leroy
@ 2004-11-06 12:16   ` Sven Luther
  2004-11-06 15:47   ` John Carr
  2004-11-07 20:18   ` Francis Dupont
  2 siblings, 0 replies; 9+ messages in thread
From: Sven Luther @ 2004-11-06 12:16 UTC (permalink / raw)
  To: Xavier Leroy; +Cc: David McClain, caml

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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Caml-list] 64-bit OCaml?
  2004-11-06 10:06 ` Xavier Leroy
  2004-11-06 12:16   ` Sven Luther
@ 2004-11-06 15:47   ` John Carr
  2004-11-07 20:18   ` Francis Dupont
  2 siblings, 0 replies; 9+ messages in thread
From: John Carr @ 2004-11-06 15:47 UTC (permalink / raw)
  To: caml-list


> 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.

3 - some floating point intensive code if unaligned accesses are slow

On 32 bit machines heap values are only 32 bit aligned and loads and
stores of 64 bit floats may be slower due to misalignment.  The
performance impact varies by CPU.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Caml-list] 64-bit OCaml?
  2004-11-06 10:06 ` Xavier Leroy
  2004-11-06 12:16   ` Sven Luther
  2004-11-06 15:47   ` John Carr
@ 2004-11-07 20:18   ` Francis Dupont
  2 siblings, 0 replies; 9+ messages in thread
From: Francis Dupont @ 2004-11-07 20:18 UTC (permalink / raw)
  To: Xavier Leroy; +Cc: David McClain, caml

 In your previous mail you wrote:

   ...  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.)
   
=> Xavier, this caqn be true in Rocquencourt but in Rennes the project
Paris has some G5 and even a Xserve G5 cluster... So this can be a
good opportunately to visit us in Brittany. More seriously I believe
it is possible to get access to an INRIA G5 for porting ocamlopt
on it as soon as real 64-bit support will be available.

Thanks

Francis.Dupont@enst-bretagne.fr


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2004-11-07 20:18 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-06  4:02 64-bit OCaml? David McClain
2004-11-06  5:05 ` [Caml-list] " David Brown
2004-11-06  9:43   ` Sven Luther
2004-11-06  5:15 ` David Brown
2004-11-06  9:41 ` Sven Luther
2004-11-06 10:06 ` Xavier Leroy
2004-11-06 12:16   ` Sven Luther
2004-11-06 15:47   ` John Carr
2004-11-07 20:18   ` Francis Dupont

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).