From 037f11ef749f34a04975739ad28c480edd4ad6fe Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Thu, 14 Feb 2002 13:25:30 +0000 Subject: [PATCH] h8300-protos.h: Update the prototype for const_costs. * config/h8300/h8300-protos.h: Update the prototype for const_costs. * config/h8300/h8300.c (const_costs): Treat SET as a little more expensive operation. * config/h8300/h8300.h (DEFAULT_RTX_COSTS): Update the reference to const_costs. From-SVN: r49765 --- gcc/ChangeLog | 9 +++++++++ gcc/config/h8300/h8300-protos.h | 2 +- gcc/config/h8300/h8300.c | 8 +++++--- gcc/config/h8300/h8300.h | 2 +- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f773d5b617f5..0da3da22e3bb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2002-02-14 Kazu Hirata + + * config/h8300/h8300-protos.h: Update the prototype for + const_costs. + * config/h8300/h8300.c (const_costs): Treat SET as a little + more expensive operation. + * config/h8300/h8300.h (DEFAULT_RTX_COSTS): Update the + reference to const_costs. + 2002-02-14 Hans-Peter Nilsson * config.gcc (c4x-*-rtems*): Fix typo in tm_file setting. diff --git a/gcc/config/h8300/h8300-protos.h b/gcc/config/h8300/h8300-protos.h index 9c9444ded12b..876b3cba2a44 100644 --- a/gcc/config/h8300/h8300-protos.h +++ b/gcc/config/h8300/h8300-protos.h @@ -30,7 +30,7 @@ extern const char *output_a_shift PARAMS ((rtx *)); extern const char *emit_a_rotate PARAMS ((enum rtx_code, rtx *)); extern const char *output_simode_bld PARAMS ((int, rtx[])); extern void print_operand_address PARAMS ((FILE *, rtx)); -extern int const_costs PARAMS ((rtx, enum rtx_code)); +extern int const_costs PARAMS ((rtx, enum rtx_code, enum rtx_code)); extern void print_operand PARAMS ((FILE *, rtx, int)); extern void final_prescan_insn PARAMS ((rtx, rtx *, int)); extern int do_movsi PARAMS ((rtx[])); diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c index 85a87b006859..b0bd3df642ba 100644 --- a/gcc/config/h8300/h8300.c +++ b/gcc/config/h8300/h8300.c @@ -872,9 +872,10 @@ function_arg (cum, mode, type, named) /* Return the cost of the rtx R with code CODE. */ int -const_costs (r, c) +const_costs (r, c, outer_code) rtx r; enum rtx_code c; + enum rtx_code outer_code; { switch (c) { @@ -882,15 +883,16 @@ const_costs (r, c) switch (INTVAL (r)) { case 0: + return 0; case 1: case 2: case -1: case -2: - return 0; + return 0 + (outer_code == SET); case 4: case -4: if (TARGET_H8300H || TARGET_H8300S) - return 0; + return 0 + (outer_code == SET); else return 1; default: diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h index cfa413af37b1..21ef1bf50251 100644 --- a/gcc/config/h8300/h8300.h +++ b/gcc/config/h8300/h8300.h @@ -1005,7 +1005,7 @@ struct cum_arg return it with a return statement. Otherwise, break from the switch. */ #define DEFAULT_RTX_COSTS(RTX, CODE, OUTER_CODE) \ - return (const_costs (RTX, CODE)); + return (const_costs (RTX, CODE, OUTER_CODE)); #define BRANCH_COST 0 -- 2.43.5