This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH, i386] RTM support
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Patrick Marlier <patrick dot marlier at gmail dot com>
- Cc: Kirill Yukhin <kirill dot yukhin at gmail dot com>, gcc-patches List <gcc-patches at gcc dot gnu dot org>, Uros Bizjak <ubizjak at gmail dot com>, "H.J. Lu" <hjl dot tools at gmail dot com>, Andi Kleen <andi at firstfloor dot org>, Richard Henderson <rth at redhat dot com>
- Date: Thu, 16 Feb 2012 17:47:23 +0100
- Subject: Re: [PATCH, i386] RTM support
- References: <CAGs3RftzMrnzFuDGv2RHvboA9utwncOuphB_G6ELDAFw-N3DNA@mail.gmail.com> <4F3D2E4D.firstname.lastname@example.org>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Feb 16, 2012 at 11:26:53AM -0500, Patrick Marlier wrote:
> On 02/16/2012 11:06 AM, Kirill Yukhin wrote:
> > +(define_insn "xbegin_1"
> > + [(set (match_operand:SI 0 "register_operand" "=a")
> > + (unspec_volatile:SI [(match_dup 0)] UNSPECV_XBEGIN))
> > + (set (match_operand:BLK 1 "" "")
> > + (unspec_volatile:BLK [(match_dup 1)] UNSPECV_XBEGIN))]
> > + "TARGET_RTM"
> > + "xbegin\t.+6"
> > + [(set_attr "type" "other")
> > + (set_attr "length" "3")])
> > +
> Here you cannot specify your fallback instruction address. Since
> those primitives provide high performance speculative code, I would
> prefer to move my fallback code far away from the speculative code
> path to improve the code locality.
The intrinsic/builtin just returns a value, so I think you need to
if (_xbegin () == ~0)
if you want to use different fallback code from the transaction code.
So the above is right and needed, though perhaps we might want
a combine pattern or peephole to turn the
movl $-1, %eax
cmpl %eax, $-1
movl $-1, %eax
if flags register is dead at that point, and perhaps also remove the
movl $-1, %eax if %eax is not live when not jumping.
This is about the intrinsics anyway, the TM code is free to use something