From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1592) id 5D4A6395A41E; Wed, 16 Nov 2022 13:42:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5D4A6395A41E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668606123; bh=KsfEY8KNfNpxwht5EEXF4pl6fEYYEGncGpQC0ZjHeZo=; h=From:To:Subject:Date:From; b=ZRYPi7o+jp/+Ljdlh7fjMJqhzm6dOxcXiucc1gqAOLPN1ZTRQSZy0pdaAqLwugOUh hL3lbfEInXLCuAtCpjHdWwVEhQAZgy+l3zul/VxQgkrEo9mKwpcTBUV1II7VQp+9ix ig9u0h2uzlW/ZdzGbLq3MPdqtyEBnagR4T8odeXw= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Alexander Monakov To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-4094] doc: fix description of -mrelax-cmpxchg-loop [PR 107676] X-Act-Checkin: gcc X-Git-Author: Alexander Monakov X-Git-Refname: refs/heads/master X-Git-Oldrev: d4cc7a8c4a623b62dd0d486d7780d91b58eb6f1f X-Git-Newrev: 85966f0d20baf50a767ac1110f537395441604a9 Message-Id: <20221116134203.5D4A6395A41E@sourceware.org> Date: Wed, 16 Nov 2022 13:42:03 +0000 (GMT) List-Id: https://gcc.gnu.org/g:85966f0d20baf50a767ac1110f537395441604a9 commit r13-4094-g85966f0d20baf50a767ac1110f537395441604a9 Author: Alexander Monakov Date: Wed Nov 16 16:33:11 2022 +0300 doc: fix description of -mrelax-cmpxchg-loop [PR 107676] gcc/ChangeLog: PR target/107676 * doc/invoke.texi (-mrelax-cmpxchg-loop): Reword description. Diff: --- 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 cbfe1102bd2..96f0b6d08bd 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