Re: [PATCH] Speed up __sync_lock_test_and_set on PowerPC

2008-09-03 Thread Richard Henderson
David Edelsohn wrote: On Wed, Sep 3, 2008 at 3:06 AM, Anton Blanchard <[EMAIL PROTECTED]> wrote: Why does the GCC alpha port emit a memory barrier at the beginning of the test_and_set sync builtin sequence, which seems to be more than the required `acquire' semantics? Um, that's a good question

Re: [PATCH] Speed up __sync_lock_test_and_set on PowerPC

2008-09-03 Thread David Edelsohn
On Wed, Sep 3, 2008 at 3:06 AM, Anton Blanchard <[EMAIL PROTECTED]> wrote: > unlock looks good, but lock has both release and acquire barriers. Even > worse, the release barrier is a heavyweight sync which is very slow. > Looking at the gcc documentation, sync_lock_test_and_set only needs an > aqui

[PATCH] Speed up __sync_lock_test_and_set on PowerPC

2008-09-03 Thread Anton Blanchard
Hi, I was debugging some performance issues with an application that uses the gcc builtin lock functions on powerpc. A simple test case: long lock_try(long *value) { return __sync_lock_test_and_set(value, 1); } long unlock(long *value) { __sync_lock_release(value); } 0010 :