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]

[cxx-mem-model] Add lockfree tests


This patch supplies __sync_mem_is_lock_free (size) and __sync_mem_always_lock_free (size).

__sync_mem_always_lock_free requires a compile time constant, and returns true if an object of the specified size will *always* generate lock free instructions on the current architecture. Otherwise false is returned.

__sync_mem_is_lock_free also returns true if instructions will always be lock free, but if the answer is not true, it resolves to an external call named '__sync_mem_is_lock_free' which will be supplied externally. Presumably by whatever library or application is providing the other external __sync_mem routines as documented in http://gcc.gnu.org/wiki/Atomic/GCCMM/LIbrary

New tests, documentation are provided, bootstraps on x86_64-unknown-linux-gnu and causes no new testsuite regressions.

Andrew


Attachment: islockfree.diff
Description: Text document


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