Version française
Home     About     Download     Resources     Contact us    
Browse thread
Ocamlopt code generator question
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Dmitry Bely <dmitry.bely@g...>
Subject: Re: Ocamlopt code generator question
On Wed, Apr 29, 2009 at 8:28 PM, Jeffrey Scofield
<jeffadm@pythagorion.local> wrote:
> Dmitry Bely <dmitry.bely@gmail.com> writes:
>
>> For amd64 we have in asmcomp/amd64/proc_nt.mlp:
>>
>> (*  xmm0 - xmm15  100 - 115       xmm0 - xmm9: Caml function arguments
>>                                 xmm0 - xmm3: C function arguments
>>                                 xmm0: Caml and C function results
>>                                 xmm6-xmm15 are preserved by C *)
>>
>> let loc_arguments arg =
>>   calling_conventions 0 9 100 109 outgoing arg
>> let loc_parameters arg =
>>   let (loc, ofs) = calling_conventions 0 9 100 109 incoming arg in loc
>> let loc_results res =
>>   let (loc, ofs) = calling_conventions 0 0 100 100 not_supported res in loc
>>
>> What these first_float=100 and last_float=109 for loc_arguments and
>> loc_parameters affect? My impression is that floats are always passed
>> boxed, so xmm registers are in fact never used to pass parameters.
>
> I don't have any experience with amd64, but I have looked at the ARM code
> generator of OCaml 3.10.2.  The first_float and last_float values there are used
> for unboxed calls to internal float functions--most notably, the C standard
> functions like floor().

No - for external C functions loc_external_arguments and
loc_external_results are used. And of course unboxed floats can be
acceptable there. But my question was about loc_arguments and
loc_parameters. E.g. what is the reason to have first_float=100 and
last_float=109 for loc_arguments?

- Dmitry Bely