aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc/tm.texi
diff options
context:
space:
mode:
authorAnatoly Sokolov <aesok@post.ru>2010-06-27 15:40:42 +0400
committerAnatoly Sokolov <aesok@gcc.gnu.org>2010-06-27 15:40:42 +0400
commitde8f4b07c03ffb0db0562f462be066684af2f0b7 (patch)
tree851a7e8964d45a63937f1e17d192d74a42b4e143 /gcc/doc/tm.texi
parent533e50f6ac9ee21fe5bcb223e8d6693466836d80 (diff)
downloadgcc-de8f4b07c03ffb0db0562f462be066684af2f0b7.zip
gcc-de8f4b07c03ffb0db0562f462be066684af2f0b7.tar.gz
gcc-de8f4b07c03ffb0db0562f462be066684af2f0b7.tar.bz2
target.h (struct gcc_target): Add register_move_cost field.
* target.h (struct gcc_target): Add register_move_cost field. * target-def.h (TARGET_REGISTER_MOVE_COST): New. (TARGET_INITIALIZER): Use TARGET_REGISTER_MOVE_COST. * targhooks.c (default_register_move_cost): New function. * targhooks.h (default_register_move_cost): Declare function. * defaults.h (REGISTER_MOVE_COST): Delete. * ira-int.h (ira_register_move_cost): Update comment. * ira.c: (ira_register_move_cost): Update comment. * reload.h (register_move_cost): Declare. * reginfo.c (register_move_cost): New function. (move_cost): Update comment. (init_move_cost, memory_move_secondary_cost): Replace REGISTER_MOVE_COST with register_move_cost. * postreload.c (reload_cse_simplify_set): (Ditto.). * reload.c (find_valid_class, find_reloads): (Ditto.). * reload1.c (choose_reload_regs): (Ditto.). * doc/tm.texi (TARGET_REGISTER_MOVE_COST): New. (REGISTER_MOVE_COST, TARGET_MEMORY_MOVE_COST): Update documentation. * doc/md.texi (can_create_pseudo_p): Update documentation. * config/i386/i386.h (MEMORY_MOVE_COST): Remove macro. * config/i386/i386-protos.h (int ix86_memory_move_cost): Remove. * config/i386/i386.h (ix86_memory_move_cost): Make static. (TARGET_MEMORY_MOVE_COST): Define. * config/ia64/ia64.h (MEMORY_MOVE_COST): Remove macro. * config/ia64/ia64-protos.h (int ia64_memory_move_cost): Remove. * config/ia64/ia64.h (ia64_memory_move_cost): Make static. (TARGET_MEMORY_MOVE_COST): Define. From-SVN: r161470
Diffstat (limited to 'gcc/doc/tm.texi')
-rw-r--r--gcc/doc/tm.texi30
1 files changed, 27 insertions, 3 deletions
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index c001c8b..637dd50 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -6116,8 +6116,32 @@ classes returns a value of 2, reload does not check to ensure that the
constraints of the insn are met. Setting a cost of other than 2 will
allow reload to verify that the constraints are met. You should do this
if the @samp{mov@var{m}} pattern's constraints do not allow such copying.
+
+These macros are obsolete, new ports should use the target hook
+@code{TARGET_REGISTER_MOVE_COST} instead.
@end defmac
+@deftypefn {Target Hook} int TARGET_REGISTER_MOVE_COST (enum machine_mode @var{mode}, enum reg_class @var{from}, enum reg_class @var{to})
+This target hook should return the cost of moving data of mode @var{mode}
+from a register in class @var{from} to one in class @var{to}. The classes
+are expressed using the enumeration values such as @code{GENERAL_REGS}.
+A value of 2 is the default; other values are interpreted relative to
+that.
+
+It is not required that the cost always equal 2 when @var{from} is the
+same as @var{to}; on some machines it is expensive to move between
+registers if they are not general registers.
+
+If reload sees an insn consisting of a single @code{set} between two
+hard registers, and if @code{TARGET_REGISTER_MOVE_COST} applied to their
+classes returns a value of 2, reload does not check to ensure that the
+constraints of the insn are met. Setting a cost of other than 2 will
+allow reload to verify that the constraints are met. You should do this
+if the @samp{mov@var{m}} pattern's constraints do not allow such copying.
+
+The default version of this function returns 2.
+@end deftypefn
+
@defmac MEMORY_MOVE_COST (@var{mode}, @var{class}, @var{in})
A C expression for the cost of moving data of mode @var{mode} between a
register of class @var{class} and memory; @var{in} is zero if the value
@@ -6149,9 +6173,9 @@ These macros are obsolete, new ports should use the target hook
This target hook should return the cost of moving data of mode @var{mode}
between a register of class @var{class} and memory; @var{in} is @code{false}
if the value is to be written to memory, @code{true} if it is to be read in.
-This cost is relative to those in @code{REGISTER_MOVE_COST}. If moving
-between registers and memory is more expensive than between two registers,
-you should add this target hook to express the relative cost.
+This cost is relative to those in @code{TARGET_REGISTER_MOVE_COST}.
+If moving between registers and memory is more expensive than between two
+registers, you should add this target hook to express the relative cost.
If you do not add this target hook, GCC uses a default cost of 4 plus
the cost of copying via a secondary reload register, if one is