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