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/doc | |
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/doc')
-rw-r--r-- | gcc/doc/tm.texi | 51 |
1 files changed, 32 insertions, 19 deletions
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index a20d48c..3a36314 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -2868,25 +2868,6 @@ Do not define this macro if you do not define is @code{BITS_PER_WORD} bits wide is correct for your machine. @end defmac -@defmac SMALL_REGISTER_CLASSES -On some machines, it is risky to let hard registers live across arbitrary -insns. Typically, these machines have instructions that require values -to be in specific registers (like an accumulator), and reload will fail -if the required hard register is used for another purpose across such an -insn. - -Define @code{SMALL_REGISTER_CLASSES} to be an expression with a nonzero -value on these machines. When this macro has a nonzero value, the -compiler will try to minimize the lifetime of hard registers. - -It is always safe to define this macro with a nonzero value, but if you -unnecessarily define it, you will reduce the amount of optimizations -that can be performed in some cases. If you do not define this macro -with a nonzero value when it is required, the compiler will run out of -spill registers and print a fatal error message. For most machines, you -should not define this macro at all. -@end defmac - @defmac CLASS_LIKELY_SPILLED_P (@var{class}) A C expression whose value is nonzero if pseudos that have been assigned to registers of class @var{class} would likely be spilled because @@ -4360,6 +4341,38 @@ insns involving vector mode @var{mode}. At the very least, it must have move patterns for this mode. @end deftypefn +@deftypefn {Target Hook} bool TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P (enum machine_mode @var{mode}) +Define this to return nonzero for machine modes for which the port has +small register classes. If this target hook returns nonzero for a given +@var{mode}, the compiler will try to minimize the lifetime of registers +in @var{mode}. The hook may be called with @code{VOIDmode} as argument. +In this case, the hook is expected to return nonzero if it returns nonzero +for any mode. + +On some machines, it is risky to let hard registers live across arbitrary +insns. Typically, these machines have instructions that require values +to be in specific registers (like an accumulator), and reload will fail +if the required hard register is used for another purpose across such an +insn. + +Passes before reload do not know which hard registers will be used +in an instruction, but the machine modes of the registers set or used in +the instruction are already known. And for some machines, register +classes are small for, say, integer registers but not for floating point +registers. For example, the AMD x86-64 architecture requires specific +registers for the legacy x86 integer instructions, but there are many +SSE registers for floating point operations. On such targets, a good +strategy may be to return nonzero from this hook for @code{INTEGRAL_MODE_P} +machine modes but zero for the SSE register classes. + +The default version of this hook retuns false for any mode. It is always +safe to redefine this hook to return with a nonzero value. But if you +unnecessarily define it, you will reduce the amount of optimizations +that can be performed in some cases. If you do not define this hook +to return a nonzero value when it is required, the compiler will run out +of spill registers and print a fatal error message. +@end deftypefn + @node Scalar Return @subsection How Scalar Function Values Are Returned @cindex return values in registers |