aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/sh/constraints.md
diff options
context:
space:
mode:
authorOleg Endo <olegendo@gcc.gnu.org>2012-03-19 18:59:16 +0000
committerOleg Endo <olegendo@gcc.gnu.org>2012-03-19 18:59:16 +0000
commit344332e87bda8e91370598dced1b9f3a0f12d35f (patch)
tree9e2d1ac348fb139421d0ed1bae0011e40bcfdd63 /gcc/config/sh/constraints.md
parent26b808448f313cd214311c371a9ea204c58ba66b (diff)
downloadgcc-344332e87bda8e91370598dced1b9f3a0f12d35f.zip
gcc-344332e87bda8e91370598dced1b9f3a0f12d35f.tar.gz
gcc-344332e87bda8e91370598dced1b9f3a0f12d35f.tar.bz2
re PR target/50751 (SH Target: Displacement addressing does not work for QImode and HImode)
PR target/50751 * config/sh/sh.h (CONST_OK_FOR_K04, CONST_OK_FOR_K12, DISP_ADDR_P, DISP_ADDR_OFFSET): New macros. * config/sh/sh.c (sh_address_cost): Add SH2A special case. (sh_legitimate_index_p): Allow QImode displacements for non-SH2A. (sh_legitimize_address): Add QImode displacement handling. (sh_cannot_change_mode_class): Disallow GENERAL_REGS for SFmode vector subregs. (sh_secondary_reload): Add QImode displacement handling. * config/sh/predicates.md (movsrc_no_disp_mem_operand): New predicate. * config/sh/constraints.md (K04, Snd, Sdd): New constraints. * config/sh/sh.md (extendqisi2): Remove constraints from expander. (*extendqisi2_compact): Rename to *extendqisi2_compact_reg, restrict to register operands only. (*extendqisi2_compact_mem_disp, *extendqisi2_compact_snd): New insns. (extendqihi2): Change insn to expander. (*extendqihi2_compact_reg): New insn. (movqi_i, movqi): Replace with ... (movqi, *movqi_reg_reg, *movqi_store_mem_disp12, *movqi_load_mem_disp, *movqi_load_mem_disp): ... these. Add new peepholes for QImode displacement addressing. From-SVN: r185534
Diffstat (limited to 'gcc/config/sh/constraints.md')
-rw-r--r--gcc/config/sh/constraints.md14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/config/sh/constraints.md b/gcc/config/sh/constraints.md
index 12a4a99..1f2ccf9 100644
--- a/gcc/config/sh/constraints.md
+++ b/gcc/config/sh/constraints.md
@@ -123,6 +123,7 @@
(match_test "ival >= -134217728 && ival <= 134217727")
(match_test "(ival & 255) == 0")
(match_test "TARGET_SH2A")))
+
(define_constraint "J16"
"0xffffffff00000000 or 0x00000000ffffffff."
(and (match_code "const_int")
@@ -133,6 +134,11 @@
(and (match_code "const_int")
(match_test "ival >= 0 && ival <= 7")))
+(define_constraint "K04"
+ "An unsigned 4-bit constant, as used in mov.b displacement addressing."
+ (and (match_code "const_int")
+ (match_test "ival >= 0 && ival <= 15")))
+
(define_constraint "K08"
"An unsigned 8-bit constant, as used in and, or, etc."
(and (match_code "const_int")
@@ -266,3 +272,11 @@
(match_test "GET_CODE (XEXP (op, 0)) == PLUS")
(match_test "REG_P (XEXP (XEXP (op, 0), 0))")
(match_test "satisfies_constraint_K12 (XEXP (XEXP (op, 0), 1))")))
+
+(define_memory_constraint "Snd"
+ "A memory reference that excludes displacement addressing."
+ (match_test "! DISP_ADDR_P (op)"))
+
+(define_memory_constraint "Sdd"
+ "A memory reference that uses displacement addressing."
+ (match_test "DISP_ADDR_P (op)"))