* [committed] Fix a couple constraints on the H8 in preparation for LRA conversion
@ 2023-05-10 11:46 Jeff Law
0 siblings, 0 replies; only message in thread
From: Jeff Law @ 2023-05-10 11:46 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 938 bytes --]
So this is the 2nd patch on the way to LRA for the H8.
LRA is more sensitive to getting define_constraint vs
define_memory_constraint vs define_special_memory_constraint correct.
than reload.
The H8 port has the "Q" constraint, which is used to indicate memory
addresses that can be used under certain circumstances in various ALU
operations. So it should be a memory constraint. Ideally it'd would be
a simple memory constraint, but it's used in contexts where MEMs are
valid only for certain parts in the H8 family. So it really needs to be
a special_memory_constraint.
The "Zz" constraint accepts memory, but the forms are limited and can
not be reloaded into a register. It seems to be working, but I
wouldn't be totally surprised if this got stressed in the right way if
it broke.
Anyway, this patch fixes "Q" and "Zz" to be special memory constraints.
Regression tested with gdbsim and pushed to the trunk.
jeff
[-- Attachment #2: Q --]
[-- Type: text/plain, Size: 2093 bytes --]
commit 02d79fb228c9f4c7d00dfe09b6ca7ef1392afbec
Author: Jeff Law <jlaw@ventanamicro>
Date: Wed May 10 05:25:12 2023 -0600
Fix a couple constraints on the H8 in preparation for LRA conversion
So this is the 2nd patch on the way to LRA for the H8.
LRA is more sensitive to getting define_constraint vs define_memory_constraint
vs define_special_memory_constraint correct. than reload.
The H8 port has the "Q" constraint, which is used to indicate memory addresses
that can be used under certain circumstances in various ALU operations. So it
should be a memory constraint. Ideally it'd would be a simple memory
constraint, but it's used in contexts where MEMs are valid only for certain
parts in the H8 family. So it really needs to be a special_memory_constraint.
The "Zz" constraint accepts memory, but the forms are limited and can not be
reloaded into a register. It seems to be working, but I wouldn't be totally
surprised if this got stressed in the right way if it broke.
Anyway, this patch fixes "Q" and "Zz" to be special memory constraints.
Regression tested with gdbsim and pushed to the trunk.
gcc
* config/h8300/constraints.md (Q): Make this a special memory
constraint.
(Zz): Similarly.
diff --git a/gcc/config/h8300/constraints.md b/gcc/config/h8300/constraints.md
index f1ebce14dad..3aef1205fef 100644
--- a/gcc/config/h8300/constraints.md
+++ b/gcc/config/h8300/constraints.md
@@ -144,7 +144,7 @@ (define_constraint "G"
(match_test "op == CONST0_RTX (SFmode)")))
;; Extra constraints.
-(define_constraint "Q"
+(define_special_memory_constraint "Q"
"@internal"
(and (match_test "TARGET_H8300SX")
(match_operand 0 "memory_operand")))
@@ -211,7 +211,7 @@ (define_constraint "Y2"
(and (match_code "const_int")
(match_test "exact_log2 (ival & 0xff) != -1")))
-(define_constraint "Zz"
+(define_special_memory_constraint "Zz"
"@internal"
(and (match_test "TARGET_H8300SX")
(match_code "mem")
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-05-10 11:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-10 11:46 [committed] Fix a couple constraints on the H8 in preparation for LRA conversion Jeff Law
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).