===================================================================
@@ -3820,13 +3820,14 @@
if (!memory_address_addr_space_p (mode, x, as))
return 1000;
- return targetm.address_cost (x, speed);
+ return targetm.address_cost (x, mode, speed);
}
/* If the target doesn't override, compute the cost as with arithmetic. */
int
-default_address_cost (rtx x, bool speed)
+default_address_cost (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED,
+ bool speed)
{
return rtx_cost (x, MEM, 0, speed);
}
===================================================================
@@ -606,7 +606,7 @@
extern void default_elf_fini_array_asm_out_destructor (rtx, int);
extern int maybe_assemble_visibility (tree);
-extern int default_address_cost (rtx, bool);
+extern int default_address_cost (rtx, enum machine_mode, bool);
/* Output stack usage information. */
extern void output_stack_usage (void);
===================================================================
@@ -6440,7 +6440,7 @@
processed, and false when @code{rtx_cost} should recurse.
@end deftypefn
-@deftypefn {Target Hook} int TARGET_ADDRESS_COST (rtx @var{address}, bool @var{speed})
+@deftypefn {Target Hook} int TARGET_ADDRESS_COST (rtx @var{address}, enum machine_mode @var{mode}, bool @var{speed})
This hook computes the cost of an addressing mode that contains
@var{address}. If not defined, the cost is computed from
the @var{address} expression and the @code{TARGET_RTX_COST} hook.
===================================================================
@@ -1758,7 +1758,7 @@
DEFHOOK
(address_cost,
"",
- int, (rtx address, bool speed),
+ int, (rtx address, enum machine_mode mode, bool speed),
default_address_cost)
/* Return where to allocate pseudo for a given hard register initial value. */
===================================================================
@@ -200,6 +200,14 @@
return 0;
}
+int
+hook_int_rtx_mode_bool_0 (rtx a ATTRIBUTE_UNUSED,
+ enum machine_mode b ATTRIBUTE_UNUSED,
+ bool c ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+
unsigned int
hook_uint_void_0 (void)
{
===================================================================
@@ -74,6 +74,7 @@
extern int hook_int_const_tree_const_tree_1 (const_tree, const_tree);
extern int hook_int_rtx_0 (rtx);
extern int hook_int_rtx_bool_0 (rtx, bool);
+extern int hook_int_rtx_mode_bool_0 (rtx, enum machine_mode, bool);
extern tree hook_tree_const_tree_null (const_tree);
===================================================================
@@ -2597,7 +2597,8 @@
/* Return the cost of an address rtx ADDR. */
static int
-s390_address_cost (rtx addr, bool speed ATTRIBUTE_UNUSED)
+s390_address_cost (rtx addr, enum machine_mode mode ATTRIBUTE_UNUSED,
+ bool speed ATTRIBUTE_UNUSED)
{
struct s390_address ad;
if (!s390_decompose_address (addr, &ad))
===================================================================
@@ -2278,7 +2278,8 @@
#undef TARGET_ADDRESS_COST
#define TARGET_ADDRESS_COST m32c_address_cost
static int
-m32c_address_cost (rtx addr, bool speed ATTRIBUTE_UNUSED)
+m32c_address_cost (rtx addr, enum machine_mode mode ATTRIBUTE_UNUSED,
+ bool speed ATTRIBUTE_UNUSED)
{
int i;
/* fprintf(stderr, "\naddress_cost\n");
===================================================================
@@ -161,7 +161,7 @@
#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS m32r_rtx_costs
#undef TARGET_ADDRESS_COST
-#define TARGET_ADDRESS_COST hook_int_rtx_bool_0
+#define TARGET_ADDRESS_COST hook_int_rtx_mode_bool_0
#undef TARGET_PROMOTE_PROTOTYPES
#define TARGET_PROMOTE_PROTOTYPES hook_bool_const_tree_true
===================================================================
@@ -11955,7 +11955,8 @@
requires to two regs - that would mean more pseudos with longer
lifetimes. */
static int
-ix86_address_cost (rtx x, bool speed ATTRIBUTE_UNUSED)
+ix86_address_cost (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED,
+ bool speed ATTRIBUTE_UNUSED)
{
struct ix86_address parts;
int cost = 1;
===================================================================
@@ -928,7 +928,7 @@
static rtx rs6000_emit_set_long_const (rtx, HOST_WIDE_INT, HOST_WIDE_INT);
static int rs6000_memory_move_cost (enum machine_mode, reg_class_t, bool);
static bool rs6000_debug_rtx_costs (rtx, int, int, int, int *, bool);
-static int rs6000_debug_address_cost (rtx, bool);
+static int rs6000_debug_address_cost (rtx, enum machine_mode, bool);
static int rs6000_debug_adjust_cost (rtx, rtx, rtx, int);
static bool is_microcoded_insn (rtx);
static bool is_nonpipeline_insn (rtx);
@@ -1294,7 +1294,7 @@
#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS rs6000_rtx_costs
#undef TARGET_ADDRESS_COST
-#define TARGET_ADDRESS_COST hook_int_rtx_bool_0
+#define TARGET_ADDRESS_COST hook_int_rtx_mode_bool_0
#undef TARGET_DWARF_REGISTER_SPAN
#define TARGET_DWARF_REGISTER_SPAN rs6000_dwarf_register_span
@@ -26070,12 +26070,13 @@
/* Debug form of ADDRESS_COST that is selected if -mdebug=cost. */
static int
-rs6000_debug_address_cost (rtx x, bool speed)
+rs6000_debug_address_cost (rtx x, enum machine_mode mode, bool speed)
{
int ret = TARGET_ADDRESS_COST (x, speed);
- fprintf (stderr, "\nrs6000_address_cost, return = %d, speed = %s, x:\n",
- ret, speed ? "true" : "false");
+ fprintf (stderr,
+ "\nrs6000_address_cost, return = %d, mode = %s, speed = %s, x:\n",
+ ret, GET_MODE_NAME (mode), speed ? "true" : "false");
debug_rtx (x);
return ret;
===================================================================
@@ -9795,7 +9795,7 @@
#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS alpha_rtx_costs
#undef TARGET_ADDRESS_COST
-#define TARGET_ADDRESS_COST hook_int_rtx_bool_0
+#define TARGET_ADDRESS_COST hook_int_rtx_mode_bool_0
#undef TARGET_MACHINE_DEPENDENT_REORG
#define TARGET_MACHINE_DEPENDENT_REORG alpha_reorg
===================================================================
@@ -2142,7 +2142,8 @@
with an address register. */
static int
-mn10300_address_cost (rtx x, bool speed)
+mn10300_address_cost (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED,
+ bool speed)
{
HOST_WIDE_INT i;
rtx base, index;
@@ -2457,7 +2458,7 @@
break;
case MEM:
- total = mn10300_address_cost (XEXP (x, 0), speed);
+ total = mn10300_address_cost (XEXP (x, 0), GET_MODE (x), speed);
if (speed)
total = COSTS_N_INSNS (2 + total);
goto alldone;
===================================================================
@@ -91,7 +91,7 @@
static void fix_range (const char *);
static int hppa_register_move_cost (enum machine_mode mode, reg_class_t,
reg_class_t);
-static int hppa_address_cost (rtx, bool);
+static int hppa_address_cost (rtx, enum machine_mode mode, bool);
static bool hppa_rtx_costs (rtx, int, int, int, int *, bool);
static inline rtx force_mode (enum machine_mode, rtx);
static void pa_reorg (void);
@@ -1397,7 +1397,7 @@
as GO_IF_LEGITIMATE_ADDRESS. */
static int
-hppa_address_cost (rtx X,
+hppa_address_cost (rtx X, enum machine_mode mode ATTRIBUTE_UNUSED,
bool speed ATTRIBUTE_UNUSED)
{
switch (GET_CODE (X))
===================================================================
@@ -58,7 +58,7 @@
static void xstormy16_init_builtins (void);
static rtx xstormy16_expand_builtin (tree, rtx, rtx, enum machine_mode, int);
static bool xstormy16_rtx_costs (rtx, int, int, int, int *, bool);
-static int xstormy16_address_cost (rtx, bool);
+static int xstormy16_address_cost (rtx, enum machine_mode, bool);
static bool xstormy16_return_in_memory (const_tree, const_tree);
static GTY(()) section *bss100_section;
@@ -103,7 +103,8 @@
}
static int
-xstormy16_address_cost (rtx x, bool speed ATTRIBUTE_UNUSED)
+xstormy16_address_cost (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED,
+ bool speed ATTRIBUTE_UNUSED)
{
return (CONST_INT_P (x) ? 2
: GET_CODE (x) == PLUS ? 7
===================================================================
@@ -689,7 +689,7 @@
#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS sparc_rtx_costs
#undef TARGET_ADDRESS_COST
-#define TARGET_ADDRESS_COST hook_int_rtx_bool_0
+#define TARGET_ADDRESS_COST hook_int_rtx_mode_bool_0
#undef TARGET_REGISTER_MOVE_COST
#define TARGET_REGISTER_MOVE_COST sparc_register_move_cost
===================================================================
@@ -86,7 +86,7 @@
#undef TARGET_OPTION_OVERRIDE
#define TARGET_OPTION_OVERRIDE lm32_option_override
#undef TARGET_ADDRESS_COST
-#define TARGET_ADDRESS_COST hook_int_rtx_bool_0
+#define TARGET_ADDRESS_COST hook_int_rtx_mode_bool_0
#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS lm32_rtx_costs
#undef TARGET_IN_SMALL_DATA_P
===================================================================
@@ -729,7 +729,8 @@
If ADDR is not a valid address, its cost is irrelevant. */
static int
-epiphany_address_cost (rtx addr, bool speed)
+epiphany_address_cost (rtx addr, enum machine_mode mode ATTRIBUTE_UNUSED,
+ bool speed)
{
rtx reg;
rtx off = const0_rtx;
===================================================================
@@ -130,7 +130,7 @@
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, int *, bool);
-static int cris_address_cost (rtx, bool);
+static int cris_address_cost (rtx, enum machine_mode, bool);
static bool cris_pass_by_reference (cumulative_args_t, enum machine_mode,
const_tree, bool);
static int cris_arg_partial_bytes (cumulative_args_t, enum machine_mode,
@@ -2149,7 +2149,8 @@
/* The ADDRESS_COST worker. */
static int
-cris_address_cost (rtx x, bool speed ATTRIBUTE_UNUSED)
+cris_address_cost (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED,
+ bool speed ATTRIBUTE_UNUSED)
{
/* The metric to use for the cost-macros is unclear.
The metric used here is (the number of cycles needed) / 2,
===================================================================
@@ -162,7 +162,7 @@
static bool arm_xscale_rtx_costs (rtx, enum rtx_code, enum rtx_code, int *, bool);
static bool arm_9e_rtx_costs (rtx, enum rtx_code, enum rtx_code, int *, bool);
static bool arm_rtx_costs (rtx, int, int, int, int *, bool);
-static int arm_address_cost (rtx, bool);
+static int arm_address_cost (rtx, enum machine_mode, bool);
static int arm_register_move_cost (enum machine_mode, reg_class_t, reg_class_t);
static int arm_memory_move_cost (enum machine_mode, reg_class_t, bool);
static void arm_init_builtins (void);
@@ -8411,7 +8411,8 @@
}
static int
-arm_address_cost (rtx x, bool speed ATTRIBUTE_UNUSED)
+arm_address_cost (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED,
+ bool speed ATTRIBUTE_UNUSED)
{
return TARGET_32BIT ? arm_arm_address_cost (x) : arm_thumb_address_cost (x);
}
===================================================================
@@ -524,7 +524,7 @@
#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS ia64_rtx_costs
#undef TARGET_ADDRESS_COST
-#define TARGET_ADDRESS_COST hook_int_rtx_bool_0
+#define TARGET_ADDRESS_COST hook_int_rtx_mode_bool_0
#undef TARGET_UNSPEC_MAY_TRAP_P
#define TARGET_UNSPEC_MAY_TRAP_P ia64_unspec_may_trap_p
===================================================================
@@ -2724,7 +2724,7 @@
}
static int
-rx_address_cost (rtx addr, bool speed)
+rx_address_cost (rtx addr, enum machine_mode mode ATTRIBUTE_UNUSED, bool speed)
{
rtx a, b;
===================================================================
@@ -53,7 +53,7 @@
static void vax_output_mi_thunk (FILE *, tree, HOST_WIDE_INT,
HOST_WIDE_INT, tree);
static int vax_address_cost_1 (rtx);
-static int vax_address_cost (rtx, bool);
+static int vax_address_cost (rtx, enum machine_mode, bool);
static bool vax_rtx_costs (rtx, int, int, int, int *, bool);
static rtx vax_function_arg (cumulative_args_t, enum machine_mode,
const_tree, bool);
@@ -738,7 +738,8 @@
}
static int
-vax_address_cost (rtx x, bool speed ATTRIBUTE_UNUSED)
+vax_address_cost (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED,
+ bool speed ATTRIBUTE_UNUSED)
{
return (1 + (REG_P (x) ? 0 : vax_address_cost_1 (x)));
}
===================================================================
@@ -248,7 +248,7 @@
static bool unspec_caller_rtx_p (rtx);
static bool sh_cannot_copy_insn_p (rtx);
static bool sh_rtx_costs (rtx, int, int, int, int *, bool);
-static int sh_address_cost (rtx, bool);
+static int sh_address_cost (rtx, enum machine_mode, bool);
static int sh_pr_n_sets (void);
static rtx sh_allocate_initial_value (rtx);
static reg_class_t sh_preferred_reload_class (rtx, reg_class_t);
@@ -3368,7 +3368,8 @@
/* Compute the cost of an address. */
static int
-sh_address_cost (rtx x, bool speed ATTRIBUTE_UNUSED)
+sh_address_cost (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED,
+ bool speed ATTRIBUTE_UNUSED)
{
/* 'reg + disp' addressing. */
if (satisfies_constraint_Sdd (x))
===================================================================
@@ -1043,7 +1043,8 @@
/* Provide the costs of an addressing mode that contains ADDR.
If ADDR is not a valid address, its cost is irrelevant. */
static int
-microblaze_address_cost (rtx addr, bool speed ATTRIBUTE_UNUSED)
+microblaze_address_cost (rtx addr, enum machine_mode mode ATTRIBUTE_UNUSED,
+ bool speed ATTRIBUTE_UNUSED)
{
return COSTS_N_INSNS (microblaze_address_insns (addr, GET_MODE (addr)));
}
===================================================================
@@ -211,7 +211,7 @@
#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS xtensa_rtx_costs
#undef TARGET_ADDRESS_COST
-#define TARGET_ADDRESS_COST hook_int_rtx_bool_0
+#define TARGET_ADDRESS_COST hook_int_rtx_mode_bool_0
#undef TARGET_MEMBER_TYPE_FORCES_BLK
#define TARGET_MEMBER_TYPE_FORCES_BLK xtensa_member_type_forces_blk
===================================================================
@@ -7161,7 +7161,7 @@
#define TARGET_RTX_COSTS spu_rtx_costs
#undef TARGET_ADDRESS_COST
-#define TARGET_ADDRESS_COST hook_int_rtx_bool_0
+#define TARGET_ADDRESS_COST hook_int_rtx_mode_bool_0
#undef TARGET_SCHED_ISSUE_RATE
#define TARGET_SCHED_ISSUE_RATE spu_sched_issue_rate
===================================================================
@@ -3943,9 +3943,10 @@
/* Implement TARGET_ADDRESS_COST. */
static int
-mips_address_cost (rtx addr, bool speed ATTRIBUTE_UNUSED)
+mips_address_cost (rtx addr, enum machine_mode mode,
+ bool speed ATTRIBUTE_UNUSED)
{
- return mips_address_insns (addr, SImode, false);
+ return mips_address_insns (addr, mode, false);
}
/* Information about a single instruction in a multi-instruction
===================================================================
@@ -212,7 +212,7 @@
static rtx mep_make_bundle (rtx, rtx);
static void mep_bundle_insns (rtx);
static bool mep_rtx_cost (rtx, int, int, int, int *, bool);
-static int mep_address_cost (rtx, bool);
+static int mep_address_cost (rtx, enum machine_mode, bool);
static void mep_setup_incoming_varargs (cumulative_args_t, enum machine_mode,
tree, int *, int);
static bool mep_pass_by_reference (cumulative_args_t cum, enum machine_mode,
@@ -7152,7 +7152,9 @@
}
static int
-mep_address_cost (rtx addr ATTRIBUTE_UNUSED, bool ATTRIBUTE_UNUSED speed_p)
+mep_address_cost (rtx addr ATTRIBUTE_UNUSED,
+ enum machine_mode mode ATTRIBUTE_UNUSED,
+ bool ATTRIBUTE_UNUSED speed_p)
{
return 1;
}
===================================================================
@@ -3130,7 +3130,7 @@
#define TARGET_RTX_COSTS v850_rtx_costs
#undef TARGET_ADDRESS_COST
-#define TARGET_ADDRESS_COST hook_int_rtx_bool_0
+#define TARGET_ADDRESS_COST hook_int_rtx_mode_bool_0
#undef TARGET_MACHINE_DEPENDENT_REORG
#define TARGET_MACHINE_DEPENDENT_REORG v850_reorg
===================================================================
@@ -191,7 +191,7 @@
#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS mcore_rtx_costs
#undef TARGET_ADDRESS_COST
-#define TARGET_ADDRESS_COST hook_int_rtx_bool_0
+#define TARGET_ADDRESS_COST hook_int_rtx_mode_bool_0
#undef TARGET_MACHINE_DEPENDENT_REORG
#define TARGET_MACHINE_DEPENDENT_REORG mcore_reorg
===================================================================
@@ -223,7 +223,7 @@
#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS mmix_rtx_costs
#undef TARGET_ADDRESS_COST
-#define TARGET_ADDRESS_COST hook_int_rtx_bool_0
+#define TARGET_ADDRESS_COST hook_int_rtx_mode_bool_0
#undef TARGET_REGISTER_MOVE_COST
#define TARGET_REGISTER_MOVE_COST mmix_register_move_cost
===================================================================
@@ -152,7 +152,7 @@
enum machine_mode, tree, int *,
int);
static bool iq2000_rtx_costs (rtx, int, int, int, int *, bool);
-static int iq2000_address_cost (rtx, bool);
+static int iq2000_address_cost (rtx, enum machine_mode, bool);
static section *iq2000_select_section (tree, int, unsigned HOST_WIDE_INT);
static rtx iq2000_legitimize_address (rtx, rtx, enum machine_mode);
static bool iq2000_pass_by_reference (cumulative_args_t, enum machine_mode,
@@ -779,7 +779,7 @@
/* Provide the costs of an addressing mode that contains ADDR. */
static int
-iq2000_address_cost (rtx addr, bool speed)
+iq2000_address_cost (rtx addr, enum machine_mode mode, bool speed)
{
switch (GET_CODE (addr))
{
@@ -830,7 +830,7 @@
case LABEL_REF:
case HIGH:
case LO_SUM:
- return iq2000_address_cost (plus1, speed) + 1;
+ return iq2000_address_cost (plus1, mode, speed) + 1;
default:
break;
===================================================================
@@ -39,7 +39,7 @@
extern bool score_unaligned_load (rtx* ops);
extern bool score_unaligned_store (rtx* ops);
extern bool score_block_move (rtx* ops);
-extern int score_address_cost (rtx addr, bool speed);
+extern int score_address_cost (rtx addr, enum machine_mode, bool speed);
extern int score_address_p (enum machine_mode mode, rtx x, int strict);
extern int score_reg_class (int regno);
extern int score_hard_regno_mode_ok (unsigned int, enum machine_mode);
===================================================================
@@ -1232,7 +1232,7 @@
/* Implement TARGET_ADDRESS_COST macro. */
int
-score_address_cost (rtx addr,
+score_address_cost (rtx addr, enum machine_mode mode ATTRIBUTE_UNUSED,
bool speed ATTRIBUTE_UNUSED)
{
return score_address_insns (addr, SImode);
===================================================================
@@ -1286,7 +1286,8 @@
/* Return cost of the memory address x. */
static int
-cr16_address_cost (rtx addr, bool speed ATTRIBUTE_UNUSED)
+cr16_address_cost (rtx addr, enum machine_mode mode ATTRIBUTE_UNUSED,
+ bool speed ATTRIBUTE_UNUSED)
{
enum cr16_addrtype addrtype;
struct cr16_address address;
===================================================================
@@ -1288,7 +1288,9 @@
All addressing modes are equally cheap on the Blackfin. */
static int
-bfin_address_cost (rtx addr ATTRIBUTE_UNUSED, bool speed ATTRIBUTE_UNUSED)
+bfin_address_cost (rtx addr ATTRIBUTE_UNUSED,
+ enum machine_mode mode ATTRIBUTE_UNUSED,
+ bool speed ATTRIBUTE_UNUSED)
{
return 1;
}
===================================================================
@@ -8886,7 +8886,8 @@
/* Implement `TARGET_ADDRESS_COST'. */
static int
-avr_address_cost (rtx x, bool speed ATTRIBUTE_UNUSED)
+avr_address_cost (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED,
+ bool speed ATTRIBUTE_UNUSED)
{
int cost = 4;