summaryrefslogtreecommitdiff
path: root/gcc/config/vax
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2003-01-28 18:08:56 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2003-01-28 18:08:56 +0000
commitec0457a896817b692d7b51959296de3955098435 (patch)
tree2f6fbc07999c9923c492e499429bdd22d90f295a /gcc/config/vax
parent87647325f990fda8bd1c04de8d1097537c6091b7 (diff)
downloadgcc-ec0457a896817b692d7b51959296de3955098435.tar.gz
* target.h (targetm.address_cost): New.
* target-def.h (TARGET_ADDRESS_COST): New. (TARGET_RTX_COSTS): Uncomment. Oops. * cse.c (address_cost): Use new target hook. (default_address_cost): New. * output.h (default_address_cost): Declare. * hooks.c (hook_int_rtx_0): New. * hooks.h (hook_int_rtx_0): Declare. * loop.c (combine_givs_p): Remove if 0 code. * system.h (ADDRESS_COST): Poison. * config/alpha/alpha.c, config/alpha/alpha.h, config/d30v/d30v.c, config/d30v/d30v.h, config/ia64/ia64.c, config/ia64/ia64.h, config/m32r/m32r.c, config/m32r/m32r.h, config/mcore/mcore.c, config/mcore/mcore.h, config/mmix/mmix.c, config/mmix/mmix.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/sparc/sparc.c, config/sparc/sparc.h, config/v850/v850.c, config/v850/v850.h, config/xtensa/xtensa.c, config/xtensa/xtensa.h (TARGET_ADDRESS_COST): Define as hook_int_rtx_0. (ADDRESS_COST): Remove. * config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.h, config/c4x/c4x-protos.h, config/c4x/c4x.c, config/c4x/c4x.h, config/dsp16xx/dsp16xx-protos.h, config/dsp16xx/dsp16xx.c, config/dsp16xx/dsp16xx.h, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.h, config/i960/i960-protos.h, config/i960/i960.c, config/i960/i960.h, config/ip2k/ip2k-protos.h, config/ip2k/ip2k.c, config/ip2k/ip2k.h, config/mips/mips-protos.h, config/mips/mips.c, config/mips/mips.h, config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c, config/m68hc11/m68hc11.h, config/ns32k/ns32k-protos.h, config/ns32k/ns32k.c, config/ns32k/ns32k.h, config/pa/pa-protos.h, config/pa/pa.c, config/pa/pa.h, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/vax/vax-protos.h, config/vax/vax.c, config/vax/vax.h (foo_address_cost): Make static. (TARGET_ADDRESS_COST): New. (ADDRESS_COST): Remove. * config/arm/arm.h, config/arm/arm.c, config/m88k/m88k.h, config/m88k/m88k.c, config/romp/romp.h, config/romp/romp.c, config/sh/sh.c, config/sh/sh.h, config/stormy16/stormy16.c, config/stormy16/stormy16.h (ADDRESS_COST): Move code ... (foo_address_cost): ... here. (TARGET_ADDRESS_COST): New. * config/m32r/m32r.c (m32r_address_cost): Remove. * config/m32r/m32r-protos.h: Update. * config/mmix/mmix.c (mmix_address_cost): Remove. * config/mmix/mmix-protos.h: Update. * config/mn10300/mn10300.c (mn10300_address_cost_1): Rename from mn10300_address_cost; move unsig allocation ... (mn10300_address_cost): ... here. (TARGET_ADDRESS_COST): New. * config/mn10300/mn10300-protos.h: Update. * config/mn10300/mn10300.h (ADDRESS_COST): Remove. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@61988 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/vax')
-rw-r--r--gcc/config/vax/vax-protos.h2
-rw-r--r--gcc/config/vax/vax.c19
-rw-r--r--gcc/config/vax/vax.h2
3 files changed, 15 insertions, 8 deletions
diff --git a/gcc/config/vax/vax-protos.h b/gcc/config/vax/vax-protos.h
index 0e8cfb1f484..d62b2ac8c8d 100644
--- a/gcc/config/vax/vax-protos.h
+++ b/gcc/config/vax/vax-protos.h
@@ -25,8 +25,6 @@ extern const char *rev_cond_name PARAMS ((rtx));
extern void split_quadword_operands PARAMS ((rtx *, rtx *, int));
extern void print_operand_address PARAMS ((FILE *, rtx));
extern int vax_float_literal PARAMS ((rtx));
-extern int vax_address_cost PARAMS ((rtx));
-extern int vax_rtx_cost PARAMS ((rtx));
extern int reg_was_0_p PARAMS ((rtx, rtx));
#endif /* RTX_CODE */
diff --git a/gcc/config/vax/vax.c b/gcc/config/vax/vax.c
index 9bff82b15e8..1413882f4a6 100644
--- a/gcc/config/vax/vax.c
+++ b/gcc/config/vax/vax.c
@@ -45,6 +45,8 @@ static int follows_p PARAMS ((rtx, rtx));
static void vax_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
static void vax_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT,
HOST_WIDE_INT, tree));
+static int vax_address_cost_1 PARAMS ((rtx));
+static int vax_address_cost PARAMS ((rtx));
static int vax_rtx_costs_1 PARAMS ((rtx, enum rtx_code, enum rtx_code));
static bool vax_rtx_costs PARAMS ((rtx, int, int, int *));
@@ -62,6 +64,8 @@ static bool vax_rtx_costs PARAMS ((rtx, int, int, int *));
#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS vax_rtx_costs
+#undef TARGET_ADDRESS_COST
+#define TARGET_ADDRESS_COST vax_address_cost
struct gcc_target targetm = TARGET_INITIALIZER;
@@ -418,8 +422,8 @@ vax_float_literal(c)
2 - indirect */
-int
-vax_address_cost (addr)
+static int
+vax_address_cost_1 (addr)
register rtx addr;
{
int reg = 0, indexed = 0, indir = 0, offset = 0, predec = 0;
@@ -487,6 +491,13 @@ vax_address_cost (addr)
return reg + indexed + indir + offset + predec;
}
+static int
+vax_address_cost (x)
+ rtx x;
+{
+ return (1 + (GET_CODE (x) == REG ? 0 : vax_address_cost_1 (x)));
+}
+
/* Cost of an expression on a VAX. This version has costs tuned for the
CVAX chip (found in the VAX 3 series) with comments for variations on
other models. */
@@ -649,7 +660,7 @@ vax_rtx_costs_1 (x, code, outer_code)
x = XEXP (x, 0);
if (GET_CODE (x) == REG || GET_CODE (x) == POST_INC)
return c;
- return c + vax_address_cost (x);
+ return c + vax_address_cost_1 (x);
default:
c = 3;
break;
@@ -703,7 +714,7 @@ vax_rtx_costs_1 (x, code, outer_code)
case MEM:
c += 1; /* 2 on VAX 2 */
if (GET_CODE (XEXP (op, 0)) != REG)
- c += vax_address_cost (XEXP (op, 0));
+ c += vax_address_cost_1 (XEXP (op, 0));
break;
case REG:
case SUBREG:
diff --git a/gcc/config/vax/vax.h b/gcc/config/vax/vax.h
index e2a1d95e13d..d52f31d854e 100644
--- a/gcc/config/vax/vax.h
+++ b/gcc/config/vax/vax.h
@@ -848,8 +848,6 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES };
#define TARGET_FLOAT_FORMAT VAX_FLOAT_FORMAT
-#define ADDRESS_COST(RTX) (1 + (GET_CODE (RTX) == REG ? 0 : vax_address_cost(RTX)))
-
/* Specify the cost of a branch insn; roughly the number of extra insns that
should be added to avoid a branch.