From patchwork Fri Nov 10 21:54:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Maciej W. Rozycki" X-Patchwork-Id: 164000 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp1405846vqs; Fri, 10 Nov 2023 13:54:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IGH9ZcRNpdGZtlT1hqxioEra3YNCHxGSt83oOu0squwGPaBC6guORAKhornHNXrnyG9WGB2 X-Received: by 2002:a37:ad06:0:b0:778:910f:3401 with SMTP id f6-20020a37ad06000000b00778910f3401mr482180qkm.78.1699653278085; Fri, 10 Nov 2023 13:54:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699653278; cv=pass; d=google.com; s=arc-20160816; b=QAIomrkCSCXpPeasxad1+qYAN5ZlF0+5iuqnB8CZyuwKXvb2yuCLJRudMDD2fSkXfD 5rzf9otckW3NFkKpBBy7AcGi+KA4Jg2Up+yHtl5yj1+sK/pKCHfFMC0jJ9ntZl6R4BFe dmlA+vVjp3eG+p3Meo3CU7Ad2Qrs6YnZW2j8tNqkEptdbAJcQPAMltYrJ/8gKeHzNSej su+mo4DSbX2B3YzzUGDHYChCcKIS2qU3wByTOkbynzMKWfjZYY7daPDe/Jyxg+aUbFiT dosEqb8H6F6W1BWScoanvprblib97iEwEPugvl+nCMcHcRbTWt7CIojXwd6MxPXiO1/I nx6A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version:user-agent :message-id:subject:cc:to:from:date:dkim-signature:arc-filter :dmarc-filter:delivered-to; bh=A+nk5nBQrFBQ8/L5wPAtU53HslYCHKmOx7c3A4Ga5+U=; fh=dp1z4I3tVhinwswv7IAFxpunWK+Ws/fGQfmox9vHv3I=; b=h3X2lbC4PTAMeFc2dJy+fzzU1bf0E1B40X+0MCXc3cZs1ndWr62WOLTttNHOyshF1t CTjWlH3+lOTVrflbcDFHfYIFeWkHlUpFmOQGQm833nShnrqPSW9m6k02imbpdFRXkP3h QtmME7DkwRkWTn2nTqQ0S+tq5IgDcH/RmZnfqiaLCdSlWLZLpYSxz+4O0uQctIJSpUqz HSGuTqpDIWY7WrOHc4eDpdxeEkOyNsfHGbnIexL/5uUdak43mTtQnS+kCWglLnO8zMKz ap+T0Cf1GRtzDpb1nPZYbjPGDK7bQai9UG9Ewzc/y6Rpfjp/phpjRyi1hevraSJbVx0c ponQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=PdBPP2kf; arc=pass (i=1); 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" Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id w4-20020a05620a444400b0077596c392f6si317586qkp.630.2023.11.10.13.54.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Nov 2023 13:54:38 -0800 (PST) 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=@embecosm.com header.s=google header.b=PdBPP2kf; arc=pass (i=1); 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" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D69F0385841C for ; Fri, 10 Nov 2023 21:54:37 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by sourceware.org (Postfix) with ESMTPS id 88A273858D32 for ; Fri, 10 Nov 2023 21:54:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 88A273858D32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 88A273858D32 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::62a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699653255; cv=none; b=o/t3B2NyYcBLLodlBYwJ5bxr5H8p8Czh5B64amfFUC4F22jI5BpxzC6VUEeK7hpdkTsGJ1kXu2LuErcLhShIe48W0+BIXn4aJ36U1qC+uF79nRv9YQ+CNJjYD7WhBweaI2kEnsXdQ4Cmu/narynp2MPvwq0NpR8PmC5qQz3yuGE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699653255; c=relaxed/simple; bh=DUjXNX6elvNhWUDYXEVhezV5QQj1pk8Ty+1f0xv/P0M=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=bm9Ohy9uGP0pjVXpGIFUf3dNxjBz72VXoF1lYnT3ytSdvRjDkkVrmf38Sv2DCANJQESSY6QBErD39qHaOeFrV6E7lOaJDmMu90E6K3QU7L0EjYQgEpvIHdXFwAPBGSw7ecIzNS9cQ9E3/PORWyj2u+pbwXYN6ozmo9PwmeBPWKU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-9c3aec5f326so737764966b.1 for ; Fri, 10 Nov 2023 13:54:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1699653249; x=1700258049; darn=gcc.gnu.org; h=mime-version:user-agent:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=A+nk5nBQrFBQ8/L5wPAtU53HslYCHKmOx7c3A4Ga5+U=; b=PdBPP2kfPipKBy8h/Xyo9bsW8n6KLw4AegvzzTZU4Q85xTgpQBadwTq5F9woWjnWPs nUKnyw0jqG4eQH0Vph8uvZFEcg/WdugruEe3SQh8dYlhIYHiA/Rk3XISt/nxYicVS3GB 8FZYXA+pxKLcM9HbifU60QPOf3XlUwpx8unqv/y+7sFsKABu65ub7Nqgpfg8GuPcamvA Qd22+lghwu7BIbisafvkHqzpBdOjIJFM1Cz+VMju34Bd1govrrdPwn3qkwE4AG0Xfs3b ugGspk4xc7BhFFt3MTzXEvCm1CAERH2oJzHjooxUTN/pcxMdZQHiv2V+4DHNfGFoYmEv LWLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699653249; x=1700258049; h=mime-version:user-agent:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=A+nk5nBQrFBQ8/L5wPAtU53HslYCHKmOx7c3A4Ga5+U=; b=W7LfgILAPJuWtwmi04OXYwGO72dk6lHq9FjXjLTgFYH5HG4SPzZDumk0CZSlQ9D7FW EkXKfiEh4urUJZ3DlNCqHPazD5rr2dyVcfLIa/MntTpRVi17RW9eWsUHU9vAchBY4dnY pwua7Y48IhgjktAuGzL+cJR8zB+SrQbolMIpr1Prm9MxpPcKaQvYGI7uYjaIPK9VTSti 8uYCFCcCyr8drDx9n3zjGqMsOXzNVdFeRyMLoOUTAKRQI3SA3X7gsTLNEC3lDCDHecVI lRvCji4JsYqoLkDZPh4SP/oBvxxrrPaA0Uk6cK6qrCAWxGUXjxsQbXCeH+Qw/GHegDd8 HX2w== X-Gm-Message-State: AOJu0Yx6DRfGqkXT9TY01xPwFrchfR1shmSk7sPWiOVFs8XK3cXDG7bO oKBuZmxhNp097MMauP/e7n9zEogot0vyjjI43qOeiw== X-Received: by 2002:a17:906:a399:b0:9b2:b15b:383d with SMTP id k25-20020a170906a39900b009b2b15b383dmr300010ejz.11.1699653248805; Fri, 10 Nov 2023 13:54:08 -0800 (PST) Received: from annie.orcam.me.uk (annie.orcam.me.uk. [2001:4190:8020::48]) by smtp.gmail.com with ESMTPSA id o7-20020a170906358700b009adc77fe164sm138464ejb.66.2023.11.10.13.54.07 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Nov 2023 13:54:08 -0800 (PST) Date: Fri, 10 Nov 2023 21:54:07 +0000 (GMT) From: "Maciej W. Rozycki" To: gcc-patches@gcc.gnu.org cc: Andrew Waterman , Jim Wilson , Kito Cheng , Palmer Dabbelt Subject: [committed] RISC-V: Fix indentation of "length" attribute for branches and jumps Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782215635330874331 X-GMAIL-MSGID: 1782215635330874331 The "length" attribute calculation expressions for branches and jumps are incorrectly and misleadingly indented, and they overrun the 80 column limit as well, all of this causing troubles in following them. Correct all these issues. gcc/ * config/riscv/riscv.md (length): Fix indentation for branch and jump length calculation expressions. --- Hi, Applied as obvious. Maciej --- gcc/config/riscv/riscv.md | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) gcc-riscv-attr-length-branch-indent.diff Index: gcc/gcc/config/riscv/riscv.md =================================================================== --- gcc.orig/gcc/config/riscv/riscv.md +++ gcc/gcc/config/riscv/riscv.md @@ -518,20 +518,26 @@ ;; Branches further than +/- 1 MiB require three instructions. ;; Branches further than +/- 4 KiB require two instructions. (eq_attr "type" "branch") - (if_then_else (and (le (minus (match_dup 0) (pc)) (const_int 4088)) - (le (minus (pc) (match_dup 0)) (const_int 4092))) - (const_int 4) - (if_then_else (and (le (minus (match_dup 0) (pc)) (const_int 1048568)) - (le (minus (pc) (match_dup 0)) (const_int 1048572))) - (const_int 8) - (const_int 12))) + (if_then_else (and (le (minus (match_dup 0) (pc)) + (const_int 4088)) + (le (minus (pc) (match_dup 0)) + (const_int 4092))) + (const_int 4) + (if_then_else (and (le (minus (match_dup 0) (pc)) + (const_int 1048568)) + (le (minus (pc) (match_dup 0)) + (const_int 1048572))) + (const_int 8) + (const_int 12))) ;; Jumps further than +/- 1 MiB require two instructions. (eq_attr "type" "jump") - (if_then_else (and (le (minus (match_dup 0) (pc)) (const_int 1048568)) - (le (minus (pc) (match_dup 0)) (const_int 1048572))) - (const_int 4) - (const_int 8)) + (if_then_else (and (le (minus (match_dup 0) (pc)) + (const_int 1048568)) + (le (minus (pc) (match_dup 0)) + (const_int 1048572))) + (const_int 4) + (const_int 8)) ;; Conservatively assume calls take two instructions (AUIPC + JALR). ;; The linker will opportunistically relax the sequence to JAL.