* [committed] RISC-V: Fix indentation of "length" attribute for branches and jumps
@ 2023-11-10 21:54 Maciej W. Rozycki
0 siblings, 0 replies; only message in thread
From: Maciej W. Rozycki @ 2023-11-10 21:54 UTC (permalink / raw)
To: gcc-patches; +Cc: Andrew Waterman, Jim Wilson, Kito Cheng, Palmer Dabbelt
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.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-11-10 21:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-10 21:54 [committed] RISC-V: Fix indentation of "length" attribute for branches and jumps Maciej W. Rozycki
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).