This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] S/390: Port of lock elision to System/z


On 04/25/2014 12:14 AM, Richard Henderson wrote:
> On 04/24/2014 02:55 PM, Peter Bergner wrote:
>> On Thu, 2014-04-24 at 17:54 -0300, Adhemerval Zanella wrote:
>>> On 24-04-2014 11:42, Stefan Liebler wrote:
>>>> +	  else
>>>> +	    {
>>>> +	      asm volatile ("" ::: "f0", "f1", "f2", "f3", "f4", "f5", "f6",
>>>> +			    "f7", "f8", "f9", "f10", "f11", "f12", "f13",
>>>> +			    "f14", "f15", "cc", "memory");
>>>
>>> Just curious: why do you need this asm assembly? Some arch specific memory barrier? 
>>
>> Unlike on Power, the S390 HTM doesn't rollback any changes to the FP
>> registers that were made in the failed transaction, so they have to
>> marked as clobbered.
> 
> GCC takes care of adding clobbers as part of the tbegin builtin.
> 
> I see that it doesn't add the non-call-saved FPRs, which is exactly
> what you're clobbering here.  But if this is in fact necessary, I
> think you should really work that out with the compiler, rather than
> leaving this hack here.

The GCC builtin clobbers all FPRs. So I don't think the asm should be necessary at all. In fact it
probably doesn't even have the desired effect under all circumstances. GCC could decide to just wrap
the FPR save and restore operations around the inline asm.

cc is set by tbegin anyway. Mentioning it in the clobber list is not required.

The memory clobber might have been useful for cases where the transaction code does
non-transactional stores to values being read in the abort code. But we do not seem to have
something like this anymore.

-Andreas-


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]