svn commit: r236456 - in head/sys: amd64/include i386/include

David Chisnall theraven at FreeBSD.org
Mon Jun 4 10:50:29 UTC 2012


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
>> 
>> 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.
> 
> 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


More information about the svn-src-all mailing list