From: Alexander Monakov Date: Wed, 16 Nov 2022 13:33:11 +0000 (+0300) Subject: doc: fix description of -mrelax-cmpxchg-loop [PR 107676] X-Git-Tag: basepoints/gcc-14~3113 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=85966f0d20baf50a767ac1110f537395441604a9;p=thirdparty%2Fgcc.git doc: fix description of -mrelax-cmpxchg-loop [PR 107676] gcc/ChangeLog: PR target/107676 * doc/invoke.texi (-mrelax-cmpxchg-loop): Reword description. --- diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index cbfe1102bd20..96f0b6d08bdf 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -33561,10 +33561,11 @@ registers. @item -mrelax-cmpxchg-loop @opindex mrelax-cmpxchg-loop -Relax cmpxchg loop by emitting an early load and compare before cmpxchg, -execute pause if load value is not expected. This reduces excessive -cachline bouncing when and works for all atomic logic fetch builtins -that generates compare and swap loop. +When emitting a compare-and-swap loop for @ref{__sync Builtins} +and @ref{__atomic Builtins} lacking a native instruction, optimize +for the highly contended case by issuing an atomic load before the +@code{CMPXCHG} instruction, and using the @code{PAUSE} instruction +to save CPU power when restarting the loop. @item -mindirect-branch=@var{choice} @opindex mindirect-branch