From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by sourceware.org (Postfix) with ESMTPS id BA9BD38582A1 for ; Tue, 15 Nov 2022 03:36:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BA9BD38582A1 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668483362; x=1700019362; h=from:to:cc:subject:date:message-id; bh=h7yboaWpGDih7shenlaLzFZcQnQqq5P473brSbNZxBY=; b=IoLx8csAaH4KNJ6K0zbKcathlh69D/wMlAaVOFefh9fi7omgx9vC82bm pcW8GWslPq4xdtDbNbnwH+cSMiPub9tsMX+W+zIAzprLxbVs6T/NbTT94 imbNqto7JrohtPN69a3kJy2O7o0UQtUIfI9ydwXXvMBHgWbUGsYdCGQQ1 yWY+j1HPpjII5EmQV46uc1G1gkSaa5jyu7nibMBm96SJrOXjwvkJEqhUE Fkc+iGAZ8TQm4E0A/mLAwN2lRX0eaiFN31qBEi2FGhI33w/eZ/tgNTa+l udVUZQkvqTUIDtGJmmgjQzGsmVwv9hp+yuOEkQFQQBrd9E4/CvDhTcjW0 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10531"; a="292545519" X-IronPort-AV: E=Sophos;i="5.96,164,1665471600"; d="scan'208";a="292545519" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Nov 2022 19:36:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10531"; a="781183963" X-IronPort-AV: E=Sophos;i="5.96,164,1665471600"; d="scan'208";a="781183963" Received: from shvmail03.sh.intel.com ([10.239.245.20]) by fmsmga001.fm.intel.com with ESMTP; 14 Nov 2022 19:36:00 -0800 Received: from shliclel320.sh.intel.com (shliclel320.sh.intel.com [10.239.240.127]) by shvmail03.sh.intel.com (Postfix) with ESMTP id 9EDF410056B2; Tue, 15 Nov 2022 11:35:59 +0800 (CST) From: Hongyu Wang To: gcc-patches@gcc.gnu.org Cc: hongtao.liu@intel.com, ubizjak@gmail.com Subject: [PATCH] doc: Reword the description of -mrelax-cmpxchg-loop [PR 107676] Date: Tue, 15 Nov 2022 11:35:59 +0800 Message-Id: <20221115033559.66827-1-hongyu.wang@intel.com> X-Mailer: git-send-email 2.18.1 X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,GIT_PATCH_0,HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_NONE,SPF_SOFTFAIL,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi, According to PR 107676, the document of -mrelax-cmpxchg-loop is nonsensical. Adjust the wording according to the comments. Bootstrapped on x86_64-pc-linux-gnu, ok for trunk? gcc/ChangeLog: PR target/107676 * doc/invoke.texi: Reword the description of -mrelax-cmpxchg-loop. --- gcc/doc/invoke.texi | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 40f667a630a..bdd7c319aef 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -33805,10 +33805,12 @@ 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. +For compare and swap loops that emitted by some __atomic_* builtins +(e.g. __atomic_fetch_(or|and|xor|nand) and their __atomic_*_fetch +counterparts), emit an atomic load before cmpxchg instruction. If the +loaded value is not equal to expected, execute a pause instead of +directly run the cmpxchg instruction. This might reduce excessive +cacheline bouncing. @item -mindirect-branch=@var{choice} @opindex mindirect-branch -- 2.18.1