summaryrefslogtreecommitdiff
path: root/gcc/config/stormy16
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/stormy16
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/stormy16')
-rw-r--r--gcc/config/stormy16/stormy16.c11
-rw-r--r--gcc/config/stormy16/stormy16.h43
2 files changed, 11 insertions, 43 deletions
diff --git a/gcc/config/stormy16/stormy16.c b/gcc/config/stormy16/stormy16.c
index 7a034626dd9..7a20df4993c 100644
--- a/gcc/config/stormy16/stormy16.c
+++ b/gcc/config/stormy16/stormy16.c
@@ -58,6 +58,7 @@ static void xstormy16_asm_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT,
static void xstormy16_init_builtins PARAMS ((void));
static rtx xstormy16_expand_builtin PARAMS ((tree, rtx, rtx, enum machine_mode, int));
static bool xstormy16_rtx_costs PARAMS ((rtx, int, int, int *));
+static int xstormy16_address_cost PARAMS ((rtx));
/* Define the information needed to generate branch and scc insns. This is
stored from the compare operation. */
@@ -138,6 +139,14 @@ xstormy16_rtx_costs (x, code, outer_code, total)
}
}
+static int
+xstormy16_address_cost (x)
+ rtx x;
+{
+ return (GET_CODE (x) == CONST_INT ? 2
+ : GET_CODE (x) == PLUS ? 7
+ : 5);
+}
/* Branches are handled as follows:
@@ -2209,5 +2218,7 @@ xstormy16_expand_builtin(exp, target, subtarget, mode, ignore)
#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS xstormy16_rtx_costs
+#undef TARGET_ADDRESS_COST
+#define TARGET_ADDRESS_COST xstormy16_address_cost
struct gcc_target targetm = TARGET_INITIALIZER;
diff --git a/gcc/config/stormy16/stormy16.h b/gcc/config/stormy16/stormy16.h
index b8a90c49f47..505236484d9 100644
--- a/gcc/config/stormy16/stormy16.h
+++ b/gcc/config/stormy16/stormy16.h
@@ -2197,49 +2197,6 @@ do { \
/* Describing Relative Costs of Operations */
-/* An expression giving the cost of an addressing mode that contains ADDRESS.
- If not defined, the cost is computed from the ADDRESS expression and the
- `CONST_COSTS' values.
-
- For most CISC machines, the default cost is a good approximation of the true
- cost of the addressing mode. However, on RISC machines, all instructions
- normally have the same length and execution time. Hence all addresses will
- have equal costs.
-
- In cases where more than one form of an address is known, the form with the
- lowest cost will be used. If multiple forms have the same, lowest, cost,
- the one that is the most complex will be used.
-
- For example, suppose an address that is equal to the sum of a register and a
- constant is used twice in the same basic block. When this macro is not
- defined, the address will be computed in a register and memory references
- will be indirect through that register. On machines where the cost of the
- addressing mode containing the sum is no higher than that of a simple
- indirect reference, this will produce an additional instruction and possibly
- require an additional register. Proper specification of this macro
- eliminates this overhead for such machines.
-
- Similar use of this macro is made in strength reduction of loops.
-
- ADDRESS need not be valid as an address. In such a case, the cost is not
- relevant and can be any value; invalid addresses need not be assigned a
- different cost.
-
- On machines where an address involving more than one register is as cheap as
- an address computation involving only one register, defining `ADDRESS_COST'
- to reflect this can cause two registers to be live over a region of code
- where only one would have been if `ADDRESS_COST' were not defined in that
- manner. This effect should be considered in the definition of this macro.
- Equivalent costs should probably only be given to addresses with different
- numbers of registers on machines with lots of registers.
-
- This macro will normally either not be defined or be defined as a
- constant. */
-#define ADDRESS_COST(ADDRESS) \
- (GET_CODE (ADDRESS) == CONST_INT ? 2 \
- : GET_CODE (ADDRESS) == PLUS ? 7 \
- : 5)
-
/* A C expression for the cost of moving data of mode MODE from a
register in class FROM to one in class TO. The classes are
expressed using the enumeration values such as `GENERAL_REGS'. A