aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.8/gcc/config/sh/predicates.md
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.8/gcc/config/sh/predicates.md')
-rw-r--r--gcc-4.8/gcc/config/sh/predicates.md11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc-4.8/gcc/config/sh/predicates.md b/gcc-4.8/gcc/config/sh/predicates.md
index dcbd75bb8..b1905fa0d 100644
--- a/gcc-4.8/gcc/config/sh/predicates.md
+++ b/gcc-4.8/gcc/config/sh/predicates.md
@@ -389,6 +389,12 @@
XEXP (XEXP (op, 0), 1),
TARGET_SH2A, true)")))
+;; Returns true if OP is a displacement address that can fit into a
+;; 16 bit (non-SH2A) memory load / store insn.
+(define_predicate "short_displacement_mem_operand"
+ (match_test "sh_disp_addr_displacement (op)
+ <= sh_max_mov_insn_displacement (GET_MODE (op), false)"))
+
;; Returns 1 if the operand can be used in an SH2A movu.{b|w} insn.
(define_predicate "zero_extend_movu_operand"
(and (match_operand 0 "displacement_mem_operand")
@@ -413,6 +419,11 @@
if (t_reg_operand (op, mode))
return 0;
+ /* Disallow PC relative QImode loads, since these is no insn to do that
+ and an imm8 load should be used instead. */
+ if (IS_PC_RELATIVE_LOAD_ADDR_P (op) && GET_MODE (op) == QImode)
+ return false;
+
if (MEM_P (op))
{
rtx inside = XEXP (op, 0);