On Wed, Jan 18, 2012 at 8:44 PM, Patrick Marlier
<patrick.marl...@gmail.com> wrote:

>> There was some discussion on where to pass arguments to regparm
>> decorated vararg functions. Well, as the ABI is pretty clear - regparm
>> should be ignored in this case, so all function arguments have to be
>> passed in memory, even if that means that the value is kicked to the
>> memory before the call, and pulled back into the register in
>> _ITM_beginTransaction.

> My main concern here is performance... Indeed, in case of libitm using
> Hardware Transactional Memory, it could be great to use registers for
> parameters. I would prefer to remove the variadic function as proposed here:
> http://gcc.gnu.org/ml/gcc-patches/2011-12/msg01784.html

Please note that all recent x86 processors implement store forwarding,
so passing arguments through memory is mostly a non-issue nowadays.

> As Torvald wrote, it was in case for hypothetical future parameters. So I
> would agree to do:
> extern uint32_t _ITM_beginTransaction(uint32_t,uint32_t) ITM_REGPARM;
>
> At least, it provides a new parameter for future use and do not use the
> stack for parameters.
>
> Other thoughts?

IMO, whatever the future decision would be, we shouldn't leave one
part of the compiler out-of-sync from the other. Proposed patch fixes
_current_ situation, where in the future, it is expected that compiler
and library changes in sync...

Uros.

Reply via email to