passes the string @option{-lgcc} to the linker.
@end defmac
+@defmac REAL_LIBGCC_SPEC
+By default, if @code{ENABLE_SHARED_LIBGCC} is defined, the
+@code{LIBGCC_SPEC} is not directly used by the driver program but is
+instead modified to refer to different versions of @file{libgcc.a}
+depending on the values of the command line flags @code{-static},
+@code{-shared}, @code{-static-libgcc}, and @code{-shared-libgcc}. On
+targets where these modifications are inappropriate, define
+@code{REAL_LIBGCC_SPEC} instead. @code{REAL_LIBGCC_SPEC} tells the
+driver how to place a reference to @file{libgcc} on the link command
+line, but, unlike @code{LIBGCC_SPEC}, it is used unmodified.
+@end defmac
+
@defmac STARTFILE_SPEC
Another C string constant used much like @code{LINK_SPEC}. The
difference between the two is that @code{STARTFILE_SPEC} is used at
value of @code{LONG_TYPE_SIZE}.
@end defmac
-@defmac MAX_LONG_TYPE_SIZE
-Maximum number for the size in bits of the type @code{long} on the
-target machine. If this is undefined, the default is
-@code{LONG_TYPE_SIZE}. Otherwise, it is the constant value that is the
-largest value that @code{LONG_TYPE_SIZE} can have at run-time. This is
-used in @code{cpp}.
-@end defmac
-
@defmac LONG_LONG_TYPE_SIZE
A C expression for the size in bits of the type @code{long long} on the
target machine. If you don't define this, the default is two
words.
@end defmac
-@defmac MAX_LONG_DOUBLE_TYPE_SIZE
-Maximum number for the size in bits of the type @code{long double} on the
-target machine. If this is undefined, the default is
-@code{LONG_DOUBLE_TYPE_SIZE}. Otherwise, it is the constant value that is
-the largest value that @code{LONG_DOUBLE_TYPE_SIZE} can have at run-time.
-This is used in @code{cpp}.
-@end defmac
-
@defmac TARGET_FLT_EVAL_METHOD
A C expression for the value for @code{FLT_EVAL_METHOD} in @file{float.h},
assuming, if applicable, that the floating-point control word is in its
and @option{-funsigned-char}.
@end defmac
-@defmac DEFAULT_SHORT_ENUMS
-A C expression to determine whether to give an @code{enum} type
-only as many bytes as it takes to represent the range of possible values
-of that type. A nonzero value means to do that; a zero value means all
+@deftypefn {Target Hook} bool TARGET_DEFAULT_SHORT_ENUMS (void)
+This target hook should return true if the compiler should give an
+@code{enum} type only as many bytes as it takes to represent the range
+of possible values of that type. It should return false if all
@code{enum} types should be allocated like @code{int}.
-If you don't define the macro, the default is 0.
-@end defmac
+The default is to return false.
+@end deftypefn
@defmac SIZE_TYPE
A C expression for a string describing the name of the data type to use
@code{WCHAR_TYPE}.
@end defmac
-@defmac MAX_WCHAR_TYPE_SIZE
-Maximum number for the size in bits of the data type for wide
-characters. If this is undefined, the default is
-@code{WCHAR_TYPE_SIZE}. Otherwise, it is the constant value that is the
-largest value that @code{WCHAR_TYPE_SIZE} can have at run-time. This is
-used in @code{cpp}.
-@end defmac
-
-@defmac GCOV_TYPE_SIZE
-A C expression for the size in bits of the type used for gcov counters on the
-target machine. If you don't define this, the default is one
-@code{LONG_TYPE_SIZE} in case it is greater or equal to 64-bit and
-@code{LONG_LONG_TYPE_SIZE} otherwise. You may want to re-define the type to
-ensure atomicity for counters in multithreaded programs.
-@end defmac
-
@defmac WINT_TYPE
A C expression for a string describing the name of the data type to
use for wide characters passed to @code{printf} and returned from
define this macro.
@end defmac
-@defmac BUILTIN_SETJMP_FRAME_VALUE
-If defined, a C expression that contains an rtx that is used to store
+@deftypefn {Target Hook} bool TARGET_BUILTIN_SETJMP_FRAME_VALUE ()
+This target hook should return an rtx that is used to store
the address of the current frame into the built in @code{setjmp} buffer.
The default value, @code{virtual_stack_vars_rtx}, is correct for most
-machines. One reason you may need to define this macro is if
+machines. One reason you may need to define this target hook is if
@code{hard_frame_pointer_rtx} is the appropriate value on your machine.
-@end defmac
+@end deftypefn
@defmac RETURN_ADDR_RTX (@var{count}, @var{frameaddr})
A C expression whose value is RTL representing the value of the return
See the PowerPC's SPE target for an example.
@end defmac
+@defmac DWARF_FRAME_REGNUM (@var{regno})
+
+Define this macro if the target's representation for dwarf registers
+used in .eh_frame or .debug_frame is different from that used in other
+debug info sections. Given a gcc hard register number, this macro
+should return the .eh_frame register number. The default is
+@code{DBX_REGISTER_NUMBER (@var{regno})}.
+
+@end defmac
+
+@defmac DWARF2_FRAME_REG_OUT (@var{regno}, @var{for_eh})
+
+Define this macro to map register numbers held in the call frame info
+that gcc has collected using @code{DWARF_FRAME_REGNUM} to those that
+should be output in .debug_frame (@code{@var{for_eh}} is zero) and
+.eh_frame (@code{@var{for_eh}} is nonzero). The default is to
+return @code{@var{regno}}.
+
+@end defmac
+
@node Elimination
@subsection Eliminating Frame Pointer and Arg Pointer
@c above is overfull. not sure what to do. --mew 5feb93 did
@c something, not sure if it looks good. --mew 10feb93
-@defmac MAYBE_REG_PARM_STACK_SPACE
-@defmacx FINAL_REG_PARM_STACK_SPACE (@var{const_size}, @var{var_size})
-Define these macros in addition to the one above if functions might
-allocate stack space for arguments even when their values are passed
-in registers. These should be used when the stack space allocated
-for arguments in registers is not a simple constant independent of the
-function declaration.
-
-The value of the first macro is the size, in bytes, of the area that
-we should initially assume would be reserved for arguments passed in registers.
-
-The value of the second macro is the actual size, in bytes, of the area
-that will be reserved for arguments passed in registers. This takes two
-arguments: an integer representing the number of bytes of fixed sized
-arguments on the stack, and a tree representing the number of bytes of
-variable sized arguments on the stack.
-
-When these macros are defined, @code{REG_PARM_STACK_SPACE} will only be
-called for libcall functions, the current function, or for a function
-being called when it is known that such stack space must be allocated.
-In each case this value can be easily computed.
-
-When deciding whether a called function needs such stack space, and how
-much space to reserve, GCC uses these two macros instead of
-@code{REG_PARM_STACK_SPACE}.
-@end defmac
-
@defmac OUTGOING_REG_PARM_STACK_SPACE
Define this if it is the responsibility of the caller to allocate the area
reserved for arguments passed in registers.
should not be empty, so use @code{int}.
@end defmac
-@defmac INIT_CUMULATIVE_ARGS (@var{cum}, @var{fntype}, @var{libname}, @var{fndecl})
+@defmac INIT_CUMULATIVE_ARGS (@var{cum}, @var{fntype}, @var{libname}, @var{fndecl}, @var{n_named_args})
A C statement (sans semicolon) for initializing the variable
@var{cum} for the state at the beginning of the argument list. The
variable has type @code{CUMULATIVE_ARGS}. The value of @var{fntype}
For direct calls that are not libcalls, @var{fndecl} contain the
declaration node of the function. @var{fndecl} is also set when
@code{INIT_CUMULATIVE_ARGS} is used to find arguments for the function
-being compiled.
+being compiled. @var{n_named_args} is set to the number of named
+arguments, including a structure return address if it is passed as a
+parameter, when making a call. When processing incoming arguments,
+@var{n_named_args} is set to -1.
When processing a call to a compiler support library function,
@var{libname} identifies which one. It is a @code{symbol_ref} rtx which
@code{FUNCTION_VALUE} is not used for return vales with aggregate data
types, because these are returned in another way. See
-@code{STRUCT_VALUE_REGNUM} and related macros, below.
+@code{TARGET_STRUCT_VALUE_RTX} and related macros, below.
@end defmac
@defmac FUNCTION_OUTGOING_VALUE (@var{valtype}, @var{func})
@code{FUNCTION_OUTGOING_VALUE} is not used for return vales with
aggregate data types, because these are returned in another way. See
-@code{STRUCT_VALUE_REGNUM} and related macros, below.
+@code{TARGET_STRUCT_VALUE_RTX} and related macros, below.
@end defmac
@defmac LIBCALL_VALUE (@var{mode})
This target hook should return the location of the structure value
address (normally a @code{mem} or @code{reg}), or 0 if the address is
passed as an ``invisible'' first argument. Note that @var{fndecl} may
-be @code{NULL}, for libcalls.
+be @code{NULL}, for libcalls. You do not need to define this target
+hook if the address is always passed as an ``invisible'' first
+argument.
On some architectures the place where the structure value address
is found by the called function is not the same place that the
Use this built-in function to save the argument registers in memory so
that the varargs mechanism can access them. Both ISO and traditional
versions of @code{va_start} must use @code{__builtin_saveregs}, unless
-you use @code{SETUP_INCOMING_VARARGS} (see below) instead.
+you use @code{TARGET_SETUP_INCOMING_VARARGS} (see below) instead.
On some machines, @code{__builtin_saveregs} is open-coded under the
-control of the macro @code{EXPAND_BUILTIN_SAVEREGS}. On other machines,
-it calls a routine written in assembler language, found in
-@file{libgcc2.c}.
+control of the target hook @code{TARGET_EXPAND_BUILTIN_SAVEREGS}. On
+other machines, it calls a routine written in assembler language,
+found in @file{libgcc2.c}.
Code generated for the call to @code{__builtin_saveregs} appears at the
beginning of the function, as opposed to where the call to
@code{TARGET_SETUP_INCOMING_VARARGS}, but the other works like neither
@code{TARGET_SETUP_INCOMING_VARARGS} nor @code{TARGET_STRICT_ARGUMENT_NAMING} was
defined, then define this hook to return @code{true} if
-@code{SETUP_INCOMING_VARARGS} is used, @code{false} otherwise.
+@code{TARGET_SETUP_INCOMING_VARARGS} is used, @code{false} otherwise.
Otherwise, you should not define this hook.
@end deftypefn
The default is to do nothing. Most ports don't need to define this hook.
@end deftypefn
-@defmac TARGET_FLOAT_LIB_COMPARE_RETURNS_BOOL (@var{mode}, @var{comparison})
+@defmac FLOAT_LIB_COMPARE_RETURNS_BOOL (@var{mode}, @var{comparison})
This macro should return @code{true} if the library routine that
implements the floating point comparison operator @var{comparison} in
mode @var{mode} will return a boolean, and @var{false} if it will
@end smallexample
@end defmac
+@deftypefn {Target Hook} bool TARGET_FIXED_CONDITION_CODE_REGS (unsigned int *, unsigned int *)
+On targets which do not use @code{(cc0)}, and which use a hard
+register rather than a pseudo-register to hold condition codes, the
+regular CSE passes are often not able to identify cases in which the
+hard register is set to a common value. Use this hook to enable a
+small pass which optimizes such cases. This hook should return true
+to enable this pass, and it should set the integers to which its
+arguments point to the hard register numbers used for condition codes.
+When there is only one such register, as is true on most systems, the
+integer pointed to by the second argument should be set to
+@code{INVALID_REGNUM}.
+
+The default version of this hook returns false.
+@end deftypefn
+
+@deftypefn {Target Hook} enum machine_mode TARGET_CC_MODES_COMPATIBLE (enum machine_mode, enum machine_mode)
+On targets which use multiple condition code modes in class
+@code{MODE_CC}, it is sometimes the case that a comparison can be
+validly done in more than one mode. On such a system, define this
+target hook to take two mode arguments and to return a mode in which
+both comparisons may be validly done. If there is no such mode,
+return @code{VOIDmode}.
+
+The default version of this hook checks whether the modes are the
+same. If they are, it returns that mode. If they are different, it
+returns @code{VOIDmode}.
+@end deftypefn
+
@node Costs
@section Describing Relative Costs of Operations
@cindex costs of instructions
@option{-fsched-verbose-@var{n}}.
@end deftypefn
+@deftypefn {Target Hook} void TARGET_SCHED_INIT_GLOBAL (FILE *@var{file}, int @var{verbose}, int @var{old_max_uid})
+This hook is executed by the scheduler after function level initializations.
+@var{file} is either a null pointer, or a stdio stream to write any debug output to.
+@var{verbose} is the verbose level provided by @option{-fsched-verbose-@var{n}}.
+@var{old_max_uid} is the maximum insn uid when scheduling begins.
+@end deftypefn
+
+@deftypefn {Target Hook} void TARGET_SCHED_FINISH_GLOBAL (FILE *@var{file}, int @var{verbose})
+This is the cleanup hook corresponding to TARGET_SCHED_INIT_GLOBAL.
+@var{file} is either a null pointer, or a stdio stream to write any debug output to.
+@var{verbose} is the verbose level provided by @option{-fsched-verbose-@var{n}}.
+@end deftypefn
+
@deftypefn {Target Hook} int TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE (void)
This hook is called many times during insn scheduling. If the hook
returns nonzero, the automaton based pipeline description is used for
insns with indexes greater than given index.
@end deftypefn
-@deftypefn {Target Hook} bool IS_COSTLY_DEPENDENCE (rtx @var{insn1}, rtx @var{insn2}, rtx @var{dep_link}, int @var{dep_cost}, int @var{distance})
+@deftypefn {Target Hook} bool TARGET_SCHED_IS_COSTLY_DEPENDENCE (rtx @var{insn1}, rtx @var{insn2}, rtx @var{dep_link}, int @var{dep_cost}, int @var{distance})
This hook is used to define which dependences are considered costly by
-the target, so costly that it is not advisable to schedule the insns that
+the target, so costly that it is not advisable to schedule the insns that
are involved in the dependence too close to one another. The parameters
-to this hook are as follows: The second parameter @var{insn2} is dependent
-upon the first parameter @var{insn1}. The dependence between @var{insn1}
-and @var{insn2} is represented by the third parameter @var{dep_link}. The
-fourth parameter @var{cost} is the cost of the dependence, and the fifth
-parameter @var{distance} is the distance in cycles between the two insns.
+to this hook are as follows: The second parameter @var{insn2} is dependent
+upon the first parameter @var{insn1}. The dependence between @var{insn1}
+and @var{insn2} is represented by the third parameter @var{dep_link}. The
+fourth parameter @var{cost} is the cost of the dependence, and the fifth
+parameter @var{distance} is the distance in cycles between the two insns.
The hook returns @code{true} if considering the distance between the two
insns the dependence between them is considered costly by the target,
and @code{false} otherwise.
Defining this hook can be useful in multiple-issue out-of-order machines,
-where (a) it's practically hopeless to predict the actual data/resource
+where (a) it's practically hopeless to predict the actual data/resource
delays, however: (b) there's a better chance to predict the actual grouping
-that will be formed, and (c) correctly emulating the grouping can be very
+that will be formed, and (c) correctly emulating the grouping can be very
important. In such targets one may want to allow issuing dependent insns
-closer to one another - i.e, closer than the dependence distance; however,
+closer to one another - i.e, closer than the dependence distance; however,
not in cases of "costly dependences", which this hooks allows to define.
@end deftypefn
Macros in the following table are generated by the program
@file{genattr} and can be useful for writing the hooks.
-@defmac TRADITIONAL_PIPELINE_INTERFACE
-The macro definition is generated if there is a traditional pipeline
-description in @file{.md} file. You should also remember that to
-simplify the insn scheduler sources an empty traditional pipeline
-description interface is generated even if there is no a traditional
-pipeline description in the @file{.md} file. The macro can be used to
-distinguish the two types of the traditional interface.
-@end defmac
-
-@defmac DFA_PIPELINE_INTERFACE
-The macro definition is generated if there is an automaton pipeline
-description in @file{.md} file. You should also remember that to
-simplify the insn scheduler sources an empty automaton pipeline
-description interface is generated even if there is no an automaton
-pipeline description in the @file{.md} file. The macro can be used to
-distinguish the two types of the automaton interface.
-@end defmac
-
@defmac MAX_DFA_ISSUE_RATE
The macro definition is generated in the automaton based pipeline
description interface. Its value is calculated from the automaton
in the text section.
@end defmac
-@defmac SHARED_SECTION_ASM_OP
-If defined, a C expression whose value is a string, including spacing,
-containing the assembler operation to identify the following data as
-shared data. If not defined, @code{DATA_SECTION_ASM_OP} will be used.
-@end defmac
-
@defmac BSS_SECTION_ASM_OP
If defined, a C expression whose value is a string, including spacing,
containing the assembler operation to identify the following data as
the function.
@end defmac
-@defmac DBX_OUTPUT_STANDARD_TYPES (@var{syms})
-Define this macro if you need to control the order of output of the
-standard data types at the beginning of compilation. The argument
-@var{syms} is a @code{tree} which is a chain of all the predefined
-global symbols, including names of data types.
-
-Normally, DBX output starts with definitions of the types for integers
-and characters, followed by all the other predefined types of the
-particular language in no particular order.
-
-On some machines, it is necessary to output different particular types
-first. To do this, define @code{DBX_OUTPUT_STANDARD_TYPES} to output
-those symbols in the necessary order. Any predefined types that you
-don't explicitly output will be output afterward in no particular order.
-
-Be careful not to define this macro so that it works only for C@. There
-are no global variables to access most of the built-in types, because
-another language may have another set of types. The way to output a
-particular type is to look through @var{syms} to see if you can find it.
-Here is an example:
-
-@smallexample
-@{
- tree decl;
- for (decl = syms; decl; decl = TREE_CHAIN (decl))
- if (!strcmp (IDENTIFIER_POINTER (DECL_NAME (decl)),
- "long int"))
- dbxout_symbol (decl);
- @dots{}
-@}
-@end smallexample
-
-@noindent
-This does nothing if the expected type does not exist.
-
-See the function @code{init_decl_processing} in @file{c-decl.c} to find
-the names to use for all the built-in C types.
-
-Here is another way of finding a particular type:
-
-@c this is still overfull. --mew 10feb93
-@smallexample
-@{
- tree decl;
- for (decl = syms; decl; decl = TREE_CHAIN (decl))
- if (TREE_CODE (decl) == TYPE_DECL
- && (TREE_CODE (TREE_TYPE (decl))
- == INTEGER_CST)
- && TYPE_PRECISION (TREE_TYPE (decl)) == 16
- && TYPE_UNSIGNED (TREE_TYPE (decl)))
-@group
- /* @r{This must be @code{unsigned short}.} */
- dbxout_symbol (decl);
- @dots{}
-@}
-@end group
-@end smallexample
-@end defmac
-
@defmac NO_DBX_FUNCTION_END
Some stabs encapsulation formats (in particular ECOFF), cannot handle the
@code{.stabs "",N_FUN,,0,0,Lscope-function-1} gdb dbx extension construct.
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.
+be localized.
@end deftypefn
@node Misc
@defmac CASE_VECTOR_PC_RELATIVE
Define this macro to be a C expression to indicate when jump-tables
-should contain relative addresses. If jump-tables never contain
-relative addresses, then you need not define this macro.
+should contain relative addresses. You need not define this macro if
+jump-tables never contain relative addresses, or jump-tables should
+contain relative addresses only when @option{-fPIC} or @option{-fPIC}
+is in effect.
@end defmac
@defmac CASE_DROPS_THROUGH
Most RISC machines have this property and most CISC machines do not.
@end defmac
-@defmac LOAD_EXTEND_OP (@var{mode})
+@defmac LOAD_EXTEND_OP (@var{mem_mode})
Define this macro to be a C expression indicating when insns that read
-memory in @var{mode}, an integral mode narrower than a word, set the
-bits outside of @var{mode} to be either the sign-extension or the
+memory in @var{mem_mode}, an integral mode narrower than a word, set the
+bits outside of @var{mem_mode} to be either the sign-extension or the
zero-extension of the data read. Return @code{SIGN_EXTEND} for values
-of @var{mode} for which the
+of @var{mem_mode} for which the
insn sign-extends, @code{ZERO_EXTEND} for which it zero-extends, and
@code{NIL} for other modes.
-This macro is not called with @var{mode} non-integral or with a width
+This macro is not called with @var{mem_mode} non-integral or with a width
greater than or equal to @code{BITS_PER_WORD}, so you may return any
value in this case. Do not define this macro if it would always return
@code{NIL}. On machines where this macro is defined, you will normally
define it as the constant @code{SIGN_EXTEND} or @code{ZERO_EXTEND}.
+
+You may return a non-@code{NIL} value even if for some hard registers
+the sign extension is not performed, if for the @code{REGNO_REG_CLASS}
+of these hard registers @code{CANNOT_CHANGE_MODE_CLASS} returns nonzero
+when the @var{from} mode is @var{mem_mode} and the @var{to} mode is any
+integral mode larger than this but not larger than @code{word_mode}.
+
+You must return @code{NIL} if for some hard registers that allow this
+mode, @code{CANNOT_CHANGE_MODE_CLASS} says that they cannot change to
+@code{word_mode}, but that they can change to another integral mode that
+is larger then @var{mem_mode} but still smaller than @code{word_mode}.
@end defmac
@defmac SHORT_IMMEDIATES_SIGN_EXTEND
symbols must be explicitly imported from shared libraries (DLLs).
@end defmac
-@defmac MD_ASM_CLOBBERS (@var{clobbers})
-A C statement that adds to @var{clobbers} @code{STRING_CST} trees for
+@deftypefn {Target Hook} tree TARGET_MD_ASM_CLOBBERS (tree @var{clobbers})
+This target hook should add to @var{clobbers} @code{STRING_CST} trees for
any hard regs the port wishes to automatically clobber for all asms.
-@end defmac
+It should return the result of the last @code{tree_cons} used to add a
+clobber.
+@end deftypefn
@defmac MATH_LIBRARY
Define this macro as a C string constant for the linker argument to link
system library's @code{pow}, @code{powf} or @code{powl} routines.
The default value places no upper bound on the multiplication count.
@end defmac
+
+@deftypefn Macro void TARGET_EXTRA_INCLUDES (int @var{stdinc})
+This target hook should register any extra include files for the
+target. The parameter @var{stdinc} indicates if normal include files
+are present.
+@end deftypefn
+
+@deftypefn Macro void TARGET_OPTF (char *@var{path})
+This target hook should register special include paths for the target.
+The parameter @var{path} is the include to register. On Darwin
+systems, this is used for Framework includes, which have semantics
+that are different from @option{-I}.
+@end deftypefn