This is the mail archive of the
libffi-discuss@sourceware.org
mailing list for the libffi project.
Re: RFC: variadic closures in x86/x86_64
- From: Andrew Haley <aph at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: "Hogan, D. (GE Power & Water)" <D dot Hogan at ge dot com>, "libffi-discuss at sourceware dot org" <libffi-discuss at sourceware dot org>
- Date: Mon, 25 Nov 2013 10:10:37 +0000
- Subject: Re: RFC: variadic closures in x86/x86_64
- Authentication-results: sourceware.org; auth=none
- References: <F023C084BCC16446BDA5B664305741E8090811 at ALPMBAPA05 dot e2k dot ad dot ge dot com> <52931854 dot 6080007 at redhat dot com> <20131125093715 dot GU892 at tucnak dot redhat dot com>
On 11/25/2013 09:37 AM, Jakub Jelinek wrote:
> On Mon, Nov 25, 2013 at 09:28:52AM +0000, Andrew Haley wrote:
>> On 11/25/2013 02:45 AM, Hogan, D. (GE Power & Water) wrote:
>>> I'm requesting feedback on an implementation of variadic closures in
>>> libffi. It currently supports x86 and x86_64. This change allows for
>>> FMI logging callbacks through JNA in the JFMI[1] and Ptolemy II[2]
>>> projects. The libffi changes are in a github branch[3].
>>
>> Why is this necessary? I thought that the variadic calling conventions
>> on x86 were the same as the non-variadic ones.
>
> On x86 they are, on x86_64 they are not (%rax register must contain the
> number of floating point varargs arguments AFAIK).
Sure, but we don't need a new libffi interface to do that. We need
only to set %rax. And we can just do that anyway; it doesn't hurt.
I must be missing something.
Andrew.