On Thu, Jan 19, 2012 at 1:24 PM, Torvald Riegel <trie...@redhat.com> wrote:

>> The spec does say that all function should be regparm(2), but I agree
>> that the above is less confusing. The attribute is ignored, but
>> perhaps a comment would clear this confusion even more.
>
> Uros, thanks for spotting the vararg issue.  This looks okay to me, but
> Richard Henderson will have to OK this.
>
> If regparm(2) cannot work with variadic functions on x86, then I'd
> prefer removing the regparm.  beginTransaction was switched to being
> variadic to allow communicating which kinds of versions a compiler has
> generated for the transaction's code (besides the default
> instrumentation that we have right now).  I'd believe Ulrich Drepper's
> experience that making this variadic is better than restricting this to
> 64b (minus 10 bits or so already in use).
>
> BTW, would regparm(2) optimize on any arch/platform besides 32b x86?
> What about x32?

No, regparm is effective only on x86_32. x32 strictly follows x86_64 ABI.

> Note that if we remove the regparm, we should also remove it on the
> other functions associated with txn begin (GTM_beginTransaction etc.).

No, this is not needed. The patch adds the move that loads %eax with
the first parameter from function arguments and pass it via regparm
ABI to GTM_beginTransaction. OTOH, in GTM_beginTransaction we can
still access other variable arguments through the pointer to CFA.

Uros.

Reply via email to