This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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 for PR libgomp/37938, IA64 specific.


On Fri, Nov 7, 2008 at 10:35 AM, Steve Ellcey <sje@cup.hp.com> wrote:
>
> On Thu, 2008-11-06 at 17:12 -0800, H.J. Lu wrote:
>
>> static inline void gomp_mutex_unlock (gomp_mutex_t *mutex)
>> {
>>   int val = __sync_lock_test_and_set (mutex, 0);
>>   if (__builtin_expect (val > 1, 0))
>>     gomp_mutex_unlock_slow (mutex);
>> }
>>
>> should work as long as mutex isn't updated with release or
>> unordered semantics prior to this function call. Who else
>> have updated mutux? What semantics are they using?
>
> Isn't the lock done with release semantics? gomp_mutex_lock
> calls __sync_bool_compare_and_swap and sync_compare_and_swap<mode> in
> sync.md generates a cmpxchg.rel instruction.
>

According to ia64 psABI, __sync_bool_compare_and_swap and
sync_compare_and_swap<mode>
should have full barrier. That means they should use cmpxchg.acq,
which is icc 11.0 generates.

-- 
H.J.


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