aboutsummaryrefslogtreecommitdiff
path: root/gcc/tm.texi
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tm.texi')
-rw-r--r--gcc/tm.texi45
1 files changed, 45 insertions, 0 deletions
diff --git a/gcc/tm.texi b/gcc/tm.texi
index ad57838..9a8887f 100644
--- a/gcc/tm.texi
+++ b/gcc/tm.texi
@@ -4223,6 +4223,51 @@ address. The compiler has standard ways of doing so in all cases. In
fact, it is safe for this macro to do nothing. But often a
machine-dependent strategy can generate better code.
+@findex LEGITIMIZE_RELOAD_ADDRESS
+@item LEGITIMIZE_RELOAD_ADDRESS (@var{x}, @var{mode}, @var{opnum}, @var{type}, @var{ind_levels}, @var{win})
+A C compound statement that attempts to replace @var{x}, which is an address
+that needs reloading, with a valid memory address for an operand of mode
+@var{mode}. @var{win} will be a C statement label elsewhere in the code.
+It is not necessary to define this macro, but it might be useful for
+performance reasons.
+
+For example, on the i386, it is sometimes possible to use a single
+reload register instead of two by reloading a sum of two pseudo
+registers into a register. On the other hand, for number of RISC
+processors offsets are limited so that often an intermediate address
+needs to be generated in order to address a stack slot. By defining
+LEGITIMIZE_RELOAD_ADDRESS appropriately, the intermediate addresses
+generated for adjacent some stack slots can be made identical, and thus
+be shared.
+
+@findex strict_memory_address_p
+The macro definition may use @code{strict_memory_address_p} to test if
+the address has become legitimate.
+
+@findex push_reload
+It may use @code{push_reload} to indicate parts that need reloading.
+@var{opnum}, @var{type} and @var{ind_levels} are usually suitable to be
+passed unaltered to push_reload.
+
+The code generated by this macro should not alter the substructure of
+@var{x}. If it transforms @var{x} into a more legitimate form, it
+should assign @var{x} (which will always be a C variable) a new value.
+This also applies to parts that you change indirectly by calling
+@code{push_reload}.
+
+@findex copy_rtx
+If you want to change only a part of @var{x}, one standard way of doing
+this is to use @code{copy_rtx}. Note, however, that is unshares only a
+single level of rtl. Thus, if the part to be changed is not at the
+top level, you'll need to replace first the top leve
+It is not necessary for this macro to come up with a legitimate
+address; but often a machine-dependent strategy can generate better code.
+
+@emph{Note}: This macro should be used with caution. It is necessary
+to know something of how reload works in order to effectively use this,
+and it is quite easy to produce macros that build in too much knowledge
+of reload internals.
+
@findex GO_IF_MODE_DEPENDENT_ADDRESS
@item GO_IF_MODE_DEPENDENT_ADDRESS (@var{addr}, @var{label})
A C statement or compound statement with a conditional @code{goto