summaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2005-04-19 21:54:11 -0700
committerRichard Henderson <rth@gcc.gnu.org>2005-04-19 21:54:11 -0700
commitf12b785df384d2ffc150cd2f9b449aa4d8a54834 (patch)
tree4acdd6c4898d643fa0b840941a2d12315366ec66 /gcc/doc
parentf242e7690e6e838ec12e2d09fe1b5fc7929e20da (diff)
downloadgcc-f12b785df384d2ffc150cd2f9b449aa4d8a54834.tar.gz
builtins.c (expand_builtin_sync_operation): Revert last change.
* builtins.c (expand_builtin_sync_operation): Revert last change. * optabs.c (expand_bool_compare_and_swap): Compare vs old value, not vs new value. (expand_compare_and_swap_loop): Likewise. (expand_sync_operation): Remove fallback from NAND to AND; invert memory operand when expanding from cmpxchg. (expand_sync_fetch_operation): Likewise. * doc/extend.texi (Atomic Builtins): Fix docs for nand and compare-and-swap. * config/alpha/alpha.c (alpha_split_atomic_op): Invert memory operand when implementing NAND. Fix double-add for AFTER. * config/alpha/sync.md (sync_nand<I48MODE>): Invert memory operand. (sync_old_nand<I48MODE>, sync_new_nand<I48MODE>): Likewise. (sync_compare_and_swap<I48MODE>): Fix compare vs zero. Return old memory value. (sync_lock_test_and_set<I48MODE>): Remove extra label and last memory barrier. * config/i386/sync.md (sync_compare_and_swap<IMODE>): Fix pattern to return old memory value. (sync_compare_and_swap_cc<IMODE>): Likewise. * config/ia64/ia64.c (ia64_dependencies_evaluation_hook): Early return pre-reload. Don't consider output or anti dependencies. * config/ia64/sync.md (IMODE): New. (modesuffix): Add QI and HI. (memory_barrier): Simplify expansion. (sync_compare_and_swap<IMODE>): Use IMODE, not I48MODE. (cmpxchg_acq_<IMODE>): Likewise. (sync_lock_test_and_set<IMODE>): Likewise. (sync_lock_release<IMODE>): Likewise. From-SVN: r98436
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/extend.texi7
1 files changed, 3 insertions, 4 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 5fc85a45abb..acd75e4f71b 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -4639,11 +4639,9 @@ returns the value that had previously been in memory. That is,
@smallexample
@{ tmp = *ptr; *ptr @var{op}= value; return tmp; @}
+@{ tmp = *ptr; *ptr = ~tmp & value; return tmp; @} // nand
@end smallexample
-The builtin @code{__sync_fetch_and_nand} could be implemented by
-@code{__sync_fetch_and_and(ptr, ~value)}.
-
@item @var{type} __sync_add_and_fetch (@var{type} *ptr, @var{type} value, ...)
@itemx @var{type} __sync_sub_and_fetch (@var{type} *ptr, @var{type} value, ...)
@itemx @var{type} __sync_or_and_fetch (@var{type} *ptr, @var{type} value, ...)
@@ -4661,6 +4659,7 @@ return the new value. That is,
@smallexample
@{ *ptr @var{op}= value; return *ptr; @}
+@{ *ptr = ~*ptr & value; return *ptr; @} // nand
@end smallexample
@item bool __sync_bool_compare_and_swap (@var{type} *ptr, @var{type} oldval @var{type} newval, ...)
@@ -4673,7 +4672,7 @@ value of @code{*@var{ptr}} is @var{oldval}, then write @var{newval} into
The ``bool'' version returns true if the comparison is successful and
@var{newval} was written. The ``val'' version returns the contents
-of @code{*@var{ptr}} after the operation.
+of @code{*@var{ptr}} before the operation.
@item __sync_synchronize (...)
@findex __sync_synchronize