This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Speed up __sync_lock_test_and_set on PowerPC
- From: "David Edelsohn" <dje dot gcc at gmail dot com>
- To: "Anton Blanchard" <anton at samba dot org>, "Richard Henderson" <rth at redhat dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 3 Sep 2008 15:34:46 -0400
- Subject: Re: [PATCH] Speed up __sync_lock_test_and_set on PowerPC
- References: <20080903070614.GA14724@kryten>
On Wed, Sep 3, 2008 at 3:06 AM, Anton Blanchard <anton@samba.org> 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
> aquire barrier:
>
>> sync_lock_test_and_set
> ...
>> This pattern must issue any memory barrier instructions such that the
>> pattern as a whole acts as an acquire barrier, that is all memory
>> operations after the pattern do not occur until the lock is acquired.
Richard,
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?
Thanks, David