caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] doing MMX through ocaml
@ 2005-11-17 21:13 Jonathan Roewen
  2005-11-17 21:47 ` Oliver Bandel
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Jonathan Roewen @ 2005-11-17 21:13 UTC (permalink / raw)
  To: caml-list

Hi,

I've received a lot of feedback on an mpeg2 decoder in ocaml, and
about performance woes ;-) So... the next step: building an MMX
library =) I presume it is possible, though, would lose a lot of
benefits having to use C wrappers everywhere....

The FFI just requires that the external symbol exists, right? Soooo, I
could theoretically define pure ASM routines that O'Caml could call.

The question begs: does OCaml expect the FFI function to have a
particular layout? Obviously, args have to be retrieved from the
stack, right? And there's no way around this?

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?

Maybe I could mod the compiler: create a 'naked' version of external,
and define registers to put values in, retrieve from? I've had a look
at the interp.c sources, and they don't look that complicated... just
a matter of defining a new instruction type for a C_CALL, and altering
the code generator and parser... though, that part in itself might be
quite tricky.

Basically, the idea is to create either a generic Math, or a special
MMX module built into the kernel, that apps can utilise if so wanted.
Of course, for the packed data types in MMX, might need some custom
types, but that shouldn't be too much of a problem.

Jonathan


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

end of thread, other threads:[~2005-11-21  9:13 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-17 21:13 [Caml-list] doing MMX through ocaml Jonathan Roewen
2005-11-17 21:47 ` Oliver Bandel
2005-11-17 21:57   ` Jonathan Roewen
2005-11-17 22:16   ` Damien Bobillot
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

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