calls.c (load_register_parameters): Don't use LOAD_ARGS_REVERSED.
[gcc.git] / gcc / doc / tm.texi
index 1645319dff0f707b74785d368033129bed97b887..028e59dd9e943133ce657ae2a04a980aee4fcc58 100644 (file)
@@ -50,6 +50,7 @@ through the macros defined in the @file{.h} file.
 * Mode Switching::      Insertion of mode-switching instructions.
 * Target Attributes::   Defining target-specific uses of @code{__attribute__}.
 * MIPS Coprocessors::   MIPS coprocessor support and how to customize it.
+* PCH Target::          Validity checking for precompiled headers.
 * Misc::                Everything else.
 @end menu
 
@@ -320,15 +321,15 @@ default value of this macro, will expand to the value of
 @end defmac
 
 @defmac SYSROOT_SUFFIX_SPEC
-Define this macro to add a suffix to the target sysroot when GCC is 
-configured with a sysroot.  This will cause GCC to search for usr/lib, 
-et al, within sysroot+suffix. 
+Define this macro to add a suffix to the target sysroot when GCC is
+configured with a sysroot.  This will cause GCC to search for usr/lib,
+et al, within sysroot+suffix.
 @end defmac
 
 @defmac SYSROOT_HEADERS_SUFFIX_SPEC
-Define this macro to add a headers_suffix to the target sysroot when 
-GCC is configured with a sysroot.  This will cause GCC to pass the 
-updated sysroot+headers_suffix to CPP@, causing it to search for
+Define this macro to add a headers_suffix to the target sysroot when
+GCC is configured with a sysroot.  This will cause GCC to pass the
+updated sysroot+headers_suffix to CPP, causing it to search for
 usr/include, et al, within sysroot+headers_suffix.
 @end defmac
 
@@ -2696,11 +2697,11 @@ A C expression that defines the optional machine-dependent constraint
 letters, amongst those accepted by @code{EXTRA_CONSTRAINT}, that should
 be treated like memory constraints by the reload pass.
 
-It should return 1 if the operand type represented by the constraint 
+It should return 1 if the operand type represented by the constraint
 at the start of @var{str}, the first letter of which is the letter @var{c},
  comprises a subset of all memory references including
-all those whose address is simply a base register.  This allows the reload 
-pass to reload an operand, if it does not directly correspond to the operand 
+all those whose address is simply a base register.  This allows the reload
+pass to reload an operand, if it does not directly correspond to the operand
 type of @var{c}, by copying its address into a base register.
 
 For example, on the S/390, some instructions do not accept arbitrary
@@ -2720,15 +2721,15 @@ letters, amongst those accepted by @code{EXTRA_CONSTRAINT} /
 @code{EXTRA_CONSTRAINT_STR}, that should
 be treated like address constraints by the reload pass.
 
-It should return 1 if the operand type represented by the constraint 
+It should return 1 if the operand type represented by the constraint
 at the start of @var{str}, which starts with the letter @var{c}, comprises
 a subset of all memory addresses including
-all those that consist of just a base register.  This allows the reload 
-pass to reload an operand, if it does not directly correspond to the operand 
+all those that consist of just a base register.  This allows the reload
+pass to reload an operand, if it does not directly correspond to the operand
 type of @var{str}, by copying it into a base register.
 
 Any constraint marked as @code{EXTRA_ADDRESS_CONSTRAINT} can only
-be used with the @code{address_operand} predicate.  It is treated 
+be used with the @code{address_operand} predicate.  It is treated
 analogously to the @samp{p} constraint.
 @end defmac
 
@@ -2905,9 +2906,9 @@ If this RTL is a @code{REG}, you should also define
 @end defmac
 
 @defmac DWARF_ALT_FRAME_RETURN_COLUMN
-A C expression whose value is an integer giving a DWARF 2 column 
+A C expression whose value is an integer giving a DWARF 2 column
 number that may be used as an alternate return column.  This should
-be defined only if @code{DWARF_FRAME_RETURN_COLUMN} is set to a 
+be defined only if @code{DWARF_FRAME_RETURN_COLUMN} is set to a
 general register, but an alternate column needs to be used for
 signal frames.
 @end defmac
@@ -2970,10 +2971,10 @@ Typically this is a call-clobbered hard register that is otherwise
 untouched by the epilogue, but could also be a stack slot.
 
 Do not define this macro if the stack pointer is saved and restored
-by the regular prolog and epilog code in the call frame itself; in 
-this case, the exception handling library routines will update the 
-stack location to be restored in place.  Otherwise, you must define 
-this macro if you want to support call frame exception handling like 
+by the regular prolog and epilog code in the call frame itself; in
+this case, the exception handling library routines will update the
+stack location to be restored in place.  Otherwise, you must define
+this macro if you want to support call frame exception handling like
 that provided by DWARF 2.
 @end defmac
 
@@ -2986,8 +2987,8 @@ Typically this is the location in the call frame at which the normal
 return address is stored.  For targets that return by popping an
 address off the stack, this might be a memory address just below
 the @emph{target} call frame rather than inside the current call
-frame.  If defined, @code{EH_RETURN_STACKADJ_RTX} will have already 
-been assigned, so it may be used to calculate the location of the 
+frame.  If defined, @code{EH_RETURN_STACKADJ_RTX} will have already
+been assigned, so it may be used to calculate the location of the
 target call frame.
 
 Some targets have more complex requirements than storing to an
@@ -3051,6 +3052,19 @@ For proper signal handling in Java this macro is accompanied by
 @code{MAKE_THROW_FRAME}, defined in @file{libjava/include/*-signal.h} headers.
 @end defmac
 
+@defmac MD_HANDLE_UNWABI (@var{context}, @var{fs})
+This macro allows the target to add operating system specific code to the
+call-frame unwinder to handle the IA-64 @code{.unwabi} unwinding directive,
+usually used for signal or interrupt frames.
+
+This macro is called from @code{uw_update_context} in @file{unwind-ia64.c}.
+@var{context} is an @code{_Unwind_Context};
+@var{fs} is an @code{_Unwind_FrameState}.  Examine @code{fs->unwabi}
+for the abi and context in the @code{.unwabi} directive.  If the
+@code{.unwabi} directive can be handled, the register save addresses should
+be updated in @var{fs}.
+@end defmac
+
 @node Stack Checking
 @subsection Specifying How Stack Checking is Done
 
@@ -3265,7 +3279,7 @@ is different than the internal representation for unwind column.
 Given a dwarf register, this macro should return the internal unwind
 column number to use instead.
 
-See the PowerPC's SPE target for an example.  
+See the PowerPC's SPE target for an example.
 @end defmac
 
 @node Elimination
@@ -3797,13 +3811,6 @@ be passed in a pair of floating point registers, even though a complex
 float would fit in one 64-bit floating point register.
 @end defmac
 
-@defmac LOAD_ARGS_REVERSED
-If defined, the order in which arguments are loaded into their
-respective argument registers is reversed so that the last
-argument is loaded first.  This macro only affects arguments
-passed in registers.
-@end defmac
-
 @node Scalar Return
 @subsection How Scalar Function Values Are Returned
 @cindex return values in registers
@@ -3902,6 +3909,18 @@ need more space than is implied by @code{FUNCTION_VALUE_REGNO_P} for
 saving and restoring an arbitrary return value.
 @end defmac
 
+@deftypefn {Target Hook} bool TARGET_RETURN_IN_MSB (tree @var{type})
+This hook should return true if values of type @var{type} are returned
+at the most significant end of a register (in other words, if they are
+padded at the least significant end).  You can assume that @var{type}
+is returned in a register; the caller is required to check this.
+
+Note that the register provided by @code{FUNCTION_VALUE} must be able
+to hold the complete return value.  For example, if a 1-, 2- or 3-byte
+structure is returned at the most significant end of a 4-byte register,
+@code{FUNCTION_VALUE} should provide an @code{SImode} rtx.
+@end deftypefn
+
 @node Aggregate Return
 @subsection How Large Values Are Returned
 @cindex aggregates as return values
@@ -3984,14 +4003,6 @@ If you enable it, GCC can save registers around function calls.  This
 makes it possible to use call-clobbered registers to hold variables that
 must live across calls.
 
-@defmac DEFAULT_CALLER_SAVES
-Define this macro if function calls on the target machine do not preserve
-any registers; in other words, if @code{CALL_USED_REGISTERS} has 1
-for all registers.  When defined, this macro enables @option{-fcaller-saves}
-by default for all optimization levels.  It has no effect for optimization
-levels 2 and higher, where @option{-fcaller-saves} is the default.
-@end defmac
-
 @defmac CALLER_SAVE_PROFITABLE (@var{refs}, @var{calls})
 A C expression to determine whether it is worthwhile to consider placing
 a pseudo-register in a call-clobbered hard register and saving and
@@ -4170,7 +4181,8 @@ function.
 Define this macro as a C expression that is nonzero if the return
 instruction or the function epilogue ignores the value of the stack
 pointer; in other words, if it is safe to delete an instruction to
-adjust the stack pointer before a return from the function.
+adjust the stack pointer before a return from the function.  The
+default is 0.
 
 Note that this macro's value is relevant only for functions for which
 frame pointers are maintained.  It is never safe to delete a final
@@ -4666,7 +4678,7 @@ don't need to define this macro.
 @findex gofast_maybe_init_libfuncs
 @defmac US_SOFTWARE_GOFAST
 Define this macro if your system C library uses the US Software GOFAST
-library to provide floating point emulation.  
+library to provide floating point emulation.
 
 In addition to defining this macro, your architecture must set
 @code{TARGET_INIT_LIBFUNCS} to @code{gofast_maybe_init_libfuncs}, or
@@ -5052,31 +5064,6 @@ that looks at an attribute (@pxref{Insn Attributes}) named, for example,
 two places, the @file{md} file and in @code{NOTICE_UPDATE_CC}.
 @end defmac
 
-@defmac EXTRA_CC_MODES
-Condition codes are represented in registers by machine modes of class
-@code{MODE_CC}.  By default, there is just one mode, @code{CCmode}, with
-this class.  If you need more such modes, create a file named
-@file{@var{machine}-modes.def} in your @file{config/@var{machine}}
-directory (@pxref{Back End, , Anatomy of a Target Back End}), containing
-a list of these modes.  Each entry in the list should be a call to the
-macro @code{CC}.  This macro takes one argument, which is the name of
-the mode: it should begin with @samp{CC}.  Do not put quotation marks
-around the name, or include the trailing @samp{mode}; these are
-automatically added.  There should not be anything else in the file
-except comments.
-
-A sample @file{@var{machine}-modes.def} file might look like this:
-
-@smallexample
-CC (CC_NOOV)   /* @r{Comparison only valid if there was no overflow.} */
-CC (CCFP)      /* @r{Floating point comparison that cannot trap.} */
-CC (CCFPE)     /* @r{Floating point comparison that may trap.} */
-@end smallexample
-
-When you create this file, the macro @code{EXTRA_CC_MODES} is
-automatically defined by @command{configure}, with value @samp{1}.
-@end defmac
-
 @defmac SELECT_CC_MODE (@var{op}, @var{x}, @var{y})
 Returns a mode from class @code{MODE_CC} to be used when comparison
 operation code @var{op} is applied to rtx @var{x} and @var{y}.  For
@@ -5093,7 +5080,8 @@ definition)
       ? CC_NOOVmode : CCmode))
 @end smallexample
 
-You need not define this macro if @code{EXTRA_CC_MODES} is not defined.
+You should define this macro if and only if you define extra CC modes
+in @file{@var{machine}-modes.def}.
 @end defmac
 
 @defmac CANONICALIZE_COMPARISON (@var{code}, @var{op0}, @var{op1})
@@ -6510,7 +6498,7 @@ provided.
 A C statement (sans semicolon) to output to the stdio stream
 @var{stream} a directive telling the assembler to calculate the size of
 the symbol @var{name} by subtracting its address from the current
-address.  
+address.
 
 If you define @code{SIZE_ASM_OP}, a default definition of this macro is
 provided.  The default assumes that the assembler recognizes a special
@@ -7124,6 +7112,12 @@ This macro is effective only in a native compiler; @command{collect2} as
 part of a cross compiler always uses @command{nm} for the target machine.
 @end defmac
 
+@defmac COLLECT_PARSE_FLAG (@var{flag})
+Define this macro to be C code that examines @command{collect2} command
+line option @var{flag} and performs special actions if
+@command{collect2} needs to behave differently depending on @var{flag}.
+@end defmac
+
 @defmac REAL_NM_FILE_NAME
 Define this macro as a C string constant containing the file name to use
 to execute @command{nm}.  The default is to search the path normally for
@@ -7217,12 +7211,6 @@ writing conditional output routines in those patterns.
 If this macro is not defined, it is equivalent to a null statement.
 @end defmac
 
-@defmac FINAL_PRESCAN_LABEL
-If defined, @code{FINAL_PRESCAN_INSN} will be called on each
-@code{CODE_LABEL}.  In that case, @var{opvec} will be a null pointer and
-@var{noperands} will be zero.
-@end defmac
-
 @defmac PRINT_OPERAND (@var{stream}, @var{x}, @var{code})
 A C compound statement to output to stdio stream @var{stream} the
 assembler syntax for an instruction operand @var{x}.  @var{x} is an
@@ -8226,7 +8214,8 @@ return nonzero for any @var{entity} that needs mode-switching.
 If you define this macro, you also have to define
 @code{NUM_MODES_FOR_MODE_SWITCHING}, @code{MODE_NEEDED},
 @code{MODE_PRIORITY_TO_MODE} and @code{EMIT_MODE_SET}.
-@code{NORMAL_MODE} is optional.
+@code{MODE_AFTER}, @code{MODE_ENTRY}, and @code{MODE_EXIT}
+are optional.
 @end defmac
 
 @defmac NUM_MODES_FOR_MODE_SWITCHING
@@ -8250,10 +8239,24 @@ return an integer value not larger than the corresponding element in
 be switched into prior to the execution of @var{insn}.
 @end defmac
 
-@defmac NORMAL_MODE (@var{entity})
+@defmac MODE_AFTER (@var{mode}, @var{insn})
+If this macro is defined, it is evaluated for every @var{insn} during
+mode switching. It determines the mode that an insn results in (if
+different from the incoming mode).
+@end defmac
+
+@defmac MODE_ENTRY (@var{entity})
+If this macro is defined, it is evaluated for every @var{entity} that needs
+mode switching. It should evaluate to an integer, which is a mode that
+@var{entity} is assumed to be switched to at function entry. If @code{MODE_ENTRY}
+is defined then @code{MODE_EXIT} must be defined.
+@end defmac
+
+@defmac MODE_EXIT (@var{entity})
 If this macro is defined, it is evaluated for every @var{entity} that needs
-mode switching.  It should evaluate to an integer, which is a mode that
-@var{entity} is assumed to be switched to at function entry and exit.
+mode switching. It should evaluate to an integer, which is a mode that
+@var{entity} is assumed to be switched to at function exit. If @code{MODE_EXIT}
+is defined then @code{MODE_ENTRY} must be defined.
 @end defmac
 
 @defmac MODE_PRIORITY_TO_MODE (@var{entity}, @var{n})
@@ -8390,6 +8393,30 @@ alternate names of coprocessor registers.  The format of each entry should be
 Default: empty.
 @end defmac
 
+@node PCH Target
+@section Parameters for Precompiled Header Validity Checking
+@cindex parameters, precompiled headers
+
+@deftypefn {Target Hook} void * TARGET_GET_PCH_VALIDITY (size_t * @var{sz})
+Define this hook if your target needs to check a different collection
+of flags than the default, which is every flag defined by
+@code{TARGET_SWITCHES} and @code{TARGET_OPTIONS}.  It should return
+some data which will be saved in the PCH file and presented to
+@code{TARGET_PCH_VALID_P} later; it should set @code{SZ} to the size
+of the data.
+@end deftypefn
+
+@deftypefn {Target Hook} const char * TARGET_PCH_VALID_P (const void * @var{data}, size_t @var{sz})
+Define this hook if your target needs to check a different collection of
+flags than the default, which is every flag defined by @code{TARGET_SWITCHES}
+and @code{TARGET_OPTIONS}.  It is given data which came from
+@code{TARGET_GET_PCH_VALIDITY} (in this version of this compiler, so there
+is no need for extensive validity checking).  It returns @code{NULL} if
+it is safe to load a PCH file with this data, or a suitable error message
+if not.  The error message will be presented to the user, so it should
+be localised.
+@end deftypefn
+
 @node Misc
 @section Miscellaneous Parameters
 @cindex parameters, miscellaneous
@@ -9152,7 +9179,7 @@ to reserve space for caller-saved target registers.
 @end deftypefn
 
 @defmac POWI_MAX_MULTS
-If defined, this macro is interpreted as a signed integer C expression 
+If defined, this macro is interpreted as a signed integer C expression
 that specifies the maximum number of floating point multiplications
 that should be emitted when expanding exponentiation by an integer
 constant inline.  When this value is defined, exponentiation requiring
@@ -9160,4 +9187,3 @@ more than this number of multiplications is implemented by calling the
 system library's @code{pow}, @code{powf} or @code{powl} routines.
 The default value places no upper bound on the multiplication count.
 @end defmac
-