This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] S/390: Hardware transactional memory support
- From: Richard Henderson <rth at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Andreas Krebbel <krebbel at linux dot vnet dot ibm dot com>, Peter Bergner <bergner at vnet dot ibm dot com>, Torvald Riegel <triegel at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 13 Aug 2013 12:09:08 -0700
- Subject: Re: [PATCH] S/390: Hardware transactional memory support
- References: <20130621102314 dot GA753 at bart> <1375443114 dot 9970 dot 187 dot camel at triegel dot csb> <51FBB13E dot 9080403 at linux dot vnet dot ibm dot com> <1375453429 dot 5240 dot 6 dot camel at otta> <51FBC1A8 dot 1010307 at linux dot vnet dot ibm dot com> <1375454206 dot 5240 dot 12 dot camel at otta> <51FBC61F dot 8020808 at linux dot vnet dot ibm dot com> <51FC1F1D dot 1070108 at redhat dot com> <20130813182644 dot GI1814 at tucnak dot redhat dot com>
On 08/13/2013 11:26 AM, Jakub Jelinek wrote:
> On Fri, Aug 02, 2013 at 11:05:33AM -1000, Richard Henderson wrote:
>> On 08/02/2013 04:45 AM, Andreas Krebbel wrote:
>>> ! XCFLAGS="${XCFLAGS} -mzarch -mhtm -msoft-float"
>>
>> Not good, since _ITM_R{F,D,E,CF,CD,CE} should return values in
>> floating point registers; similarly for the write accessors.
>
> So, would it be enough to compile just beginend.cc with -msoft-float
> and the rest normally?
No.
>From what I understand of the s390 restriction, we can't touch the
floating point registers after starting a transaction, at least until
we're committed to restoring them all.
Which means that we have to have everything along the path from
htm_begin_success == false until a longjmp restores them. This path
includes a call to std::operator new, so that makes it a non-starter.
Better, I think, to pass the gtm_jmpbuf to htm_begin. Then we can do
uint32_t ret = __builtin_tbegin_nofloat (NULL);
if (!htm_begin_success(ret))
// restore fpu state from jb
return ret;
at which point we're back to normal and we can do whatever we want
within the normal abi wrt the fpu.
r~