Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Christophe Papazian <christophe.papazian@gmail.com>
To: caml-list@yquem.inria.fr
Subject: [Caml-list] Alignment of data
Date: Wed, 27 Jan 2010 18:20:44 +0100	[thread overview]
Message-ID: <F4CB0D18-6169-446E-A72F-410D25115D34@gmail.com> (raw)
In-Reply-To: <4B6066AB.5010907@inria.fr>

Dear Xavier Leroy,
thank you for your answer

>> I am working on some ppc architecture, and I realize that I have a  
>> (very) big slowdown due to bad alignment of data by ocamlopt. I  
>> need to have my data aligned in memory depending of the size of the  
>> data : floats are to be aligned on 8 bytes, int on 4 bytes, etc....
>
> First, make sure that misalignment is really the source of your
> slowdown.  The PowerPC processors I'm familiar with can access
> 4-aligned 8-byte floats with minimal overhead, while the penalty is
> much bigger for other misalignments.

I am sorry, but I am sure of that. I ran some tests to ensure that the  
problem
is coming from that particular point.

> Data allocated in the Caml heap is word-aligned, where a word is 4
> bytes on a 32-bit platform and 8 bytes on a 64-bit platform.  This is
> deeply ingrained in the Caml GC and allocator, so don't expect to
> change this easily.

I didn't expect to change myself such a deep feature in ocaml, but I  
hoped
that you or somebody in your team could. Could it be possible to have  
everything
8 aligned on a 32-bit platform with minimum efforts ? Any help is  
welcomed !

> What you can do, however:
>
> 1- Use the 64-bit PowerPC port.  Everything will be 8-aligned then.

Is there a 64-bit PowerPC Linux (ELF) support in ocaml ? I thought it  
was only
a 64-bit PowerPC OSX (Darwin) support...

Thank you to Goswin von Brederlow and Pascal Cuoq for their answers,  
but I should
say that I really prefer to use the GC as usual, without rewriting it :)

Christophe


  reply	other threads:[~2010-01-27 17:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-27 12:03 Christophe Papazian
2010-01-27 15:26 ` [Caml-list] " Goswin von Brederlow
2010-01-27 16:15 ` Xavier Leroy
2010-01-27 17:20   ` Christophe Papazian [this message]
2010-01-27 17:56     ` Richard Jones
     [not found] <20100127161719.C6A10BC37@yquem.inria.fr>
2010-01-27 16:38 ` Pascal Cuoq
2010-01-27 21:01   ` [Caml-list] " Goswin von Brederlow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F4CB0D18-6169-446E-A72F-410D25115D34@gmail.com \
    --to=christophe.papazian@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox