From patchwork Tue Mar 14 16:04:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Peter Nilsson X-Patchwork-Id: 69709 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1843533wrd; Tue, 14 Mar 2023 09:05:36 -0700 (PDT) X-Google-Smtp-Source: AK7set8csjH9CB54pvoCvXmXJq3Rx4mxxT/kHk28KZcOQn1PZFq02BQcg/m1jAuSdAGqW4LoP9PT X-Received: by 2002:a17:906:1952:b0:91e:52a8:9efc with SMTP id b18-20020a170906195200b0091e52a89efcmr3575672eje.43.1678809935917; Tue, 14 Mar 2023 09:05:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678809935; cv=none; d=google.com; s=arc-20160816; b=l7h8D6gAroK//NTDTgc1Y+CA5I6h1oOwcg1ul2jSSGv6DR2yPwn3BJcN2r2+Jt37oV k2HwOaE0NsNmzGdWUrFDTwLFhKG7mrW9MPVMEVPoO7teOh3MlkPBWOHqMrlsd6PX3sHt ByzCLHuWUoI4YnYmt9oGG34B1rAbJ4baTf1yi9t4O3cY9jtA6bnkSXli4blprYb0O1UM js5dWNmeSQ42fwORsstMtG17c+Zvu78j9jn8H5LURpn2nnj+j6EA9nv4ua7sAZCx5LID ocR9dhNEZ23X7nGJz5szAUHhd5/ffT/4fOsCda4guJuE7qBDb7Fi5hx+dynFojh11wrD QRpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:date:message-id :references:content-transfer-encoding:mime-version:subject :in-reply-to:cc:to:dmarc-filter:delivered-to:dkim-signature :dkim-filter; bh=xmxCqq1f2Gcd2/bWbqxTEYglqLM8UAKW24CfH1BQkgo=; b=L3Gbe/EvgcWjDB1XpxpF6j/6n415zrfqWha5nIreeyfdus5U8fkbRQRMv7vRLBVqoO KFXywpXr+81xJrPqIB1sln5oCAIR1YgHOt2jjiBnnrh4fHvEu1MpKKvH7iU0Yan2E0VB yufze3Fj0VVY2//fMT1ecRhUpyTDwplmJzcTSdPrxzLpbtDsrljOZT0y0mKzh2lx7h0j NO9rHH4gQ5YrmLsIZ+ENVLIuRPGzA06pADVYTr3i8pNQAtowo40mlNR7mxO4tWujrCxL b4tOEp3gOs6FTyGliN5kemJE4525N6BzFm1m3a2+VtiVEZKS8Rwo+b/aKghAIbdBnw6u uEOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=axTLB6N0; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id lj21-20020a170906f9d500b008c580ab8d9esi2873192ejb.69.2023.03.14.09.05.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Mar 2023 09:05:35 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=axTLB6N0; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3F2BA3858C2D for ; Tue, 14 Mar 2023 16:05:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3F2BA3858C2D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1678809929; bh=xmxCqq1f2Gcd2/bWbqxTEYglqLM8UAKW24CfH1BQkgo=; h=To:CC:In-Reply-To:Subject:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=axTLB6N02+26AeLAZ4pj8Fb2mZNXoRDi8ym0ut/SlKprT1EoonHjDuATfxWFuRTQk iD+8fisKuCiSCcfqKbPC0qSE7ZohJfE+THBe+weAY/un0sQZFUYq0J+Fnwc+pvOofX vWmcUI4AWs4blBvPD+pWfo2X1EITrD21wfyWxosc= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp2.axis.com (smtp2.axis.com [195.60.68.18]) by sourceware.org (Postfix) with ESMTPS id 260973858D37 for ; Tue, 14 Mar 2023 16:04:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 260973858D37 To: Sandra Loosemore CC: , In-Reply-To: (message from Sandra Loosemore on Mon, 13 Mar 2023 22:31:21 -0600) Subject: [PATCH v2] doc: md.texi (Insn Splitting): Tweak wording for readability. MIME-Version: 1.0 References: <20230314012536.2789120417@pchp3.se.axis.com> Message-ID: <20230314160443.AC7E420417@pchp3.se.axis.com> Date: Tue, 14 Mar 2023 17:04:43 +0100 X-Spam-Status: No, score=-8.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, MEDICAL_SUBJECT, SPF_HELO_PASS, SPF_PASS, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Hans-Peter Nilsson via Gcc-patches From: Hans-Peter Nilsson Reply-To: Hans-Peter Nilsson Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760304495914318871?= X-GMAIL-MSGID: =?utf-8?q?1760359807590220209?= > Date: Mon, 13 Mar 2023 22:31:21 -0600 > From: Sandra Loosemore > On 3/13/23 19:25, Hans-Peter Nilsson via Gcc-patches wrote: > > Jan, did I get this right? This was from your > > r0-36413-g6b24c25948265c / svn r44249, now on its 22nd year! > > > > I spot-checked the pdf for readability. Also calling on a > > doc maintainer to check grammos etc. Ok to commit? > > > > -- >8 -- > > I needed to check what was allowed in a define_split, but > > had problems understanding what was meant by "Splitting of > > jump instruction into sequence that over by another jump > > instruction". > > > > * doc/md.texi (Insn Splitting): Tweak wording for readability. > > Thanks for noticing this! I can't comment on technical correctness, but > I do have some further suggestions on wording below. Thank you for the review! Updated version below with your suggestions. When spot-checking the pdf I noticed a strange split of the page after the next after the section I changed: last on page 484 "17.17 Including Patterns in Machine Descriptions", there's a "(include" last on the page and "pathname)" on top of page 485. I'm afraid this patch triggered that. IMHO it'd be wrong to diddle with formatting of *that* in *this* patch, instead leaving it to a follow-up-patch. I think the obvious fix is to *not* split up (include pathname)" because that just looks odd even without the page end in-between. Right? -- >8 -- I needed to check what was allowed in a define_split, but had problems understanding what was meant by "Splitting of jump instruction into sequence that over by another jump instruction". * doc/md.texi (Insn Splitting): Tweak wording for readability. Co-Authored-By: Sandra Loosemore --- gcc/doc/md.texi | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi index 8e3113599fdc..134b227b9a93 100644 --- a/gcc/doc/md.texi +++ b/gcc/doc/md.texi @@ -8756,21 +8756,21 @@ insns that don't. Instead, write two separate @code{define_split} definitions, one for the insns that are valid and one for the insns that are not valid. -The splitter is allowed to split jump instructions into sequence of -jumps or create new jumps in while splitting non-jump instructions. As -the control flow graph and branch prediction information needs to be updated, -several restriction apply. - -Splitting of jump instruction into sequence that over by another jump -instruction is always valid, as compiler expect identical behavior of new -jump. When new sequence contains multiple jump instructions or new labels, -more assistance is needed. Splitter is required to create only unconditional -jumps, or simple conditional jump instructions. Additionally it must attach a -@code{REG_BR_PROB} note to each conditional jump. A global variable -@code{split_branch_probability} holds the probability of the original branch in case -it was a simple conditional jump, @minus{}1 otherwise. To simplify -recomputing of edge frequencies, the new sequence is required to have only -forward jumps to the newly created labels. +The splitter is allowed to split jump instructions into a sequence of jumps or +create new jumps while splitting non-jump instructions. As the control flow +graph and branch prediction information needs to be updated after the splitter +runs, several restrictions apply. + +Splitting of a jump instruction into a sequence that has another jump +instruction to the same label is always valid, as the compiler expects +identical behavior of the new jump. When the new sequence contains multiple +jump instructions or new labels, more assistance is needed. The splitter is +permitted to create only unconditional jumps, or simple conditional jump +instructions. Additionally it must attach a @code{REG_BR_PROB} note to each +conditional jump. A global variable @code{split_branch_probability} holds the +probability of the original branch in case it was a simple conditional jump, +@minus{}1 otherwise. To simplify recomputing of edge frequencies, the new +sequence is permitted to have only forward jumps to the newly-created labels. @findex define_insn_and_split For the common case where the pattern of a define_split exactly matches the