diff options
author | Steven Bosscher <steven@gcc.gnu.org> | 2010-05-03 17:47:47 +0000 |
---|---|---|
committer | Steven Bosscher <steven@gcc.gnu.org> | 2010-05-03 17:47:47 +0000 |
commit | 42db504c2fb2b460e24ca0e73b8559fc33b3cf33 (patch) | |
tree | d6b919e11206907a280cef642b29741b31e6e929 /gcc/config/sh | |
parent | d5ece0a1f59fd71e156bc58c8423eb7ea8d16480 (diff) | |
download | gcc-42db504c2fb2b460e24ca0e73b8559fc33b3cf33.zip gcc-42db504c2fb2b460e24ca0e73b8559fc33b3cf33.tar.gz gcc-42db504c2fb2b460e24ca0e73b8559fc33b3cf33.tar.bz2 |
tm.texi (defmac SMALL_REGISTER_CLASSES): Remove.
* doc/tm.texi (defmac SMALL_REGISTER_CLASSES): Remove.
(TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P): Add documentation,
based on the above, for new target hook.
* hooks.c (hook_bool_mode_true): New generic hook.
* hooks.h (hook_bool_mode_true): Add prototype.
* target.h (struct gcc_target): Add small_register_classes_for_mode_p
target hook.
* target-def.h (TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P): New default
target hook, set to hook_bool_mode_false.
* regs.h: Remove default definition of SMALL_REGISTER_CLASSES.
* reload.c (push_secondary_reload): Replace SMALL_REGISTER_CLASSES
with targetm.small_register_classes_for_mode_p.
(find_reusable_reload): Likewise.
(combine_reloads): Likewise.
* reload1.c (reload_as_needed): Likewise.
* cse.c (approx_reg_cost_1, hash_rtx_cb): Likewise.
* ifcvt.c (noce_process_if_block, check_cond_move_block,
dead_or_predicable): Likewise.
* regmove.c (optimize_reg_copy_1): Likewise.
* calls.c (prepare_call_address): Likewise.
(precompute_register_parameters): Likewise.
* config/sh/sh.h: Replace SMALL_REGISTER_CLASSES with new target
hook definition.
* config/sh/sh.c (sh_small_register_classes_for_mode_p): Add
implementation of the hook that considers all register classes
small except for SH64.
(sh_override_options): Use the new hook.
* config/sh/sh-protos.h (sh_small_register_classes_for_mode_p):
Add prototype.
* config/arm/arm.h: Replace SMALL_REGISTER_CLASSES with new target
hook definition.
* config/arm/arm.c (arm_small_register_classes_for_mode_p): Add
implementation of the hook that considers all register classes
small for THUMB1.
* config/arm/arm-protos.h (arm_small_register_classes_for_mode_p):
Add prototype.
* config/mips/mips.h: Replace SMALL_REGISTER_CLASSES with new target
hook definition.
* config/mips/mips.c (mips_small_register_classes_for_mode_p): Add
implementation of the hook that considers all register classes
small for MIPS16.
* config/mips/mips-protos.h (mips_small_register_classes_for_mode_p):
Add prototype.
* config/i386/i386.h: Replace SMALL_REGISTER_CLASSES with new target
hook definition.
* config/m32c/m32c.h: Likewise.
* config/pdp11/pdp11.h: Likewise.
* config/avr/avr.h: Likewise.
* config/xtensa/xtensa.h: Likewise.
* config/m68hc11/m68hc11.h: Likewise.
* config/mn10300/mn10300.h: Likewise.
* config/mcore/mcore.h: Likewise.
* config/h8300/h8300.h: Likewise.
* config/bfin/bfin.h: Likewise.
* config/iq2000/iq2000.h: Remove SMALL_REGISTER_CLASSES definition.
* config/rx/rx.h: Remove SMALL_REGISTER_CLASSES definition.
From-SVN: r158997
Diffstat (limited to 'gcc/config/sh')
-rw-r--r-- | gcc/config/sh/sh-protos.h | 1 | ||||
-rw-r--r-- | gcc/config/sh/sh.c | 12 | ||||
-rw-r--r-- | gcc/config/sh/sh.h | 11 |
3 files changed, 17 insertions, 7 deletions
diff --git a/gcc/config/sh/sh-protos.h b/gcc/config/sh/sh-protos.h index fdef756..d59cf6a 100644 --- a/gcc/config/sh/sh-protos.h +++ b/gcc/config/sh/sh-protos.h @@ -145,6 +145,7 @@ extern int sh_attr_renesas_p (const_tree); extern int sh_cfun_attr_renesas_p (void); extern bool sh_cannot_change_mode_class (enum machine_mode, enum machine_mode, enum reg_class); +extern bool sh_small_register_classes_for_mode_p (enum machine_mode); extern void sh_mark_label (rtx, int); extern int sh_register_move_cost (enum machine_mode mode, enum reg_class, enum reg_class); diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index a3084b9..c3293fe 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -865,7 +865,7 @@ sh_override_options (void) || (TARGET_SHMEDIA && !TARGET_PT_FIXED)) flag_no_function_cse = 1; - if (SMALL_REGISTER_CLASSES) + if (targetm.small_register_classes_for_mode_p (VOIDmode)) \ { /* Never run scheduling before reload, since that can break global alloc, and generates slower code anyway due @@ -9311,7 +9311,7 @@ get_free_reg (HARD_REG_SET regs_live) if (! TEST_HARD_REG_BIT (regs_live, 1)) return gen_rtx_REG (Pmode, 1); - /* Hard reg 1 is live; since this is a SMALL_REGISTER_CLASSES target, + /* Hard reg 1 is live; since this is a small register classes target, there shouldn't be anything but a jump before the function end. */ gcc_assert (!TEST_HARD_REG_BIT (regs_live, 7)); return gen_rtx_REG (Pmode, 7); @@ -11252,6 +11252,14 @@ sh_cannot_change_mode_class (enum machine_mode from, enum machine_mode to, return 0; } +/* Return true if registers in machine mode MODE will likely be + allocated to registers in small register classes. */ + +static bool +sh_small_register_classes_for_mode_p (enum machine_mode mode ATTRIBUTE_UNUSED) +{ + return (! TARGET_SHMEDIA); +} /* If ADDRESS refers to a CODE_LABEL, add NUSES to the number of times that label is used. */ diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h index f870ba6..4eb8f39 100644 --- a/gcc/config/sh/sh.h +++ b/gcc/config/sh/sh.h @@ -1209,11 +1209,12 @@ extern enum reg_class regno_reg_class[FIRST_PSEUDO_REGISTER]; FPUL_REGS, LIM_REG_CLASSES \ } -/* When defined, the compiler allows registers explicitly used in the - rtl to be used as spill registers but prevents the compiler from - extending the lifetime of these registers. */ - -#define SMALL_REGISTER_CLASSES (! TARGET_SHMEDIA) +/* When this hook returns true for MODE, the compiler allows + registers explicitly used in the rtl to be used as spill registers + but prevents the compiler from extending the lifetime of these + registers. */ +#define TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P \ + sh_small_register_classes_for_mode_p /* The order in which register should be allocated. */ /* Sometimes FP0_REGS becomes the preferred class of a floating point pseudo, |