Version française
Home     About     Download     Resources     Contact us    
Browse thread
Re: [Caml-list] Native compiler support for m68k?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Xavier Leroy <xavier.leroy@i...>
Subject: Re: [Caml-list] Native compiler support for m68k?
> ok, I got 2.0.4 working for m68k-linux, not very hard.
> Speed is quite impressive, fib is faster than gcc code ?!

Sure: gcc passes all parameters on the stack, ocamlopt passes the
first ones in registers.

> One thing that I need to verify is the interaction of the native
> compiler and the strange m68k-linux ABI which is different from
> SUN or BSD. The unusual part of m68k-linux ABI is that functions
> returning pointer return their value in register a0, while integer
> types are retuned in d0.
> 
> How does the code generated by the native compiler interact
> with c-ABI functions?

C functions that can be called by Caml code must be declared with
return type "value", which is "long".  So, the C compiler will arrange
for the result to be in D0, which is where ocamlopt-generated code
expects to find it.

- Xavier Leroy

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners