From faefd2ad4ea444a7f2b19f8710241312a5b8f60e Mon Sep 17 00:00:00 2001 From: amacleod Date: Thu, 10 Nov 2011 22:46:25 +0000 Subject: [PATCH] 2011-11-10 Andrew MacLeod * doc/extend.texi: Document __atomic_test_and_set and __atomic_clear. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181273 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 4 ++++ gcc/doc/extend.texi | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1f8a56af363..5af6961bd18 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2011-11-10 Andrew MacLeod + * doc/extend.texi: Document __atomic_test_and_set and __atomic_clear. + +2011-11-10 Andrew MacLeod + PR middle-end/51038 * builtins.c (expand_builtin_atomic_clear): New. Expand atomic_clear. (expand_builtin_atomic_test_and_set): New. Expand atomic test_and_set. diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index c7e8ede9cb0..15238c1b39e 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -7002,6 +7002,27 @@ All memory models are valid. @end deftypefn +@deftypefn {Built-in Function} bool __atomic_test_and_set (bool *ptr, int memmodel) + +This built-in function performs an atomic test-and-set operation on +@code{*@var{ptr}}. @code{*@var{ptr}} is set to the value 1 and +the previous contents are returned. + +All memory models are valid. + +@end deftypefn + +@deftypefn {Built-in Function} void __atomic_clear (bool *ptr, int memmodel) + +This built-in function performs an atomic clear operation on +@code{*@var{ptr}}. After the operation, @code{*@var{ptr}} will contain 0. + +The valid memory model variants are +@code{__ATOMIC_RELAXED}, @code{__ATOMIC_SEQ_CST}, and +@code{__ATOMIC_RELEASE}. + +@end deftypefn + @deftypefn {Built-in Function} void __atomic_thread_fence (int memmodel) This built-in function acts as a synchronization fence between threads -- 2.11.4.GIT