From e82f3e03115480ac3d055819658a107249932c65 Mon Sep 17 00:00:00 2001 From: Hongyu Wang Date: Tue, 15 Nov 2022 11:16:17 +0800 Subject: [PATCH] doc: Reword the description of -mrelax-cmpxchg-loop [PR 107676] gcc/ChangeLog: PR target/107676 * doc/invoke.texi: Reword the description of -mrelax-cmpxchg-loop. --- gcc/doc/invoke.texi | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 40f667a630a..bcbe3a7e420 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -33805,10 +33805,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 -- 2.18.1