-@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
+@c Free Software Foundation, Inc.
@c This is part of the GCC manual.
@c For copying conditions, see the file gcc.texi.
* 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
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 SIGNED_CHAR_SPEC
@item SIGNED_CHAR_SPEC
A C string constant that tells the GCC driver program options to
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
@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
Like PCC_BITFIELD_TYPE_MATTERS except that its effect is limited to
aligning a bitfield within the structure.
+@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.
+
@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
(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.
+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
@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.
@end table
@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.
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
@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 SMALL_STACK
@item SMALL_STACK
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.
@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
@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
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{MODE_AT_ENTRY} and @code{MODE_USES_IN_EXIT_BLOCK} are 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_USES_IN_EXIT_BLOCK
+@item MODE_USES_IN_EXIT_BLOCK
+If this macro is defined, it is called for each exit block when mode switching
+optimization is performed. Its return value should be the pattern of an insn,
+or a sequence of insns. It is emitted before the return insn / use insns at
+the end of the exit block.
+
+This is done before insns are examined for their need of any mode switching.
+
+@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 MODE_AT_ENTRY
+@item MODE_AT_ENTRY (@var{entity})
+If this macro is defined, it is evaluated for every @var{entity} that needs
+mode switching. It should evaluate to an integer, which is a mode that
+@var{entity} is assumed to be switched to at function entry.
+
+@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
@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
+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
@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
+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
@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}.
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.
@end table