caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Damien Bobillot <damien.bobillot@m4x.org>
To: Oliver Bandel <oliver@first.in-berlin.de>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] doing MMX through ocaml
Date: Thu, 17 Nov 2005 23:16:54 +0100	[thread overview]
Message-ID: <CE131290-E604-466D-8908-809610F4BBB3@m4x.org> (raw)
In-Reply-To: <20051117214745.GA580@first.in-berlin.de>

[-- Attachment #1: Type: text/plain, Size: 1584 bytes --]

Oliver Bandel wrote :

> On Fri, Nov 18, 2005 at 10:13:00AM +1300, Jonathan Roewen wrote:
> [...]
>> The FFI just requires that the external symbol exists, right?  
>> Soooo, I
>> could theoretically define pure ASM routines that O'Caml could call.
> [...]
>> And since MMX deals solely with integers, the Val_long/Long_val  
>> macros
>> could be implemented by a simple extra MMX instruction or two, right?
>
> ASM...MMX.... will the OS be available for more than one platform?

Yes, MMX is not portable.

But I think it's more a question of creating an abstract interface  
for vectorized algorithms like fft, convolution, vector operations  
(addition, multiplication element by element)... SIMD instructions on  
x86 and ppc are very similar, not compatible but may be abstracted to  
the same fonctions without too much overhead.

As an exemple, I will quote Apple's Accelaration framework. It's a  
library for signal processing (1D and 2D), linear algebra (blas &  
lapack) optimised to use MMX & SSE instructions when running the x86  
version of MacOS X, and use Altivec instructions when running the ppc  
version.

It may be a good think to have such a vectorize library in ocaml, to  
open the way to fast signal processing inside ocaml.

PS : I think it will perhaps have the same problems as floating  
computation, which is not really efficient. As far as I know, floats  
are not stored as float in memory, but as a generic ocaml value  : a  
pointer to a structure contains a tag indicating that it's a float,  
and after the IEEE float value.

-- 
Damien Bobillot


[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 2375 bytes --]

  parent reply	other threads:[~2005-11-17 22:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-17 21:13 Jonathan Roewen
2005-11-17 21:47 ` Oliver Bandel
2005-11-17 21:57   ` Jonathan Roewen
2005-11-17 22:16   ` Damien Bobillot [this message]
2005-11-17 22:43     ` Daniel Bünzli
2005-11-17 22:55       ` Jonathan Roewen
2005-11-18  1:26         ` Vincenzo Ciancia
2005-11-18 10:04         ` [Caml-list] " Alessandro Baretta
2005-11-17 22:55       ` Damien Bobillot
2005-11-17 23:01 ` Vincenzo Ciancia
2005-11-17 23:49 ` [Caml-list] " Erik de Castro Lopo
2005-11-18  1:52   ` Grégory Guyomarc'h
2005-11-18  3:06   ` Brian Hurt
2005-11-18  3:29     ` Jonathan Roewen
2005-11-18 19:22     ` Ken Rose
2005-11-21  9:11       ` Sebastian Egner

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=CE131290-E604-466D-8908-809610F4BBB3@m4x.org \
    --to=damien.bobillot@m4x.org \
    --cc=caml-list@inria.fr \
    --cc=oliver@first.in-berlin.de \
    /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;
as well as URLs for NNTP newsgroup(s).