This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] libitm: Add custom HTM fast path for RTM on x86_64.
- From: Torvald Riegel <triegel at redhat dot com>
- To: Andi Kleen <andi at firstfloor dot org>
- Cc: gcc-patches at gcc dot gnu dot org, Richard Henderson <rth at redhat dot com>, Jakub Jelinek <jakub at redhat dot com>, Andreas Krebbel <krebbel at linux dot vnet dot ibm dot com>, Peter Bergner <bergner at vnet dot ibm dot com>, "Kleen, Andi" <andi dot kleen at intel dot com>
- Date: Wed, 21 Aug 2013 19:33:18 +0200
- Subject: Re: [PATCH] libitm: Add custom HTM fast path for RTM on x86_64.
- References: <1377094606 dot 3196 dot 4901 dot camel at triegel dot csb> <874najhsps dot fsf at tassilo dot jf dot intel dot com>
On Wed, 2013-08-21 at 10:14 -0700, Andi Kleen wrote:
> Torvald Riegel <triegel@redhat.com> writes:
> > +#endif
> > leaq 8(%rsp), %rax
> > - subq $56, %rsp
> > - cfi_def_cfa_offset(64)
> > + subq $64, %rsp
> > + cfi_def_cfa_offset(72)
>
> I don't see why you did this change and the addq change below.
I need to store edi (ie, the properties of the transaction passed to the
function by the compiler) on the stack, so these two changes create
additional room for it. (I wasn't sure about alignment requirements, so
I just used 8 bytes for it.)
> The rest seems reasonable to me, although I haven't tried to untangle
> the full dependencies between C++ and asm code for retries.
If anyone has any suggestions for how to improve the comments, let me
know.
> It would be likely cleaner to just keep the retries fully
> in C++ like the original patch did. There's no advantage
> of going back to assembler.
That's true for x86, but it seems that for s390, we can't easily put the
xbegin/tbegin into the C++ code because of floating point register
save/restore issues. The added complexity on the x86 side seemed to be
a reasonable price for having a general HTM fast path retry handling on
the C++ side.
Torvald