Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Jun 2012 11:44:31 +0100
From:      David Chisnall <theraven@FreeBSD.org>
To:        Tijl Coosemans <tijl@FreeBSD.org>
Cc:        svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Konstantin Belousov <kib@FreeBSD.org>
Subject:   Re: svn commit: r236456 - in head/sys: amd64/include i386/include
Message-ID:  <BB7B778E-6903-43B8-97E2-E0A0E4A5CBD9@FreeBSD.org>
In-Reply-To: <4FCC873B.90104@freebsd.org>
References:  <201206021810.q52IAGZA004238@svn.freebsd.org> <4FCC873B.90104@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 4 Jun 2012, at 11:00, Tijl Coosemans wrote:

> On 02-06-2012 20:10, Konstantin Belousov wrote:
>> Author: kib
>> Date: Sat Jun  2 18:10:16 2012
>> New Revision: 236456
>> URL: http://svn.freebsd.org/changeset/base/236456
>>=20
>> Log:
>>  Use plain store for atomic_store_rel on x86, instead of implicitly
>>  locked xchg instruction.  IA32 memory model guarantees that store =
has
>>  release semantic, since stores cannot pass loads or stores.
>=20
> They can pass non-temporal stores can't they?

Now that we have support for C11 atomics via stdatomic.h (in current and =
stable), it would be nice to compare their performance with the assembly =
versions.  There is the potential for greater optimisation, because the =
compiler treats any asm block as a full barrier, so only the CPU, not =
the compiler, can reorder loads and stores across it.  With the C11 =
stuff, on a new compiler (clang or gcc 4.7), the compiler can perform =
any reordering of loads and stores that does not violate the semantics =
specified by the atomic operation.

David=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BB7B778E-6903-43B8-97E2-E0A0E4A5CBD9>