From: Matthew Malcomson <[email protected]>
N.b. this has already been approved (since I made the suggested changes)
https://gcc.gnu.org/pipermail/gcc-patches/2024-November/668858.html
Including this so I'm sending up a complete rebased patchset, but
not requesting a review for it.
-------------- >8 ------- 8< -----------
Do not mention suffixed versions since integral suffixed versions are
not mentioned in existing docs.
gcc/ChangeLog:
* doc/extend.texi: Document ability to use floating point atomic
fetch_add/fetch_sub/add_fetch/sub_fetch builtins.
Signed-off-by: Matthew Malcomson <[email protected]>
---
gcc/doc/extend.texi | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 224d6197d63..8c081e52a92 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -16719,6 +16719,15 @@ the same format with the addition of a @samp{size_t}
parameter inserted
as the first parameter indicating the size of the object being pointed to.
All objects must be the same size.
+Moreover, the @samp{__atomic_fetch_add}, @samp{__atomic_fetch_sub},
+@samp{__atomic_add_fetch}, and @samp{__atomic_sub_fetch} builtins accept
+floating-point types of @code{float}, @code{double}, @code{long double}. They
+handle @code{bfloat16}, @code{_Float16}, @code{_Float32}, @code{_Float64},
+@code{_Float128}, @code{_Float32x}, and @code{_Float64x} types if these are
+supported by the architecture. These functions use a lock-free built-in
+function if the size of the floating-point type makes that possible and
+otherwise leave an external call to be resolved at run time.
+
There are 6 different memory orders that can be specified. These map
to the C++11 memory orders with the same names, see the C++11 standard
or the @uref{https://gcc.gnu.org/wiki/Atomic/GCCMM/AtomicSync,GCC wiki
--
2.43.0