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: 1862590 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=embecosm.com header.i=@embecosm.com header.a=rsa-sha256 header.s=google header.b=PdBPP2kf; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SRszm2nf2z1yR3 for ; Sat, 11 Nov 2023 08:54:28 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9EA87385841C for ; Fri, 10 Nov 2023 21:54:25 +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-Google-Smtp-Source: AGHT+IHfmcrWWUiY0S3HctoJfd4sT8T4Pw5sdtPhgcyibdkx0aRlkWgj8KZmaVuBP80izpz7Ih0pmA== 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+incoming=patchwork.ozlabs.org@gcc.gnu.org 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.