This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[cxx-mem-model] Add lockfree tests
- From: Andrew MacLeod <amacleod at redhat dot com>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Cc: Richard Henderson <rth at redhat dot com>, Aldy Hernandez <aldyh at redhat dot com>
- Date: Thu, 06 Oct 2011 11:42:37 -0400
- Subject: [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