-@c Copyright (C) 1988,89,92-99,2000 Free Software Foundation, Inc.
+@c Copyright (C) 1988,1989,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001
+@c Free Software Foundation, Inc.
@c This is part of the GCC manual.
@c For copying conditions, see the file gcc.texi.
@menu
* Driver:: Controlling how the driver runs the compilation passes.
* Run-time Target:: Defining @samp{-m} options like @samp{-m68000} and @samp{-m68020}.
+* Per-Function Data:: Defining data structures for per-function information.
* Storage Layout:: Defining sizes and alignments of data.
* Type Layout:: Defining sizes and properties of basic user data types.
* Registers:: Naming and describing the hardware registers.
* Assembler Format:: Defining how to write insns and pseudo-ops to output.
* Debugging Info:: Defining the format of debugging output.
* Cross-compilation:: Handling floating point for cross-compilers.
+* Mode Switching:: Insertion of mode-switching instructions.
* Misc:: Everything else.
@end menu
Do not define this macro if it does not need to do anything.
+@findex CPLUSPLUS_CPP_SPEC
+@item CPLUSPLUS_CPP_SPEC
+This macro is just like @code{CPP_SPEC}, but is used for C++, rather
+than C. If you do not define this macro, then the value of
+@code{CPP_SPEC} (if any) will be used instead.
+
@findex NO_BUILTIN_SIZE_TYPE
@item NO_BUILTIN_SIZE_TYPE
If this macro is defined, the preprocessor will not define the builtin macro
which are not accessible to the preprocessor. Otherwise, it should not
be defined.
+@findex NO_BUILTIN_WCHAR_TYPE
+@item NO_BUILTIN_WCHAR_TYPE
+If this macro is defined, the preprocessor will not define the builtin macro
+@code{__WCHAR_TYPE__}. The macro @code{__WCHAR_TYPE__} must then be
+defined by @code{CPP_SPEC} instead.
+
+This should be defined if @code{WCHAR_TYPE} depends on target dependent flags
+which are not accessible to the preprocessor. Otherwise, it should not
+be defined.
+
+@findex NO_BUILTIN_WINT_TYPE
+@item NO_BUILTIN_WINT_TYPE
+If this macro is defined, the preprocessor will not define the builtin macro
+@code{__WINT_TYPE__}. The macro @code{__WINT_TYPE__} must then be
+defined by @code{CPP_SPEC} instead.
+
+This should be defined if @code{WINT_TYPE} depends on target dependent flags
+which are not accessible to the preprocessor. Otherwise, it should not
+be defined.
+
@findex SIGNED_CHAR_SPEC
@item SIGNED_CHAR_SPEC
A C string constant that tells the GCC driver program options to
the value of @code{LIB_SPEC}.
If this macro is not defined, the GCC driver provides a default that
-passes the string @samp{-lgcc} to the linker unless the @samp{-shared}
-option is specified.
+passes the string @samp{-lgcc} to the linker.
@findex STARTFILE_SPEC
@item STARTFILE_SPEC
Do not define this macro if it does not need to do anything.
+@findex THREAD_MODEL_SPEC
+@item THREAD_MODEL_SPEC
+GCC @code{-v} will print the thread model GCC was configured to use.
+However, this doesn't work on platforms that are multilibbed on thread
+models, such as AIX 4.3. On such platforms, define
+@code{THREAD_MODEL_SPEC} such that it evaluates to a string without
+blanks that names one of the recognized thread models. @code{%*}, the
+default value of this macro, will expand to the value of
+@code{thread_file} set in @file{config.gcc}.
+
@findex EXTRA_SPECS
@item EXTRA_SPECS
Define this macro to provide additional specifications to put in the
line for invoking the linker and there is no other way to accomplish
the effect you need.
+@findex LINK_ELIMINATE_DUPLICATE_LDIRECTORIES
+@item LINK_ELIMINATE_DUPLICATE_LDIRECTORIES
+A nonzero value causes collect2 to remove duplicate -L<directory> search
+directories from linking commands. Do not give it a nonzero value if
+removing duplicate search directories changes the linker's semantics.
+
@findex MULTILIB_DEFAULTS
@item MULTILIB_DEFAULTS
Define this macro as a C expression for the initializer of an array of
Cross compilers do not use this macro and do not search either
@file{/usr/local/include} or its replacement.
+@findex MODIFY_TARGET_NAME
+@item MODIFY_TARGET_NAME
+Define this macro if you with to define command-line switches that modify the
+default target name
+
+For each switch, you can include a string to be appended to the first
+part of the configuration name or a string to be deleted from the
+configuration name, if present. The definition should be an initializer
+for an array of structures. Each array element should have three
+elements: the switch name (a string constant, including the initial
+dash), one of the enumeration codes @code{ADD} or @code{DELETE} to
+indicate whether the string should be inserted or deleted, and the string
+to be inserted or deleted (a string constant).
+
+For example, on a machine where @samp{64} at the end of the
+configuration name denotes a 64-bit target and you want the @samp{-32}
+and @samp{-64} switches to select between 32- and 64-bit targets, you would
+code
+
+@smallexample
+#define MODIFY_TARGET_NAME \
+ @{ @{ "-32", DELETE, "64"@}, \
+ @{"-64", ADD, "64"@}@}
+@end smallexample
+
+
@findex SYSTEM_INCLUDE_DIR
@item SYSTEM_INCLUDE_DIR
Define this macro as a C string constant if you wish to specify a
The definition should be an initializer for an array of structures.
Each array element should have four elements: the directory name (a
-string constant), the component name, and flag for C++-only directories,
+string constant), the component name (also a string constant), a flag
+for C++-only directories,
and a flag showing that the includes in the directory don't need to be
wrapped in @code{extern @samp{C}} when compiling C++. Mark the end of
the array with a null element.
The component name denotes what GNU package the include file is part of,
if any, in all upper-case letters. For example, it might be @samp{GCC}
-or @samp{BINUTILS}. If the package is part of the a vendor-supplied
+or @samp{BINUTILS}. If the package is part of a vendor-supplied
operating system, code the component name as @samp{0}.
-@findex STRUCT_FORCE_BLK
-@item STRUCT_FORCE_BLK (@var{field})
-Return 1 if a structure containing @var{field} should be accessed using
-@code{BLKMODE}.
-
-Normally, this is not needed. See the file @file{c4x.h} for an example
-of how to use this macro to prevent a structure having a floating point
-field from being accessed in an integer mode.
-
-
For example, here is the definition used for VAX/VMS:
@example
@item CPP_PREDEFINES
Define this to be a string constant containing @samp{-D} options to
define the predefined macros that identify this machine and system.
-These macros will be predefined unless the @samp{-ansi} option is
-specified.
+These macros will be predefined unless the @option{-ansi} option (or a
+@option{-std} option for strict ISO C conformance) is specified.
In addition, a parallel set of macros are predefined, whose names are
made by appending @samp{__} at the beginning and at the end. These
-@samp{__} macros are permitted by the ANSI standard, so they are
-predefined regardless of whether @samp{-ansi} is specified.
+@samp{__} macros are permitted by the ISO standard, so they are
+predefined regardless of whether @option{-ansi} or a @option{-std} option
+is specified.
For example, on the Sun, one can use the following value:
@code{target_flags}.
Define a macro @code{TARGET_@var{featurename}} for each such option.
-Its definition should test a bit in @code{target_flags}; for example:
+Its definition should test a bit in @code{target_flags}. It is
+recommended that a helper macro @code{TARGET_MASK_@var{featurename}}
+is defined for each bit-value to test, and used in
+@code{TARGET_@var{featurename}} and @code{TARGET_SWITCHES}. For
+example:
@smallexample
-#define TARGET_68020 (target_flags & 1)
+#define TARGET_MASK_68020 1
+#define TARGET_68020 (target_flags & TARGET_MASK_68020)
@end smallexample
One place where these macros are used is in the condition-expressions
@smallexample
#define TARGET_SWITCHES \
- @{ @{ "68020", 1, "" @}, \
- @{ "68000", -1, "Compile for the 68000" @}, \
- @{ "", 1, "" @}@}
+ @{ @{ "68020", TARGET_MASK_68020, "" @}, \
+ @{ "68000", -TARGET_MASK_68020, "Compile for the 68000" @}, \
+ @{ "", TARGET_MASK_68020, "" @}@}
@end smallexample
@findex TARGET_OPTIONS
@samp{-fomit-frame-pointer} option whenever @samp{-O} is specified.
@end table
+@node Per-Function Data
+@section Defining data structures for per-function information.
+@cindex per-function data
+@cindex data structures
+
+If the target needs to store information on a per-function basis, GCC
+provides a macro and a couple of variables to allow this. Note, just
+using statics to store the information is a bad idea, since GCC supports
+nested functions, so you can be halfway through encoding one function
+when another one comes along.
+
+GCC defines a data structure called @code{struct function} which
+contains all of the data specific to an individual function. This
+structure contains a field called @code{machine} whose type is
+@code{struct machine_function *}, which can be used by targets to point
+to their own specific data.
+
+If a target needs per-function specific data it should define the type
+@code{struct machine_function} and also the macro
+@code{INIT_EXPANDERS}. This macro should be used to initialise some or
+all of the function pointers @code{init_machine_status},
+@code{free_machine_status} and @code{mark_machine_status}. These
+pointers are explained below.
+
+One typical use of per-function, target specific data is to create an
+RTX to hold the register containing the function's return address. This
+RTX can then be used to implement the @code{__builtin_return_address}
+function, for level 0.
+
+Note - earlier implementations of GCC used a single data area to hold
+all of the per-function information. Thus when processing of a nested
+function began the old per-function data had to be pushed onto a
+stack, and when the processing was finished, it had to be popped off the
+stack. GCC used to provide function pointers called
+@code{save_machine_status} and @code{restore_machine_status} to handle
+the saving and restoring of the target specific information. Since the
+single data area approach is no longer used, these pointers are no
+longer supported.
+
+The macro and function pointers are described below.
+
+@table @code
+@findex INIT_EXPANDERS
+@item INIT_EXPANDERS
+Macro called to initialise any target specific information. This macro
+is called once per function, before generation of any RTL has begun.
+The intention of this macro is to allow the initialisation of the
+function pointers below.
+
+@findex init_machine_status
+@item init_machine_status
+This is a @code{void (*)(struct function *)} function pointer. If this
+pointer is non-NULL it will be called once per function, before function
+compilation starts, in order to allow the target to perform any target
+specific initialisation of the @code{struct function} structure. It is
+intended that this would be used to initialise the @code{machine} of
+that struture.
+
+@findex free_machine_status
+@item free_machine_status
+This is a @code{void (*)(struct function *)} function pointer. If this
+pointer is non-NULL it will be called once per function, after the
+function has been compiled, in order to allow any memory allocated
+during the @code{init_machine_status} function call to be freed.
+
+@findex mark_machine_status
+@item mark_machine_status
+This is a @code{void (*)(struct function *)} function pointer. If this
+pointer is non-NULL it will be called once per function in order to mark
+any data items in the @code{struct machine_function} structure which
+need garbage collection.
+
+@end table
+
@node Storage Layout
@section Storage Layout
@cindex storage layout
@findex BIGGEST_FIELD_ALIGNMENT
@item BIGGEST_FIELD_ALIGNMENT
-Biggest alignment that any structure field can require on this machine,
-in bits. If defined, this overrides @code{BIGGEST_ALIGNMENT} for
-structure fields only.
+Biggest alignment that any structure or union field can require on this
+machine, in bits. If defined, this overrides @code{BIGGEST_ALIGNMENT} for
+structure and union fields only, unless the field alignment has been set
+by the @code{__attribute__ ((aligned (@var{n})))} construct.
@findex ADJUST_FIELD_ALIGN
@item ADJUST_FIELD_ALIGN (@var{field}, @var{computed})
@findex DATA_ALIGNMENT
@item DATA_ALIGNMENT (@var{type}, @var{basic-align})
-If defined, a C expression to compute the alignment for a variables in
+If defined, a C expression to compute the alignment for a variable in
the static store. @var{type} is the data type, and @var{basic-align} is
the alignment that the object would ordinarily have. The value of this
macro is used instead of that alignment to align the object.
@findex LOCAL_ALIGNMENT
@item LOCAL_ALIGNMENT (@var{type}, @var{basic-align})
-If defined, a C expression to compute the alignment for a variables in
+If defined, a C expression to compute the alignment for a variable in
the local store. @var{type} is the data type, and @var{basic-align} is
the alignment that the object would ordinarily have. The value of this
macro is used instead of that alignment to align the object.
Like PCC_BITFIELD_TYPE_MATTERS except that its effect is limited to
aligning a bitfield within the structure.
+@findex MEMBER_TYPE_FORCES_BLK
+@item MEMBER_TYPE_FORCES_BLK (@var{field})
+Return 1 if a structure or array containing @var{field} should be accessed using
+@code{BLKMODE}.
+
+Normally, this is not needed. See the file @file{c4x.h} for an example
+of how to use this macro to prevent a structure having a floating point
+field from being accessed in an integer mode.
+
@findex ROUND_TYPE_SIZE
@item ROUND_TYPE_SIZE (@var{type}, @var{computed}, @var{specified})
Define this macro as an expression for the overall size of a type
The default is to round @var{computed} up to a multiple of @var{specified}.
+@findex ROUND_TYPE_SIZE_UNIT
+@item ROUND_TYPE_SIZE_UNIT (@var{type}, @var{computed}, @var{specified})
+Similar to @code{ROUND_TYPE_SIZE}, but sizes and alignments are
+specified in units (bytes). If you define @code{ROUND_TYPE_SIZE},
+you must also define this macro and they must be defined consistently
+with each other.
+
@findex ROUND_TYPE_ALIGN
@item ROUND_TYPE_ALIGN (@var{type}, @var{computed}, @var{specified})
Define this macro as an expression for the alignment of a type (given
appropriate sizes. If this macro is undefined, @code{GET_MODE_BITSIZE
(DImode)} is assumed.
+@findex VECTOR_MODE_SUPPORTED_P
+@item VECTOR_MODE_SUPPORTED_P(@var{mode})
+Define this macro to be nonzero if the port is prepared to handle insns
+involving vector mode @var{mode}. At the very least, it must have move
+patterns for this mode.
+
@findex STACK_SAVEAREA_MODE
@item STACK_SAVEAREA_MODE (@var{save_level})
If defined, an expression of type @code{enum machine_mode} that
implementation by default. The ``thunk'' implementation is more efficient
(especially if you have provided an implementation of
@code{ASM_OUTPUT_MI_THUNK}, see @ref{Function Entry}), but is not binary
-compatible with code compiled using the traditional implementation.
-If you are writing a new ports, define @code{DEFAULT_VTABLE_THUNKS} to 1.
+compatible with code compiled using the traditional implementation.
+If you are writing a new port, define @code{DEFAULT_VTABLE_THUNKS} to 1.
If you do not define this macro, the default for @samp{-fvtable-thunk} is 0.
@end table
@item 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. If you want to support GNU Ada on your machine, the value of
+words. If you want to support GNU Ada on your machine, the value of this
macro must be at least 64.
@findex CHAR_TYPE_SIZE
largest value that @code{WCHAR_TYPE_SIZE} can have at run-time. This is
used in @code{cpp}.
-@findex OBJC_INT_SELECTORS
-@item OBJC_INT_SELECTORS
-Define this macro if the type of Objective C selectors should be
-@code{int}.
+@findex WINT_TYPE
+@item 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
+@code{getwc}. The typedef name @code{wint_t} is defined using the
+contents of the string. See @code{SIZE_TYPE} above for more
+information.
+
+If you don't define this macro, the default is @code{"unsigned int"}.
-If this macro is not defined, then selectors should have the type
-@code{struct objc_selector *}.
+@findex INTMAX_TYPE
+@item INTMAX_TYPE
+A C expression for a string describing the name of the data type that
+can represent any value of any standard or extended signed integer type.
+The typedef name @code{intmax_t} is defined using the contents of the
+string. See @code{SIZE_TYPE} above for more information.
+
+If you don't define this macro, the default is the first of
+@code{"int"}, @code{"long int"}, or @code{"long long int"} that has as
+much precision as @code{long long int}.
+
+@findex UINTMAX_TYPE
+@item UINTMAX_TYPE
+A C expression for a string describing the name of the data type that
+can represent any value of any standard or extended unsigned integer
+type. The typedef name @code{uintmax_t} is defined using the contents
+of the string. See @code{SIZE_TYPE} above for more information.
+
+If you don't define this macro, the default is the first of
+@code{"unsigned int"}, @code{"long unsigned int"}, or @code{"long long
+unsigned int"} that has as much precision as @code{long long unsigned
+int}.
@findex OBJC_SELECTORS_WITHOUT_LABELS
@item OBJC_SELECTORS_WITHOUT_LABELS
On certain machines, it is important to have a separate label for each
selector because this enables the linker to eliminate duplicate selectors.
+@findex TARGET_PTRMEMFUNC_VBIT_LOCATION
+@item TARGET_PTRMEMFUNC_VBIT_LOCATION
+The C++ compiler represents a pointer-to-member-function with a struct
+that looks like:
+
+@example
+ struct @{
+ union @{
+ void (*fn)();
+ ptrdiff_t vtable_index;
+ @};
+ ptrdiff_t delta;
+ @};
+@end example
+
+@noindent
+The C++ compiler must use one bit to indicate whether the function that
+will be called through a pointer-to-member-function is virtual.
+Normally, we assume that the low-order bit of a function pointer must
+always be zero. Then, by ensuring that the vtable_index is odd, we can
+distinguish which variant of the union is in use. But, on some
+platforms function pointers can be odd, and so this doesn't work. In
+that case, we use the low-order bit of the @code{delta} field, and shift
+the remainder of the @code{delta} field to the left.
+
+GCC will automatically make the right selection about where to store
+this bit using the @code{FUNCTION_BOUNDARY} setting for your platform.
+However, some platforms such as ARM/Thumb have @code{FUNCTION_BOUNDARY}
+set such that functions always start at even addresses, but the lowest
+bit of pointers to functions indicate whether the function at that
+address is in ARM or Thumb mode. If this is the case of your
+architecture, you should define this macro to
+@code{ptrmemfunc_vbit_in_delta}.
+
+In general, you should not have to define this macro. On architectures
+in which function addresses are always even, according to
+@code{FUNCTION_BOUNDARY}, GCC will automatically define this macro to
+@code{ptrmemfunc_vbit_in_pfn}.
+
@findex TARGET_BELL
@item TARGET_BELL
A C constant expression for the integer value for escape sequence
@findex fixed_regs
@findex call_used_regs
@item CONDITIONAL_REGISTER_USAGE
-Zero or more C statements that may conditionally modify four variables
-@code{fixed_regs}, @code{call_used_regs}, @code{global_regs}
-(these three are of type @code{char []}) and @code{reg_class_contents}
-(of type @code{HARD_REG_SET}).
+Zero or more C statements that may conditionally modify five variables
+@code{fixed_regs}, @code{call_used_regs}, @code{global_regs},
+(these three are of type @code{char []}), @code{reg_names} (of type
+@code{const char * []}) and @code{reg_class_contents} (of type
+@code{HARD_REG_SET}).
Before the macro is called @code{fixed_regs}, @code{call_used_regs}
-and @code{reg_class_contents} have been initialized from
-@code{FIXED_REGISTERS}, @code{CALL_USED_REGISTERS} and
-@code{REG_CLASS_CONTENTS}, respectively,
+@code{reg_class_contents} and @code{reg_names} have been initialized
+from @code{FIXED_REGISTERS}, @code{CALL_USED_REGISTERS},
+@code{REG_CLASS_CONTENTS} and @code{REGISTER_NAMES}, respectively,
@code{global_regs} has been cleared, and any @samp{-ffixed-@var{reg}},
@samp{-fcall-used-@var{reg}} and @samp{-fcall-saved-@var{reg}} command
options have been applied.
function. Return @var{in} if register number @var{in} is not an inbound
register.
+@findex LOCAL_REGNO
+@item LOCAL_REGNO (@var{regno})
+Define this macro if the target machine has register windows. This C
+expression returns true if the register is call-saved but is in the
+register window. Unlike most call-saved registers, such registers
+need not be explicitly restored on function exit or during non-local
+gotos.
+
@ignore
@findex PC_REGNUM
@item PC_REGNUM
@smallexample
#define HARD_REGNO_NREGS(REGNO, MODE) \
((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) \
- / UNITS_PER_WORD))
-@end smallexample
-
-@findex ALTER_HARD_SUBREG
-@item ALTER_HARD_SUBREG (@var{tgt_mode}, @var{word}, @var{src_mode}, @var{regno})
-A C expression that returns an adjusted hard register number for
-
-@smallexample
-(subreg:@var{tgt_mode} (reg:@var{src_mode} @var{regno}) @var{word})
+ / UNITS_PER_WORD)
@end smallexample
-This may be needed if the target machine has mixed sized big-endian
-registers, like Sparc v9.
-
@findex HARD_REGNO_MODE_OK
@item HARD_REGNO_MODE_OK (@var{regno}, @var{mode})
A C expression that is nonzero if it is permissible to store a value
@findex AVOID_CCMODE_COPIES
@item AVOID_CCMODE_COPIES
Define this macro if the compiler should avoid copies to/from @code{CCmode}
-registers. You should only define this macro if support fo copying to/from
+registers. You should only define this macro if support for copying to/from
@code{CCmode} is incomplete.
+
+@findex SUBREG_REGNO_OFFSET
+@item SUBREG_REGNO_OFFSET
+Define this macro if the compiler needs to handle subregs in a non-standard
+way. The macro returns the correct regno offset for mode @code{YMODE} given
+a subreg of type @code{XMODE}.
+This macro takes 4 parameters:
+@code{XREGNO} - A regno of an inner hard subreg_reg (or what will become one).
+@code{XMODE} - The mode of xregno.
+@code{OFFSET} - The byte offset.
+@code{YMODE} - The mode of a top level SUBREG (or what may become one).
+The default function can be found in rtlanal.c, function
+@code{subreg_regno_offset}. Normally this does not need to be defined.
@end table
@node Leaf Functions
@table @code
@findex LEAF_REGISTERS
@item LEAF_REGISTERS
-A C initializer for a vector, indexed by hard register number, which
+Name of a char vector, indexed by hard register number, which
contains 1 for a register that is allowable in a candidate for leaf
function treatment.
Then the integers are replaced by sub-initializers, braced groupings containing
several integers. Each sub-initializer must be suitable as an initializer
for the type @code{HARD_REG_SET} which is defined in @file{hard-reg-set.h}.
+In this situation, the first integer in each sub-initializer corresponds to
+registers 0 through 31, the second integer to registers 32 through 63, and
+so on.
@findex REGNO_REG_CLASS
@item REGNO_REG_CLASS (@var{regno})
This macro helps control the handling of multiple-word values
in the reload pass.
-@item CLASS_CANNOT_CHANGE_SIZE
-If defined, a C expression for a class that contains registers which the
-compiler must always access in a mode that is the same size as the mode
-in which it loaded the register.
+@item CLASS_CANNOT_CHANGE_MODE
+If defined, a C expression for a class that contains registers for
+which the compiler may not change modes arbitrarily.
+
+@item CLASS_CANNOT_CHANGE_MODE_P(@var{from}, @var{to})
+A C expression that is true if, for a register in
+@code{CLASS_CANNOT_CHANGE_MODE}, the requested mode punning is illegal.
For the example, loading 32-bit integer or floating-point objects into
floating-point registers on the Alpha extends them to 64-bits.
Therefore loading a 64-bit object and then storing it as a 32-bit object
does not store the low-order 32-bits, as would be the case for a normal
-register. Therefore, @file{alpha.h} defines this macro as
-@code{FLOAT_REGS}.
+register. Therefore, @file{alpha.h} defines @code{CLASS_CANNOT_CHANGE_MODE}
+as @code{FLOAT_REGS} and @code{CLASS_CANNOT_CHANGE_MODE_P} restricts
+mode changes to same-size modes.
+
+Compare this to IA-64, which extends floating-point values to 82-bits,
+and stores 64-bit integers in a different format than 64-bit doubles.
+Therefore @code{CLASS_CANNOT_CHANGE_MODE_P} is always true.
@end table
Three other special macros describe which operands fit which constraint
@findex EXTRA_CONSTRAINT
@item EXTRA_CONSTRAINT (@var{value}, @var{c})
A C expression that defines the optional machine-dependent constraint
-letters (@samp{Q}, @samp{R}, @samp{S}, @samp{T}, @samp{U}) that can
-be used to segregate specific types of operands, usually memory
-references, for the target machine. Normally this macro will not be
-defined. If it is required for a particular target machine, it should
-return 1 if @var{value} corresponds to the operand type represented by
-the constraint letter @var{c}. If @var{c} is not defined as an extra
+letters that can be used to segregate specific types of operands, usually
+memory references, for the target machine. Any letter that is not
+elsewhere defined and not matched by @code{REG_CLASS_FROM_LETTER}
+may be used. Normally this macro will not be defined.
+
+If it is required for a particular target machine, it should return 1
+if @var{value} corresponds to the operand type represented by the
+constraint letter @var{c}. If @var{c} is not defined as an extra
constraint, the value returned should be 0 regardless of @var{value}.
-For example, on the ROMP, load instructions cannot have their output in r0 if
-the memory reference contains a symbolic address. Constraint letter
-@samp{Q} is defined as representing a memory address that does
+For example, on the ROMP, load instructions cannot have their output
+in r0 if the memory reference contains a symbolic address. Constraint
+letter @samp{Q} is defined as representing a memory address that does
@emph{not} contain a symbolic address. An alternative is specified with
a @samp{Q} constraint on the input and @samp{r} on the output. The next
alternative specifies @samp{m} on the input and a register class that
* Caller Saves::
* Function Entry::
* Profiling::
+* Inlining::
+* Tail Calling::
@end menu
@node Frame Layout
You only need to define this macro if you want to support call frame
debugging information like that provided by DWARF 2.
+If this RTL is a @code{REG}, you should also define
+DWARF_FRAME_RETURN_COLUMN to @code{DWARF_FRAME_REGNUM (REGNO)}.
+
@findex INCOMING_FRAME_SP_OFFSET
@item INCOMING_FRAME_SP_OFFSET
A C expression whose value is an integer giving the offset, in bytes,
debugging information like that provided by DWARF 2.
@findex ARG_POINTER_CFA_OFFSET
-@item ARG_POINTER_CFA_OFFSET
+@item ARG_POINTER_CFA_OFFSET (@var{fundecl})
A C expression whose value is an integer giving the offset, in bytes,
from the argument pointer to the canonical frame address (cfa). The
-final value should coincide with that calculated by
+final value should coincide with that calculated by
@code{INCOMING_FRAME_SP_OFFSET}. Which is unfortunately not usable
during virtual register instantiation.
-You only need to define this macro if you want to support call frame
-debugging information like that provided by DWARF 2.
+The default value for this macro is @code{FIRST_PARM_OFFSET (fundecl)},
+which is correct for most machines; in general, the arguments are found
+immediately before the stack frame. Note that this is not the case on
+some targets that save registers into the caller's frame, such as SPARC
+and rs6000, and so such targets need to define this macro.
+
+You only need to define this macro if the default is incorrect, and you
+want to support call frame debugging information like that provided by
+DWARF 2.
+
+@findex EH_RETURN_DATA_REGNO
+@item EH_RETURN_DATA_REGNO (@var{N})
+A C expression whose value is the @var{N}th register number used for
+data by exception handlers, or @code{INVALID_REGNUM} if fewer than
+@var{N} registers are usable.
+
+The exception handling library routines communicate with the exception
+handlers via a set of agreed upon registers. Ideally these registers
+should be call-clobbered; it is possible to use call-saved registers,
+but may negatively impact code size. The target must support at least
+2 data registers, but should define 4 if there are enough free registers.
+
+You must define this macro if you want to support call frame exception
+handling like that provided by DWARF 2.
+
+@findex EH_RETURN_STACKADJ_RTX
+@item EH_RETURN_STACKADJ_RTX
+A C expression whose value is RTL representing a location in which
+to store a stack adjustment to be applied before function return.
+This is used to unwind the stack to an exception handler's call frame.
+It will be assigned zero on code paths that return normally.
+
+Typically this is a call-clobbered hard register that is otherwise
+untouched by the epilogue, but could also be a stack slot.
+
+You must define this macro if you want to support call frame exception
+handling like that provided by DWARF 2.
+
+@findex EH_RETURN_HANDLER_RTX
+@item EH_RETURN_HANDLER_RTX
+A C expression whose value is RTL representing a location in which
+to store the address of an exception handler to which we should
+return. It will not be assigned on code paths that return normally.
+
+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. @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
+address calculable during initial code generation. In that case
+the @code{eh_return} instruction pattern should be used instead.
+
+If you want to support call frame exception handling, you must
+define either this macro or the @code{eh_return} instruction pattern.
+
+@findex ASM_PREFERRED_EH_DATA_FORMAT
+@item ASM_PREFERRED_EH_DATA_FORMAT(@var{CODE}, @var{GLOBAL})
+This macro chooses the encoding of pointers embedded in the exception
+handling sections. If at all possible, this should be defined such
+that the exception handling section will not require dynamic relocations,
+and so may be read-only.
+
+@var{CODE} is 0 for data, 1 for code labels, 2 for function pointers.
+@var{GLOBAL} is true if the symbol may be affected by dynamic relocations.
+The macro should return a combination of the @code{DW_EH_PE_*} defines
+as found in @file{dwarf2.h}.
+
+If this macro is not defined, pointers will not be encoded but
+represented directly.
+
+@findex ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX
+@item ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(@var{FILE}, @var{ENCODING}, @var{SIZE}, @var{ADDR}, @var{DONE})
+This macro allows the target to emit whatever special magic is required
+to represent the encoding chosen by @code{ASM_PREFERRED_EH_DATA_FORMAT}.
+Generic code takes care of pc-relative and indirect encodings; this must
+be defined if the target uses text-relative or data-relative encodings.
+
+This is a C statement that branches to @var{DONE} if the format was
+handled. @var{ENCODING} is the format chosen, @var{SIZE} is the number
+of bytes that the format occupies, @var{ADDR} is the @code{SYMBOL_REF}
+to be emitted.
@findex SMALL_STACK
@item SMALL_STACK
@findex STACK_CHECK_BUILTIN
@item STACK_CHECK_BUILTIN
A nonzero value if stack checking is done by the configuration files in a
-machine-dependent manner. You should define this macro if stack checking
-is require by the ABI of your machine or if you would like to have to stack
+machine-dependent manner. You should define this macro if stack checking
+is require by the ABI of your machine or if you would like to have to stack
checking in some more efficient way than GCC's portable approach.
The default value of this macro is zero.
@findex STACK_CHECK_PROBE_LOAD
@item STACK_CHECK_PROBE_LOAD
-A integer which is nonzero if GCC should perform the stack probe
+A integer which is nonzero if GCC should perform the stack probe
as a load instruction and zero if GCC should use a store instruction.
The default is zero, which is the most efficient choice on most systems.
code on certain machines. If the macro is not defined in target
header files, it defaults to 0.
+@findex PUSH_ARGS
+@item PUSH_ARGS
+A C expression. If nonzero, push insns will be used to pass
+outgoing arguments.
+If the target machine does not have a push instruction, set it to zero.
+That directs GCC to use an alternate strategy: to
+allocate the entire argument block and then store the arguments into
+it. When PUSH_ARGS is nonzero, PUSH_ROUNDING must be defined too.
+On some machines, the definition
+
@findex PUSH_ROUNDING
@item PUSH_ROUNDING (@var{npushed})
A C expression that is the number of bytes actually pushed onto the
stack when an instruction attempts to push @var{npushed} bytes.
-If the target machine does not have a push instruction, do not define
-this macro. That directs GCC to use an alternate strategy: to
-allocate the entire argument block and then store the arguments into
-it.
-
On some machines, the definition
@example
@findex ACCUMULATE_OUTGOING_ARGS
@findex current_function_outgoing_args_size
@item ACCUMULATE_OUTGOING_ARGS
-If defined, the maximum amount of space required for outgoing arguments
+A C expression. If nonzero, the maximum amount of space required for outgoing arguments
will be computed and placed into the variable
@code{current_function_outgoing_args_size}. No space will be pushed
onto the stack for each call; instead, the function prologue should
increase the stack frame size by this amount.
-Defining both @code{PUSH_ROUNDING} and @code{ACCUMULATE_OUTGOING_ARGS}
+Setting both @code{PUSH_ARGS} and @code{ACCUMULATE_OUTGOING_ARGS}
is not proper.
@findex REG_PARM_STACK_SPACE
(which happens for C support library functions); and @var{named},
which is 1 for an ordinary argument and 0 for nameless arguments that
correspond to @samp{@dots{}} in the called function's prototype.
+@var{type} can be an incomplete type if a syntax error has previously
+occurred.
The value of the expression is usually either a @code{reg} RTX for the
hard register in which to pass the argument, or zero to pass the
register RTX indicates how large this part of the argument is. The
second operand of the @code{expr_list} is a @code{const_int} which gives
the offset in bytes into the entire argument of where this part starts.
-As a special exception the first @code{expr_list} in the @code{parallel}
+As a special exception the first @code{expr_list} in the @code{parallel}
RTX may have a first operand of zero. This indicates that the entire
argument is also stored on the stack.
@cindex @file{stdarg.h} and register arguments
-The usual way to make the ANSI library @file{stdarg.h} work on a machine
+The usual way to make the ISO library @file{stdarg.h} work on a machine
where some arguments are usually passed in registers, is to cause
nameless arguments to be passed on the stack instead. This is done
by making @code{FUNCTION_ARG} return 0 whenever @var{named} is 0.
@findex FUNCTION_ARG_PARTIAL_NREGS
@item FUNCTION_ARG_PARTIAL_NREGS (@var{cum}, @var{mode}, @var{type}, @var{named})
A C expression for the number of words, at the beginning of an
-argument, must be put in registers. The value must be zero for
+argument, that must be put in registers. The value must be zero for
arguments that are passed entirely in registers or that are entirely
pushed on the stack.
macro is called, either @var{libname} or @var{fntype} is nonzero, but
never both of them at once.
+@findex INIT_CUMULATIVE_LIBCALL_ARGS
+@item INIT_CUMULATIVE_LIBCALL_ARGS (@var{cum}, @var{mode}, @var{libname})
+Like @code{INIT_CUMULATIVE_ARGS} but only used for outgoing libcalls,
+it gets a @code{MODE} argument instead of @var{fntype}, that would be
+@code{NULL}. @var{indirect} would always be zero, too. If this macro
+is not defined, @code{INIT_CUMULATIVE_ARGS (cum, NULL_RTX, libname,
+0)} is used instead.
+
@findex INIT_CUMULATIVE_INCOMING_ARGS
@item INIT_CUMULATIVE_INCOMING_ARGS (@var{cum}, @var{fntype}, @var{libname})
Like @code{INIT_CUMULATIVE_ARGS} but overrides it for the purposes of
@findex PAD_VARARGS_DOWN
@item PAD_VARARGS_DOWN
-If defined, a C expression which determines whether the default
-implementation of va_arg will attempt to pad down before reading the
+If defined, a C expression which determines whether the default
+implementation of va_arg will attempt to pad down before reading the
next argument, if that argument is smaller than its aligned space as
controlled by @code{PARM_BOUNDARY}. If this macro is not defined, all such
arguments are padded down if @code{BYTES_BIG_ENDIAN} is true.
@findex LOAD_ARGS_REVERSED
@item LOAD_ARGS_REVERSED
If defined, the order in which arguments are loaded into their
-respective argument registers is reversed so that the last
+respective argument registers is reversed so that the last
argument is loaded first. This macro only affects arguments
passed in registers.
@item 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 @samp{-fcaller-saves}
+for all registers. When defined, this macro enables @samp{-fcaller-saves}
by default for all optimization levels. It has no effect for optimization
levels 2 and higher, where @samp{-fcaller-saves} is the default.
@findex EPILOGUE_USES
@item EPILOGUE_USES (@var{regno})
-Define this macro as a C expression that is nonzero for registers are
+Define this macro as a C expression that is nonzero for registers that are
used by the epilogue or the @samp{return} pattern. The stack and frame
pointer registers are already be assumed to be used as needed.
@item FUNCTION_PROFILER (@var{file}, @var{labelno})
A C statement or compound statement to output to @var{file} some
assembler code to call the profiling subroutine @code{mcount}.
-Before calling, the assembler code must load the address of a
-counter variable into a register where @code{mcount} expects to
-find the address. The name of this variable is @samp{LP} followed
-by the number @var{labelno}, so you would generate the name using
-@samp{LP%d} in a @code{fprintf}.
@findex mcount
-The details of how the address should be passed to @code{mcount} are
-determined by your operating system environment, not by GCC. To
-figure them out, compile a small program for profiling using the
-system's installed C compiler and look at the assembler code that
-results.
+The details of how @code{mcount} expects to be called are determined by
+your operating system environment, not by GCC. To figure them out,
+compile a small program for profiling using the system's installed C
+compiler and look at the assembler code that results.
+
+Older implementations of @code{mcount} expect the address of a counter
+variable to be loaded into some register. The name of this variable is
+@samp{LP} followed by the number @var{labelno}, so you would generate
+the name using @samp{LP%d} in a @code{fprintf}.
+
+@findex PROFILE_HOOK
+@item PROFILE_HOOK
+A C statement or compound statement to output to @var{file} some assembly
+code to call the profiling subroutine @code{mcount} even the target does
+not support profiling.
+
+@findex NO_PROFILE_COUNTERS
+@item NO_PROFILE_COUNTERS
+Define this macro if the @code{mcount} subroutine on your system does
+not need a counter variable allocated for each function. This is true
+for almost all modern implementations. If you define this macro, you
+must not use the @var{labelno} argument to @code{FUNCTION_PROFILER}.
@findex PROFILE_BEFORE_PROLOGUE
@item PROFILE_BEFORE_PROLOGUE
be clobbered by a function call, including condition codes. The
@code{asm} statement will be mostly likely needed to handle this
task. Local labels in the assembler code can be concatenated with the
-string @var{id}, to obtain a unique lable name.
+string @var{id}, to obtain a unique label name.
Registers or condition codes clobbered by @code{FUNCTION_PROLOGUE} or
@code{FUNCTION_EPILOGUE} must be saved in the macros
support block profiling.
@end table
+@node Inlining
+@subsection Permitting inlining of functions with attributes
+@cindex inlining
+
+By default if a function has a target specific attribute attached to it,
+it will not be inlined. This behaviour can be overridden if the target
+defines the @samp{FUNCTION_ATTRIBUTE_INLINABLE_P} macro. This macro
+takes one argument, a @samp{DECL} describing the function. It should
+return non-zero if the function can be inlined, otherwise it should
+return 0.
+
+@node Tail Calling
+@subsection Permitting tail calls to functions
+@cindex tail calls
+@cindex sibling calls
+
+@table @code
+@findex FUNCTION_OK_FOR_SIBCALL
+@item FUNCTION_OK_FOR_SIBCALL (@var{decl})
+A C expression that evaluates to true if it is ok to perform a sibling
+call to @var{decl}.
+
+It is not uncommon for limitations of calling conventions to prevent
+tail calls to functions outside the current unit of translation, or
+during PIC compilation. Use this macro to enforce these restrictions,
+as the @code{sibcall} md pattern can not fail, or fall over to a
+``normal'' call.
+@end table
+
@node Varargs
@section Implementing the Varargs Macros
@cindex varargs implementation
varargs, and the two machine independent header files must have
conditionals to include it.
-ANSI @file{stdarg.h} differs from traditional @file{varargs.h} mainly in
+ISO @file{stdarg.h} differs from traditional @file{varargs.h} mainly in
the calling convention for @code{va_start}. The traditional
implementation takes just one argument, which is the variable in which
-to store the argument pointer. The ANSI implementation of
+to store the argument pointer. The ISO implementation of
@code{va_start} takes an additional second argument. The user is
supposed to write the last named argument of the function here.
@findex __builtin_saveregs
@item __builtin_saveregs ()
Use this built-in function to save the argument registers in memory so
-that the varargs mechanism can access them. Both ANSI and traditional
+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.
machines that pass all their arguments on the stack.
The argument @var{args_so_far} is the @code{CUMULATIVE_ARGS} data
-structure, containing the values that obtain after processing of the
+structure, containing the values that are obtained after processing the
named arguments. The arguments @var{mode} and @var{type} describe the
last named argument---its machine mode and its data type as a tree node.
RTX for the static chain value that should be passed to the function
when it is called.
+@findex TRAMPOLINE_ADJUST_ADDRESS
+@item TRAMPOLINE_ADJUST_ADDRESS (@var{addr})
+A C statement that should perform any machine-specific adjustment in
+the address of the trampoline. Its argument contains the address that
+was passed to @code{INITIALIZE_TRAMPOLINE}. In case the address to be
+used for a function call should be different from the address in which
+the template was stored, the different address should be assigned to
+@var{addr}. If this macro is not defined, @var{addr} will be used for
+function calls.
+
@findex ALLOCATE_TRAMPOLINE
@item ALLOCATE_TRAMPOLINE (@var{fp})
A C expression to allocate run-time space for a trampoline. The
@findex TARGET_MEM_FUNCTIONS
@cindex @code{bcopy}, implicit usage
@cindex @code{memcpy}, implicit usage
+@cindex @code{memmove}, implicit usage
@cindex @code{bzero}, implicit usage
@cindex @code{memset}, implicit usage
@item TARGET_MEM_FUNCTIONS
-Define this macro if GCC should generate calls to the System V
-(and ANSI C) library functions @code{memcpy} and @code{memset}
-rather than the BSD functions @code{bcopy} and @code{bzero}.
+Define this macro if GCC should generate calls to the ISO C
+(and System V) library functions @code{memcpy}, @code{memmove} and
+@code{memset} rather than the BSD functions @code{bcopy} and @code{bzero}.
@findex LIBGCC_NEEDS_DOUBLE
@item LIBGCC_NEEDS_DOUBLE
-Define this macro if only @code{float} arguments cannot be passed to
-library routines (so they must be converted to @code{double}). This
-macro affects both how library calls are generated and how the library
-routines in @file{libgcc1.c} accept their arguments. It is useful on
+Define this macro if @code{float} arguments cannot be passed to library
+routines (so they must be converted to @code{double}). This macro
+affects both how library calls are generated and how the library
+routines in @file{libgcc.a} accept their arguments. It is useful on
machines where floating and fixed point arguments are passed
differently, such as the i860.
-@findex FLOAT_ARG_TYPE
-@item FLOAT_ARG_TYPE
-Define this macro to override the type used by the library routines to
-pick up arguments of type @code{float}. (By default, they use a union
-of @code{float} and @code{int}.)
-
-The obvious choice would be @code{float}---but that won't work with
-traditional C compilers that expect all arguments declared as @code{float}
-to arrive as @code{double}. To avoid this conversion, the library routines
-ask for the value as some other type and then treat it as a @code{float}.
-
-On some systems, no other type will work for this. For these systems,
-you must use @code{LIBGCC_NEEDS_DOUBLE} instead, to force conversion of
-the values @code{double} before they are passed.
-
-@findex FLOATIFY
-@item FLOATIFY (@var{passed-value})
-Define this macro to override the way library routines redesignate a
-@code{float} argument as a @code{float} instead of the type it was
-passed as. The default is an expression which takes the @code{float}
-field of the union.
-
-@findex FLOAT_VALUE_TYPE
-@item FLOAT_VALUE_TYPE
-Define this macro to override the type used by the library routines to
-return values that ought to have type @code{float}. (By default, they
-use @code{int}.)
-
-The obvious choice would be @code{float}---but that won't work with
-traditional C compilers gratuitously convert values declared as
-@code{float} into @code{double}.
-
-@findex INTIFY
-@item INTIFY (@var{float-value})
-Define this macro to override the way the value of a
-@code{float}-returning library routine should be packaged in order to
-return it. These functions are actually declared to return type
-@code{FLOAT_VALUE_TYPE} (normally @code{int}).
-
-These values can't be returned as type @code{float} because traditional
-C compilers would gratuitously convert the value to a @code{double}.
-
-A local variable named @code{intify} is always available when the macro
-@code{INTIFY} is used. It is a union of a @code{float} field named
-@code{f} and a field named @code{i} whose type is
-@code{FLOAT_VALUE_TYPE} or @code{int}.
-
-If you don't define this macro, the default definition works by copying
-the value through that union.
-
-@findex nongcc_SI_type
-@item nongcc_SI_type
-Define this macro as the name of the data type corresponding to
-@code{SImode} in the system's own C compiler.
-
-You need not define this macro if that type is @code{long int}, as it usually
-is.
-
-@findex nongcc_word_type
-@item nongcc_word_type
-Define this macro as the name of the data type corresponding to the
-word_mode in the system's own C compiler.
-
-You need not define this macro if that type is @code{long int}, as it usually
-is.
-
-@findex perform_@dots{}
-@item perform_@dots{}
-Define these macros to supply explicit C statements to carry out various
-arithmetic operations on types @code{float} and @code{double} in the
-library routines in @file{libgcc1.c}. See that file for a full list
-of these macros and their arguments.
-
-On most machines, you don't need to define any of these macros, because
-the C compiler that comes with the system takes care of doing them.
-
@findex NEXT_OBJC_RUNTIME
@item NEXT_OBJC_RUNTIME
Define this macro to generate code for Objective C message sending using
This is about addressing modes.
@table @code
-@findex HAVE_POST_INCREMENT
-@item HAVE_POST_INCREMENT
-A C expression that is nonzero the machine supports post-increment addressing.
-
@findex HAVE_PRE_INCREMENT
-@findex HAVE_POST_DECREMENT
@findex HAVE_PRE_DECREMENT
+@findex HAVE_POST_INCREMENT
+@findex HAVE_POST_DECREMENT
@item HAVE_PRE_INCREMENT
-@itemx HAVE_POST_DECREMENT
@itemx HAVE_PRE_DECREMENT
-Similar for other kinds of addressing.
+@itemx HAVE_POST_INCREMENT
+@itemx HAVE_POST_DECREMENT
+A C expression that is non-zero if the machine supports pre-increment,
+pre-decrement, post-increment, or post-decrement addressing respectively.
+
+@findex HAVE_POST_MODIFY_DISP
+@findex HAVE_PRE_MODIFY_DISP
+@item HAVE_PRE_MODIFY_DISP
+@itemx HAVE_POST_MODIFY_DISP
+A C expression that is non-zero if the machine supports pre- or
+post-address side-effect generation involving constants other than
+the size of the memory operand.
+
+@findex HAVE_POST_MODIFY_REG
+@findex HAVE_PRE_MODIFY_REG
+@item HAVE_PRE_MODIFY_REG
+@itemx HAVE_POST_MODIFY_REG
+A C expression that is non-zero if the machine supports pre- or
+post-address side-effect generation involving a register displacement.
@findex CONSTANT_ADDRESS_P
@item CONSTANT_ADDRESS_P (@var{x})
looking for one that is valid, and will reload one or both registers
only if neither labeling works.
+@findex FIND_BASE_TERM
+@item FIND_BASE_TERM (@var{x})
+A C expression to determine the base term of address @var{x}.
+This macro is used in only one place: `find_base_term' in alias.c.
+
+It is always safe for this macro to not be defined. It exists so
+that alias analysis can understand machine-dependent addresses.
+
+The typical use of this macro is to handle addresses containing
+a label_ref or symbol_ref within an UNSPEC.
+
@findex LEGITIMIZE_ADDRESS
@item LEGITIMIZE_ADDRESS (@var{x}, @var{oldx}, @var{mode}, @var{win})
A C compound statement that attempts to replace @var{x} with a valid
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.
+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
@findex EXTRA_CC_MODES
@item EXTRA_CC_MODES
-A list of additional modes for condition code values in registers
+A list of additional modes for condition code values in registers
(@pxref{Jump Patterns}). This macro should expand to a sequence of
calls of the macro @code{CC} separated by white space. @code{CC} takes
two arguments. The first is the enumeration name of the mode, which
@findex CANONICALIZE_COMPARISON
@item CANONICALIZE_COMPARISON (@var{code}, @var{op0}, @var{op1})
-One some machines not all possible comparisons are defined, but you can
+On some machines not all possible comparisons are defined, but you can
convert an invalid comparison into a valid one. For example, the Alpha
does not have a @code{GT} comparison, but you can use an @code{LT}
comparison instead and swap the order of the operands.
#define REVERSIBLE_CC_MODE(MODE) ((MODE) != CCFPEmode)
@end smallexample
+@findex REVERSE_CONDITION (@var{code}, @var{mode})
+A C expression whose value is reversed condition code of the @var{code} for
+comparison done in CC_MODE @var{mode}. The macro is used only in case
+@code{REVERSIBLE_CC_MODE (@var{mode})} is nonzero. Define this macro in case
+machine has some non-standard way how to reverse certain conditionals. For
+instance in case all floating point conditions are non-trapping, compiler may
+freely convert unordered compares to ordered one. Then definition may look
+like:
+
+@smallexample
+#define REVERSE_CONDITION(CODE, MODE) \
+ ((MODE) != CCFPmode ? reverse_condtion (CODE) \
+ : reverse_condition_maybe_unordered (CODE))
+@end smallexample
+
+@findex REVERSE_CONDEXEC_PREDICATES_P
+@item REVERSE_CONDEXEC_PREDICATES_P (@var{code1}, @var{code2})
+A C expression that returns true if the conditional execution predicate
+@var{code1} is the inverse of @var{code2} and vice versa. Define this to
+return 0 if the target has conditional execution predicates that cannot be
+reversed safely. If no expansion is specified, this macro is defined as
+follows:
+
+@smallexample
+#define REVERSE_CONDEXEC_PREDICATES_P (x, y) ((x) == reverse_condition (y))
+@end smallexample
+
@end table
@node Costs
value.
This macro is optional; do not define it if the default cost assumptions
-are adequate for the target machine.
+are adequate for the target machine.
@findex ADDRESS_COST
@item ADDRESS_COST (@var{address})
constant.
@findex REGISTER_MOVE_COST
-@item REGISTER_MOVE_COST (@var{from}, @var{to})
-A C expression for the cost of moving data 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.
+@item REGISTER_MOVE_COST (@var{mode}, @var{from}, @var{to})
+A C expression for 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
@table @code
@findex TEXT_SECTION_ASM_OP
@item TEXT_SECTION_ASM_OP
-A C expression whose value is a string containing the assembler
-operation that should precede instructions and read-only data. Normally
-@code{".text"} is right.
+A C expression whose value is a string, including spacing, containing the
+assembler operation that should precede instructions and read-only data.
+Normally @code{"\t.text"} is right.
@findex DATA_SECTION_ASM_OP
@item DATA_SECTION_ASM_OP
-A C expression whose value is a string containing the assembler
-operation to identify the following data as writable initialized data.
-Normally @code{".data"} is right.
+A C expression whose value is a string, including spacing, containing the
+assembler operation to identify the following data as writable initialized
+data. Normally @code{"\t.data"} is right.
@findex SHARED_SECTION_ASM_OP
@item SHARED_SECTION_ASM_OP
-If defined, a C expression whose value is a string containing the
-assembler operation to identify the following data as shared data. If
-not defined, @code{DATA_SECTION_ASM_OP} will be used.
+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.
@findex BSS_SECTION_ASM_OP
@item BSS_SECTION_ASM_OP
-If defined, a C expression whose value is a string containing the
-assembler operation to identify the following data as uninitialized global
-data. If not defined, and neither @code{ASM_OUTPUT_BSS} nor
-@code{ASM_OUTPUT_ALIGNED_BSS} are defined, uninitialized global data will be
-output in the data section if @samp{-fno-common} is passed, otherwise
-@code{ASM_OUTPUT_COMMON} will be used.
+If defined, a C expression whose value is a string, including spacing,
+containing the assembler operation to identify the following data as
+uninitialized global data. If not defined, and neither
+@code{ASM_OUTPUT_BSS} nor @code{ASM_OUTPUT_ALIGNED_BSS} are defined,
+uninitialized global data will be output in the data section if
+@samp{-fno-common} is passed, otherwise @code{ASM_OUTPUT_COMMON} will be
+used.
@findex SHARED_BSS_SECTION_ASM_OP
@item SHARED_BSS_SECTION_ASM_OP
-If defined, a C expression whose value is a string containing the
-assembler operation to identify the following data as uninitialized global
-shared data. If not defined, and @code{BSS_SECTION_ASM_OP} is, the latter
-will be used.
+If defined, a C expression whose value is a string, including spacing,
+containing the assembler operation to identify the following data as
+uninitialized global shared data. If not defined, and
+@code{BSS_SECTION_ASM_OP} is, the latter will be used.
@findex INIT_SECTION_ASM_OP
@item INIT_SECTION_ASM_OP
-If defined, a C expression whose value is a string containing the
-assembler operation to identify the following data as initialization
-code. If not defined, GCC will assume such a section does not
-exist.
+If defined, a C expression whose value is a string, including spacing,
+containing the assembler operation to identify the following data as
+initialization code. If not defined, GCC will assume such a section does
+not exist.
+
+@findex FINI_SECTION_ASM_OP
+@item FINI_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
+finalization code. If not defined, GCC will assume such a section does
+not exist.
+
+@findex CRT_CALL_STATIC_FUNCTION
+@item CRT_CALL_STATIC_FUNCTION
+If defined, a C statement that calls the function named as the sole
+argument of this macro. This is used in @file{crtstuff.c} if
+@code{INIT_SECTION_ASM_OP} or @code{FINI_SECTION_ASM_OP} to calls to
+initialization and finalization functions from the init and fini
+sections. By default, this macro is a simple function call. Some
+ports need hand-crafted assembly code to avoid dependencies on
+registers initialized in the function prologue or to ensure that
+constant pools don't end up too far way in the text section.
@findex EXTRA_SECTIONS
@findex in_text
@findex JUMP_TABLES_IN_TEXT_SECTION
@item JUMP_TABLES_IN_TEXT_SECTION
-Define this macro to be an expression with a non-zero value if jump
+Define this macro to be an expression with a non-zero value if jump
tables (for @code{tablejump} insns) should be output in the text
section, along with the assembler instructions. Otherwise, the
readonly data section is used.
On systems that use SDB, it is necessary to output certain commands;
see @file{attasm.h}.
-@findex ASM_IDENTIFY_GCC
-@item ASM_IDENTIFY_GCC (@var{file})
-A C statement to output assembler commands which will identify
-the object file as having been compiled with GCC (or another
-GNU compiler).
-
-If you don't define this macro, the string @samp{gcc_compiled.:}
-is output. This string is calculated to define a symbol which,
-on BSD systems, will never be defined for any other reason.
-GDB checks for the presence of this symbol when reading the
-symbol table of an executable.
-
-On non-BSD systems, you must arrange communication with GDB in
-some other fashion. If GDB is not used on your system, you can
-define this macro with an empty body.
-
@findex ASM_COMMENT_START
@item ASM_COMMENT_START
A C string constant describing how to begin a comment in the target
for the file format in use is appropriate.
@findex OUTPUT_QUOTED_STRING
-@item OUTPUT_QUOTED_STRING (@var{stream}, @var{name})
+@item OUTPUT_QUOTED_STRING (@var{stream}, @var{string})
A C statement to output the string @var{string} to the stdio stream
@var{stream}. If you do not call the function @code{output_quoted_string}
in your config files, GCC will only call it to output filenames to
@var{name} for object @var{decl} which is either a @code{FUNCTION_DECL}, a
@code{VAR_DECL} or @code{NULL_TREE}. @var{reloc}
indicates whether the initial value of @var{exp} requires link-time
-relocations. Some target formats do not support
-arbitrary sections. Do not define this macro in such cases.
+relocations. The string given by @var{name} will always be the
+canonical version stored in the global stringpool.
+
+Some target formats do not support arbitrary sections. Do not define
+this macro in such cases.
At present this macro is only used to support section attributes.
When this macro is undefined, section attributes are disabled.
a size of @code{UNITS_PER_WORD}, once for each word, you need not define
the macro.
+@findex OUTPUT_ADDR_CONST_EXTRA
+@item OUTPUT_ADDR_CONST_EXTRA (@var{stream}, @var{x}, @var{fail})
+A C statement to recognize @var{rtx} patterns that
+@code{output_addr_const} can't deal with, and output assembly code to
+@var{stream} corresponding to the pattern @var{x}. This may be used to
+allow machine-dependent @code{UNSPEC}s to appear within constants.
+
+If @code{OUTPUT_ADDR_CONST_EXTRA} fails to recognize a pattern, it must
+@code{goto fail}, so that a standard error message is printed. If it
+prints an error message itself, by calling, for example,
+@code{output_operand_lossage}, it may just complete normally.
+
@findex ASM_OUTPUT_BYTE
@item ASM_OUTPUT_BYTE (@var{stream}, @var{value})
A C statement to output to the stdio stream @var{stream} an assembler
@findex ASM_BYTE_OP
@item ASM_BYTE_OP
-A C string constant giving the pseudo-op to use for a sequence of
-single-byte constants. If this macro is not defined, the default is
-@code{"byte"}.
+A C string constant, including spacing, giving the pseudo-op to use for a
+sequence of single-byte constants. If this macro is not defined, the
+default is @code{"\t.byte\t"}.
+
+@findex UNALIGNED_SHORT_ASM_OP
+@findex UNALIGNED_INT_ASM_OP
+@findex UNALIGNED_DOUBLE_INT_ASM_OP
+@item UNALIGNED_SHORT_ASM_OP
+@itemx UNALIGNED_INT_ASM_OP
+@itemx UNALIGNED_DOUBLE_INT_ASM_OP
+A C string constant, including spacing, giving the pseudo-op to use
+to assemble 16-, 32-, and 64-bit integers respectively @emph{without}
+adding implicit padding or alignment. These macros are required if
+DWARF 2 frame unwind is used. On ELF systems, these will default
+to @code{.2byte}, @code{.4byte}, and @code{.8byte}.@refill
@findex ASM_OUTPUT_ASCII
@item ASM_OUTPUT_ASCII (@var{stream}, @var{ptr}, @var{len})
pool before the function.
@findex ASM_OUTPUT_POOL_PROLOGUE
-@item ASM_OUTPUT_POOL_PROLOGUE (@var{file} @var{funname} @var{fundecl} @var{size})
+@item ASM_OUTPUT_POOL_PROLOGUE (@var{file}, @var{funname}, @var{fundecl}, @var{size})
A C statement to output assembler commands to define the start of the
constant pool for a function. @var{funname} is a string giving
the name of the function. Should the return type of the function
@findex ASM_CLOSE_PAREN
@item ASM_OPEN_PAREN
@itemx ASM_CLOSE_PAREN
-These macros are defined as C string constant, describing the syntax
+These macros are defined as C string constants, describing the syntax
in the assembler for grouping arithmetic expressions. The following
definitions are correct for most assemblers:
@item ASM_OUTPUT_ALIGNED_DECL_COMMON (@var{stream}, @var{decl}, @var{name}, @var{size}, @var{alignment})
Like @code{ASM_OUTPUT_ALIGNED_COMMON} except that @var{decl} of the
variable to be output, if there is one, or @code{NULL_TREE} if there
-is not corresponding variable. If you define this macro, GCC wil use it
+is no corresponding variable. If you define this macro, GCC will use it
in place of both @code{ASM_OUTPUT_COMMON} and
@code{ASM_OUTPUT_ALIGNED_COMMON}. Define this macro when you need to see
the variable's decl in order to chose what to output.
@item ASM_OUTPUT_ALIGNED_DECL_LOCAL (@var{stream}, @var{decl}, @var{name}, @var{size}, @var{alignment})
Like @code{ASM_OUTPUT_ALIGNED_DECL} except that @var{decl} of the
variable to be output, if there is one, or @code{NULL_TREE} if there
-is not corresponding variable. If you define this macro, GCC wil use it
+is no corresponding variable. If you define this macro, GCC will use it
in place of both @code{ASM_OUTPUT_DECL} and
@code{ASM_OUTPUT_ALIGNED_DECL}. Define this macro when you need to see
the variable's decl in order to chose what to output.
a reference to the label @var{label}.
@end ignore
+@findex ASM_OUTPUT_SYMBOL_REF
+@item ASM_OUTPUT_SYMBOL_REF (@var{stream}, @var{sym})
+A C statement (sans semicolon) to output a reference to
+@code{SYMBOL_REF} @var{sym}. If not defined, @code{assemble_output}
+will be used to output the name of the symbol. This macro may be used
+to modify the way a symbol is referenced depending on information
+encoded by @code{ENCODE_SECTION_INFO}.
+
@findex ASM_OUTPUT_INTERNAL_LABEL
@item ASM_OUTPUT_INTERNAL_LABEL (@var{stream}, @var{prefix}, @var{num})
A C statement to output to the stdio stream @var{stream} a label whose
fprintf (@var{stream}, "L%s%d:\n", @var{prefix}, @var{num})
@end example
+@findex ASM_OUTPUT_DEBUG_LABEL
+@item ASM_OUTPUT_DEBUG_LABEL (@var{stream}, @var{prefix}, @var{num})
+A C statement to output to the stdio stream @var{stream} a debug info
+label whose name is made from the string @var{prefix} and the number
+@var{num}. This is useful for VLIW targets, where debug info labels
+may need to be treated differently than branch target labels. On some
+systems, branch target labels must be at the beginning of instruction
+bundles, but debug info labels can occur in the middle of instruction
+bundles.
+
+If this macro is not defined, then @code{ASM_OUTPUT_INTERNAL_LABEL} will be
+used.
+
@findex ASM_OUTPUT_ALTERNATE_LABEL_NAME
@item ASM_OUTPUT_ALTERNATE_LABEL_NAME (@var{stream}, @var{string})
A C statement to output to the stdio stream @var{stream} the string
correct for most systems.
@findex ASM_OUTPUT_DEF_FROM_DECLS
-@item ASM_OUTPUT_DEF (@var{stream}, @var{decl_of_name}, @var{decl_of_value})
+@item ASM_OUTPUT_DEF_FROM_DECLS (@var{stream}, @var{decl_of_name}, @var{decl_of_value})
A C statement to output to the stdio stream @var{stream} assembler code
-which defines (equates) the symbol whoes tree node is @var{decl_of_name}
+which defines (equates) the symbol whose tree node is @var{decl_of_name}
to have the value of the tree node @var{decl_of_value}. This macro will
be used in preference to @samp{ASM_OUTPUT_DEF} if it is defined and if
the tree nodes are available.
On systems where the assembler can handle quoted names, you can use this
macro to provide more human-readable names.
+
+@findex ASM_DECLARE_UNRESOLVED_REFERENCE
+@item ASM_DECLARE_UNRESOLVED_REFERENCE (@var{stream}, @var{name})
+A C statement (sans semicolon) to output to the stdio stream
+@var{stream} commands to declare that the label @var{name} is an
+unresolved Objective-C class reference. This is only needed for targets
+whose linkers have special support for NeXT-style runtimes.
@end table
@node Initialization
@table @code
@findex INIT_SECTION_ASM_OP
@item INIT_SECTION_ASM_OP
-If defined, a C string constant for the assembler operation to identify
-the following data as initialization code. If not defined, GCC will
-assume such a section does not exist. When you are using special
-sections for initialization and termination functions, this macro also
-controls how @file{crtstuff.c} and @file{libgcc2.c} arrange to run the
-initialization functions.
+If defined, a C string constant, including spacing, for the assembler
+operation to identify the following data as initialization code. If not
+defined, GCC will assume such a section does not exist. When you are
+using special sections for initialization and termination functions, this
+macro also controls how @file{crtstuff.c} and @file{libgcc2.c} arrange to
+run the initialization functions.
@item HAS_INIT_SECTION
@findex HAS_INIT_SECTION
where the init section is not actually run automatically, but is still
useful for collecting the lists of constructors and destructors.
+@item SUPPORTS_INIT_PRIORITY
+@findex SUPPORTS_INIT_PRIORITY
+If nonzero, the C++ @code{init_priority} attribute is supported and the
+compiler should emit instructions to control the order of initialization
+of objects. If zero, the compiler will issue an error message upon
+encountering an @code{init_priority} attribute.
+
@item ASM_OUTPUT_CONSTRUCTOR (@var{stream}, @var{name})
@findex ASM_OUTPUT_CONSTRUCTOR
Define this macro as a C statement to output on the stream @var{stream}
functions rather than initialization functions.
When @code{ASM_OUTPUT_CONSTRUCTOR} and @code{ASM_OUTPUT_DESTRUCTOR} are
-defined, the initializaiton routine generated for the generated object
+defined, the initialization routine generated for the generated object
file will have static linkage.
@end table
@item ASM_FPRINTF_EXTENSIONS(@var{file}, @var{argptr}, @var{format})
@findex ASM_FPRINTF_EXTENSIONS
-If defiend this macro should expand to a series of @code{case}
+If defined this macro should expand to a series of @code{case}
statements which will be parsed inside the @code{switch} statement of
the @code{asm_fprintf} function. This allows targets to define extra
printf formats which may useful when generating their assembler
-statements. Noet that upper case letters are reserved for future
+statements. Note that upper case letters are reserved for future
generic extensions to asm_fprintf, and so are not available to target
specific code. The output file is given by the parameter @var{file}.
The varargs input pointer is @var{argptr} and the rest of the format
the jump-table.
@end table
-@node Exception Region Output
+@node Exception Region Output
@subsection Assembler Commands for Exception Regions
@c prevent bad page break with this line
@findex EH_FRAME_SECTION_ASM_OP
@item EH_FRAME_SECTION_ASM_OP
-If defined, a C string constant for the assembler operation to switch to
-the section for exception handling frame unwind information. If not
-defined, GCC will provide a default definition if the target supports
-named sections. @file{crtstuff.c} uses this macro to switch to the
-appropriate section.
+If defined, a C string constant, including spacing, for the assembler
+operation to switch to the section for exception handling frame unwind
+information. If not defined, GCC will provide a default definition if the
+target supports named sections. @file{crtstuff.c} uses this macro to
+switch to the appropriate section.
You should define this symbol if your target supports DWARF 2 frame
unwind information and the default definition does not work.
If this macro is defined to anything, the DWARF 2 unwinder will be used
instead of inline unwinders and __unwind_function in the non-setjmp case.
+@findex DWARF_CIE_DATA_ALIGNMENT
+@item DWARF_CIE_DATA_ALIGNMENT
+This macro need only be defined if the target might save registers in the
+function prologue at an offset to the stack pointer that is not aligned to
+@code{UNITS_PER_WORD}. The definition should be the negative minimum
+alignment if @code{STACK_GROWS_DOWNWARD} is defined, and the positive
+minimum alignment otherwise. @xref{SDB and DWARF}. Only applicable if
+the target supports DWARF 2 frame unwind information.
+
@end table
@node Alignment Output
@findex LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP
@item LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP
-The maximum number of bytes to skip when applying
+The maximum number of bytes to skip when applying
@code{LABEL_ALIGN_AFTER_BARRIER}. This works only if
@code{ASM_OUTPUT_MAX_SKIP_ALIGN} is defined.
@findex ASM_STABS_OP
@item ASM_STABS_OP
-A C string constant naming the assembler pseudo op to use instead of
-@code{.stabs} to define an ordinary debugging symbol. If you don't
-define this macro, @code{.stabs} is used. This macro applies only to
-DBX debugging information format.
+A C string constant, including spacing, naming the assembler pseudo op to
+use instead of @code{"\t.stabs\t"} to define an ordinary debugging symbol.
+If you don't define this macro, @code{"\t.stabs\t"} is used. This macro
+applies only to DBX debugging information format.
@findex ASM_STABD_OP
@item ASM_STABD_OP
-A C string constant naming the assembler pseudo op to use instead of
-@code{.stabd} to define a debugging symbol whose value is the current
-location. If you don't define this macro, @code{.stabd} is used.
-This macro applies only to DBX debugging information format.
+A C string constant, including spacing, naming the assembler pseudo op to
+use instead of @code{"\t.stabd\t"} to define a debugging symbol whose
+value is the current location. If you don't define this macro,
+@code{"\t.stabd\t"} is used. This macro applies only to DBX debugging
+information format.
@findex ASM_STABN_OP
@item ASM_STABN_OP
-A C string constant naming the assembler pseudo op to use instead of
-@code{.stabn} to define a debugging symbol with no name. If you don't
-define this macro, @code{.stabn} is used. This macro applies only to
-DBX debugging information format.
+A C string constant, including spacing, naming the assembler pseudo op to
+use instead of @code{"\t.stabn\t"} to define a debugging symbol with no
+name. If you don't define this macro, @code{"\t.stabn\t"} is used. This
+macro applies only to DBX debugging information format.
@findex DBX_NO_XREFS
@item DBX_NO_XREFS
and has the type @code{REAL_VALUE_TYPE}.
@end table
+@node Mode Switching
+@section Mode Switching Instructions
+@cindex mode switching
+The following macros control mode switching optimizations:
+
+@table @code
+@findex OPTIMIZE_MODE_SWITCHING
+@item OPTIMIZE_MODE_SWITCHING (@var{entity})
+Define this macro if the port needs extra instructions inserted for mode
+switching in an optimizing compilation.
+
+For an example, the SH4 can perform both single and double precision
+floating point operations, but to perform a single precision operation,
+the FPSCR PR bit has to be cleared, while for a double precision
+operation, this bit has to be set. Changing the PR bit requires a general
+purpose register as a scratch register, hence these FPSCR sets have to
+be inserted before reload, i.e. you can't put this into instruction emitting
+or MACHINE_DEPENDENT_REORG.
+
+You can have multiple entities that are mode-switched, and select at run time
+which entities actually need it. @code{OPTIMIZE_MODE_SWITCHING} should
+return non-zero for any @var{entity} that 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.
+
+@findex NUM_MODES_FOR_MODE_SWITCHING
+@item NUM_MODES_FOR_MODE_SWITCHING
+If you define @code{OPTIMIZE_MODE_SWITCHING}, you have to define this as
+initializer for an array of integers. Each initializer element
+N refers to an entity that needs mode switching, and specifies the number
+of different modes that might need to be set for this entity.
+The position of the initializer in the initializer - starting counting at
+zero - determines the integer that is used to refer to the mode-switched
+entity in question.
+In macros that take mode arguments / yield a mode result, modes are
+represented as numbers 0 .. N - 1. N is used to specify that no mode
+switch is needed / supplied.
+
+@findex MODE_NEEDED
+@item MODE_NEEDED (@var{entity}, @var{insn})
+@var{entity} is an integer specifying a mode-switched entity. If
+@code{OPTIMIZE_MODE_SWITCHING} is defined, you must define this macro to
+return an integer value not larger than the corresponding element in
+NUM_MODES_FOR_MODE_SWITCHING, to denote the mode that @var{entity} must
+be switched into prior to the execution of INSN.
+
+@findex NORMAL_MODE
+@item NORMAL_MODE (@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.
+
+@findex MODE_PRIORITY_TO_MODE
+@item MODE_PRIORITY_TO_MODE (@var{entity}, @var{n})
+This macro specifies the order in which modes for ENTITY are processed.
+0 is the highest priority, NUM_MODES_FOR_MODE_SWITCHING[ENTITY] - 1 the
+lowest. The value of the macro should be an integer designating a mode
+for ENTITY. For any fixed @var{entity}, @code{mode_priority_to_mode}
+(@var{entity}, @var{n}) shall be a bijection in 0 ..
+@code{num_modes_for_mode_switching}[@var{entity}] - 1 .
+
+@findex EMIT_MODE_SET
+@item EMIT_MODE_SET (@var{entity}, @var{mode}, @var{hard_regs_live})
+Generate one or more insns to set @var{entity} to @var{mode}.
+@var{hard_reg_live} is the set of hard registers live at the point where
+the insn(s) are to be inserted.
+@end table
+
@node Misc
@section Miscellaneous Parameters
@cindex parameters, miscellaneous
in the list specified by this macro are those used in the most insn
patterns.
+For each predicate function named in @var{PREDICATE_CODES}, a
+declaration will be generated in @file{insn-codes.h}.
+
@item SPECIAL_MODE_PREDICATES
@findex SPECIAL_MODE_PREDICATES
Define this if you have special predicates that know special things
-about modes. Genrecog will warn about certain forms of
+about modes. Genrecog will warn about certain forms of
@code{match_operand} without a mode; if the operand predicate is
-listed in @code{SPECIAL_MODE_PREDICATES}, the warning will be
+listed in @code{SPECIAL_MODE_PREDICATES}, the warning will be
suppressed.
Here is an example from the IA-32 port (@code{ext_register_operand}
Optional: return the preferred mode for an @code{addr_diff_vec}
when the minimum and maximum offset are known. If you define this,
it enables extra code in branch shortening to deal with @code{addr_diff_vec}.
-To make this work, you also have to define INSN_ALIGN and
+To make this work, you also have to define INSN_ALIGN and
make the alignment for @code{addr_diff_vec} explicit.
The @var{body} argument is provided so that the offset_unsigned and scale
flags can be updated.
@samp{extern "C" @{@dots{}@}}.
@findex HANDLE_PRAGMA
+@item HANDLE_PRAGMA (@var{getc}, @var{ungetc}, @var{name})
+This macro is no longer supported. You must use
+@code{REGISTER_TARGET_PRAGMAS} instead.
+
+@findex REGISTER_TARGET_PRAGMAS
@findex #pragma
@findex pragma
-@item HANDLE_PRAGMA (@var{getc}, @var{ungetc}, @var{name})
-Define this macro if you want to implement any pragmas. If defined, it
-is a C expression whose value is 1 if the pragma was handled by the
-macro, zero otherwise. The argument @var{getc} is a function of type
-@samp{int (*)(void)} which will return the next character in the input
-stream, or EOF if no characters are left. The argument @var{ungetc} is
-a function of type @samp{void (*)(int)} which will push a character back
-into the input stream. The argument @var{name} is the word following
-#pragma in the input stream. The input stream pointer will be pointing
-just beyond the end of this word. The input stream should be left
-undistrubed if the expression returns zero, otherwise it should be
-pointing at the next character after the end of the pragma. Any
-characters remaining on the line will be ignored.
-
-It is generally a bad idea to implement new uses of @code{#pragma}. The
-only reason to define this macro is for compatibility with other
-compilers that do support @code{#pragma} for the sake of any user
-programs which already use it.
-
-If the pragma can be implemented by atttributes then the macro
+@item REGISTER_TARGET_PRAGMAS (@var{pfile})
+Define this macro if you want to implement any target-specific pragmas.
+If defined, it is a C expression which makes a series of calls to the
+@code{cpp_register_pragma} and/or @code{cpp_register_pragma_space}
+functions. The @var{pfile} argument is the first argument to supply to
+these functions. The macro may also do setup required for the pragmas.
+
+The primary reason to define this macro is to provide compatibility with
+other compilers for the same target. In general, we discourage
+definition of target-specific pragmas for GCC.
+
+If the pragma can be implemented by attributes then the macro
@samp{INSERT_ATTRIBUTES} might be a useful one to define as well.
-Note: older versions of this macro only had two arguments: @var{stream}
-and @var{token}. The macro was changed in order to allow it to work
-when gcc is built both with and without a cpp library.
+Preprocessor macros that appear on pragma lines are not expanded. All
+@samp{#pragma} directives that do not match any registered pragma are
+silently ignored, unless the user specifies @samp{-Wunknown-pragmas}.
+
+@deftypefun void cpp_register_pragma (cpp_reader *@var{pfile}, const char *@var{space}, const char *@var{name}, void (*@var{callback}) (cpp_reader *))
+
+Each call to @code{cpp_register_pragma} establishes one pragma. The
+@var{callback} routine will be called when the preprocessor encounters a
+pragma of the form
+
+@smallexample
+#pragma [@var{space}] @var{name} @dots{}
+@end smallexample
+
+@var{space} must have been the subject of a previous call to
+@code{cpp_register_pragma_space}, or else be a null pointer. The
+callback routine receives @var{pfile} as its first argument, but must
+not use it for anything (this may change in the future). It may read
+any text after the @var{name} by making calls to @code{c_lex}. Text
+which is not read by the callback will be silently ignored.
+
+Note that both @var{space} and @var{name} are case sensitive.
+
+For an example use of this routine, see @file{c4x.h} and the callback
+routines defined in @file{c4x.c}.
+
+Note that the use of @code{c_lex} is specific to the C and C++
+compilers. It will not work in the Java or Fortran compilers, or any
+other language compilers for that matter. Thus if @code{c_lex} is going
+to be called from target-specific code, it must only be done so when
+building hte C and C++ compilers. This can be done by defining the
+variables @code{c_target_objs} and @code{cxx_target_objs} in the
+target entry in the @code{config.gcc} file. These variables should name
+the target-specific, language-specific object file which contains the
+code that uses @code{c_lex}. Note it will also be necessary to add a
+rule to the makefile fragment pointed to by @code{tmake_file} that shows
+how to build this object file.
+@end deftypefun
+
+@deftypefun void cpp_register_pragma_space (cpp_reader *@var{pfile}, const char *@var{space})
+This routine establishes a namespace for pragmas, which will be
+registered by subsequent calls to @code{cpp_register_pragma}. For
+example, pragmas defined by the C standard are in the @samp{STDC}
+namespace, and pragmas specific to GCC are in the @samp{GCC} namespace.
+
+For an example use of this routine in a target header, see @file{v850.h}.
+@end deftypefun
@findex HANDLE_SYSV_PRAGMA
@findex #pragma
@item NEED_ATEXIT
@findex NEED_ATEXIT
Define this if the target system lacks the function @code{atexit}
-from the ANSI C standard. If this macro is defined, a default definition
+from the ISO C standard. If this macro is defined, a default definition
will be provided to support C++. If @code{ON_EXIT} is not defined,
a default @code{exit} function will also be provided.
Define this if your @code{exit} function needs to do something
besides calling an external function @code{_cleanup} before
terminating with @code{_exit}. The @code{EXIT_BODY} macro is
-only needed if neither @code{HAVE_ATEXIT} nor
-@code{INIT_SECTION_ASM_OP} are defined.
+only needed if @code{NEED_ATEXIT} is defined and @code{ON_EXIT} is not
+defined.
@findex INSN_SETS_ARE_DELAYED
@item INSN_SETS_ARE_DELAYED (@var{insn})
@findex ISSUE_RATE
@item ISSUE_RATE
A C expression that returns how many instructions can be issued at the
-same time if the machine is a superscalar machine. This is only used by
-the @samp{Haifa} scheduler, and not the traditional scheduler.
+same time if the machine is a superscalar machine.
@findex MD_SCHED_INIT
-@item MD_SCHED_INIT (@var{file}, @var{verbose})
-A C statement which is executed by the @samp{Haifa} scheduler at the
+@item MD_SCHED_INIT (@var{file}, @var{verbose}, @var{max_ready})
+A C statement which is executed by the scheduler at the
beginning of each block of instructions that are to be scheduled.
@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
+@samp{-fsched-verbose-}@var{n}. @var{max_ready} is the maximum number
+of insns in the current scheduling region that can be live at the same
+time. This can be used to allocate scratch space if it is needed.
+
+@findex MD_SCHED_FINISH
+@item MD_SCHED_FINISH (@var{file}, @var{verbose})
+A C statement which is executed by the scheduler at the end of each block
+of instructions that are to be scheduled. It can be used to perform
+cleanup of any actions done by the other scheduling macros.
+@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
@samp{-fsched-verbose-}@var{n}.
@findex MD_SCHED_REORDER
-@item MD_SCHED_REORDER (@var{file}, @var{verbose}, @var{ready}, @var{n_ready},
- @var{clock}, @var{can_issue_more})
-A C statement which is executed by the @samp{Haifa} scheduler after it
+@item MD_SCHED_REORDER (@var{file}, @var{verbose}, @var{ready}, @var{n_ready}, @var{clock}, @var{can_issue_more})
+A C statement which is executed by the scheduler after it
has scheduled the ready list to allow the machine description to reorder
it (for example to combine two small instructions together on
@samp{VLIW} machines). @var{file} is either a null pointer, or a stdio
@var{ready}[@var{n_ready}-1] and going to @var{ready}[0]. @var{clock}
is the timer tick of the scheduler. @var{can_issue_more} is an output
parameter that is set to the number of insns that can issue this clock;
-normally this is just @code{issue_rate}.
+normally this is just @code{issue_rate}. See also @samp{MD_SCHED_REORDER2}.
+
+@findex MD_SCHED_REORDER2
+@item MD_SCHED_REORDER2 (@var{file}, @var{verbose}, @var{ready}, @var{n_ready}, @var{clock}, @var{can_issue_more})
+Like @samp{MD_SCHED_REORDER}, but called at a different time. While the
+@samp{MD_SCHED_REORDER} macro is called whenever the scheduler starts a
+new cycle, this macro is used immediately after @samp{MD_SCHED_VARIABLE_ISSUE}
+is called; it can reorder the ready list and set @var{can_issue_more} to
+determine whether there are more insns to be scheduled in the same cycle.
+Defining this macro can be useful if there are frequent situations where
+scheduling one insn causes other insns to become ready in the same cycle,
+these other insns can then be taken into account properly.
@findex MD_SCHED_VARIABLE_ISSUE
@item MD_SCHED_VARIABLE_ISSUE (@var{file}, @var{verbose}, @var{insn}, @var{more})
-A C statement which is executed by the @samp{Haifa} scheduler after it
+A C statement which is executed by the scheduler after it
has scheduled an insn from the ready list. @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 @samp{-fsched-verbose-}@var{n}.
@findex TARGET_HAS_F_SETLKW
@item TARGET_HAS_F_SETLKW
-Define this macro iff the target supports file locking with fcntl / F_SETLKW.
+Define this macro if the target supports file locking with fcntl / F_SETLKW.
Note that this functionality is part of POSIX.
Defining @code{TARGET_HAS_F_SETLKW} will enable the test coverage code
to use file locking when exiting a program, which avoids race conditions
if the program has forked.
+
+@findex MAX_CONDITIONAL_EXECUTE
+@item MAX_CONDITIONAL_EXECUTE
+
+A C expression for the maximum number of instructions to execute via
+conditional execution instructions instead of a branch. A value of
+@code{BRANCH_COST}+1 is the default if the machine does not use cc0, and
+1 if it does use cc0.
+
+@findex IFCVT_MODIFY_TESTS
+@item IFCVT_MODIFY_TESTS
+A C expression to modify the tests in @code{TRUE_EXPR}, and
+@code{FALSE_EXPPR} for use in converting insns in @code{TEST_BB},
+@code{THEN_BB}, @code{ELSE_BB}, and @code{JOIN_BB} basic blocks to
+conditional execution. Set either @code{TRUE_EXPR} or @code{FALSE_EXPR}
+to a null pointer if the tests cannot be converted.
+
+@findex IFCVT_MODIFY_INSN
+@item IFCVT_MODIFY_INSN
+A C expression to modify the @code{PATTERN} of an @code{INSN} that is to
+be converted to conditional execution format.
+
+@findex IFCVT_MODIFY_FINAL
+@item IFCVT_MODIFY_FINAL
+A C expression to perform any final machine dependent modifications in
+converting code to conditional execution in the basic blocks
+@code{TEST_BB}, @code{THEN_BB}, @code{ELSE_BB}, and @code{JOIN_BB}.
+
+@findex IFCVT_MODIFY_CANCEL
+@item IFCVT_MODIFY_CANCEL
+A C expression to cancel any machine dependent modifications in
+converting code to conditional execution in the basic blocks
+@code{TEST_BB}, @code{THEN_BB}, @code{ELSE_BB}, and @code{JOIN_BB}.
+
+@findex MD_INIT_BUILTINS
+@item MD_INIT_BUILTINS
+Define this macro if you have any machine-specific builtin functions that
+need to be defined. It should be a C expression that performs the
+necessary setup.
+
+Machine specific builtins can be useful to expand special machine
+instructions that would otherwise not normally be generated because
+they have no equivalent in the source language (for example, SIMD vector
+instructions or prefetch instructions).
+
+To create a builtin function, call the function @code{builtin_function}
+which is defined by the language frontend. You can use any type nodes set
+up by @code{build_common_tree_nodes} and @code{build_common_tree_nodes_2};
+only language frontends that use these two functions will use
+@samp{MD_INIT_BUILTINS}.
+
+@findex MD_EXPAND_BUILTIN
+@item MD_EXPAND_BUILTIN(@var{exp}, @var{target}, @var{subtarget}, @var{mode}, @var{ignore})
+
+Expand a call to a machine specific builtin that was set up by
+@samp{MD_INIT_BUILTINS}. @var{exp} is the expression for the function call;
+the result should go to @var{target} if that is convenient, and have mode
+@var{mode} if that is convenient. @var{subtarget} may be used as the target
+for computing one of @var{exp}'s operands. @var{ignore} is nonzero if the value
+is to be ignored.
+This macro should return the result of the call to the builtin.
+
@end table