aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/h8300
diff options
context:
space:
mode:
authorAnatoly Sokolov <aesok@post.ru>2011-03-31 15:22:32 +0000
committerAnatoly Sokolov <aesok@post.ru>2011-03-31 15:22:32 +0000
commit437b5c266b59786c6fdfd0d290d903f6f5671ca0 (patch)
treea245303e5be419b165f50a5025ba82e8a081ed68 /gcc/config/h8300
parentdce1d20562d7e413cefe4d4017e74c147db28096 (diff)
* config/h8300/h8300.h (GO_IF_MODE_DEPENDENT_ADDRESS): Remove macro.
* config/h8300/h8300-protos.h (h8300_get_index): Remove. * config/h8300/h8300.c (TARGET_MODE_DEPENDENT_ADDRESS_P): Define. (h8300_mode_dependent_address_p): New function. (h8300_get_index): Make static. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@171787 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/h8300')
-rw-r--r--gcc/config/h8300/h8300-protos.h3
-rw-r--r--gcc/config/h8300/h8300.c21
-rw-r--r--gcc/config/h8300/h8300.h11
3 files changed, 21 insertions, 14 deletions
diff --git a/gcc/config/h8300/h8300-protos.h b/gcc/config/h8300/h8300-protos.h
index 1211c63897a..131410172b9 100644
--- a/gcc/config/h8300/h8300-protos.h
+++ b/gcc/config/h8300/h8300-protos.h
@@ -1,6 +1,6 @@
/* Definitions of target machine for GNU compiler.
Renesas H8/300 version
- Copyright (C) 2000, 2002, 2003, 2004, 2005, 2007, 2009, 2010
+ Copyright (C) 2000, 2002, 2003, 2004, 2005, 2007, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Steve Chamberlain (sac@cygnus.com),
Jim Wilson (wilson@cygnus.com), and Doug Evans (dje@cygnus.com).
@@ -110,7 +110,6 @@ struct cpp_reader;
extern void h8300_pr_interrupt (struct cpp_reader *);
extern void h8300_pr_saveall (struct cpp_reader *);
extern enum reg_class h8300_reg_class_from_letter (int);
-extern rtx h8300_get_index (rtx, enum machine_mode mode, int *);
extern unsigned int h8300_insn_length_from_table (rtx, rtx *);
extern const char * output_h8sx_shift (rtx *, int, int);
extern bool h8300_operands_match_p (rtx *);
diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c
index 0e44a3ab425..6649b3fb52c 100644
--- a/gcc/config/h8300/h8300.c
+++ b/gcc/config/h8300/h8300.c
@@ -113,6 +113,7 @@ static unsigned int h8300_binary_length (rtx, const h8300_length_table
static bool h8300_short_move_mem_p (rtx, enum rtx_code);
static unsigned int h8300_move_length (rtx *, const h8300_length_table *);
static bool h8300_hard_regno_scratch_ok (unsigned int);
+static rtx h8300_get_index (rtx, enum machine_mode mode, int *);
/* CPU_TYPE, says what cpu we're compiling for. */
int cpu_type;
@@ -2094,7 +2095,7 @@ notice_update_cc (rtx body, rtx insn)
MODE is the mode of the value being accessed. It can be VOIDmode
if the address is known to be valid, but its mode is unknown. */
-rtx
+static rtx
h8300_get_index (rtx x, enum machine_mode mode, int *size)
{
int dummy, factor;
@@ -2156,6 +2157,21 @@ h8300_get_index (rtx x, enum machine_mode mode, int *size)
return x;
}
+/* Worker function for TARGET_MODE_DEPENDENT_ADDRESS_P.
+
+ On the H8/300, the predecrement and postincrement address depend thus
+ (the amount of decrement or increment being the length of the operand). */
+
+static bool
+h8300_mode_dependent_address_p (const_rtx addr)
+{
+ if (GET_CODE (addr) == PLUS
+ && h8300_get_index (XEXP (addr, 0), VOIDmode, 0) != XEXP (addr, 0))
+ return true;
+
+ return false;
+}
+
static const h8300_length_table addb_length_table =
{
/* #xx Rs @aa @Rs @xx */
@@ -6026,4 +6042,7 @@ h8300_trampoline_init (rtx m_tramp, tree fndecl, rtx cxt)
#undef TARGET_EXCEPT_UNWIND_INFO
#define TARGET_EXCEPT_UNWIND_INFO sjlj_except_unwind_info
+#undef TARGET_MODE_DEPENDENT_ADDRESS_P
+#define TARGET_MODE_DEPENDENT_ADDRESS_P h8300_mode_dependent_address_p
+
struct gcc_target targetm = TARGET_INITIALIZER;
diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h
index 837ecd0c3cb..ce81dcd1d78 100644
--- a/gcc/config/h8300/h8300.h
+++ b/gcc/config/h8300/h8300.h
@@ -762,17 +762,6 @@ struct cum_arg
((C) == 'W')
-/* Go to LABEL if ADDR (a legitimate address expression)
- has an effect that depends on the machine mode it is used for.
-
- On the H8/300, the predecrement and postincrement address depend thus
- (the amount of decrement or increment being the length of the operand). */
-
-#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) \
- if (GET_CODE (ADDR) == PLUS \
- && h8300_get_index (XEXP (ADDR, 0), VOIDmode, 0) != XEXP (ADDR, 0)) \
- goto LABEL;
-
/* Specify the machine mode that this machine uses
for the index in the tablejump instruction. */
#define CASE_VECTOR_MODE Pmode