On 01/24/2012 11:05 AM, Uros Bizjak wrote:
> Hello!
> 
> Attached patch optimizes x86_64 gtm_jmpbuf layout to avoid copying
> return address. Optimized layout uses the same trick as x86_32 - call
> used registers are saved just below return address. And there is just
> enough space in the call alignment hole to put all of them there.
> 
> 2012-01-24  Uros Bizjak  <ubiz...@gmail.com>
> 
>       * config/x86/target.h (gtm_jmpbuf) [__x86_64__]: Move rip to the
>       end of struct.
>       * config/x86/sjlj.S (_ITM_beginTransaction) [__x86_64__]: Update
>       offset values.  Do not copy return address.  Decrement stack
>       by 56 bytes only.
>       (GTM_longjump) [__x86_64__]: Update offset values.

Ok.

> BTW: Do we really need move at the end of GTM_longjump:
> 
>       movq    48(%rsi), %r15
>       movq    56(%rsi), %rdx
>>>     movl    %edi, %eax

Yes, that copies the first argument to the return register.


r~

Reply via email to