Commit b95491a0 by Anatoly Sokolov Committed by Anatoly Sokolov

m32c.c (cris_memory_move_cost): New.

	* config/cris/m32c.c (cris_memory_move_cost): New.
	(cris_register_move_cost): Make static. Change arguments type from
	enum reg_class to reg_class_t.
	(TARGET_REGISTER_MOVE_COST, TARGET_MEMORY_MOVE_COST): Define.
	* config/cris/cris.h (REGISTER_MOVE_COST, MEMORY_MOVE_COST): Remove.
	* config/cris/cris-protos.h (cris_register_move_cost): Remove.

From-SVN: r164768
parent 45c13d4c
2010-09-30 Anatoly Sokolov <aesok@post.ru>
* config/cris/m32c.c (cris_memory_move_cost): New.
(cris_register_move_cost): Make static. Change arguments type from
enum reg_class to reg_class_t.
(TARGET_REGISTER_MOVE_COST, TARGET_MEMORY_MOVE_COST): Define.
* config/cris/cris.h (REGISTER_MOVE_COST, MEMORY_MOVE_COST): Remove.
* config/cris/cris-protos.h (cris_register_move_cost): Remove.
2010-09-30 Jakub Jelinek <jakub@redhat.com> 2010-09-30 Jakub Jelinek <jakub@redhat.com>
PR target/45843 PR target/45843
...@@ -31,8 +31,6 @@ extern bool cris_simple_epilogue (void); ...@@ -31,8 +31,6 @@ extern bool cris_simple_epilogue (void);
extern const char *cris_op_str (rtx); extern const char *cris_op_str (rtx);
extern void cris_notice_update_cc (rtx, rtx); extern void cris_notice_update_cc (rtx, rtx);
extern bool cris_reload_address_legitimized (rtx, enum machine_mode, int, int, int); extern bool cris_reload_address_legitimized (rtx, enum machine_mode, int, int, int);
extern int cris_register_move_cost (enum machine_mode, enum reg_class,
enum reg_class);
extern int cris_side_effect_mode_ok (enum rtx_code, rtx *, int, int, extern int cris_side_effect_mode_ok (enum rtx_code, rtx *, int, int,
int, int, int); int, int, int);
extern bool cris_cc0_user_requires_cmp (rtx); extern bool cris_cc0_user_requires_cmp (rtx);
......
...@@ -121,6 +121,8 @@ static void cris_asm_output_mi_thunk ...@@ -121,6 +121,8 @@ static void cris_asm_output_mi_thunk
static void cris_file_start (void); static void cris_file_start (void);
static void cris_init_libfuncs (void); static void cris_init_libfuncs (void);
static int cris_register_move_cost (enum machine_mode, reg_class_t, reg_class_t);
static int cris_memory_move_cost (enum machine_mode, reg_class_t, bool);
static bool cris_rtx_costs (rtx, int, int, int *, bool); static bool cris_rtx_costs (rtx, int, int, int *, bool);
static int cris_address_cost (rtx, bool); static int cris_address_cost (rtx, bool);
static bool cris_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode, static bool cris_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode,
...@@ -185,6 +187,10 @@ int cris_cpu_version = CRIS_DEFAULT_CPU_VERSION; ...@@ -185,6 +187,10 @@ int cris_cpu_version = CRIS_DEFAULT_CPU_VERSION;
#undef TARGET_INIT_LIBFUNCS #undef TARGET_INIT_LIBFUNCS
#define TARGET_INIT_LIBFUNCS cris_init_libfuncs #define TARGET_INIT_LIBFUNCS cris_init_libfuncs
#undef TARGET_REGISTER_MOVE_COST
#define TARGET_REGISTER_MOVE_COST cris_register_move_cost
#undef TARGET_MEMORY_MOVE_COST
#define TARGET_MEMORY_MOVE_COST cris_memory_move_cost
#undef TARGET_RTX_COSTS #undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS cris_rtx_costs #define TARGET_RTX_COSTS cris_rtx_costs
#undef TARGET_ADDRESS_COST #undef TARGET_ADDRESS_COST
...@@ -1378,11 +1384,11 @@ cris_reload_address_legitimized (rtx x, ...@@ -1378,11 +1384,11 @@ cris_reload_address_legitimized (rtx x,
return false; return false;
} }
/* Worker function for REGISTER_MOVE_COST. */ /* Worker function for TARGET_REGISTER_MOVE_COST. */
int static int
cris_register_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED, cris_register_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED,
enum reg_class from, enum reg_class to) reg_class_t from, reg_class_t to)
{ {
if (!TARGET_V32) if (!TARGET_V32)
{ {
...@@ -1424,6 +1430,23 @@ cris_register_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED, ...@@ -1424,6 +1430,23 @@ cris_register_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED,
return 2; return 2;
} }
/* Worker function for TARGET_MEMORY_MOVE_COST.
This isn't strictly correct for v0..3 in buswidth-8bit mode, but should
suffice. */
static int
cris_memory_move_cost (enum machine_mode mode,
reg_class_t rclass ATTRIBUTE_UNUSED,
bool in ATTRIBUTE_UNUSED)
{
if (mode == QImode
|| mode == HImode)
return 4;
else
return 6;
}
/* Worker for cris_notice_update_cc; handles the "normal" cases. /* Worker for cris_notice_update_cc; handles the "normal" cases.
FIXME: this code is historical; its functionality should be FIXME: this code is historical; its functionality should be
refactored to look at insn attributes and moved to refactored to look at insn attributes and moved to
......
...@@ -1073,14 +1073,6 @@ struct cum_args {int regs;}; ...@@ -1073,14 +1073,6 @@ struct cum_args {int regs;};
/* Node: Costs */ /* Node: Costs */
#define REGISTER_MOVE_COST(MODE, FROM, TO) \
cris_register_move_cost (MODE, FROM, TO)
/* This isn't strictly correct for v0..3 in buswidth-8bit mode, but
should suffice. */
#define MEMORY_MOVE_COST(M, CLASS, IN) \
(((M) == QImode) ? 4 : ((M) == HImode) ? 4 : 6)
/* Regardless of the presence of delay slots, the default value of 1 for /* Regardless of the presence of delay slots, the default value of 1 for
BRANCH_COST is the best in the range (1, 2, 3), tested with gcc-2.7.2 BRANCH_COST is the best in the range (1, 2, 3), tested with gcc-2.7.2
with testcases ipps and gcc, giving smallest and fastest code. */ with testcases ipps and gcc, giving smallest and fastest code. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment