From: "Maciej W. Rozycki" <macro@embecosm.com>
To: gcc-patches@gcc.gnu.org
Cc: Andrew Waterman <andrew@sifive.com>,
Jim Wilson <jim.wilson.gcc@gmail.com>,
Kito Cheng <kito.cheng@gmail.com>,
Palmer Dabbelt <palmer@dabbelt.com>
Subject: [committed] RISC-V: Fix indentation of "length" attribute for branches and jumps
Date: Fri, 10 Nov 2023 21:54:07 +0000 (GMT) [thread overview]
Message-ID: <alpine.DEB.2.20.2311101822270.5892@tpp.orcam.me.uk> (raw)
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.
reply other threads:[~2023-11-10 21:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.20.2311101822270.5892@tpp.orcam.me.uk \
--to=macro@embecosm.com \
--cc=andrew@sifive.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jim.wilson.gcc@gmail.com \
--cc=kito.cheng@gmail.com \
--cc=palmer@dabbelt.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).