From d4173f0f7ba10bb13427e1ebeffd538ed0df6be2 Mon Sep 17 00:00:00 2001 From: jsm28 Date: Wed, 10 Jul 2013 23:24:24 +0000 Subject: [PATCH] * doc/tm.texi.in: Move hook documentation to .... * target.def: ... here. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@200893 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 3 + gcc/doc/tm.texi.in | 2783 ---------------------------------------------------- gcc/target.def | 2783 ++++++++++++++++++++++++++++++++++++++++++++++------ 3 files changed, 2502 insertions(+), 3067 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6f83465bb10..d5e9258dd93 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,8 @@ 2013-07-10 Joseph Myers + * doc/tm.texi.in: Move hook documentation to .... + * target.def: ... here. + * doc/tm.texi.in (TARGET_CANONICALIZE_COMPARISON): Remove stray text on @hook line. * doc/tm.texi: Regenerate. diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in index 667d5d10aba..fad6d1044ea 100644 --- a/gcc/doc/tm.texi.in +++ b/gcc/doc/tm.texi.in @@ -698,14 +698,6 @@ should use @code{TARGET_HANDLE_C_OPTION} instead. @hook TARGET_CHECK_STRING_OBJECT_FORMAT_ARG @hook TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE -This target function is similar to the hook @code{TARGET_OPTION_OVERRIDE} -but is called when the optimize level is changed via an attribute or -pragma or when it is reset at the end of the code affected by the -attribute or pragma. It is not called at the beginning of compilation -when @code{TARGET_OPTION_OVERRIDE} is called so if you want to perform these -actions then, you should have @code{TARGET_OPTION_OVERRIDE} call -@code{TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE}. -@end deftypefn @defmac C_COMMON_OVERRIDE_OPTIONS This is similar to the @code{TARGET_OPTION_OVERRIDE} hook @@ -929,26 +921,6 @@ Do not define this macro if it would never modify @var{m}. @end defmac @hook TARGET_PROMOTE_FUNCTION_MODE -Like @code{PROMOTE_MODE}, but it is applied to outgoing function arguments or -function return values. The target hook should return the new mode -and possibly change @code{*@var{punsignedp}} if the promotion should -change signedness. This function is called only for scalar @emph{or -pointer} types. - -@var{for_return} allows to distinguish the promotion of arguments and -return values. If it is @code{1}, a return value is being promoted and -@code{TARGET_FUNCTION_VALUE} must perform the same promotions done here. -If it is @code{2}, the returned mode should be that of the register in -which an incoming parameter is copied, or the outgoing result is computed; -then the hook should return the same mode as @code{promote_mode}, though -the signedness may be different. - -@var{type} can be NULL when promoting function arguments of libcalls. - -The default is to not promote arguments and return values. You can -also define the hook to @code{default_promote_function_mode_always_promote} -if you would like to apply the same rules given by @code{PROMOTE_MODE}. -@end deftypefn @defmac PARM_BOUNDARY Normal alignment required for function parameters on the stack, in @@ -1234,31 +1206,10 @@ to aligning a bit-field within the structure. @end defmac @hook TARGET_ALIGN_ANON_BITFIELD -When @code{PCC_BITFIELD_TYPE_MATTERS} is true this hook will determine -whether unnamed bitfields affect the alignment of the containing -structure. The hook should return true if the structure should inherit -the alignment requirements of an unnamed bitfield's type. -@end deftypefn @hook TARGET_NARROW_VOLATILE_BITFIELD -This target hook should return @code{true} if accesses to volatile bitfields -should use the narrowest mode possible. It should return @code{false} if -these accesses should use the bitfield container type. - -The default is @code{!TARGET_STRICT_ALIGN}. -@end deftypefn @hook TARGET_MEMBER_TYPE_FORCES_BLK -Return true if a structure, union or array containing @var{field} should -be accessed using @code{BLKMODE}. - -If @var{field} is the only field in the structure, @var{mode} is its -mode, otherwise @var{mode} is VOIDmode. @var{mode} is provided in the -case where structures of one field would require the structure's mode to -retain the field's mode. - -Normally, this is not needed. -@end deftypefn @defmac ROUND_TYPE_ALIGN (@var{type}, @var{computed}, @var{specified}) Define this macro as an expression for the alignment of a type (given @@ -1303,23 +1254,10 @@ pattern needs to support both a 32- and a 64-bit mode. @end defmac @hook TARGET_LIBGCC_CMP_RETURN_MODE -This target hook should return the mode to be used for the return value -of compare instructions expanded to libgcc calls. If not defined -@code{word_mode} is returned which is the right choice for a majority of -targets. -@end deftypefn @hook TARGET_LIBGCC_SHIFT_COUNT_MODE -This target hook should return the mode to be used for the shift count operand -of shift instructions expanded to libgcc calls. If not defined -@code{word_mode} is returned which is the right choice for a majority of -targets. -@end deftypefn @hook TARGET_UNWIND_WORD_MODE -Return machine mode to be used for @code{_Unwind_Word} type. -The default is to use @code{word_mode}. -@end deftypefn @defmac ROUND_TOWARDS_ZERO If defined, this macro should be true if the prevailing rounding @@ -1343,88 +1281,16 @@ The default definition of this macro returns false for all sizes. @end defmac @hook TARGET_MS_BITFIELD_LAYOUT_P -This target hook returns @code{true} if bit-fields in the given -@var{record_type} are to be laid out following the rules of Microsoft -Visual C/C++, namely: (i) a bit-field won't share the same storage -unit with the previous bit-field if their underlying types have -different sizes, and the bit-field will be aligned to the highest -alignment of the underlying types of itself and of the previous -bit-field; (ii) a zero-sized bit-field will affect the alignment of -the whole enclosing structure, even if it is unnamed; except that -(iii) a zero-sized bit-field will be disregarded unless it follows -another bit-field of nonzero size. If this hook returns @code{true}, -other macros that control bit-field layout are ignored. - -When a bit-field is inserted into a packed record, the whole size -of the underlying type is used by one or more same-size adjacent -bit-fields (that is, if its long:3, 32 bits is used in the record, -and any additional adjacent long bit-fields are packed into the same -chunk of 32 bits. However, if the size changes, a new field of that -size is allocated). In an unpacked record, this is the same as using -alignment, but not equivalent when packing. - -If both MS bit-fields and @samp{__attribute__((packed))} are used, -the latter will take precedence. If @samp{__attribute__((packed))} is -used on a single field when MS bit-fields are in use, it will take -precedence for that field, but the alignment of the rest of the structure -may affect its placement. -@end deftypefn @hook TARGET_DECIMAL_FLOAT_SUPPORTED_P -Returns true if the target supports decimal floating point. -@end deftypefn @hook TARGET_FIXED_POINT_SUPPORTED_P -Returns true if the target supports fixed-point arithmetic. -@end deftypefn @hook TARGET_EXPAND_TO_RTL_HOOK -This hook is called just before expansion into rtl, allowing the target -to perform additional initializations or analysis before the expansion. -For example, the rs6000 port uses it to allocate a scratch stack slot -for use in copying SDmode values between memory and floating point -registers whenever the function being expanded has any SDmode -usage. -@end deftypefn @hook TARGET_INSTANTIATE_DECLS -This hook allows the backend to perform additional instantiations on rtl -that are not actually in any insns yet, but will be later. -@end deftypefn @hook TARGET_MANGLE_TYPE -If your target defines any fundamental types, or any types your target -uses should be mangled differently from the default, define this hook -to return the appropriate encoding for these types as part of a C++ -mangled name. The @var{type} argument is the tree structure representing -the type to be mangled. The hook may be applied to trees which are -not target-specific fundamental types; it should return @code{NULL} -for all such types, as well as arguments it does not recognize. If the -return value is not @code{NULL}, it must point to a statically-allocated -string constant. - -Target-specific fundamental types might be new fundamental types or -qualified versions of ordinary fundamental types. Encode new -fundamental types as @samp{@w{u @var{n} @var{name}}}, where @var{name} -is the name used for the type in source code, and @var{n} is the -length of @var{name} in decimal. Encode qualified versions of -ordinary types as @samp{@w{U @var{n} @var{name} @var{code}}}, where -@var{name} is the name used for the type qualifier in source code, -@var{n} is the length of @var{name} as above, and @var{code} is the -code used to represent the unqualified version of this type. (See -@code{write_builtin_type} in @file{cp/mangle.c} for the list of -codes.) In both cases the spaces are for clarity; do not include any -spaces in your string. - -This hook is applied to types prior to typedef resolution. If the mangled -name for a particular type depends only on that type's main variant, you -can perform typedef resolution yourself using @code{TYPE_MAIN_VARIANT} -before mangling. - -The default version of this hook always returns @code{NULL}, which is -appropriate for a target that does not define any new fundamental -types. -@end deftypefn @node Type Layout @section Layout of Source Language Data Types @@ -1619,13 +1485,6 @@ and @option{-funsigned-char}. @end defmac @hook TARGET_DEFAULT_SHORT_ENUMS -This target hook should return true if the compiler should give an -@code{enum} type only as many bytes as it takes to represent the range -of possible values of that type. It should return false if all -@code{enum} types should be allocated like @code{int}. - -The default is to return false. -@end deftypefn @defmac SIZE_TYPE A C expression for a string describing the name of the data type to use @@ -1921,36 +1780,6 @@ preserve the entire contents of a register across a call. @findex reg_names @findex reg_class_contents @hook TARGET_CONDITIONAL_REGISTER_USAGE -This hook may conditionally modify five variables -@code{fixed_regs}, @code{call_used_regs}, @code{global_regs}, -@code{reg_names}, and @code{reg_class_contents}, to take into account -any dependence of these register sets on target flags. The first three -of these are of type @code{char []} (interpreted as Boolean vectors). -@code{global_regs} is a @code{const char *[]}, and -@code{reg_class_contents} is a @code{HARD_REG_SET}. Before the macro is -called, @code{fixed_regs}, @code{call_used_regs}, -@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 @option{-ffixed-@var{reg}}, -@option{-fcall-used-@var{reg}} and @option{-fcall-saved-@var{reg}} -command options have been applied. - -@cindex disabling certain registers -@cindex controlling register usage -If the usage of an entire class of registers depends on the target -flags, you may indicate this to GCC by using this macro to modify -@code{fixed_regs} and @code{call_used_regs} to 1 for each of the -registers in the classes which should not be used by GCC@. Also define -the macro @code{REG_CLASS_FROM_LETTER} / @code{REG_CLASS_FROM_CONSTRAINT} -to return @code{NO_REGS} if it -is called with a letter for a class that shouldn't be used. - -(However, if this class is not included in @code{GENERAL_REGS} and all -of the insn patterns whose constraints permit this class are -controlled by target switches, then GCC will automatically avoid using -these registers when the target switches are opposed to them.) -@end deftypefn @defmac INCOMING_REGNO (@var{out}) Define this macro if the target machine has register windows. This C @@ -2188,14 +2017,6 @@ allocation. @end defmac @hook TARGET_HARD_REGNO_SCRATCH_OK -This target hook should return @code{true} if it is OK to use a hard register -@var{regno} as scratch reg in peephole2. - -One common use of this macro is to prevent using of a register that -is not saved by a prologue in an interrupt handler. - -The default version of this hook always returns @code{true}. -@end deftypefn @defmac AVOID_CCMODE_COPIES Define this macro if the compiler should avoid copies to/from @code{CCmode} @@ -2523,38 +2344,6 @@ only if neither labeling works. @hook TARGET_PREFERRED_RENAME_CLASS @hook TARGET_PREFERRED_RELOAD_CLASS -A target hook that places additional restrictions on the register class -to use when it is necessary to copy value @var{x} into a register in class -@var{rclass}. The value is a register class; perhaps @var{rclass}, or perhaps -another, smaller class. - -The default version of this hook always returns value of @code{rclass} argument. - -Sometimes returning a more restrictive class makes better code. For -example, on the 68000, when @var{x} is an integer constant that is in range -for a @samp{moveq} instruction, the value of this macro is always -@code{DATA_REGS} as long as @var{rclass} includes the data registers. -Requiring a data register guarantees that a @samp{moveq} will be used. - -One case where @code{TARGET_PREFERRED_RELOAD_CLASS} must not return -@var{rclass} is if @var{x} is a legitimate constant which cannot be -loaded into some register class. By returning @code{NO_REGS} you can -force @var{x} into a memory location. For example, rs6000 can load -immediate values into general-purpose registers, but does not have an -instruction for loading an immediate value into a floating-point -register, so @code{TARGET_PREFERRED_RELOAD_CLASS} returns @code{NO_REGS} when -@var{x} is a floating-point constant. If the constant can't be loaded -into any kind of register, code generation will be better if -@code{TARGET_LEGITIMATE_CONSTANT_P} makes the constant illegitimate instead -of using @code{TARGET_PREFERRED_RELOAD_CLASS}. - -If an insn has pseudos in it after register allocation, reload will go -through the alternatives and call repeatedly @code{TARGET_PREFERRED_RELOAD_CLASS} -to find the best one. Returning @code{NO_REGS}, in this case, makes -reload add a @code{!} in front of the constraint: the x86 back-end uses -this feature to discourage usage of 387 registers when math is done in -the SSE registers (and vice versa). -@end deftypefn @defmac PREFERRED_RELOAD_CLASS (@var{x}, @var{class}) A C expression that places additional restrictions on the register class @@ -2594,15 +2383,6 @@ the SSE registers (and vice versa). @end defmac @hook TARGET_PREFERRED_OUTPUT_RELOAD_CLASS -Like @code{TARGET_PREFERRED_RELOAD_CLASS}, but for output reloads instead of -input reloads. - -The default version of this hook always returns value of @code{rclass} -argument. - -You can also use @code{TARGET_PREFERRED_OUTPUT_RELOAD_CLASS} to discourage -reload from using some alternatives, like @code{TARGET_PREFERRED_RELOAD_CLASS}. -@end deftypefn @defmac LIMIT_RELOAD_CLASS (@var{mode}, @var{class}) A C expression that places additional restrictions on the register class @@ -2621,90 +2401,6 @@ require the macro to do something nontrivial. @end defmac @hook TARGET_SECONDARY_RELOAD -Many machines have some registers that cannot be copied directly to or -from memory or even from other types of registers. An example is the -@samp{MQ} register, which on most machines, can only be copied to or -from general registers, but not memory. Below, we shall be using the -term 'intermediate register' when a move operation cannot be performed -directly, but has to be done by copying the source into the intermediate -register first, and then copying the intermediate register to the -destination. An intermediate register always has the same mode as -source and destination. Since it holds the actual value being copied, -reload might apply optimizations to re-use an intermediate register -and eliding the copy from the source when it can determine that the -intermediate register still holds the required value. - -Another kind of secondary reload is required on some machines which -allow copying all registers to and from memory, but require a scratch -register for stores to some memory locations (e.g., those with symbolic -address on the RT, and those with certain symbolic address on the SPARC -when compiling PIC)@. Scratch registers need not have the same mode -as the value being copied, and usually hold a different value than -that being copied. Special patterns in the md file are needed to -describe how the copy is performed with the help of the scratch register; -these patterns also describe the number, register class(es) and mode(s) -of the scratch register(s). - -In some cases, both an intermediate and a scratch register are required. - -For input reloads, this target hook is called with nonzero @var{in_p}, -and @var{x} is an rtx that needs to be copied to a register of class -@var{reload_class} in @var{reload_mode}. For output reloads, this target -hook is called with zero @var{in_p}, and a register of class @var{reload_class} -needs to be copied to rtx @var{x} in @var{reload_mode}. - -If copying a register of @var{reload_class} from/to @var{x} requires -an intermediate register, the hook @code{secondary_reload} should -return the register class required for this intermediate register. -If no intermediate register is required, it should return NO_REGS. -If more than one intermediate register is required, describe the one -that is closest in the copy chain to the reload register. - -If scratch registers are needed, you also have to describe how to -perform the copy from/to the reload register to/from this -closest intermediate register. Or if no intermediate register is -required, but still a scratch register is needed, describe the -copy from/to the reload register to/from the reload operand @var{x}. - -You do this by setting @code{sri->icode} to the instruction code of a pattern -in the md file which performs the move. Operands 0 and 1 are the output -and input of this copy, respectively. Operands from operand 2 onward are -for scratch operands. These scratch operands must have a mode, and a -single-register-class -@c [later: or memory] -output constraint. - -When an intermediate register is used, the @code{secondary_reload} -hook will be called again to determine how to copy the intermediate -register to/from the reload operand @var{x}, so your hook must also -have code to handle the register class of the intermediate operand. - -@c [For later: maybe we'll allow multi-alternative reload patterns - -@c the port maintainer could name a mov pattern that has clobbers - -@c and match the constraints of input and output to determine the required -@c alternative. A restriction would be that constraints used to match -@c against reloads registers would have to be written as register class -@c constraints, or we need a new target macro / hook that tells us if an -@c arbitrary constraint can match an unknown register of a given class. -@c Such a macro / hook would also be useful in other places.] - - -@var{x} might be a pseudo-register or a @code{subreg} of a -pseudo-register, which could either be in a hard register or in memory. -Use @code{true_regnum} to find out; it will return @minus{}1 if the pseudo is -in memory and the hard register number if it is in a register. - -Scratch operands in memory (constraint @code{"=m"} / @code{"=&m"}) are -currently not supported. For the time being, you will have to continue -to use @code{SECONDARY_MEMORY_NEEDED} for that purpose. - -@code{copy_cost} also uses this target hook to find out how values are -copied. If you want it to include some extra cost for the need to allocate -(a) scratch register(s), set @code{sri->extra_cost} to the additional cost. -Or if two dependent moves are supposed to have a lower cost than the sum -of the individual moves due to expected fortuitous scheduling and/or special -forwarding logic, you can set @code{sri->extra_cost} to a negative amount. -@end deftypefn @defmac SECONDARY_RELOAD_CLASS (@var{class}, @var{mode}, @var{x}) @defmacx SECONDARY_INPUT_RELOAD_CLASS (@var{class}, @var{mode}, @var{x}) @@ -2812,37 +2508,8 @@ is @code{BITS_PER_WORD} bits wide is correct for your machine. @end defmac @hook TARGET_CLASS_LIKELY_SPILLED_P -A target hook which returns @code{true} if pseudos that have been assigned -to registers of class @var{rclass} would likely be spilled because -registers of @var{rclass} are needed for spill registers. - -The default version of this target hook returns @code{true} if @var{rclass} -has exactly one register and @code{false} otherwise. On most machines, this -default should be used. For generally register-starved machines, such as -i386, or machines with right register constraints, such as SH, this hook -can be used to avoid excessive spilling. - -This hook is also used by some of the global intra-procedural code -transformations to throtle code motion, to avoid increasing register -pressure. -@end deftypefn @hook TARGET_CLASS_MAX_NREGS -A target hook returns the maximum number of consecutive registers -of class @var{rclass} needed to hold a value of mode @var{mode}. - -This is closely related to the macro @code{HARD_REGNO_NREGS}. In fact, -the value returned by @code{TARGET_CLASS_MAX_NREGS (@var{rclass}, -@var{mode})} target hook should be the maximum value of -@code{HARD_REGNO_NREGS (@var{regno}, @var{mode})} for all @var{regno} -values in the class @var{rclass}. - -This target hook helps control the handling of multiple-word values -in the reload pass. - -The default version of this target hook returns the size of @var{mode} -in words. -@end deftypefn @defmac CLASS_MAX_NREGS (@var{class}, @var{mode}) A C expression for the maximum number of consecutive registers @@ -3178,12 +2845,6 @@ define this macro. @end defmac @hook TARGET_BUILTIN_SETJMP_FRAME_VALUE -This target hook should return an rtx that is used to store -the address of the current frame into the built in @code{setjmp} buffer. -The default value, @code{virtual_stack_vars_rtx}, is correct for most -machines. One reason you may need to define this target hook is if -@code{hard_frame_pointer_rtx} is the appropriate value on your machine. -@end deftypefn @defmac FRAME_ADDR_RTX (@var{frameaddr}) A C expression whose value is RTL representing the value of the frame @@ -3245,20 +2906,6 @@ terminate the stack backtrace. New ports should avoid this. @end defmac @hook TARGET_DWARF_HANDLE_FRAME_UNSPEC -This target hook allows the backend to emit frame-related insns that -contain UNSPECs or UNSPEC_VOLATILEs. The DWARF 2 call frame debugging -info engine will invoke it on insns of the form -@smallexample -(set (reg) (unspec [@dots{}] UNSPEC_INDEX)) -@end smallexample -and -@smallexample -(set (reg) (unspec_volatile [@dots{}] UNSPECV_INDEX)). -@end smallexample -to let the backend emit the call frame instructions. @var{label} is -the CFI label attached to the insn, @var{pattern} is the pattern of -the insn and @var{index} is @code{UNSPEC_INDEX} or @code{UNSPECV_INDEX}. -@end deftypefn @defmac INCOMING_FRAME_SP_OFFSET A C expression whose value is an integer giving the offset, in bytes, @@ -3641,26 +3288,6 @@ defined; instead, the @code{TARGET_STATIC_CHAIN} hook should be used. @end defmac @hook TARGET_STATIC_CHAIN -This hook replaces the use of @code{STATIC_CHAIN_REGNUM} et al for -targets that may use different static chain locations for different -nested functions. This may be required if the target has function -attributes that affect the calling conventions of the function and -those calling conventions use different static chain locations. - -The default version of this hook uses @code{STATIC_CHAIN_REGNUM} et al. - -If the static chain is passed in memory, this hook should be used to -provide rtx giving @code{mem} expressions that denote where they are stored. -Often the @code{mem} expression as seen by the caller will be at an offset -from the stack pointer and the @code{mem} expression as seen by the callee -will be at an offset from the frame pointer. -@findex stack_pointer_rtx -@findex frame_pointer_rtx -@findex arg_pointer_rtx -The variables @code{stack_pointer_rtx}, @code{frame_pointer_rtx}, and -@code{arg_pointer_rtx} will have been initialized and should be used -to refer to those items. -@end deftypefn @defmac DWARF_FRAME_REGISTERS This macro specifies the maximum number of hard registers that can be @@ -3743,29 +3370,6 @@ defined and 0 otherwise. This is about eliminating the frame pointer and arg pointer. @hook TARGET_FRAME_POINTER_REQUIRED -This target hook should return @code{true} if a function must have and use -a frame pointer. This target hook is called in the reload pass. If its return -value is @code{true} the function will have a frame pointer. - -This target hook can in principle examine the current function and decide -according to the facts, but on most machines the constant @code{false} or the -constant @code{true} suffices. Use @code{false} when the machine allows code -to be generated with no frame pointer, and doing so saves some time or space. -Use @code{true} when there is no possible advantage to avoiding a frame -pointer. - -In certain cases, the compiler does not know how to produce valid code -without a frame pointer. The compiler recognizes those cases and -automatically gives the function a frame pointer regardless of what -@code{TARGET_FRAME_POINTER_REQUIRED} returns. You don't need to worry about -them. - -In a function that does not require a frame pointer, the frame pointer -register can be allocated for ordinary usage, unless you mark it as a -fixed register. See @code{FIXED_REGISTERS} for more information. - -Default return value is @code{false}. -@end deftypefn @findex get_frame_size @defmac INITIAL_FRAME_POINTER_OFFSET (@var{depth-var}) @@ -3809,15 +3413,6 @@ specified first since that is the preferred elimination. @end defmac @hook TARGET_CAN_ELIMINATE -This target hook should returns @code{true} if the compiler is allowed to -try to replace register number @var{from_reg} with register number -@var{to_reg}. This target hook need only be defined if @code{ELIMINABLE_REGS} -is defined, and will usually be @code{true}, since most of the cases -preventing register elimination are things that the compiler already -knows about. - -Default return value is @code{true}. -@end deftypefn @defmac INITIAL_ELIMINATION_OFFSET (@var{from-reg}, @var{to-reg}, @var{offset-var}) This macro is similar to @code{INITIAL_FRAME_POINTER_OFFSET}. It @@ -3836,12 +3431,6 @@ on the stack. See the following section for other macros that control passing certain arguments in registers. @hook TARGET_PROMOTE_PROTOTYPES -This target hook returns @code{true} if an argument declared in a -prototype as an integral type smaller than @code{int} should actually be -passed as an @code{int}. In addition to avoiding errors in certain -cases of mismatch, it also makes for better code on certain machines. -The default is to not promote prototypes. -@end deftypefn @defmac PUSH_ARGS A C expression. If nonzero, push insns will be used to pass @@ -3936,42 +3525,6 @@ stack in its natural location. @end defmac @hook TARGET_RETURN_POPS_ARGS -This target hook returns the number of bytes of its own arguments that -a function pops on returning, or 0 if the function pops no arguments -and the caller must therefore pop them all after the function returns. - -@var{fundecl} is a C variable whose value is a tree node that describes -the function in question. Normally it is a node of type -@code{FUNCTION_DECL} that describes the declaration of the function. -From this you can obtain the @code{DECL_ATTRIBUTES} of the function. - -@var{funtype} is a C variable whose value is a tree node that -describes the function in question. Normally it is a node of type -@code{FUNCTION_TYPE} that describes the data type of the function. -From this it is possible to obtain the data types of the value and -arguments (if known). - -When a call to a library function is being considered, @var{fundecl} -will contain an identifier node for the library function. Thus, if -you need to distinguish among various library functions, you can do so -by their names. Note that ``library function'' in this context means -a function used to perform arithmetic, whose name is known specially -in the compiler and was not mentioned in the C code being compiled. - -@var{size} is the number of bytes of arguments passed on the -stack. If a variable number of bytes is passed, it is zero, and -argument popping will always be the responsibility of the calling function. - -On the VAX, all functions always pop their arguments, so the definition -of this macro is @var{size}. On the 68000, using the standard -calling convention, no functions pop their arguments, so the value of -the macro is always 0 in this case. But an alternative calling -convention is available in which functions that take a fixed number of -arguments pop them but other functions (such as @code{printf}) pop -nothing (the caller pops all). When this convention is in use, -@var{funtype} is examined to determine whether a function takes a fixed -number of arguments. -@end deftypefn @defmac CALL_POPS_ARGS (@var{cum}) A C expression that should indicate the number of bytes a call sequence @@ -3998,124 +3551,16 @@ types of arguments are passed in registers or how they are arranged in the stack. @hook TARGET_FUNCTION_ARG -Return an RTX indicating whether a function argument is passed in a -register and if so, which register. - -The arguments are @var{ca}, which summarizes all the previous -arguments; @var{mode}, the machine mode of the argument; @var{type}, -the data type of the argument as a tree node or 0 if that is not known -(which happens for C support library functions); and @var{named}, -which is @code{true} for an ordinary argument and @code{false} 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 return value is usually either a @code{reg} RTX for the hard -register in which to pass the argument, or zero to pass the argument -on the stack. - -The value of the expression can also be a @code{parallel} RTX@. This is -used when an argument is passed in multiple locations. The mode of the -@code{parallel} should be the mode of the entire argument. The -@code{parallel} holds any number of @code{expr_list} pairs; each one -describes where part of the argument is passed. In each -@code{expr_list} the first operand must be a @code{reg} RTX for the hard -register in which to pass this part of the argument, and the mode of 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} -RTX may have a first operand of zero. This indicates that the entire -argument is also stored on the stack. - -The last time this hook is called, it is called with @code{MODE == -VOIDmode}, and its result is passed to the @code{call} or @code{call_value} -pattern as operands 2 and 3 respectively. - -@cindex @file{stdarg.h} and register arguments -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{TARGET_FUNCTION_ARG} return 0 whenever -@var{named} is @code{false}. - -@cindex @code{TARGET_MUST_PASS_IN_STACK}, and @code{TARGET_FUNCTION_ARG} -@cindex @code{REG_PARM_STACK_SPACE}, and @code{TARGET_FUNCTION_ARG} -You may use the hook @code{targetm.calls.must_pass_in_stack} -in the definition of this macro to determine if this argument is of a -type that must be passed in the stack. If @code{REG_PARM_STACK_SPACE} -is not defined and @code{TARGET_FUNCTION_ARG} returns nonzero for such an -argument, the compiler will abort. If @code{REG_PARM_STACK_SPACE} is -defined, the argument will be computed in the stack and then loaded into -a register. -@end deftypefn @hook TARGET_MUST_PASS_IN_STACK -This target hook should return @code{true} if we should not pass @var{type} -solely in registers. The file @file{expr.h} defines a -definition that is usually appropriate, refer to @file{expr.h} for additional -documentation. -@end deftypefn @hook TARGET_FUNCTION_INCOMING_ARG -Define this hook if the target machine has ``register windows'', so -that the register in which a function sees an arguments is not -necessarily the same as the one in which the caller passed the -argument. - -For such machines, @code{TARGET_FUNCTION_ARG} computes the register in -which the caller passes the value, and -@code{TARGET_FUNCTION_INCOMING_ARG} should be defined in a similar -fashion to tell the function being called where the arguments will -arrive. - -If @code{TARGET_FUNCTION_INCOMING_ARG} is not defined, -@code{TARGET_FUNCTION_ARG} serves both purposes. -@end deftypefn @hook TARGET_ARG_PARTIAL_BYTES -This target hook returns the number of bytes at the beginning of an -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. - -On some machines, certain arguments must be passed partially in -registers and partially in memory. On these machines, typically the -first few words of arguments are passed in registers, and the rest -on the stack. If a multi-word argument (a @code{double} or a -structure) crosses that boundary, its first few words must be passed -in registers and the rest must be pushed. This macro tells the -compiler when this occurs, and how many bytes should go in registers. - -@code{TARGET_FUNCTION_ARG} for these arguments should return the first -register to be used by the caller for this argument; likewise -@code{TARGET_FUNCTION_INCOMING_ARG}, for the called function. -@end deftypefn @hook TARGET_PASS_BY_REFERENCE -This target hook should return @code{true} if an argument at the -position indicated by @var{cum} should be passed by reference. This -predicate is queried after target independent reasons for being -passed by reference, such as @code{TREE_ADDRESSABLE (type)}. - -If the hook returns true, a copy of that argument is made in memory and a -pointer to the argument is passed instead of the argument itself. -The pointer is passed in whatever way is appropriate for passing a pointer -to that type. -@end deftypefn @hook TARGET_CALLEE_COPIES -The function argument described by the parameters to this hook is -known to be passed by reference. The hook should return true if the -function argument should be copied by the callee instead of copied -by the caller. - -For any argument for which the hook returns true, if it can be -determined that the argument is not modified, then a copy need -not be generated. - -The default version of this hook always returns false. -@end deftypefn @defmac CUMULATIVE_ARGS A C type for declaring a variable that is used as the first argument @@ -4184,16 +3629,6 @@ argument @var{libname} exists for symmetry with @end defmac @hook TARGET_FUNCTION_ARG_ADVANCE -This hook updates the summarizer variable pointed to by @var{ca} to -advance past an argument in the argument list. The values @var{mode}, -@var{type} and @var{named} describe that argument. Once this is done, -the variable @var{cum} is suitable for analyzing the @emph{following} -argument with @code{TARGET_FUNCTION_ARG}, etc. - -This hook need not do anything if the argument in question was passed -on the stack. The compiler knows how to track the amount of stack space -used for arguments without any special help. -@end deftypefn @defmac FUNCTION_ARG_OFFSET (@var{mode}, @var{type}) If defined, a C expression that is the number of bytes to add to the @@ -4239,10 +3674,6 @@ required. @end defmac @hook TARGET_FUNCTION_ARG_BOUNDARY -This hook returns the alignment boundary, in bits, of an argument -with the specified mode and type. The default hook returns -@code{PARM_BOUNDARY} for all arguments. -@end deftypefn @hook TARGET_FUNCTION_ARG_ROUND_BOUNDARY @@ -4256,115 +3687,28 @@ stack. @end defmac @hook TARGET_SPLIT_COMPLEX_ARG -This hook should return true if parameter of type @var{type} are passed -as two scalar parameters. By default, GCC will attempt to pack complex -arguments into the target's word size. Some ABIs require complex arguments -to be split and treated as their individual components. For example, on -AIX64, complex floats should be passed in a pair of floating point -registers, even though a complex float would fit in one 64-bit floating -point register. - -The default value of this hook is @code{NULL}, which is treated as always -false. -@end deftypefn @hook TARGET_BUILD_BUILTIN_VA_LIST -This hook returns a type node for @code{va_list} for the target. -The default version of the hook returns @code{void*}. -@end deftypefn @hook TARGET_ENUM_VA_LIST_P -This target hook is used in function @code{c_common_nodes_and_builtins} -to iterate through the target specific builtin types for va_list. The -variable @var{idx} is used as iterator. @var{pname} has to be a pointer -to a @code{const char *} and @var{ptree} a pointer to a @code{tree} typed -variable. -The arguments @var{pname} and @var{ptree} are used to store the result of -this macro and are set to the name of the va_list builtin type and its -internal type. -If the return value of this macro is zero, then there is no more element. -Otherwise the @var{IDX} should be increased for the next call of this -macro to iterate through all types. -@end deftypefn @hook TARGET_FN_ABI_VA_LIST -This hook returns the va_list type of the calling convention specified by -@var{fndecl}. -The default version of this hook returns @code{va_list_type_node}. -@end deftypefn @hook TARGET_CANONICAL_VA_LIST_TYPE -This hook returns the va_list type of the calling convention specified by the -type of @var{type}. If @var{type} is not a valid va_list type, it returns -@code{NULL_TREE}. -@end deftypefn @hook TARGET_GIMPLIFY_VA_ARG_EXPR -This hook performs target-specific gimplification of -@code{VA_ARG_EXPR}. The first two parameters correspond to the -arguments to @code{va_arg}; the latter two are as in -@code{gimplify.c:gimplify_expr}. -@end deftypefn @hook TARGET_VALID_POINTER_MODE -Define this to return nonzero if the port can handle pointers -with machine mode @var{mode}. The default version of this -hook returns true for both @code{ptr_mode} and @code{Pmode}. -@end deftypefn @hook TARGET_REF_MAY_ALIAS_ERRNO @hook TARGET_SCALAR_MODE_SUPPORTED_P -Define this to return nonzero if the port is prepared to handle -insns involving scalar mode @var{mode}. For a scalar mode to be -considered supported, all the basic arithmetic and comparisons -must work. - -The default version of this hook returns true for any mode -required to handle the basic C types (as defined by the port). -Included here are the double-word arithmetic supported by the -code in @file{optabs.c}. -@end deftypefn @hook TARGET_VECTOR_MODE_SUPPORTED_P -Define this to return 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. -@end deftypefn @hook TARGET_ARRAY_MODE_SUPPORTED_P @hook TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P -Define this to return nonzero for machine modes for which the port has -small register classes. If this target hook returns nonzero for a given -@var{mode}, the compiler will try to minimize the lifetime of registers -in @var{mode}. The hook may be called with @code{VOIDmode} as argument. -In this case, the hook is expected to return nonzero if it returns nonzero -for any mode. - -On some machines, it is risky to let hard registers live across arbitrary -insns. Typically, these machines have instructions that require values -to be in specific registers (like an accumulator), and reload will fail -if the required hard register is used for another purpose across such an -insn. - -Passes before reload do not know which hard registers will be used -in an instruction, but the machine modes of the registers set or used in -the instruction are already known. And for some machines, register -classes are small for, say, integer registers but not for floating point -registers. For example, the AMD x86-64 architecture requires specific -registers for the legacy x86 integer instructions, but there are many -SSE registers for floating point operations. On such targets, a good -strategy may be to return nonzero from this hook for @code{INTEGRAL_MODE_P} -machine modes but zero for the SSE register classes. - -The default version of this hook returns false for any mode. It is always -safe to redefine this hook to return with a nonzero value. But if you -unnecessarily define it, you will reduce the amount of optimizations -that can be performed in some cases. If you do not define this hook -to return a nonzero value when it is required, the compiler will run out -of spill registers and print a fatal error message. -@end deftypefn @hook TARGET_FLAGS_REGNUM @@ -4379,48 +3723,6 @@ values---values that can fit in registers. @hook TARGET_FUNCTION_VALUE -Define this to return an RTX representing the place where a function -returns or receives a value of data type @var{ret_type}, a tree node -representing a data type. @var{fn_decl_or_type} is a tree node -representing @code{FUNCTION_DECL} or @code{FUNCTION_TYPE} of a -function being called. If @var{outgoing} is false, the hook should -compute the register in which the caller will see the return value. -Otherwise, the hook should return an RTX representing the place where -a function returns a value. - -On many machines, only @code{TYPE_MODE (@var{ret_type})} is relevant. -(Actually, on most machines, scalar values are returned in the same -place regardless of mode.) The value of the expression is usually a -@code{reg} RTX for the hard register where the return value is stored. -The value can also be a @code{parallel} RTX, if the return value is in -multiple places. See @code{TARGET_FUNCTION_ARG} for an explanation of the -@code{parallel} form. Note that the callee will populate every -location specified in the @code{parallel}, but if the first element of -the @code{parallel} contains the whole return value, callers will use -that element as the canonical location and ignore the others. The m68k -port uses this type of @code{parallel} to return pointers in both -@samp{%a0} (the canonical location) and @samp{%d0}. - -If @code{TARGET_PROMOTE_FUNCTION_RETURN} returns true, you must apply -the same promotion rules specified in @code{PROMOTE_MODE} if -@var{valtype} is a scalar type. - -If the precise function being called is known, @var{func} is a tree -node (@code{FUNCTION_DECL}) for it; otherwise, @var{func} is a null -pointer. This makes it possible to use a different value-returning -convention for specific functions when all their calls are -known. - -Some target machines have ``register windows'' so that the register in -which a function returns its value is not the same as the one in which -the caller sees the value. For such machines, you should return -different RTX depending on @var{outgoing}. - -@code{TARGET_FUNCTION_VALUE} is not used for return values with -aggregate data types, because these are returned in another way. See -@code{TARGET_STRUCT_VALUE_RTX} and related macros, below. -@end deftypefn - @defmac FUNCTION_VALUE (@var{valtype}, @var{func}) This macro has been deprecated. Use @code{TARGET_FUNCTION_VALUE} for a new target instead. @@ -4437,15 +3739,6 @@ compiled. @end defmac @hook TARGET_LIBCALL_VALUE -Define this hook if the back-end needs to know the name of the libcall -function in order to determine where the result should be returned. - -The mode of the result is given by @var{mode} and the name of the called -library function is given by @var{fun}. The hook should return an RTX -representing the place where the library function result will be returned. - -If this hook is not defined, then LIBCALL_VALUE will be used. -@end deftypefn @defmac FUNCTION_VALUE_REGNO_P (@var{regno}) A C expression that is nonzero if @var{regno} is the number of a hard @@ -4469,19 +3762,6 @@ for a new target instead. @end defmac @hook TARGET_FUNCTION_VALUE_REGNO_P -A target hook that return @code{true} if @var{regno} is the number of a hard -register in which the values of called function may come back. - -A register whose use for returning values is limited to serving as the -second of a pair (for a value of type @code{double}, say) need not be -recognized by this target hook. - -If the machine has register windows, so that the caller and the called -function use different registers for the return value, this target hook -should recognize only the caller's register numbers. - -If this hook is not defined, then FUNCTION_VALUE_REGNO_P will be used. -@end deftypefn @defmac APPLY_RESULT_SIZE Define this macro if @samp{untyped_call} and @samp{untyped_return} @@ -4490,17 +3770,6 @@ saving and restoring an arbitrary return value. @end defmac @hook TARGET_RETURN_IN_MSB -This hook should return true if values of type @var{type} are returned -at the most significant end of a register (in other words, if they are -padded at the least significant end). You can assume that @var{type} -is returned in a register; the caller is required to check this. - -Note that the register provided by @code{TARGET_FUNCTION_VALUE} must -be able to hold the complete return value. For example, if a 1-, 2- -or 3-byte structure is returned at the most significant end of a -4-byte register, @code{TARGET_FUNCTION_VALUE} should provide an -@code{SImode} rtx. -@end deftypefn @node Aggregate Return @subsection How Large Values Are Returned @@ -4520,23 +3789,6 @@ This section describes how to control returning structure values in memory. @hook TARGET_RETURN_IN_MEMORY -This target hook should return a nonzero value to say to return the -function value in memory, just as large structures are always returned. -Here @var{type} will be the data type of the value, and @var{fntype} -will be the type of the function doing the returning, or @code{NULL} for -libcalls. - -Note that values of mode @code{BLKmode} must be explicitly handled -by this function. Also, the option @option{-fpcc-struct-return} -takes effect regardless of this macro. On most systems, it is -possible to leave the hook undefined; this causes a default -definition to be used, whose value is the constant 1 for @code{BLKmode} -values, and 0 otherwise. - -Do not use this hook to indicate that structures and unions should always -be returned in memory. You should instead use @code{DEFAULT_PCC_STRUCT_RETURN} -to indicate this. -@end deftypefn @defmac DEFAULT_PCC_STRUCT_RETURN Define this macro to be 1 if all structure and union return values must be @@ -4550,27 +3802,6 @@ If not defined, this defaults to the value 1. @end defmac @hook TARGET_STRUCT_VALUE_RTX -This target hook should return the location of the structure value -address (normally a @code{mem} or @code{reg}), or 0 if the address is -passed as an ``invisible'' first argument. Note that @var{fndecl} may -be @code{NULL}, for libcalls. You do not need to define this target -hook if the address is always passed as an ``invisible'' first -argument. - -On some architectures the place where the structure value address -is found by the called function is not the same place that the -caller put it. This can be due to register windows, or it could -be because the function prologue moves it to a different place. -@var{incoming} is @code{1} or @code{2} when the location is needed in -the context of the called function, and @code{0} in the context of -the caller. - -If @var{incoming} is nonzero and the address is to be found on the -stack, return a @code{mem} which refers to the frame pointer. If -@var{incoming} is @code{2}, the result is being used to fetch the -structure value address at the beginning of a function. If you need -to emit adjusting code, you should do it at this point. -@end deftypefn @defmac PCC_STATIC_STRUCT_RETURN Define this macro if the usual system convention on the target machine @@ -4623,110 +3854,12 @@ This section describes the macros that output function entry (@dfn{prologue}) and exit (@dfn{epilogue}) code. @hook TARGET_ASM_FUNCTION_PROLOGUE -If defined, a function that outputs the assembler code for entry to a -function. The prologue is responsible for setting up the stack frame, -initializing the frame pointer register, saving registers that must be -saved, and allocating @var{size} additional bytes of storage for the -local variables. @var{size} is an integer. @var{file} is a stdio -stream to which the assembler code should be output. - -The label for the beginning of the function need not be output by this -macro. That has already been done when the macro is run. - -@findex regs_ever_live -To determine which registers to save, the macro can refer to the array -@code{regs_ever_live}: element @var{r} is nonzero if hard register -@var{r} is used anywhere within the function. This implies the function -prologue should save register @var{r}, provided it is not one of the -call-used registers. (@code{TARGET_ASM_FUNCTION_EPILOGUE} must likewise use -@code{regs_ever_live}.) - -On machines that have ``register windows'', the function entry code does -not save on the stack the registers that are in the windows, even if -they are supposed to be preserved by function calls; instead it takes -appropriate steps to ``push'' the register stack, if any non-call-used -registers are used in the function. - -@findex frame_pointer_needed -On machines where functions may or may not have frame-pointers, the -function entry code must vary accordingly; it must set up the frame -pointer if one is wanted, and not otherwise. To determine whether a -frame pointer is in wanted, the macro can refer to the variable -@code{frame_pointer_needed}. The variable's value will be 1 at run -time in a function that needs a frame pointer. @xref{Elimination}. - -The function entry code is responsible for allocating any stack space -required for the function. This stack space consists of the regions -listed below. In most cases, these regions are allocated in the -order listed, with the last listed region closest to the top of the -stack (the lowest address if @code{STACK_GROWS_DOWNWARD} is defined, and -the highest address if it is not defined). You can use a different order -for a machine if doing so is more convenient or required for -compatibility reasons. Except in cases where required by standard -or by a debugger, there is no reason why the stack layout used by GCC -need agree with that used by other compilers for a machine. -@end deftypefn @hook TARGET_ASM_FUNCTION_END_PROLOGUE -If defined, a function that outputs assembler code at the end of a -prologue. This should be used when the function prologue is being -emitted as RTL, and you have some extra assembler that needs to be -emitted. @xref{prologue instruction pattern}. -@end deftypefn @hook TARGET_ASM_FUNCTION_BEGIN_EPILOGUE -If defined, a function that outputs assembler code at the start of an -epilogue. This should be used when the function epilogue is being -emitted as RTL, and you have some extra assembler that needs to be -emitted. @xref{epilogue instruction pattern}. -@end deftypefn @hook TARGET_ASM_FUNCTION_EPILOGUE -If defined, a function that outputs the assembler code for exit from a -function. The epilogue is responsible for restoring the saved -registers and stack pointer to their values when the function was -called, and returning control to the caller. This macro takes the -same arguments as the macro @code{TARGET_ASM_FUNCTION_PROLOGUE}, and the -registers to restore are determined from @code{regs_ever_live} and -@code{CALL_USED_REGISTERS} in the same way. - -On some machines, there is a single instruction that does all the work -of returning from the function. On these machines, give that -instruction the name @samp{return} and do not define the macro -@code{TARGET_ASM_FUNCTION_EPILOGUE} at all. - -Do not define a pattern named @samp{return} if you want the -@code{TARGET_ASM_FUNCTION_EPILOGUE} to be used. If you want the target -switches to control whether return instructions or epilogues are used, -define a @samp{return} pattern with a validity condition that tests the -target switches appropriately. If the @samp{return} pattern's validity -condition is false, epilogues will be used. - -On machines where functions may or may not have frame-pointers, the -function exit code must vary accordingly. Sometimes the code for these -two cases is completely different. To determine whether a frame pointer -is wanted, the macro can refer to the variable -@code{frame_pointer_needed}. The variable's value will be 1 when compiling -a function that needs a frame pointer. - -Normally, @code{TARGET_ASM_FUNCTION_PROLOGUE} and -@code{TARGET_ASM_FUNCTION_EPILOGUE} must treat leaf functions specially. -The C variable @code{current_function_is_leaf} is nonzero for such a -function. @xref{Leaf Functions}. - -On some machines, some functions pop their arguments on exit while -others leave that for the caller to do. For example, the 68020 when -given @option{-mrtd} pops arguments in functions that take a fixed -number of arguments. - -@findex pops_args -@findex crtl->args.pops_args -Your definition of the macro @code{RETURN_POPS_ARGS} decides which -functions pop their own arguments. @code{TARGET_ASM_FUNCTION_EPILOGUE} -needs to know what was decided. The number of bytes of the current -function's arguments that this function should pop is available in -@code{crtl->args.pops_args}. @xref{Scalar Return}. -@end deftypefn @itemize @bullet @item @@ -4789,54 +3922,8 @@ on entry to an exception edge. @end defmac @hook TARGET_ASM_OUTPUT_MI_THUNK -A function that outputs the assembler code for a thunk -function, used to implement C++ virtual function calls with multiple -inheritance. The thunk acts as a wrapper around a virtual function, -adjusting the implicit object parameter before handing control off to -the real function. - -First, emit code to add the integer @var{delta} to the location that -contains the incoming first argument. Assume that this argument -contains a pointer, and is the one used to pass the @code{this} pointer -in C++. This is the incoming argument @emph{before} the function prologue, -e.g.@: @samp{%o0} on a sparc. The addition must preserve the values of -all other incoming arguments. - -Then, if @var{vcall_offset} is nonzero, an additional adjustment should be -made after adding @code{delta}. In particular, if @var{p} is the -adjusted pointer, the following adjustment should be made: - -@smallexample -p += (*((ptrdiff_t **)p))[vcall_offset/sizeof(ptrdiff_t)] -@end smallexample - -After the additions, emit code to jump to @var{function}, which is a -@code{FUNCTION_DECL}. This is a direct pure jump, not a call, and does -not touch the return address. Hence returning from @var{FUNCTION} will -return to whoever called the current @samp{thunk}. - -The effect must be as if @var{function} had been called directly with -the adjusted first argument. This macro is responsible for emitting all -of the code for a thunk function; @code{TARGET_ASM_FUNCTION_PROLOGUE} -and @code{TARGET_ASM_FUNCTION_EPILOGUE} are not invoked. - -The @var{thunk_fndecl} is redundant. (@var{delta} and @var{function} -have already been extracted from it.) It might possibly be useful on -some targets, but probably not. - -If you do not define this macro, the target-independent code in the C++ -front end will generate a less efficient heavyweight thunk that calls -@var{function} instead of jumping to it. The generic approach does -not support varargs. -@end deftypefn @hook TARGET_ASM_CAN_OUTPUT_MI_THUNK -A function that returns true if TARGET_ASM_OUTPUT_MI_THUNK would be able -to output the assembler code for the thunk function specified by the -arguments it is passed, and false otherwise. In the latter case, the -generic approach will be used by the C++ front end, with the limitations -previously exposed. -@end deftypefn @node Profiling @subsection Generating Code for Profiling @@ -4884,26 +3971,8 @@ the function prologue. Normally, the profiling code comes after. @cindex tail calls @hook TARGET_FUNCTION_OK_FOR_SIBCALL -True if it is ok to do sibling call optimization for the specified -call expression @var{exp}. @var{decl} will be the called function, -or @code{NULL} if this is an indirect call. - -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. The hook is used to enforce these restrictions, -as the @code{sibcall} md pattern can not fail, or fall over to a -``normal'' call. The criteria for successful sibling call optimization -may vary greatly between different architectures. -@end deftypefn @hook TARGET_EXTRA_LIVE_ON_ENTRY -Add any hard registers to @var{regs} that are live on entry to the -function. This hook only needs to be defined to provide registers that -cannot be found by examination of FUNCTION_ARG_REGNO_P, the callee saved -registers, STATIC_CHAIN_INCOMING_REGNUM, STATIC_CHAIN_REGNUM, -TARGET_STRUCT_VALUE_RTX, FRAME_POINTER_REGNUM, EH_USES, -FRAME_POINTER_REGNUM, ARG_POINTER_REGNUM, and the PIC_OFFSET_TABLE_REGNUM. -@end deftypefn @hook TARGET_SET_UP_BY_PROLOGUE @@ -4914,25 +3983,8 @@ FRAME_POINTER_REGNUM, ARG_POINTER_REGNUM, and the PIC_OFFSET_TABLE_REGNUM. @cindex stack smashing protection @hook TARGET_STACK_PROTECT_GUARD -This hook returns a @code{DECL} node for the external variable to use -for the stack protection guard. This variable is initialized by the -runtime to some random value and is used to initialize the guard value -that is placed at the top of the local stack frame. The type of this -variable must be @code{ptr_type_node}. - -The default version of this hook creates a variable called -@samp{__stack_chk_guard}, which is normally defined in @file{libgcc2.c}. -@end deftypefn @hook TARGET_STACK_PROTECT_FAIL -This hook returns a @code{CALL_EXPR} that alerts the runtime that the -stack protect guard variable has been modified. This expression should -involve a call to a @code{noreturn} function. - -The default version of this hook invokes a function called -@samp{__stack_chk_fail}, taking no arguments. This function is -normally defined in @file{libgcc2.c}. -@end deftypefn @hook TARGET_SUPPORTS_SPLIT_STACK @@ -5005,70 +4057,12 @@ interpret the values of @code{__builtin_classify_type}. These machine description macros help implement varargs: @hook TARGET_EXPAND_BUILTIN_SAVEREGS -If defined, this hook produces the machine-specific code for a call to -@code{__builtin_saveregs}. This code will be moved to the very -beginning of the function, before any parameter access are made. The -return value of this function should be an RTX that contains the value -to use as the return of @code{__builtin_saveregs}. -@end deftypefn @hook TARGET_SETUP_INCOMING_VARARGS -This target hook offers an alternative to using -@code{__builtin_saveregs} and defining the hook -@code{TARGET_EXPAND_BUILTIN_SAVEREGS}. Use it to store the anonymous -register arguments into the stack so that all the arguments appear to -have been passed consecutively on the stack. Once this is done, you can -use the standard implementation of varargs that works for machines that -pass all their arguments on the stack. - -The argument @var{args_so_far} points to the @code{CUMULATIVE_ARGS} data -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. - -The target hook should do two things: first, push onto the stack all the -argument registers @emph{not} used for the named arguments, and second, -store the size of the data thus pushed into the @code{int}-valued -variable pointed to by @var{pretend_args_size}. The value that you -store here will serve as additional offset for setting up the stack -frame. - -Because you must generate code to push the anonymous arguments at -compile time without knowing their data types, -@code{TARGET_SETUP_INCOMING_VARARGS} is only useful on machines that -have just a single category of argument register and use it uniformly -for all data types. - -If the argument @var{second_time} is nonzero, it means that the -arguments of the function are being analyzed for the second time. This -happens for an inline function, which is not actually compiled until the -end of the source file. The hook @code{TARGET_SETUP_INCOMING_VARARGS} should -not generate any instructions in this case. -@end deftypefn @hook TARGET_STRICT_ARGUMENT_NAMING -Define this hook to return @code{true} if the location where a function -argument is passed depends on whether or not it is a named argument. - -This hook controls how the @var{named} argument to @code{TARGET_FUNCTION_ARG} -is set for varargs and stdarg functions. If this hook returns -@code{true}, the @var{named} argument is always true for named -arguments, and false for unnamed arguments. If it returns @code{false}, -but @code{TARGET_PRETEND_OUTGOING_VARARGS_NAMED} returns @code{true}, -then all arguments are treated as named. Otherwise, all named arguments -except the last are treated as named. - -You need not define this hook if it always returns @code{false}. -@end deftypefn @hook TARGET_PRETEND_OUTGOING_VARARGS_NAMED -If you need to conditionally change ABIs so that one works with -@code{TARGET_SETUP_INCOMING_VARARGS}, but the other works like neither -@code{TARGET_SETUP_INCOMING_VARARGS} nor @code{TARGET_STRICT_ARGUMENT_NAMING} was -defined, then define this hook to return @code{true} if -@code{TARGET_SETUP_INCOMING_VARARGS} is used, @code{false} otherwise. -Otherwise, you should not define this hook. -@end deftypefn @node Trampolines @section Trampolines for Nested Functions @@ -5099,16 +4093,6 @@ may be necessary to take out pieces of the address and store them separately. @hook TARGET_ASM_TRAMPOLINE_TEMPLATE -This hook is called by @code{assemble_trampoline_template} to output, -on the stream @var{f}, assembler code for a block of data that contains -the constant parts of a trampoline. This code should not include a -label---the label is taken care of automatically. - -If you do not define this hook, it means no template is needed -for the target. Do not define this hook on systems where the block move -code to copy the trampoline into place would be larger than the code -to generate it on the spot. -@end deftypefn @defmac TRAMPOLINE_SECTION Return the section into which the trampoline template is to be placed @@ -5127,33 +4111,8 @@ is used for aligning trampolines. @end defmac @hook TARGET_TRAMPOLINE_INIT -This hook is called to initialize a trampoline. -@var{m_tramp} is an RTX for the memory block for the trampoline; @var{fndecl} -is the @code{FUNCTION_DECL} for the nested function; @var{static_chain} is an -RTX for the static chain value that should be passed to the function -when it is called. - -If the target defines @code{TARGET_ASM_TRAMPOLINE_TEMPLATE}, then the -first thing this hook should do is emit a block move into @var{m_tramp} -from the memory block returned by @code{assemble_trampoline_template}. -Note that the block move need only cover the constant parts of the -trampoline. If the target isolates the variable parts of the trampoline -to the end, not all @code{TRAMPOLINE_SIZE} bytes need be copied. - -If the target requires any other actions, such as flushing caches or -enabling stack execution, these actions should be performed after -initializing the trampoline proper. -@end deftypefn @hook TARGET_TRAMPOLINE_ADJUST_ADDRESS -This hook should perform any machine-specific adjustment in -the address of the trampoline. Its argument contains the address of the -memory block that was passed to @code{TARGET_TRAMPOLINE_INIT}. In case -the address to be used for a function call should be different from the -address at which the template was stored, the different address should -be returned; otherwise @var{addr} should be returned unchanged. -If this hook is not defined, @var{addr} will be used for function calls. -@end deftypefn Implementing trampolines is difficult on many machines because they have separate instruction and data caches. Writing into a stack location @@ -5214,14 +4173,6 @@ are ABI-mandated names that the compiler should provide. @findex set_optab_libfunc @findex init_one_libfunc @hook TARGET_INIT_LIBFUNCS -This hook should declare additional library routines or rename -existing ones, using the functions @code{set_optab_libfunc} and -@code{init_one_libfunc} defined in @file{optabs.c}. -@code{init_optabs} calls this macro after initializing all the normal -library routines. - -The default is to do nothing. Most ports don't need to define this hook. -@end deftypefn @hook TARGET_LIBFUNC_GNU_PREFIX @@ -5358,69 +4309,6 @@ accept. @end defmac @hook TARGET_LEGITIMATE_ADDRESS_P -A function that returns whether @var{x} (an RTX) is a legitimate memory -address on the target machine for a memory operand of mode @var{mode}. - -Legitimate addresses are defined in two variants: a strict variant and a -non-strict one. The @var{strict} parameter chooses which variant is -desired by the caller. - -The strict variant is used in the reload pass. It must be defined so -that any pseudo-register that has not been allocated a hard register is -considered a memory reference. This is because in contexts where some -kind of register is required, a pseudo-register with no hard register -must be rejected. For non-hard registers, the strict variant should look -up the @code{reg_renumber} array; it should then proceed using the hard -register number in the array, or treat the pseudo as a memory reference -if the array holds @code{-1}. - -The non-strict variant is used in other passes. It must be defined to -accept all pseudo-registers in every context where some kind of -register is required. - -Normally, constant addresses which are the sum of a @code{symbol_ref} -and an integer are stored inside a @code{const} RTX to mark them as -constant. Therefore, there is no need to recognize such sums -specifically as legitimate addresses. Normally you would simply -recognize any @code{const} as legitimate. - -Usually @code{PRINT_OPERAND_ADDRESS} is not prepared to handle constant -sums that are not marked with @code{const}. It assumes that a naked -@code{plus} indicates indexing. If so, then you @emph{must} reject such -naked constant sums as illegitimate addresses, so that none of them will -be given to @code{PRINT_OPERAND_ADDRESS}. - -@cindex @code{TARGET_ENCODE_SECTION_INFO} and address validation -On some machines, whether a symbolic address is legitimate depends on -the section that the address refers to. On these machines, define the -target hook @code{TARGET_ENCODE_SECTION_INFO} to store the information -into the @code{symbol_ref}, and then check for it here. When you see a -@code{const}, you will have to look inside it to find the -@code{symbol_ref} in order to determine the section. @xref{Assembler -Format}. - -@cindex @code{GO_IF_LEGITIMATE_ADDRESS} -Some ports are still using a deprecated legacy substitute for -this hook, the @code{GO_IF_LEGITIMATE_ADDRESS} macro. This macro -has this syntax: - -@example -#define GO_IF_LEGITIMATE_ADDRESS (@var{mode}, @var{x}, @var{label}) -@end example - -@noindent -and should @code{goto @var{label}} if the address @var{x} is a valid -address on the target machine for a memory operand of mode @var{mode}. - -@findex REG_OK_STRICT -Compiler source files that want to use the strict variant of this -macro define the macro @code{REG_OK_STRICT}. You should use an -@code{#ifdef REG_OK_STRICT} conditional to define the strict variant in -that case and the non-strict variant otherwise. - -Using the hook is usually simpler because it limits the number of -files that are recompiled when changes are made. -@end deftypefn @defmac TARGET_MEM_CONSTRAINT A single character to be used instead of the default @code{'m'} @@ -5447,27 +4335,6 @@ a label_ref or symbol_ref within an UNSPEC@. @end defmac @hook TARGET_LEGITIMIZE_ADDRESS -This hook is given an invalid memory address @var{x} for an -operand of mode @var{mode} and should try to return a valid memory -address. - -@findex break_out_memory_refs -@var{x} will always be the result of a call to @code{break_out_memory_refs}, -and @var{oldx} will be the operand that was given to that function to produce -@var{x}. - -The code of the hook should not alter the substructure of -@var{x}. If it transforms @var{x} into a more legitimate form, it -should return the new @var{x}. - -It is not necessary for this hook to come up with a legitimate address, -with the exception of native TLS addresses (@pxref{Emulated TLS}). -The compiler has standard ways of doing so in all cases. In fact, if -the target supports only emulated TLS, it -is safe to omit this hook or make it return @var{x} if it cannot find -a valid way to legitimize the address. But often a machine-dependent -strategy can generate better code. -@end deftypefn @defmac LEGITIMIZE_RELOAD_ADDRESS (@var{x}, @var{mode}, @var{opnum}, @var{type}, @var{ind_levels}, @var{win}) A C compound statement that attempts to replace @var{x}, which is an address @@ -5519,169 +4386,38 @@ address; but often a machine-dependent strategy can generate better code. @end defmac @hook TARGET_MODE_DEPENDENT_ADDRESS_P -This hook returns @code{true} if memory address @var{addr} in address -space @var{addrspace} can have -different meanings depending on the machine mode of the memory -reference it is used for or if the address is valid for some modes -but not others. - -Autoincrement and autodecrement addresses typically have mode-dependent -effects because the amount of the increment or decrement is the size -of the operand being addressed. Some machines have other mode-dependent -addresses. Many RISC machines have no mode-dependent addresses. - -You may assume that @var{addr} is a valid address for the machine. - -The default version of this hook returns @code{false}. -@end deftypefn @hook TARGET_LEGITIMATE_CONSTANT_P -This hook returns true if @var{x} is a legitimate constant for a -@var{mode}-mode immediate operand on the target machine. You can assume that -@var{x} satisfies @code{CONSTANT_P}, so you need not check this. - -The default definition returns true. -@end deftypefn @hook TARGET_DELEGITIMIZE_ADDRESS -This hook is used to undo the possibly obfuscating effects of the -@code{LEGITIMIZE_ADDRESS} and @code{LEGITIMIZE_RELOAD_ADDRESS} target -macros. Some backend implementations of these macros wrap symbol -references inside an @code{UNSPEC} rtx to represent PIC or similar -addressing modes. This target hook allows GCC's optimizers to understand -the semantics of these opaque @code{UNSPEC}s by converting them back -into their original form. -@end deftypefn @hook TARGET_CONST_NOT_OK_FOR_DEBUG_P -This hook should return true if @var{x} should not be emitted into -debug sections. -@end deftypefn @hook TARGET_CANNOT_FORCE_CONST_MEM -This hook should return true if @var{x} is of a form that cannot (or -should not) be spilled to the constant pool. @var{mode} is the mode -of @var{x}. - -The default version of this hook returns false. - -The primary reason to define this hook is to prevent reload from -deciding that a non-legitimate constant would be better reloaded -from the constant pool instead of spilling and reloading a register -holding the constant. This restriction is often true of addresses -of TLS symbols for various targets. -@end deftypefn @hook TARGET_USE_BLOCKS_FOR_CONSTANT_P -This hook should return true if pool entries for constant @var{x} can -be placed in an @code{object_block} structure. @var{mode} is the mode -of @var{x}. - -The default version returns false for all constants. -@end deftypefn @hook TARGET_USE_BLOCKS_FOR_DECL_P -This hook should return true if pool entries for @var{decl} should -be placed in an @code{object_block} structure. - -The default version returns true for all decls. -@end deftypefn @hook TARGET_BUILTIN_RECIPROCAL -This hook should return the DECL of a function that implements reciprocal of -the builtin function with builtin function code @var{fn}, or -@code{NULL_TREE} if such a function is not available. @var{md_fn} is true -when @var{fn} is a code of a machine-dependent builtin function. When -@var{sqrt} is true, additional optimizations that apply only to the reciprocal -of a square root function are performed, and only reciprocals of @code{sqrt} -function are valid. -@end deftypefn @hook TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD -This hook should return the DECL of a function @var{f} that given an -address @var{addr} as an argument returns a mask @var{m} that can be -used to extract from two vectors the relevant data that resides in -@var{addr} in case @var{addr} is not properly aligned. - -The autovectorizer, when vectorizing a load operation from an address -@var{addr} that may be unaligned, will generate two vector loads from -the two aligned addresses around @var{addr}. It then generates a -@code{REALIGN_LOAD} operation to extract the relevant data from the -two loaded vectors. The first two arguments to @code{REALIGN_LOAD}, -@var{v1} and @var{v2}, are the two vectors, each of size @var{VS}, and -the third argument, @var{OFF}, defines how the data will be extracted -from these two vectors: if @var{OFF} is 0, then the returned vector is -@var{v2}; otherwise, the returned vector is composed from the last -@var{VS}-@var{OFF} elements of @var{v1} concatenated to the first -@var{OFF} elements of @var{v2}. - -If this hook is defined, the autovectorizer will generate a call -to @var{f} (using the DECL tree that this hook returns) and will -use the return value of @var{f} as the argument @var{OFF} to -@code{REALIGN_LOAD}. Therefore, the mask @var{m} returned by @var{f} -should comply with the semantics expected by @code{REALIGN_LOAD} -described above. -If this hook is not defined, then @var{addr} will be used as -the argument @var{OFF} to @code{REALIGN_LOAD}, in which case the low -log2(@var{VS}) @minus{} 1 bits of @var{addr} will be considered. -@end deftypefn @hook TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST -Returns cost of different scalar or vector statements for vectorization cost model. -For vector memory operations the cost may depend on type (@var{vectype}) and -misalignment value (@var{misalign}). -@end deftypefn @hook TARGET_VECTORIZE_VECTOR_ALIGNMENT_REACHABLE -Return true if vector alignment is reachable (by peeling N iterations) for the given type. -@end deftypefn @hook TARGET_VECTORIZE_VEC_PERM_CONST_OK -Return true if a vector created for @code{vec_perm_const} is valid. -@end deftypefn @hook TARGET_VECTORIZE_BUILTIN_CONVERSION -This hook should return the DECL of a function that implements conversion of the -input vector of type @var{src_type} to type @var{dest_type}. -The value of @var{code} is one of the enumerators in @code{enum tree_code} and -specifies how the conversion is to be applied -(truncation, rounding, etc.). - -If this hook is defined, the autovectorizer will use the -@code{TARGET_VECTORIZE_BUILTIN_CONVERSION} target hook when vectorizing -conversion. Otherwise, it will return @code{NULL_TREE}. -@end deftypefn @hook TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION -This hook should return the decl of a function that implements the -vectorized variant of the builtin function with builtin function code -@var{code} or @code{NULL_TREE} if such a function is not available. -The value of @var{fndecl} is the builtin function declaration. The -return type of the vectorized function shall be of vector type -@var{vec_type_out} and the argument types should be @var{vec_type_in}. -@end deftypefn @hook TARGET_VECTORIZE_SUPPORT_VECTOR_MISALIGNMENT -This hook should return true if the target supports misaligned vector -store/load of a specific factor denoted in the @var{misalignment} -parameter. The vector store/load should be of machine mode @var{mode} and -the elements in the vectors should be of type @var{type}. @var{is_packed} -parameter is true if the memory access is defined in a packed struct. -@end deftypefn @hook TARGET_VECTORIZE_PREFERRED_SIMD_MODE -This hook should return the preferred mode for vectorizing scalar -mode @var{mode}. The default is -equal to @code{word_mode}, because the vectorizer can do some -transformations even in absence of specialized @acronym{SIMD} hardware. -@end deftypefn @hook TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_SIZES -This hook should return a mask of sizes that should be iterated over -after trying to autovectorize using the vector size derived from the -mode returned by @code{TARGET_VECTORIZE_PREFERRED_SIMD_MODE}. -The default is zero which means to not iterate over other vector sizes. -@end deftypefn @hook TARGET_VECTORIZE_INIT_COST @@ -5696,12 +4432,6 @@ The default is zero which means to not iterate over other vector sizes. @hook TARGET_VECTORIZE_BUILTIN_TM_STORE @hook TARGET_VECTORIZE_BUILTIN_GATHER -Target builtin that implements vector gather operation. @var{mem_vectype} -is the vector type of the load and @var{index_type} is scalar type of -the index, scaled by @var{scale}. -The default is @code{NULL_TREE} which means to not vectorize gather -loads. -@end deftypefn @node Anchored Addresses @section Anchored Addresses @@ -5739,39 +4469,12 @@ section anchors at all unless either @code{TARGET_MIN_ANCHOR_OFFSET} or @code{TARGET_MAX_ANCHOR_OFFSET} is set to a nonzero value. @hook TARGET_MIN_ANCHOR_OFFSET -The minimum offset that should be applied to a section anchor. -On most targets, it should be the smallest offset that can be -applied to a base register while still giving a legitimate address -for every mode. The default value is 0. -@end deftypevr @hook TARGET_MAX_ANCHOR_OFFSET -Like @code{TARGET_MIN_ANCHOR_OFFSET}, but the maximum (inclusive) -offset that should be applied to section anchors. The default -value is 0. -@end deftypevr @hook TARGET_ASM_OUTPUT_ANCHOR -Write the assembly code to define section anchor @var{x}, which is a -@code{SYMBOL_REF} for which @samp{SYMBOL_REF_ANCHOR_P (@var{x})} is true. -The hook is called with the assembly output position set to the beginning -of @code{SYMBOL_REF_BLOCK (@var{x})}. - -If @code{ASM_OUTPUT_DEF} is available, the hook's default definition uses -it to define the symbol as @samp{. + SYMBOL_REF_BLOCK_OFFSET (@var{x})}. -If @code{ASM_OUTPUT_DEF} is not available, the hook's default definition -is @code{NULL}, which disables the use of section anchors altogether. -@end deftypefn @hook TARGET_USE_ANCHORS_FOR_SYMBOL_P -Return true if GCC should attempt to use anchors to access @code{SYMBOL_REF} -@var{x}. You can assume @samp{SYMBOL_REF_HAS_BLOCK_INFO_P (@var{x})} and -@samp{!SYMBOL_REF_ANCHOR_P (@var{x})}. - -The default version is correct for most targets, but you might need to -intercept this hook to handle things like target-specific attributes -or target-specific sections. -@end deftypefn @node Condition Code @section Condition Code Status @@ -5941,26 +4644,6 @@ in @file{@var{machine}-modes.def}. @end defmac @hook TARGET_CANONICALIZE_COMPARISON -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. - -On such machines, implement this hook to do any required conversions. -@var{code} is the initial comparison code and @var{op0} and @var{op1} -are the left and right operands of the comparison, respectively. If -@var{op0_preserve_value} is @code{true} the implementation is not -allowed to change the value of @var{op0} since the value might be used -in RTXs which aren't comparisons. E.g. the implementation is not -allowed to swap operands in that case. - -GCC will not assume that the comparison resulting from this macro is -valid but will see if the resulting insn matches a pattern in the -@file{md} file. - -You need not to implement this hook if it would never change the -comparison code or operands. -@end deftypefn @defmac REVERSIBLE_CC_MODE (@var{mode}) A C expression whose value is one if it is always safe to reverse a @@ -5995,32 +4678,8 @@ like: @end defmac @hook TARGET_FIXED_CONDITION_CODE_REGS -On targets which do not use @code{(cc0)}, and which use a hard -register rather than a pseudo-register to hold condition codes, the -regular CSE passes are often not able to identify cases in which the -hard register is set to a common value. Use this hook to enable a -small pass which optimizes such cases. This hook should return true -to enable this pass, and it should set the integers to which its -arguments point to the hard register numbers used for condition codes. -When there is only one such register, as is true on most systems, the -integer pointed to by @var{p2} should be set to -@code{INVALID_REGNUM}. - -The default version of this hook returns false. -@end deftypefn @hook TARGET_CC_MODES_COMPATIBLE -On targets which use multiple condition code modes in class -@code{MODE_CC}, it is sometimes the case that a comparison can be -validly done in more than one mode. On such a system, define this -target hook to take two mode arguments and to return a mode in which -both comparisons may be validly done. If there is no such mode, -return @code{VOIDmode}. - -The default version of this hook checks whether the modes are the -same. If they are, it returns that mode. If they are different, it -returns @code{VOIDmode}. -@end deftypefn @node Cond Exec Macros @subsection Macros to control conditional execution @@ -6063,25 +4722,6 @@ These macros are obsolete, new ports should use the target hook @end defmac @hook TARGET_REGISTER_MOVE_COST -This target hook should return 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 -registers if they are not general registers. - -If reload sees an insn consisting of a single @code{set} between two -hard registers, and if @code{TARGET_REGISTER_MOVE_COST} applied to their -classes returns a value of 2, reload does not check to ensure that the -constraints of the insn are met. Setting a cost of other than 2 will -allow reload to verify that the constraints are met. You should do this -if the @samp{mov@var{m}} pattern's constraints do not allow such copying. - -The default version of this function returns 2. -@end deftypefn @defmac MEMORY_MOVE_COST (@var{mode}, @var{class}, @var{in}) A C expression for the cost of moving data of mode @var{mode} between a @@ -6111,28 +4751,6 @@ These macros are obsolete, new ports should use the target hook @end defmac @hook TARGET_MEMORY_MOVE_COST -This target hook should return the cost of moving data of mode @var{mode} -between a register of class @var{rclass} and memory; @var{in} is @code{false} -if the value is to be written to memory, @code{true} if it is to be read in. -This cost is relative to those in @code{TARGET_REGISTER_MOVE_COST}. -If moving between registers and memory is more expensive than between two -registers, you should add this target hook to express the relative cost. - -If you do not add this target hook, GCC uses a default cost of 4 plus -the cost of copying via a secondary reload register, if one is -needed. If your machine requires a secondary reload register to copy -between memory and a register of @var{rclass} but the reload mechanism is -more complex than copying via an intermediate, use this target hook to -reflect the actual cost of the move. - -GCC defines the function @code{memory_move_secondary_cost} if -secondary reloads are needed. It computes the costs due to copying via -a secondary register. If your machine copies from memory using a -secondary register in the conventional way but the default base value of -4 is not correct for your machine, use this target hook to add some other -value to the result of that function. The arguments to that function -are the same as to this target hook. -@end deftypefn @defmac BRANCH_COST (@var{speed_p}, @var{predictable_p}) A C expression for the cost of a branch instruction. A value of 1 is @@ -6318,71 +4936,8 @@ Define this macro if a non-short-circuit operation produced by @end defmac @hook TARGET_RTX_COSTS -This target hook describes the relative costs of RTL expressions. - -The cost may depend on the precise form of the expression, which is -available for examination in @var{x}, and the fact that @var{x} appears -as operand @var{opno} of an expression with rtx code @var{outer_code}. -That is, the hook can assume that there is some rtx @var{y} such -that @samp{GET_CODE (@var{y}) == @var{outer_code}} and such that -either (a) @samp{XEXP (@var{y}, @var{opno}) == @var{x}} or -(b) @samp{XVEC (@var{y}, @var{opno})} contains @var{x}. - -@var{code} is @var{x}'s expression code---redundant, since it can be -obtained with @code{GET_CODE (@var{x})}. - -In implementing this hook, you can use the construct -@code{COSTS_N_INSNS (@var{n})} to specify a cost equal to @var{n} fast -instructions. - -On entry to the hook, @code{*@var{total}} contains a default estimate -for the cost of the expression. The hook should modify this value as -necessary. Traditionally, the default costs are @code{COSTS_N_INSNS (5)} -for multiplications, @code{COSTS_N_INSNS (7)} for division and modulus -operations, and @code{COSTS_N_INSNS (1)} for all other operations. - -When optimizing for code size, i.e.@: when @code{speed} is -false, this target hook should be used to estimate the relative -size cost of an expression, again relative to @code{COSTS_N_INSNS}. - -The hook returns true when all subexpressions of @var{x} have been -processed, and false when @code{rtx_cost} should recurse. -@end deftypefn @hook TARGET_ADDRESS_COST -This hook computes the cost of an addressing mode that contains -@var{address}. If not defined, the cost is computed from -the @var{address} expression and the @code{TARGET_RTX_COST} hook. - -For most CISC machines, the default cost is a good approximation of the -true cost of the addressing mode. However, on RISC machines, all -instructions normally have the same length and execution time. Hence -all addresses will have equal costs. - -In cases where more than one form of an address is known, the form with -the lowest cost will be used. If multiple forms have the same, lowest, -cost, the one that is the most complex will be used. - -For example, suppose an address that is equal to the sum of a register -and a constant is used twice in the same basic block. When this macro -is not defined, the address will be computed in a register and memory -references will be indirect through that register. On machines where -the cost of the addressing mode containing the sum is no higher than -that of a simple indirect reference, this will produce an additional -instruction and possibly require an additional register. Proper -specification of this macro eliminates this overhead for such machines. - -This hook is never called with an invalid address. - -On machines where an address involving more than one register is as -cheap as an address computation involving only one register, defining -@code{TARGET_ADDRESS_COST} to reflect this can cause two registers to -be live over a region of code where only one would have been if -@code{TARGET_ADDRESS_COST} were not defined in that manner. This effect -should be considered in the definition of this macro. Equivalent costs -should probably only be given to addresses with different numbers of -registers on machines with lots of registers. -@end deftypefn @node Scheduling @section Adjusting the Instruction Scheduler @@ -6393,357 +4948,86 @@ hooks for this purpose. It is usually enough to define just a few of them: try the first ones in this list first. @hook TARGET_SCHED_ISSUE_RATE -This hook returns the maximum number of instructions that can ever -issue at the same time on the target machine. The default is one. -Although the insn scheduler can define itself the possibility of issue -an insn on the same cycle, the value can serve as an additional -constraint to issue insns on the same simulated processor cycle (see -hooks @samp{TARGET_SCHED_REORDER} and @samp{TARGET_SCHED_REORDER2}). -This value must be constant over the entire compilation. If you need -it to vary depending on what the instructions are, you must use -@samp{TARGET_SCHED_VARIABLE_ISSUE}. -@end deftypefn @hook TARGET_SCHED_VARIABLE_ISSUE -This hook is executed by the scheduler after it has scheduled an insn -from the ready list. It should return the number of insns which can -still be issued in the current cycle. The default is -@samp{@w{@var{more} - 1}} for insns other than @code{CLOBBER} and -@code{USE}, which normally are not counted against the issue rate. -You should define this hook if some insns take more machine resources -than others, so that fewer insns can follow them in the same cycle. -@var{file} is either a null pointer, or a stdio stream to write any -debug output to. @var{verbose} is the verbose level provided by -@option{-fsched-verbose-@var{n}}. @var{insn} is the instruction that -was scheduled. -@end deftypefn @hook TARGET_SCHED_ADJUST_COST -This function corrects the value of @var{cost} based on the -relationship between @var{insn} and @var{dep_insn} through the -dependence @var{link}. It should return the new value. The default -is to make no adjustment to @var{cost}. This can be used for example -to specify to the scheduler using the traditional pipeline description -that an output- or anti-dependence does not incur the same cost as a -data-dependence. If the scheduler using the automaton based pipeline -description, the cost of anti-dependence is zero and the cost of -output-dependence is maximum of one and the difference of latency -times of the first and the second insns. If these values are not -acceptable, you could use the hook to modify them too. See also -@pxref{Processor pipeline description}. -@end deftypefn @hook TARGET_SCHED_ADJUST_PRIORITY -This hook adjusts the integer scheduling priority @var{priority} of -@var{insn}. It should return the new priority. Increase the priority to -execute @var{insn} earlier, reduce the priority to execute @var{insn} -later. Do not define this hook if you do not need to adjust the -scheduling priorities of insns. -@end deftypefn @hook TARGET_SCHED_REORDER -This hook 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 stream to write any -debug output to. @var{verbose} is the verbose level provided by -@option{-fsched-verbose-@var{n}}. @var{ready} is a pointer to the ready -list of instructions that are ready to be scheduled. @var{n_readyp} is -a pointer to the number of elements in the ready list. The scheduler -reads the ready list in reverse order, starting with -@var{ready}[@var{*n_readyp} @minus{} 1] and going to @var{ready}[0]. @var{clock} -is the timer tick of the scheduler. You may modify the ready list and -the number of ready insns. The return value is the number of insns that -can issue this cycle; normally this is just @code{issue_rate}. See also -@samp{TARGET_SCHED_REORDER2}. -@end deftypefn @hook TARGET_SCHED_REORDER2 -Like @samp{TARGET_SCHED_REORDER}, but called at a different time. That -function is called whenever the scheduler starts a new cycle. This one -is called once per iteration over a cycle, immediately after -@samp{TARGET_SCHED_VARIABLE_ISSUE}; it can reorder the ready list and -return the number of insns to be scheduled in the same cycle. Defining -this hook 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. -@end deftypefn @hook TARGET_SCHED_DEPENDENCIES_EVALUATION_HOOK -This hook is called after evaluation forward dependencies of insns in -chain given by two parameter values (@var{head} and @var{tail} -correspondingly) but before insns scheduling of the insn chain. For -example, it can be used for better insn classification if it requires -analysis of dependencies. This hook can use backward and forward -dependencies of the insn scheduler because they are already -calculated. -@end deftypefn @hook TARGET_SCHED_INIT -This hook 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 @option{-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, e.g.@: by @samp{TARGET_SCHED_REORDER}. -@end deftypefn @hook TARGET_SCHED_FINISH -This hook 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 hooks. @var{file} -is either a null pointer, or a stdio stream to write any debug output -to. @var{verbose} is the verbose level provided by -@option{-fsched-verbose-@var{n}}. -@end deftypefn @hook TARGET_SCHED_INIT_GLOBAL -This hook is executed by the scheduler after function level initializations. -@var{file} is either a null pointer, or a stdio stream to write any debug output to. -@var{verbose} is the verbose level provided by @option{-fsched-verbose-@var{n}}. -@var{old_max_uid} is the maximum insn uid when scheduling begins. -@end deftypefn @hook TARGET_SCHED_FINISH_GLOBAL -This is the cleanup hook corresponding to @code{TARGET_SCHED_INIT_GLOBAL}. -@var{file} is either a null pointer, or a stdio stream to write any debug output to. -@var{verbose} is the verbose level provided by @option{-fsched-verbose-@var{n}}. -@end deftypefn @hook TARGET_SCHED_DFA_PRE_CYCLE_INSN -The hook returns an RTL insn. The automaton state used in the -pipeline hazard recognizer is changed as if the insn were scheduled -when the new simulated processor cycle starts. Usage of the hook may -simplify the automaton pipeline description for some @acronym{VLIW} -processors. If the hook is defined, it is used only for the automaton -based pipeline description. The default is not to change the state -when the new simulated processor cycle starts. -@end deftypefn @hook TARGET_SCHED_INIT_DFA_PRE_CYCLE_INSN -The hook can be used to initialize data used by the previous hook. -@end deftypefn @hook TARGET_SCHED_DFA_POST_CYCLE_INSN -The hook is analogous to @samp{TARGET_SCHED_DFA_PRE_CYCLE_INSN} but used -to changed the state as if the insn were scheduled when the new -simulated processor cycle finishes. -@end deftypefn @hook TARGET_SCHED_INIT_DFA_POST_CYCLE_INSN -The hook is analogous to @samp{TARGET_SCHED_INIT_DFA_PRE_CYCLE_INSN} but -used to initialize data used by the previous hook. -@end deftypefn @hook TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE -The hook to notify target that the current simulated cycle is about to finish. -The hook is analogous to @samp{TARGET_SCHED_DFA_PRE_CYCLE_INSN} but used -to change the state in more complicated situations - e.g., when advancing -state on a single insn is not enough. -@end deftypefn @hook TARGET_SCHED_DFA_POST_ADVANCE_CYCLE -The hook to notify target that new simulated cycle has just started. -The hook is analogous to @samp{TARGET_SCHED_DFA_POST_CYCLE_INSN} but used -to change the state in more complicated situations - e.g., when advancing -state on a single insn is not enough. -@end deftypefn @hook TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD -This hook controls better choosing an insn from the ready insn queue -for the @acronym{DFA}-based insn scheduler. Usually the scheduler -chooses the first insn from the queue. If the hook returns a positive -value, an additional scheduler code tries all permutations of -@samp{TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD ()} -subsequent ready insns to choose an insn whose issue will result in -maximal number of issued insns on the same cycle. For the -@acronym{VLIW} processor, the code could actually solve the problem of -packing simple insns into the @acronym{VLIW} insn. Of course, if the -rules of @acronym{VLIW} packing are described in the automaton. - -This code also could be used for superscalar @acronym{RISC} -processors. Let us consider a superscalar @acronym{RISC} processor -with 3 pipelines. Some insns can be executed in pipelines @var{A} or -@var{B}, some insns can be executed only in pipelines @var{B} or -@var{C}, and one insn can be executed in pipeline @var{B}. The -processor may issue the 1st insn into @var{A} and the 2nd one into -@var{B}. In this case, the 3rd insn will wait for freeing @var{B} -until the next cycle. If the scheduler issues the 3rd insn the first, -the processor could issue all 3 insns per cycle. - -Actually this code demonstrates advantages of the automaton based -pipeline hazard recognizer. We try quickly and easy many insn -schedules to choose the best one. - -The default is no multipass scheduling. -@end deftypefn @hook TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD -This hook controls what insns from the ready insn queue will be -considered for the multipass insn scheduling. If the hook returns -zero for @var{insn}, the insn will be not chosen to -be issued. - -The default is that any ready insns can be chosen to be issued. -@end deftypefn - @hook TARGET_SCHED_FIRST_CYCLE_MULTIPASS_BEGIN -This hook prepares the target backend for a new round of multipass -scheduling. -@end deftypefn @hook TARGET_SCHED_FIRST_CYCLE_MULTIPASS_ISSUE -This hook is called when multipass scheduling evaluates instruction INSN. -@end deftypefn @hook TARGET_SCHED_FIRST_CYCLE_MULTIPASS_BACKTRACK -This is called when multipass scheduling backtracks from evaluation of -an instruction. -@end deftypefn @hook TARGET_SCHED_FIRST_CYCLE_MULTIPASS_END -This hook notifies the target about the result of the concluded current -round of multipass scheduling. -@end deftypefn @hook TARGET_SCHED_FIRST_CYCLE_MULTIPASS_INIT -This hook initializes target-specific data used in multipass scheduling. -@end deftypefn @hook TARGET_SCHED_FIRST_CYCLE_MULTIPASS_FINI -This hook finalizes target-specific data used in multipass scheduling. -@end deftypefn @hook TARGET_SCHED_DFA_NEW_CYCLE -This hook is called by the insn scheduler before issuing @var{insn} -on cycle @var{clock}. If the hook returns nonzero, -@var{insn} is not issued on this processor cycle. Instead, -the processor cycle is advanced. If *@var{sort_p} -is zero, the insn ready queue is not sorted on the new cycle -start as usually. @var{dump} and @var{verbose} specify the file and -verbosity level to use for debugging output. -@var{last_clock} and @var{clock} are, respectively, the -processor cycle on which the previous insn has been issued, -and the current processor cycle. -@end deftypefn @hook TARGET_SCHED_IS_COSTLY_DEPENDENCE -This hook is used to define which dependences are considered costly by -the target, so costly that it is not advisable to schedule the insns that -are involved in the dependence too close to one another. The parameters -to this hook are as follows: The first parameter @var{_dep} is the dependence -being evaluated. The second parameter @var{cost} is the cost of the -dependence as estimated by the scheduler, and the third -parameter @var{distance} is the distance in cycles between the two insns. -The hook returns @code{true} if considering the distance between the two -insns the dependence between them is considered costly by the target, -and @code{false} otherwise. - -Defining this hook can be useful in multiple-issue out-of-order machines, -where (a) it's practically hopeless to predict the actual data/resource -delays, however: (b) there's a better chance to predict the actual grouping -that will be formed, and (c) correctly emulating the grouping can be very -important. In such targets one may want to allow issuing dependent insns -closer to one another---i.e., closer than the dependence distance; however, -not in cases of ``costly dependences'', which this hooks allows to define. -@end deftypefn @hook TARGET_SCHED_H_I_D_EXTENDED -This hook is called by the insn scheduler after emitting a new instruction to -the instruction stream. The hook notifies a target backend to extend its -per instruction data structures. -@end deftypefn @hook TARGET_SCHED_ALLOC_SCHED_CONTEXT -Return a pointer to a store large enough to hold target scheduling context. -@end deftypefn @hook TARGET_SCHED_INIT_SCHED_CONTEXT -Initialize store pointed to by @var{tc} to hold target scheduling context. -It @var{clean_p} is true then initialize @var{tc} as if scheduler is at the -beginning of the block. Otherwise, copy the current context into @var{tc}. -@end deftypefn @hook TARGET_SCHED_SET_SCHED_CONTEXT -Copy target scheduling context pointed to by @var{tc} to the current context. -@end deftypefn @hook TARGET_SCHED_CLEAR_SCHED_CONTEXT -Deallocate internal data in target scheduling context pointed to by @var{tc}. -@end deftypefn @hook TARGET_SCHED_FREE_SCHED_CONTEXT -Deallocate a store for target scheduling context pointed to by @var{tc}. -@end deftypefn @hook TARGET_SCHED_SPECULATE_INSN -This hook is called by the insn scheduler when @var{insn} has only -speculative dependencies and therefore can be scheduled speculatively. -The hook is used to check if the pattern of @var{insn} has a speculative -version and, in case of successful check, to generate that speculative -pattern. The hook should return 1, if the instruction has a speculative form, -or @minus{}1, if it doesn't. @var{request} describes the type of requested -speculation. If the return value equals 1 then @var{new_pat} is assigned -the generated speculative pattern. -@end deftypefn @hook TARGET_SCHED_NEEDS_BLOCK_P -This hook is called by the insn scheduler during generation of recovery code -for @var{insn}. It should return @code{true}, if the corresponding check -instruction should branch to recovery code, or @code{false} otherwise. -@end deftypefn @hook TARGET_SCHED_GEN_SPEC_CHECK -This hook is called by the insn scheduler to generate a pattern for recovery -check instruction. If @var{mutate_p} is zero, then @var{insn} is a -speculative instruction for which the check should be generated. -@var{label} is either a label of a basic block, where recovery code should -be emitted, or a null pointer, when requested check doesn't branch to -recovery code (a simple check). If @var{mutate_p} is nonzero, then -a pattern for a branchy check corresponding to a simple check denoted by -@var{insn} should be generated. In this case @var{label} can't be null. -@end deftypefn @hook TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC -This hook is used as a workaround for -@samp{TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD} not being -called on the first instruction of the ready list. The hook is used to -discard speculative instructions that stand first in the ready list from -being scheduled on the current cycle. If the hook returns @code{false}, -@var{insn} will not be chosen to be issued. -For non-speculative instructions, -the hook should always return @code{true}. For example, in the ia64 backend -the hook is used to cancel data speculative insns when the ALAT table -is nearly full. -@end deftypefn @hook TARGET_SCHED_SET_SCHED_FLAGS -This hook is used by the insn scheduler to find out what features should be -enabled/used. -The structure *@var{spec_info} should be filled in by the target. -The structure describes speculation types that can be used in the scheduler. -@end deftypefn @hook TARGET_SCHED_SMS_RES_MII -This hook is called by the swing modulo scheduler to calculate a -resource-based lower bound which is based on the resources available in -the machine and the resources required by each instruction. The target -backend can use @var{g} to calculate such bound. A very simple lower -bound will be used in case this hook is not implemented: the total number -of instructions divided by the issue rate. -@end deftypefn @hook TARGET_SCHED_DISPATCH -This hook is called by Haifa Scheduler. It returns true if dispatch scheduling -is supported in hardware and the condition specified in the parameter is true. -@end deftypefn @hook TARGET_SCHED_DISPATCH_DO -This hook is called by Haifa Scheduler. It performs the operation specified -in its second parameter. -@end deftypefn @hook TARGET_SCHED_EXPOSED_PIPELINE @@ -6925,40 +5209,10 @@ This macro is irrelevant if there is no separate readonly data section. @end defmac @hook TARGET_ASM_INIT_SECTIONS -Define this hook if you need to do something special to set up the -@file{varasm.c} sections, or if your target has some special sections -of its own that you need to create. - -GCC calls this hook after processing the command line, but before writing -any assembly code, and before calling any of the section-returning hooks -described below. -@end deftypefn @hook TARGET_ASM_RELOC_RW_MASK -Return a mask describing how relocations should be treated when -selecting sections. Bit 1 should be set if global relocations -should be placed in a read-write section; bit 0 should be set if -local relocations should be placed in a read-write section. - -The default version of this function returns 3 when @option{-fpic} -is in effect, and 0 otherwise. The hook is typically redefined -when the target cannot support (some kinds of) dynamic relocations -in read-only sections even in executables. -@end deftypefn @hook TARGET_ASM_SELECT_SECTION -Return the section into which @var{exp} should be placed. You can -assume that @var{exp} is either a @code{VAR_DECL} node or a constant of -some sort. @var{reloc} indicates whether the initial value of @var{exp} -requires link-time relocations. Bit 0 is set when variable contains -local relocations only, while bit 1 is set for global relocations. -@var{align} is the constant alignment in bits. - -The default version of this function takes care of putting read-only -variables in @code{readonly_data_section}. - -See also @var{USE_SELECT_SECTION_FOR_FUNCTIONS}. -@end deftypefn @defmac USE_SELECT_SECTION_FOR_FUNCTIONS Define this macro if you wish TARGET_ASM_SELECT_SECTION to be called @@ -6970,122 +5224,30 @@ it is unlikely to be called. @end defmac @hook TARGET_ASM_UNIQUE_SECTION -Build up a unique section name, expressed as a @code{STRING_CST} node, -and assign it to @samp{DECL_SECTION_NAME (@var{decl})}. -As with @code{TARGET_ASM_SELECT_SECTION}, @var{reloc} indicates whether -the initial value of @var{exp} requires link-time relocations. - -The default version of this function appends the symbol name to the -ELF section name that would normally be used for the symbol. For -example, the function @code{foo} would be placed in @code{.text.foo}. -Whatever the actual target object format, this is often good enough. -@end deftypefn @hook TARGET_ASM_FUNCTION_RODATA_SECTION -Return the readonly data section associated with -@samp{DECL_SECTION_NAME (@var{decl})}. -The default version of this function selects @code{.gnu.linkonce.r.name} if -the function's section is @code{.gnu.linkonce.t.name}, @code{.rodata.name} -if function is in @code{.text.name}, and the normal readonly-data section -otherwise. -@end deftypefn @hook TARGET_ASM_MERGEABLE_RODATA_PREFIX @hook TARGET_ASM_TM_CLONE_TABLE_SECTION @hook TARGET_ASM_SELECT_RTX_SECTION -Return the section into which a constant @var{x}, of mode @var{mode}, -should be placed. You can assume that @var{x} is some kind of -constant in RTL@. The argument @var{mode} is redundant except in the -case of a @code{const_int} rtx. @var{align} is the constant alignment -in bits. - -The default version of this function takes care of putting symbolic -constants in @code{flag_pic} mode in @code{data_section} and everything -else in @code{readonly_data_section}. -@end deftypefn @hook TARGET_MANGLE_DECL_ASSEMBLER_NAME -Define this hook if you need to postprocess the assembler name generated -by target-independent code. The @var{id} provided to this hook will be -the computed name (e.g., the macro @code{DECL_NAME} of the @var{decl} in C, -or the mangled name of the @var{decl} in C++). The return value of the -hook is an @code{IDENTIFIER_NODE} for the appropriate mangled name on -your target system. The default implementation of this hook just -returns the @var{id} provided. -@end deftypefn @hook TARGET_ENCODE_SECTION_INFO -Define this hook if references to a symbol or a constant must be -treated differently depending on something about the variable or -function named by the symbol (such as what section it is in). - -The hook is executed immediately after rtl has been created for -@var{decl}, which may be a variable or function declaration or -an entry in the constant pool. In either case, @var{rtl} is the -rtl in question. Do @emph{not} use @code{DECL_RTL (@var{decl})} -in this hook; that field may not have been initialized yet. - -In the case of a constant, it is safe to assume that the rtl is -a @code{mem} whose address is a @code{symbol_ref}. Most decls -will also have this form, but that is not guaranteed. Global -register variables, for instance, will have a @code{reg} for their -rtl. (Normally the right thing to do with such unusual rtl is -leave it alone.) - -The @var{new_decl_p} argument will be true if this is the first time -that @code{TARGET_ENCODE_SECTION_INFO} has been invoked on this decl. It will -be false for subsequent invocations, which will happen for duplicate -declarations. Whether or not anything must be done for the duplicate -declaration depends on whether the hook examines @code{DECL_ATTRIBUTES}. -@var{new_decl_p} is always true when the hook is called for a constant. - -@cindex @code{SYMBOL_REF_FLAG}, in @code{TARGET_ENCODE_SECTION_INFO} -The usual thing for this hook to do is to record flags in the -@code{symbol_ref}, using @code{SYMBOL_REF_FLAG} or @code{SYMBOL_REF_FLAGS}. -Historically, the name string was modified if it was necessary to -encode more than one bit of information, but this practice is now -discouraged; use @code{SYMBOL_REF_FLAGS}. - -The default definition of this hook, @code{default_encode_section_info} -in @file{varasm.c}, sets a number of commonly-useful bits in -@code{SYMBOL_REF_FLAGS}. Check whether the default does what you need -before overriding it. -@end deftypefn @hook TARGET_STRIP_NAME_ENCODING -Decode @var{name} and return the real name part, sans -the characters that @code{TARGET_ENCODE_SECTION_INFO} -may have added. -@end deftypefn @hook TARGET_IN_SMALL_DATA_P -Returns true if @var{exp} should be placed into a ``small data'' section. -The default version of this hook always returns false. -@end deftypefn @hook TARGET_HAVE_SRODATA_SECTION -Contains the value true if the target places read-only -``small data'' into a separate section. The default value is false. -@end deftypevr @hook TARGET_PROFILE_BEFORE_PROLOGUE @hook TARGET_BINDS_LOCAL_P -Returns true if @var{exp} names an object for which name resolution -rules must resolve to the current ``module'' (dynamic shared library -or executable image). - -The default version of this hook implements the name resolution rules -for ELF, which has a looser model of global name binding than other -currently supported object file formats. -@end deftypefn @hook TARGET_HAVE_TLS -Contains the value true if the target supports thread-local storage. -The default value is false. -@end deftypevr @node PIC @@ -7166,39 +5328,12 @@ This describes the overall framework of an assembly file. @findex default_file_start @hook TARGET_ASM_FILE_START -Output to @code{asm_out_file} any text which the assembler expects to -find at the beginning of a file. The default behavior is controlled -by two flags, documented below. Unless your target's assembler is -quite unusual, if you override the default, you should call -@code{default_file_start} at some point in your target hook. This -lets other target files rely on these variables. -@end deftypefn @hook TARGET_ASM_FILE_START_APP_OFF -If this flag is true, the text of the macro @code{ASM_APP_OFF} will be -printed as the very first line in the assembly file, unless -@option{-fverbose-asm} is in effect. (If that macro has been defined -to the empty string, this variable has no effect.) With the normal -definition of @code{ASM_APP_OFF}, the effect is to notify the GNU -assembler that it need not bother stripping comments or extra -whitespace from its input. This allows it to work a bit faster. - -The default is false. You should not set it to true unless you have -verified that your port does not generate any extra whitespace or -comments that will cause GAS to issue errors in NO_APP mode. -@end deftypevr @hook TARGET_ASM_FILE_START_FILE_DIRECTIVE -If this flag is true, @code{output_file_directive} will be called -for the primary source file, immediately after printing -@code{ASM_APP_OFF} (if that is enabled). Most ELF assemblers expect -this to be done. The default is false. -@end deftypevr @hook TARGET_ASM_FILE_END -Output to @code{asm_out_file} any text which the assembler expects -to find at the end of a file. The default is to output nothing. -@end deftypefn @deftypefun void file_end_indicate_exec_stack () Some systems use a common convention, the @samp{.note.GNU-stack} @@ -7210,24 +5345,10 @@ this function. @end deftypefun @hook TARGET_ASM_LTO_START -Output to @code{asm_out_file} any text which the assembler expects -to find at the start of an LTO section. The default is to output -nothing. -@end deftypefn @hook TARGET_ASM_LTO_END -Output to @code{asm_out_file} any text which the assembler expects -to find at the end of an LTO section. The default is to output -nothing. -@end deftypefn @hook TARGET_ASM_CODE_END -Output to @code{asm_out_file} any text which is needed before emitting -unwind info and debug info at the end of a file. Some targets emit -here PIC setup thunks that cannot be emitted at the end of file, -because they couldn't have unwind info then. The default is to output -nothing. -@end deftypefn @defmac ASM_COMMENT_START A C string constant describing how to begin a comment in the target @@ -7272,22 +5393,8 @@ of the filename using this macro. @end defmac @hook TARGET_ASM_NAMED_SECTION -Output assembly directives to switch to section @var{name}. The section -should have attributes as specified by @var{flags}, which is a bit mask -of the @code{SECTION_*} flags defined in @file{output.h}. If @var{decl} -is non-NULL, it is the @code{VAR_DECL} or @code{FUNCTION_DECL} with which -this section is associated. -@end deftypefn @hook TARGET_ASM_FUNCTION_SECTION -Return preferred text (sub)section for function @var{decl}. -Main purpose of this function is to separate cold, normal and hot -functions. @var{startup} is true when function is known to be used only -at startup (from static constructors or it is @code{main()}). -@var{exit} is true when function is known to be used only at exit -(from static destructors). -Return NULL if function should go to default text section. -@end deftypefn @hook TARGET_ASM_FUNCTION_SWITCHED_TEXT_SECTIONS @@ -7298,74 +5405,12 @@ It must not be modified by command-line option processing. @anchor{TARGET_HAVE_SWITCHABLE_BSS_SECTIONS} @hook TARGET_HAVE_SWITCHABLE_BSS_SECTIONS -This flag is true if we can create zeroed data by switching to a BSS -section and then using @code{ASM_OUTPUT_SKIP} to allocate the space. -This is true on most ELF targets. -@end deftypevr @hook TARGET_SECTION_TYPE_FLAGS -Choose a set of section attributes for use by @code{TARGET_ASM_NAMED_SECTION} -based on a variable or function decl, a section name, and whether or not the -declaration's initializer may contain runtime relocations. @var{decl} may be -null, in which case read-write data should be assumed. - -The default version of this function handles choosing code vs data, -read-only vs read-write data, and @code{flag_pic}. You should only -need to override this if your target has special flags that might be -set via @code{__attribute__}. -@end deftypefn @hook TARGET_ASM_RECORD_GCC_SWITCHES -Provides the target with the ability to record the gcc command line -switches that have been passed to the compiler, and options that are -enabled. The @var{type} argument specifies what is being recorded. -It can take the following values: - -@table @gcctabopt -@item SWITCH_TYPE_PASSED -@var{text} is a command line switch that has been set by the user. - -@item SWITCH_TYPE_ENABLED -@var{text} is an option which has been enabled. This might be as a -direct result of a command line switch, or because it is enabled by -default or because it has been enabled as a side effect of a different -command line switch. For example, the @option{-O2} switch enables -various different individual optimization passes. - -@item SWITCH_TYPE_DESCRIPTIVE -@var{text} is either NULL or some descriptive text which should be -ignored. If @var{text} is NULL then it is being used to warn the -target hook that either recording is starting or ending. The first -time @var{type} is SWITCH_TYPE_DESCRIPTIVE and @var{text} is NULL, the -warning is for start up and the second time the warning is for -wind down. This feature is to allow the target hook to make any -necessary preparations before it starts to record switches and to -perform any necessary tidying up after it has finished recording -switches. - -@item SWITCH_TYPE_LINE_START -This option can be ignored by this target hook. - -@item SWITCH_TYPE_LINE_END -This option can be ignored by this target hook. -@end table - -The hook's return value must be zero. Other return values may be -supported in the future. - -By default this hook is set to NULL, but an example implementation is -provided for ELF based targets. Called @var{elf_record_gcc_switches}, -it records the switches as ASCII text inside a new, string mergeable -section in the assembler output file. The name of the new section is -provided by the @code{TARGET_ASM_RECORD_GCC_SWITCHES_SECTION} target -hook. -@end deftypefn @hook TARGET_ASM_RECORD_GCC_SWITCHES_SECTION -This is the name of the section that will be created by the example -ELF implementation of the @code{TARGET_ASM_RECORD_GCC_SWITCHES} target -hook. -@end deftypevr @need 2000 @node Data Output @@ -7373,49 +5418,10 @@ hook. @hook TARGET_ASM_BYTE_OP -@deftypevrx {Target Hook} {const char *} TARGET_ASM_ALIGNED_HI_OP -@deftypevrx {Target Hook} {const char *} TARGET_ASM_ALIGNED_SI_OP -@deftypevrx {Target Hook} {const char *} TARGET_ASM_ALIGNED_DI_OP -@deftypevrx {Target Hook} {const char *} TARGET_ASM_ALIGNED_TI_OP -@deftypevrx {Target Hook} {const char *} TARGET_ASM_UNALIGNED_HI_OP -@deftypevrx {Target Hook} {const char *} TARGET_ASM_UNALIGNED_SI_OP -@deftypevrx {Target Hook} {const char *} TARGET_ASM_UNALIGNED_DI_OP -@deftypevrx {Target Hook} {const char *} TARGET_ASM_UNALIGNED_TI_OP -These hooks specify assembly directives for creating certain kinds -of integer object. The @code{TARGET_ASM_BYTE_OP} directive creates a -byte-sized object, the @code{TARGET_ASM_ALIGNED_HI_OP} one creates an -aligned two-byte object, and so on. Any of the hooks may be -@code{NULL}, indicating that no suitable directive is available. - -The compiler will print these strings at the start of a new line, -followed immediately by the object's initial value. In most cases, -the string should contain a tab, a pseudo-op, and then another tab. -@end deftypevr @hook TARGET_ASM_INTEGER -The @code{assemble_integer} function uses this hook to output an -integer object. @var{x} is the object's value, @var{size} is its size -in bytes and @var{aligned_p} indicates whether it is aligned. The -function should return @code{true} if it was able to output the -object. If it returns false, @code{assemble_integer} will try to -split the object into smaller parts. - -The default implementation of this hook will use the -@code{TARGET_ASM_BYTE_OP} family of strings, returning @code{false} -when the relevant string is @code{NULL}. -@end deftypefn @hook TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA -A target hook to recognize @var{rtx} patterns that @code{output_addr_const} -can't deal with, and output assembly code to @var{file} corresponding to -the pattern @var{x}. This may be used to allow machine-dependent -@code{UNSPEC}s to appear within constants. - -If target hook fails to recognize a pattern, it must return @code{false}, -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 -return @code{true}. -@end deftypefn @defmac ASM_OUTPUT_ASCII (@var{stream}, @var{ptr}, @var{len}) A C statement to output to the stdio stream @var{stream} an assembler @@ -7505,10 +5511,6 @@ the character @samp{;} is treated as a logical line separator. @end defmac @hook TARGET_ASM_OPEN_PAREN -These target hooks are C string constants, describing the syntax in the -assembler for grouping arithmetic expressions. If not overridden, they -default to normal parentheses, which is correct for most assemblers. -@end deftypevr These macros are provided by @file{real.h} for writing the definitions of @code{ASM_OUTPUT_DOUBLE} and the like: @@ -7798,18 +5800,6 @@ You may wish to use @code{ASM_OUTPUT_TYPE_DIRECTIVE} and/or @end defmac @hook TARGET_ASM_DECLARE_CONSTANT_NAME -A target hook to output to the stdio stream @var{file} any text necessary -for declaring the name @var{name} of a constant which is being defined. This -target hook is responsible for outputting the label definition (perhaps using -@code{assemble_label}). The argument @var{exp} is the value of the constant, -and @var{size} is the size of the constant in bytes. The @var{name} -will be an internal label. - -The default version of this target hook, define the @var{name} in the -usual manner as a label (by means of @code{assemble_label}). - -You may wish to use @code{ASM_OUTPUT_TYPE_DIRECTIVE} in this target hook. -@end deftypefn @defmac ASM_DECLARE_REGISTER_GLOBAL (@var{stream}, @var{decl}, @var{regno}, @var{name}) A C statement (sans semicolon) to output to the stdio stream @@ -7835,21 +5825,8 @@ You may wish to use @code{ASM_OUTPUT_SIZE_DIRECTIVE} and/or @end defmac @hook TARGET_ASM_GLOBALIZE_LABEL -This target hook is a function to output to the stdio stream -@var{stream} some commands that will make the label @var{name} global; -that is, available for reference from other files. - -The default implementation relies on a proper definition of -@code{GLOBAL_ASM_OP}. -@end deftypefn @hook TARGET_ASM_GLOBALIZE_DECL_NAME -This target hook is a function to output to the stdio stream -@var{stream} some commands that will make the name associated with @var{decl} -global; that is, available for reference from other files. - -The default implementation uses the TARGET_ASM_GLOBALIZE_LABEL target hook. -@end deftypefn @defmac ASM_WEAKEN_LABEL (@var{stream}, @var{name}) A C statement (sans semicolon) to output to the stdio stream @@ -7921,10 +5898,6 @@ be emitted as one-only. @end defmac @hook TARGET_ASM_ASSEMBLE_VISIBILITY -This target hook is a function to output to @var{asm_out_file} some -commands that will make the symbol(s) associated with @var{decl} have -hidden, protected or internal visibility as specified by @var{visibility}. -@end deftypefn @defmac TARGET_WEAK_NOT_IN_ARCHIVE_TOC A C expression that evaluates to true if the target's linker expects @@ -7957,16 +5930,8 @@ The GNU assembler and most Unix assemblers don't require anything. @end defmac @hook TARGET_ASM_EXTERNAL_LIBCALL -This target hook is a function to output to @var{asm_out_file} an assembler -pseudo-op to declare a library function name external. The name of the -library function is given by @var{symref}, which is a @code{symbol_ref}. -@end deftypefn @hook TARGET_ASM_MARK_DECL_PRESERVED -This target hook is a function to output to @var{asm_out_file} an assembler -directive to annotate @var{symbol} as used. The Darwin target uses the -.no_dead_code_strip directive. -@end deftypefn @defmac ASM_OUTPUT_LABELREF (@var{stream}, @var{name}) A C statement (sans semicolon) to output to the stdio stream @@ -7997,21 +5962,6 @@ being taken. @end defmac @hook TARGET_ASM_INTERNAL_LABEL -A function to output to the stdio stream @var{stream} a label whose -name is made from the string @var{prefix} and the number @var{labelno}. - -It is absolutely essential that these labels be distinct from the labels -used for user-level functions and variables. Otherwise, certain programs -will have name conflicts with internal labels. - -It is desirable to exclude internal labels from the symbol table of the -object file. Most assemblers have a naming convention for labels that -should be excluded; on many systems, the letter @samp{L} at the -beginning of a label has this effect. You should find out what -convention your system uses, and follow it. - -The default version of this function utilizes @code{ASM_GENERATE_INTERNAL_LABEL}. -@end deftypefn @defmac ASM_OUTPUT_DEBUG_LABEL (@var{stream}, @var{prefix}, @var{num}) A C statement to output to the stdio stream @var{stream} a debug info @@ -8322,30 +6272,10 @@ encountering an @code{init_priority} attribute. @end defmac @hook TARGET_HAVE_CTORS_DTORS -This value is true if the target supports some ``native'' method of -collecting constructors and destructors to be run at startup and exit. -It is false if we must use @command{collect2}. -@end deftypevr @hook TARGET_ASM_CONSTRUCTOR -If defined, a function that outputs assembler code to arrange to call -the function referenced by @var{symbol} at initialization time. - -Assume that @var{symbol} is a @code{SYMBOL_REF} for a function taking -no arguments and with no return value. If the target supports initialization -priorities, @var{priority} is a value between 0 and @code{MAX_INIT_PRIORITY}; -otherwise it must be @code{DEFAULT_INIT_PRIORITY}. - -If this macro is not defined by the target, a suitable default will -be chosen if (1) the target supports arbitrary section names, (2) the -target defines @code{CTORS_SECTION_ASM_OP}, or (3) @code{USE_COLLECT2} -is not defined. -@end deftypefn @hook TARGET_ASM_DESTRUCTOR -This is like @code{TARGET_ASM_CONSTRUCTOR} but used for termination -functions rather than initialization functions. -@end deftypefn If @code{TARGET_HAVE_CTORS_DTORS} is true, the initialization routine generated for the generated object file will have static linkage. @@ -8492,17 +6422,6 @@ If this macro is not defined, it is equivalent to a null statement. @end defmac @hook TARGET_ASM_FINAL_POSTSCAN_INSN -If defined, this target hook is a function which is executed just after the -output of assembler code for @var{insn}, to change the mode of the assembler -if necessary. - -Here the argument @var{opvec} is the vector containing the operands -extracted from @var{insn}, and @var{noperands} is the number of -elements of the vector which contain meaningful data for this insn. -The contents of this vector are what was used to convert the insn -template into assembler code, so you can change the assembler mode -by checking the contents of the vector. -@end deftypefn @defmac PRINT_OPERAND (@var{stream}, @var{x}, @var{code}) A C compound statement to output to stdio stream @var{stream} the @@ -8712,32 +6631,12 @@ the jump-table. @end defmac @hook TARGET_ASM_EMIT_UNWIND_LABEL -This target hook emits a label at the beginning of each FDE@. It -should be defined on targets where FDEs need special labels, and it -should write the appropriate label, for the FDE associated with the -function declaration @var{decl}, to the stdio stream @var{stream}. -The third argument, @var{for_eh}, is a boolean: true if this is for an -exception table. The fourth argument, @var{empty}, is a boolean: -true if this is a placeholder label for an omitted FDE@. - -The default is that FDEs are not given nonlocal labels. -@end deftypefn @hook TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL -This target hook emits a label at the beginning of the exception table. -It should be defined on targets where it is desirable for the table -to be broken up according to function. - -The default is that no label is emitted. -@end deftypefn @hook TARGET_ASM_EMIT_EXCEPT_PERSONALITY @hook TARGET_ASM_UNWIND_EMIT -This target hook emits assembly directives required to unwind the -given instruction. This is only used when @code{TARGET_EXCEPT_UNWIND_INFO} -returns @code{UI_TARGET}. -@end deftypefn @hook TARGET_ASM_UNWIND_EMIT_BEFORE_INSN @@ -8845,43 +6744,14 @@ the target supports DWARF 2 frame unwind information. @end defmac @hook TARGET_TERMINATE_DW2_EH_FRAME_INFO -Contains the value true if the target should add a zero word onto the -end of a Dwarf-2 frame info section when used for exception handling. -Default value is false if @code{EH_FRAME_SECTION_NAME} is defined, and -true otherwise. -@end deftypevr @hook TARGET_DWARF_REGISTER_SPAN -Given a register, this hook should return a parallel of registers to -represent where to find the register pieces. Define this hook if the -register and its mode are represented in Dwarf in non-contiguous -locations, or if the register should be represented in more than one -register in Dwarf. Otherwise, this hook should return @code{NULL_RTX}. -If not defined, the default is to return @code{NULL_RTX}. -@end deftypefn @hook TARGET_INIT_DWARF_REG_SIZES_EXTRA -If some registers are represented in Dwarf-2 unwind information in -multiple pieces, define this hook to fill in information about the -sizes of those pieces in the table used by the unwinder at runtime. -It will be called by @code{expand_builtin_init_dwarf_reg_sizes} after -filling in a single size corresponding to each hard register; -@var{address} is the address of the table. -@end deftypefn @hook TARGET_ASM_TTYPE -This hook is used to output a reference from a frame unwinding table to -the type_info object identified by @var{sym}. It should return @code{true} -if the reference was output. Returning @code{false} will cause the -reference to be output using the normal Dwarf2 routines. -@end deftypefn @hook TARGET_ARM_EABI_UNWINDER -This flag should be set to @code{true} on targets that use an ARM EABI -based unwinding library, and @code{false} on other targets. This effects -the format of unwinding tables, and how the unwinder in entered after -running a cleanup. The default is @code{false}. -@end deftypevr @node Alignment Output @subsection Assembler Commands for Alignment @@ -8904,10 +6774,6 @@ selection in @var{align_jumps} in a @code{JUMP_ALIGN} implementation. @end defmac @hook TARGET_ASM_JUMP_ALIGN_MAX_SKIP -The maximum number of bytes to skip before @var{label} when applying -@code{JUMP_ALIGN}. This works only if -@code{ASM_OUTPUT_MAX_SKIP_ALIGN} is defined. -@end deftypefn @defmac LABEL_ALIGN_AFTER_BARRIER (@var{label}) The alignment (log base 2) to put in front of @var{label}, which follows @@ -8919,10 +6785,6 @@ define the macro. @end defmac @hook TARGET_ASM_LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP -The maximum number of bytes to skip before @var{label} when applying -@code{LABEL_ALIGN_AFTER_BARRIER}. This works only if -@code{ASM_OUTPUT_MAX_SKIP_ALIGN} is defined. -@end deftypefn @defmac LOOP_ALIGN (@var{label}) The alignment (log base 2) to put in front of @var{label} that heads @@ -8939,10 +6801,6 @@ selection in @code{align_loops} in a @code{LOOP_ALIGN} implementation. @end defmac @hook TARGET_ASM_LOOP_ALIGN_MAX_SKIP -The maximum number of bytes to skip when applying @code{LOOP_ALIGN} to -@var{label}. This works only if @code{ASM_OUTPUT_MAX_SKIP_ALIGN} is -defined. -@end deftypefn @defmac LABEL_ALIGN (@var{label}) The alignment (log base 2) to put in front of @var{label}. @@ -8956,10 +6814,6 @@ selection in @code{align_labels} in a @code{LABEL_ALIGN} implementation. @end defmac @hook TARGET_ASM_LABEL_ALIGN_MAX_SKIP -The maximum number of bytes to skip when applying @code{LABEL_ALIGN} -to @var{label}. This works only if @code{ASM_OUTPUT_MAX_SKIP_ALIGN} -is defined. -@end deftypefn @defmac ASM_OUTPUT_SKIP (@var{stream}, @var{nbytes}) A C statement to output to the stdio stream @var{stream} an assembler @@ -9302,10 +7156,6 @@ Define this macro if GCC should produce dwarf version 2 format debugging output in response to the @option{-g} option. @hook TARGET_DWARF_CALLING_CONVENTION -Define this to enable the dwarf attribute @code{DW_AT_calling_convention} to -be emitted for each function. Instead of an integer return the enum -value for the @code{DW_CC_} tag. -@end deftypefn To support optional call frame debugging information, you must also define @code{INCOMING_RETURN_ADDR_RTX} and either set @@ -9323,17 +7173,6 @@ how you define @code{DWARF2_FRAME_INFO}. @end defmac @hook TARGET_DEBUG_UNWIND_INFO -This hook defines the mechanism that will be used for describing frame -unwind information to the debugger. Normally the hook will return -@code{UI_DWARF2} if DWARF 2 debug information is enabled, and -return @code{UI_NONE} otherwise. - -A target may return @code{UI_DWARF2} even when DWARF 2 debug information -is disabled in order to always output DWARF 2 frame information. - -A target may return @code{UI_TARGET} if it has ABI specified unwind tables. -This will suppress generation of the normal debug frame unwind information. -@end deftypefn @defmac DWARF2_ASM_LINE_DEBUG_INFO Define this macro to be a nonzero value if the assembler can generate Dwarf 2 @@ -9379,9 +7218,6 @@ is referenced by a function. @end defmac @hook TARGET_ASM_OUTPUT_DWARF_DTPREL -If defined, this target hook is a function which outputs a DTP-relative -reference to the given TLS symbol of the specified size. -@end deftypefn @defmac PUT_SDB_@dots{} Define these macros to override the assembler syntax for the special @@ -9633,64 +7469,16 @@ These are described using the following target hooks; they also need to be documented in @file{extend.texi}. @hook TARGET_ATTRIBUTE_TABLE -If defined, this target hook points to an array of @samp{struct -attribute_spec} (defined in @file{tree.h}) specifying the machine -specific attributes for this target and some of the restrictions on the -entities to which these attributes are applied and the arguments they -take. -@end deftypevr @hook TARGET_ATTRIBUTE_TAKES_IDENTIFIER_P -If defined, this target hook is a function which returns true if the -machine-specific attribute named @var{name} expects an identifier -given as its first argument to be passed on as a plain identifier, not -subjected to name lookup. If this is not defined, the default is -false for all machine-specific attributes. -@end deftypefn @hook TARGET_COMP_TYPE_ATTRIBUTES -If defined, this target hook is a function which returns zero if the attributes on -@var{type1} and @var{type2} are incompatible, one if they are compatible, -and two if they are nearly compatible (which causes a warning to be -generated). If this is not defined, machine-specific attributes are -supposed always to be compatible. -@end deftypefn @hook TARGET_SET_DEFAULT_TYPE_ATTRIBUTES -If defined, this target hook is a function which assigns default attributes to -the newly defined @var{type}. -@end deftypefn @hook TARGET_MERGE_TYPE_ATTRIBUTES -Define this target hook if the merging of type attributes needs special -handling. If defined, the result is a list of the combined -@code{TYPE_ATTRIBUTES} of @var{type1} and @var{type2}. It is assumed -that @code{comptypes} has already been called and returned 1. This -function may call @code{merge_attributes} to handle machine-independent -merging. -@end deftypefn @hook TARGET_MERGE_DECL_ATTRIBUTES -Define this target hook if the merging of decl attributes needs special -handling. If defined, the result is a list of the combined -@code{DECL_ATTRIBUTES} of @var{olddecl} and @var{newdecl}. -@var{newdecl} is a duplicate declaration of @var{olddecl}. Examples of -when this is needed are when one attribute overrides another, or when an -attribute is nullified by a subsequent definition. This function may -call @code{merge_attributes} to handle machine-independent merging. - -@findex TARGET_DLLIMPORT_DECL_ATTRIBUTES -If the only target-specific handling you require is @samp{dllimport} -for Microsoft Windows targets, you should define the macro -@code{TARGET_DLLIMPORT_DECL_ATTRIBUTES} to @code{1}. The compiler -will then define a function called -@code{merge_dllimport_decl_attributes} which can then be defined as -the expansion of @code{TARGET_MERGE_DECL_ATTRIBUTES}. You can also -add @code{handle_dll_attribute} in the attribute table for your port -to perform initial processing of the @samp{dllimport} and -@samp{dllexport} attributes. This is done in @file{i386/cygwin.h} and -@file{i386/i386.c}, for example. -@end deftypefn @hook TARGET_VALID_DLLIMPORT_ATTRIBUTE_P @@ -9704,92 +7492,24 @@ on this implementation detail. @end defmac @hook TARGET_INSERT_ATTRIBUTES -Define this target hook if you want to be able to add attributes to a decl -when it is being created. This is normally useful for back ends which -wish to implement a pragma by using the attributes which correspond to -the pragma's effect. The @var{node} argument is the decl which is being -created. The @var{attr_ptr} argument is a pointer to the attribute list -for this decl. The list itself should not be modified, since it may be -shared with other decls, but attributes may be chained on the head of -the list and @code{*@var{attr_ptr}} modified to point to the new -attributes, or a copy of the list may be made if further changes are -needed. -@end deftypefn @hook TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P -@cindex inlining -This target hook returns @code{true} if it is ok to inline @var{fndecl} -into the current function, despite its having target-specific -attributes, @code{false} otherwise. By default, if a function has a -target specific attribute attached to it, it will not be inlined. -@end deftypefn @hook TARGET_OPTION_VALID_ATTRIBUTE_P -This hook is called to parse @code{attribute(target("..."))}, which -allows setting target-specific options on individual functions. -These function-specific options may differ -from the options specified on the command line. The hook should return -@code{true} if the options are valid. - -The hook should set the @code{DECL_FUNCTION_SPECIFIC_TARGET} field in -the function declaration to hold a pointer to a target-specific -@code{struct cl_target_option} structure. -@end deftypefn @hook TARGET_OPTION_SAVE -This hook is called to save any additional target-specific information -in the @code{struct cl_target_option} structure for function-specific -options. -@xref{Option file format}. -@end deftypefn @hook TARGET_OPTION_RESTORE -This hook is called to restore any additional target-specific -information in the @code{struct cl_target_option} structure for -function-specific options. -@end deftypefn @hook TARGET_OPTION_PRINT -This hook is called to print any additional target-specific -information in the @code{struct cl_target_option} structure for -function-specific options. -@end deftypefn @hook TARGET_OPTION_PRAGMA_PARSE -This target hook parses the options for @code{#pragma GCC target}, which -sets the target-specific options for functions that occur later in the -input stream. The options accepted should be the same as those handled by the -@code{TARGET_OPTION_VALID_ATTRIBUTE_P} hook. -@end deftypefn @hook TARGET_OPTION_OVERRIDE -Sometimes certain combinations of command options do not make sense on -a particular target machine. You can override the hook -@code{TARGET_OPTION_OVERRIDE} to take account of this. This hooks is called -once just after all the command options have been parsed. - -Don't use this hook to turn on various extra optimizations for -@option{-O}. That is what @code{TARGET_OPTION_OPTIMIZATION} is for. - -If you need to do something whenever the optimization level is -changed via the optimize attribute or pragma, see -@code{TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE} -@end deftypefn @hook TARGET_OPTION_FUNCTION_VERSIONS -This target hook returns @code{true} if @var{DECL1} and @var{DECL2} are -versions of the same function. @var{DECL1} and @var{DECL2} are function -versions if and only if they have the same function signature and -different target specific attributes, that is, they are compiled for -different target machines. -@end deftypefn @hook TARGET_CAN_INLINE_P -This target hook returns @code{false} if the @var{caller} function -cannot inline @var{callee}, based on target specific information. By -default, inlining is not allowed if the callee function has function -specific target options and the caller does not use the same options. -@end deftypefn @node Emulated TLS @section Emulating TLS @@ -9808,66 +7528,24 @@ which, when given the address of the control object, will return the address of the current thread's instance of the TLS object. @hook TARGET_EMUTLS_GET_ADDRESS -Contains the name of the helper function that uses a TLS control -object to locate a TLS instance. The default causes libgcc's -emulated TLS helper function to be used. -@end deftypevr @hook TARGET_EMUTLS_REGISTER_COMMON -Contains the name of the helper function that should be used at -program startup to register TLS objects that are implicitly -initialized to zero. If this is @code{NULL}, all TLS objects will -have explicit initializers. The default causes libgcc's emulated TLS -registration function to be used. -@end deftypevr @hook TARGET_EMUTLS_VAR_SECTION -Contains the name of the section in which TLS control variables should -be placed. The default of @code{NULL} allows these to be placed in -any section. -@end deftypevr @hook TARGET_EMUTLS_TMPL_SECTION -Contains the name of the section in which TLS initializers should be -placed. The default of @code{NULL} allows these to be placed in any -section. -@end deftypevr @hook TARGET_EMUTLS_VAR_PREFIX -Contains the prefix to be prepended to TLS control variable names. -The default of @code{NULL} uses a target-specific prefix. -@end deftypevr @hook TARGET_EMUTLS_TMPL_PREFIX -Contains the prefix to be prepended to TLS initializer objects. The -default of @code{NULL} uses a target-specific prefix. -@end deftypevr @hook TARGET_EMUTLS_VAR_FIELDS -Specifies a function that generates the FIELD_DECLs for a TLS control -object type. @var{type} is the RECORD_TYPE the fields are for and -@var{name} should be filled with the structure tag, if the default of -@code{__emutls_object} is unsuitable. The default creates a type suitable -for libgcc's emulated TLS function. -@end deftypefn @hook TARGET_EMUTLS_VAR_INIT -Specifies a function that generates the CONSTRUCTOR to initialize a -TLS control object. @var{var} is the TLS control object, @var{decl} -is the TLS object and @var{tmpl_addr} is the address of the -initializer. The default initializes libgcc's emulated TLS control object. -@end deftypefn @hook TARGET_EMUTLS_VAR_ALIGN_FIXED -Specifies whether the alignment of TLS control variable objects is -fixed and should not be increased as some backends may do to optimize -single objects. The default is false. -@end deftypevr @hook TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS -Specifies whether a DWARF @code{DW_OP_form_tls_address} location descriptor -may be used to describe emulated TLS control objects. -@end deftypevr @node MIPS Coprocessors @section Defining coprocessor specifics for MIPS targets. @@ -9905,33 +7583,10 @@ you may want to override in subtargets; it is described below. @cindex parameters, precompiled headers @hook TARGET_GET_PCH_VALIDITY -This hook returns a pointer to the data needed by -@code{TARGET_PCH_VALID_P} and sets -@samp{*@var{sz}} to the size of the data in bytes. -@end deftypefn @hook TARGET_PCH_VALID_P -This hook checks whether the options used to create a PCH file are -compatible with the current settings. It returns @code{NULL} -if so and a suitable error message if not. Error messages will -be presented to the user and must be localized using @samp{_(@var{msg})}. - -@var{data} is the data that was returned by @code{TARGET_GET_PCH_VALIDITY} -when the PCH file was created and @var{sz} is the size of that data in bytes. -It's safe to assume that the data was created by the same version of the -compiler, so no format checking is needed. - -The default definition of @code{default_pch_valid_p} should be -suitable for most targets. -@end deftypefn @hook TARGET_CHECK_PCH_TARGET_FLAGS -If this hook is nonnull, the default implementation of -@code{TARGET_PCH_VALID_P} will use it to check for compatible values -of @code{target_flags}. @var{pch_flags} specifies the value that -@code{target_flags} had when the PCH file was created. The return -value is the same as for @code{TARGET_PCH_VALID_P}. -@end deftypefn @hook TARGET_PREPARE_PCH_SAVE @@ -9940,84 +7595,28 @@ value is the same as for @code{TARGET_PCH_VALID_P}. @cindex parameters, c++ abi @hook TARGET_CXX_GUARD_TYPE -Define this hook to override the integer type used for guard variables. -These are used to implement one-time construction of static objects. The -default is long_long_integer_type_node. -@end deftypefn @hook TARGET_CXX_GUARD_MASK_BIT -This hook determines how guard variables are used. It should return -@code{false} (the default) if the first byte should be used. A return value of -@code{true} indicates that only the least significant bit should be used. -@end deftypefn @hook TARGET_CXX_GET_COOKIE_SIZE -This hook returns the size of the cookie to use when allocating an array -whose elements have the indicated @var{type}. Assumes that it is already -known that a cookie is needed. The default is -@code{max(sizeof (size_t), alignof(type))}, as defined in section 2.7 of the -IA64/Generic C++ ABI@. -@end deftypefn @hook TARGET_CXX_COOKIE_HAS_SIZE -This hook should return @code{true} if the element size should be stored in -array cookies. The default is to return @code{false}. -@end deftypefn @hook TARGET_CXX_IMPORT_EXPORT_CLASS -If defined by a backend this hook allows the decision made to export -class @var{type} to be overruled. Upon entry @var{import_export} -will contain 1 if the class is going to be exported, @minus{}1 if it is going -to be imported and 0 otherwise. This function should return the -modified value and perform any other actions necessary to support the -backend's targeted operating system. -@end deftypefn @hook TARGET_CXX_CDTOR_RETURNS_THIS -This hook should return @code{true} if constructors and destructors return -the address of the object created/destroyed. The default is to return -@code{false}. -@end deftypefn @hook TARGET_CXX_KEY_METHOD_MAY_BE_INLINE -This hook returns true if the key method for a class (i.e., the method -which, if defined in the current translation unit, causes the virtual -table to be emitted) may be an inline function. Under the standard -Itanium C++ ABI the key method may be an inline function so long as -the function is not declared inline in the class definition. Under -some variants of the ABI, an inline function can never be the key -method. The default is to return @code{true}. -@end deftypefn @hook TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY @hook TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT -This hook returns true (the default) if virtual tables and other -similar implicit class data objects are always COMDAT if they have -external linkage. If this hook returns false, then class data for -classes whose virtual table will be emitted in only one translation -unit will not be COMDAT. -@end deftypefn @hook TARGET_CXX_LIBRARY_RTTI_COMDAT -This hook returns true (the default) if the RTTI information for -the basic types which is defined in the C++ runtime should always -be COMDAT, false if it should not be COMDAT. -@end deftypefn @hook TARGET_CXX_USE_AEABI_ATEXIT -This hook returns true if @code{__aeabi_atexit} (as defined by the ARM EABI) -should be used to register static destructors when @option{-fuse-cxa-atexit} -is in effect. The default is to return false to use @code{__cxa_atexit}. -@end deftypefn @hook TARGET_CXX_USE_ATEXIT_FOR_CXA_ATEXIT -This hook returns true if the target @code{atexit} function can be used -in the same manner as @code{__cxa_atexit} to register C++ static -destructors. This requires that @code{atexit}-registered functions in -shared libraries are run in the correct order when the libraries are -unloaded. The default is to return false. -@end deftypefn @hook TARGET_CXX_ADJUST_CLASS_AT_DEFINITION @@ -10062,62 +7661,18 @@ c_register_addr_space ("__ea", ADDR_SPACE_EA); @end smallexample @hook TARGET_ADDR_SPACE_POINTER_MODE -Define this to return the machine mode to use for pointers to -@var{address_space} if the target supports named address spaces. -The default version of this hook returns @code{ptr_mode} for the -generic address space only. -@end deftypefn @hook TARGET_ADDR_SPACE_ADDRESS_MODE -Define this to return the machine mode to use for addresses in -@var{address_space} if the target supports named address spaces. -The default version of this hook returns @code{Pmode} for the -generic address space only. -@end deftypefn @hook TARGET_ADDR_SPACE_VALID_POINTER_MODE -Define this to return nonzero if the port can handle pointers -with machine mode @var{mode} to address space @var{as}. This target -hook is the same as the @code{TARGET_VALID_POINTER_MODE} target hook, -except that it includes explicit named address space support. The default -version of this hook returns true for the modes returned by either the -@code{TARGET_ADDR_SPACE_POINTER_MODE} or @code{TARGET_ADDR_SPACE_ADDRESS_MODE} -target hooks for the given address space. -@end deftypefn @hook TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P -Define this to return true if @var{exp} is a valid address for mode -@var{mode} in the named address space @var{as}. The @var{strict} -parameter says whether strict addressing is in effect after reload has -finished. This target hook is the same as the -@code{TARGET_LEGITIMATE_ADDRESS_P} target hook, except that it includes -explicit named address space support. -@end deftypefn @hook TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS -Define this to modify an invalid address @var{x} to be a valid address -with mode @var{mode} in the named address space @var{as}. This target -hook is the same as the @code{TARGET_LEGITIMIZE_ADDRESS} target hook, -except that it includes explicit named address space support. -@end deftypefn @hook TARGET_ADDR_SPACE_SUBSET_P -Define this to return whether the @var{subset} named address space is -contained within the @var{superset} named address space. Pointers to -a named address space that is a subset of another named address space -will be converted automatically without a cast if used together in -arithmetic operations. Pointers to a superset address space can be -converted to pointers to a subset address space via explicit casts. -@end deftypefn @hook TARGET_ADDR_SPACE_CONVERT -Define this to convert the pointer expression represented by the RTL -@var{op} with type @var{from_type} that points to a named address -space to a new pointer expression with type @var{to_type} that points -to a different named address space. When this hook it called, it is -guaranteed that one of the two address spaces is a subset of the other, -as determined by the @code{TARGET_ADDR_SPACE_SUBSET_P} target hook. -@end deftypefn @node Misc @section Miscellaneous Parameters @@ -10168,11 +7723,6 @@ is in effect. @end defmac @hook TARGET_CASE_VALUES_THRESHOLD -This function return the smallest number of different values for which it -is best to use a jump-table instead of a tree of conditional branches. -The default is four for machines with a @code{casesi} instruction and -five otherwise. This is best for most machines. -@end deftypefn @defmac WORD_REGISTER_OPERATIONS Define this macro if operations between registers with integral mode @@ -10213,13 +7763,6 @@ extends. @end defmac @hook TARGET_MIN_DIVISIONS_FOR_RECIP_MUL -When @option{-ffast-math} is in effect, GCC tries to optimize -divisions by the same divisor, by turning them into multiplications by -the reciprocal. This target hook specifies the minimum number of divisions -that should be there for GCC to perform the optimization for a variable -of mode @var{mode}. The default implementation returns 3 if the machine -has an instruction for the division, and 2 if it does not. -@end deftypefn @defmac MOVE_MAX The maximum number of bytes that a single instruction can move quickly @@ -10261,28 +7804,6 @@ You need not define this macro if it would always have the value of zero. @anchor{TARGET_SHIFT_TRUNCATION_MASK} @hook TARGET_SHIFT_TRUNCATION_MASK -This function describes how the standard shift patterns for @var{mode} -deal with shifts by negative amounts or by more than the width of the mode. -@xref{shift patterns}. - -On many machines, the shift patterns will apply a mask @var{m} to the -shift count, meaning that a fixed-width shift of @var{x} by @var{y} is -equivalent to an arbitrary-width shift of @var{x} by @var{y & m}. If -this is true for mode @var{mode}, the function should return @var{m}, -otherwise it should return 0. A return value of 0 indicates that no -particular behavior is guaranteed. - -Note that, unlike @code{SHIFT_COUNT_TRUNCATED}, this function does -@emph{not} apply to general shift rtxes; it applies only to instructions -that are generated by the named shift patterns. - -The default implementation of this function returns -@code{GET_MODE_BITSIZE (@var{mode}) - 1} if @code{SHIFT_COUNT_TRUNCATED} -and 0 otherwise. This definition is always safe, but if -@code{SHIFT_COUNT_TRUNCATED} is false, and some shift patterns -nevertheless truncate the shift count, you may get better code -by overriding it. -@end deftypefn @defmac TRULY_NOOP_TRUNCATION (@var{outprec}, @var{inprec}) A C expression which is nonzero if on this machine it is safe to @@ -10301,32 +7822,6 @@ such cases may improve things. @end defmac @hook TARGET_MODE_REP_EXTENDED -The representation of an integral mode can be such that the values -are always extended to a wider integral mode. Return -@code{SIGN_EXTEND} if values of @var{mode} are represented in -sign-extended form to @var{rep_mode}. Return @code{UNKNOWN} -otherwise. (Currently, none of the targets use zero-extended -representation this way so unlike @code{LOAD_EXTEND_OP}, -@code{TARGET_MODE_REP_EXTENDED} is expected to return either -@code{SIGN_EXTEND} or @code{UNKNOWN}. Also no target extends -@var{mode} to @var{rep_mode} so that @var{rep_mode} is not the next -widest integral mode and currently we take advantage of this fact.) - -Similarly to @code{LOAD_EXTEND_OP} you may return a non-@code{UNKNOWN} -value even if the extension is not performed on certain hard registers -as long as for the @code{REGNO_REG_CLASS} of these hard registers -@code{CANNOT_CHANGE_MODE_CLASS} returns nonzero. - -Note that @code{TARGET_MODE_REP_EXTENDED} and @code{LOAD_EXTEND_OP} -describe two related properties. If you define -@code{TARGET_MODE_REP_EXTENDED (mode, word_mode)} you probably also want -to define @code{LOAD_EXTEND_OP (mode)} to return the same type of -extension. - -In order to enforce the representation of @code{mode}, -@code{TRULY_NOOP_TRUNCATION} should return false when truncating to -@code{mode}. -@end deftypefn @defmac STORE_FLAG_VALUE A C expression describing the value returned by a comparison operator @@ -10629,15 +8124,6 @@ You need not define this macro if it would always evaluate to zero. @end defmac @hook TARGET_MD_ASM_CLOBBERS -This target hook should add to @var{clobbers} @code{STRING_CST} trees for -any hard regs the port wishes to automatically clobber for an asm. -It should return the result of the last @code{tree_cons} used to add a -clobber. The @var{outputs}, @var{inputs} and @var{clobber} lists are the -corresponding parameters to the asm and may be inspected to avoid -clobbering a register that is an input or output of the asm. You can use -@code{tree_overlaps_hard_reg_set}, declared in @file{tree.h}, to test -for overlap with regards to asm-declared registers. -@end deftypefn @defmac MATH_LIBRARY Define this macro as a C string constant for the linker argument to link @@ -10718,119 +8204,27 @@ to by @var{ce_info}. @end defmac @hook TARGET_MACHINE_DEPENDENT_REORG -If non-null, this hook performs a target-specific pass over the -instruction stream. The compiler will run it at all optimization levels, -just before the point at which it normally does delayed-branch scheduling. - -The exact purpose of the hook varies from target to target. Some use -it to do transformations that are necessary for correctness, such as -laying out in-function constant pools or avoiding hardware hazards. -Others use it as an opportunity to do some machine-dependent optimizations. - -You need not implement the hook if it has nothing to do. The default -definition is null. -@end deftypefn @hook TARGET_INIT_BUILTINS -Define this hook if you have any machine-specific built-in functions -that need to be defined. It should be a function that performs the -necessary setup. - -Machine specific built-in functions 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 built-in function, call the function -@code{lang_hooks.builtin_function} -which is defined by the language front end. You can use any type nodes set -up by @code{build_common_tree_nodes}; -only language front ends that use those two functions will call -@samp{TARGET_INIT_BUILTINS}. -@end deftypefn @hook TARGET_BUILTIN_DECL -Define this hook if you have any machine-specific built-in functions -that need to be defined. It should be a function that returns the -builtin function declaration for the builtin function code @var{code}. -If there is no such builtin and it cannot be initialized at this time -if @var{initialize_p} is true the function should return @code{NULL_TREE}. -If @var{code} is out of range the function should return -@code{error_mark_node}. -@end deftypefn @hook TARGET_EXPAND_BUILTIN -Expand a call to a machine specific built-in function that was set up by -@samp{TARGET_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 function should return the result of the call to the -built-in function. -@end deftypefn - @hook TARGET_RESOLVE_OVERLOADED_BUILTIN -Select a replacement for a machine specific built-in function that -was set up by @samp{TARGET_INIT_BUILTINS}. This is done -@emph{before} regular type checking, and so allows the target to -implement a crude form of function overloading. @var{fndecl} is the -declaration of the built-in function. @var{arglist} is the list of -arguments passed to the built-in function. The result is a -complete expression that implements the operation, usually -another @code{CALL_EXPR}. -@var{arglist} really has type @samp{VEC(tree,gc)*} -@end deftypefn @hook TARGET_FOLD_BUILTIN -Fold a call to a machine specific built-in function that was set up by -@samp{TARGET_INIT_BUILTINS}. @var{fndecl} is the declaration of the -built-in function. @var{n_args} is the number of arguments passed to -the function; the arguments themselves are pointed to by @var{argp}. -The result is another tree, valid for both GIMPLE and GENERIC, -containing a simplified expression for the call's result. If -@var{ignore} is true the value will be ignored. -@end deftypefn @hook TARGET_GIMPLE_FOLD_BUILTIN @hook TARGET_COMPARE_VERSION_PRIORITY -This hook is used to compare the target attributes in two functions to -determine which function's features get higher priority. This is used -during function multi-versioning to figure out the order in which two -versions must be dispatched. A function version with a higher priority -is checked for dispatching earlier. @var{decl1} and @var{decl2} are - the two function decls that will be compared. -@end deftypefn @hook TARGET_GET_FUNCTION_VERSIONS_DISPATCHER -This hook is used to get the dispatcher function for a set of function -versions. The dispatcher function is called to invoke the right function -version at run-time. @var{decl} is one version from a set of semantically -identical versions. -@end deftypefn @hook TARGET_GENERATE_VERSION_DISPATCHER_BODY -This hook is used to generate the dispatcher logic to invoke the right -function version at run-time for a given set of function versions. -@var{arg} points to the callgraph node of the dispatcher function whose -body must be generated. -@end deftypefn @hook TARGET_INVALID_WITHIN_DOLOOP -Take an instruction in @var{insn} and return NULL if it is valid within a -low-overhead loop, otherwise return a string explaining why doloop -could not be applied. - -Many targets use special registers for low-overhead looping. For any -instruction that clobbers these this function should return a string indicating -the reason why the doloop could not be applied. -By default, the RTL loop optimizer does not use a present doloop pattern for -loops containing function calls or branch on table instructions. -@end deftypefn - @hook TARGET_LEGITIMATE_COMBINED_INSN @defmac MD_CAN_REDIRECT_BRANCH (@var{branch1}, @var{branch2}) @@ -10847,61 +8241,12 @@ may in turn cause a branch offset to overflow. @hook TARGET_CAN_FOLLOW_JUMP @hook TARGET_COMMUTATIVE_P -This target hook returns @code{true} if @var{x} is considered to be commutative. -Usually, this is just COMMUTATIVE_P (@var{x}), but the HP PA doesn't consider -PLUS to be commutative inside a MEM@. @var{outer_code} is the rtx code -of the enclosing rtl, if known, otherwise it is UNKNOWN. -@end deftypefn @hook TARGET_ALLOCATE_INITIAL_VALUE -When the initial value of a hard register has been copied in a pseudo -register, it is often not necessary to actually allocate another register -to this pseudo register, because the original hard register or a stack slot -it has been saved into can be used. @code{TARGET_ALLOCATE_INITIAL_VALUE} -is called at the start of register allocation once for each hard register -that had its initial value copied by using -@code{get_func_hard_reg_initial_val} or @code{get_hard_reg_initial_val}. -Possible values are @code{NULL_RTX}, if you don't want -to do any special allocation, a @code{REG} rtx---that would typically be -the hard register itself, if it is known not to be clobbered---or a -@code{MEM}. -If you are returning a @code{MEM}, this is only a hint for the allocator; -it might decide to use another register anyways. -You may use @code{current_function_is_leaf} or -@code{REG_N_SETS} in the hook to determine if the hard -register in question will not be clobbered. -The default value of this hook is @code{NULL}, which disables any special -allocation. -@end deftypefn - @hook TARGET_UNSPEC_MAY_TRAP_P -This target hook returns nonzero if @var{x}, an @code{unspec} or -@code{unspec_volatile} operation, might cause a trap. Targets can use -this hook to enhance precision of analysis for @code{unspec} and -@code{unspec_volatile} operations. You may call @code{may_trap_p_1} -to analyze inner elements of @var{x} in which case @var{flags} should be -passed along. -@end deftypefn @hook TARGET_SET_CURRENT_FUNCTION -The compiler invokes this hook whenever it changes its current function -context (@code{cfun}). You can define this function if -the back end needs to perform any initialization or reset actions on a -per-function basis. For example, it may be used to implement function -attributes that affect register usage or code generation patterns. -The argument @var{decl} is the declaration for the new function context, -and may be null to indicate that the compiler has left a function context -and is returning to processing at the top level. -The default hook function does nothing. - -GCC sets @code{cfun} to a dummy function context during initialization of -some parts of the back end. The hook function is not invoked in this -situation; you need not worry about the hook being invoked recursively, -or when the back end is in a partially-initialized state. -@code{cfun} might be @code{NULL} to indicate processing at top level, -outside of any function scope. -@end deftypefn @defmac TARGET_OBJECT_SUFFIX Define this macro to be a C string representing the suffix for object @@ -10941,56 +8286,14 @@ build_type_attribute_variant (@var{mdecl}, @end defmac @hook TARGET_CANNOT_MODIFY_JUMPS_P -This target hook returns @code{true} past the point in which new jump -instructions could be created. On machines that require a register for -every jump such as the SHmedia ISA of SH5, this point would typically be -reload, so this target hook should be defined to a function such as: - -@smallexample -static bool -cannot_modify_jumps_past_reload_p () -@{ - return (reload_completed || reload_in_progress); -@} -@end smallexample -@end deftypefn @hook TARGET_BRANCH_TARGET_REGISTER_CLASS -This target hook returns a register class for which branch target register -optimizations should be applied. All registers in this class should be -usable interchangeably. After reload, registers in this class will be -re-allocated and loads will be hoisted out of loops and be subjected -to inter-block scheduling. -@end deftypefn @hook TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED -Branch target register optimization will by default exclude callee-saved -registers -that are not already live during the current function; if this target hook -returns true, they will be included. The target code must than make sure -that all target registers in the class returned by -@samp{TARGET_BRANCH_TARGET_REGISTER_CLASS} that might need saving are -saved. @var{after_prologue_epilogue_gen} indicates if prologues and -epilogues have already been generated. Note, even if you only return -true when @var{after_prologue_epilogue_gen} is false, you still are likely -to have to make special provisions in @code{INITIAL_ELIMINATION_OFFSET} -to reserve space for caller-saved target registers. -@end deftypefn @hook TARGET_HAVE_CONDITIONAL_EXECUTION -This target hook returns true if the target supports conditional execution. -This target hook is required only when the target has several different -modes and they have different conditional execution capability, such as ARM. -@end deftypefn @hook TARGET_LOOP_UNROLL_ADJUST -This target hook returns a new value for the number of times @var{loop} -should be unrolled. The parameter @var{nunroll} is the number of times -the loop is to be unrolled. The parameter @var{loop} is a pointer to -the loop, which is going to be checked for unrolling. This target hook -is required only when the target has special constraints like maximum -number of memory accesses. -@end deftypefn @defmac POWI_MAX_MULTS If defined, this macro is interpreted as a signed integer C expression @@ -11062,72 +8365,22 @@ and scanf formatter settings. @end defmac @hook TARGET_RELAXED_ORDERING -If set to @code{true}, means that the target's memory model does not -guarantee that loads which do not depend on one another will access -main memory in the order of the instruction stream; if ordering is -important, an explicit memory barrier must be used. This is true of -many recent processors which implement a policy of ``relaxed,'' -``weak,'' or ``release'' memory consistency, such as Alpha, PowerPC, -and ia64. The default is @code{false}. -@end deftypevr @hook TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN -If defined, this macro returns the diagnostic message when it is -illegal to pass argument @var{val} to function @var{funcdecl} -with prototype @var{typelist}. -@end deftypefn @hook TARGET_INVALID_CONVERSION -If defined, this macro returns the diagnostic message when it is -invalid to convert from @var{fromtype} to @var{totype}, or @code{NULL} -if validity should be determined by the front end. -@end deftypefn @hook TARGET_INVALID_UNARY_OP -If defined, this macro returns the diagnostic message when it is -invalid to apply operation @var{op} (where unary plus is denoted by -@code{CONVERT_EXPR}) to an operand of type @var{type}, or @code{NULL} -if validity should be determined by the front end. -@end deftypefn @hook TARGET_INVALID_BINARY_OP -If defined, this macro returns the diagnostic message when it is -invalid to apply operation @var{op} to operands of types @var{type1} -and @var{type2}, or @code{NULL} if validity should be determined by -the front end. -@end deftypefn @hook TARGET_INVALID_PARAMETER_TYPE -If defined, this macro returns the diagnostic message when it is -invalid for functions to include parameters of type @var{type}, -or @code{NULL} if validity should be determined by -the front end. This is currently used only by the C and C++ front ends. -@end deftypefn @hook TARGET_INVALID_RETURN_TYPE -If defined, this macro returns the diagnostic message when it is -invalid for functions to have return type @var{type}, -or @code{NULL} if validity should be determined by -the front end. This is currently used only by the C and C++ front ends. -@end deftypefn @hook TARGET_PROMOTED_TYPE -If defined, this target hook returns the type to which values of -@var{type} should be promoted when they appear in expressions, -analogous to the integer promotions, or @code{NULL_TREE} to use the -front end's normal promotion rules. This hook is useful when there are -target-specific types with special promotion rules. -This is currently used only by the C and C++ front ends. -@end deftypefn @hook TARGET_CONVERT_TO_TYPE -If defined, this hook returns the result of converting @var{expr} to -@var{type}. It should return the converted expression, -or @code{NULL_TREE} to apply the front end's normal conversion rules. -This hook is useful when there are target-specific types with special -conversion rules. -This is currently used only by the C and C++ front ends. -@end deftypefn @defmac TARGET_USE_JCR_SECTION This macro determines whether to use the JCR section to register Java @@ -11148,52 +8401,16 @@ and the associated definitions of those functions. @end defmac @hook TARGET_UPDATE_STACK_BOUNDARY -Define this macro to update the current function stack boundary if -necessary. -@end deftypefn @hook TARGET_GET_DRAP_RTX -This hook should return an rtx for Dynamic Realign Argument Pointer (DRAP) if a -different argument pointer register is needed to access the function's -argument list due to stack realignment. Return @code{NULL} if no DRAP -is needed. -@end deftypefn @hook TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS -When optimization is disabled, this hook indicates whether or not -arguments should be allocated to stack slots. Normally, GCC allocates -stacks slots for arguments when not optimizing in order to make -debugging easier. However, when a function is declared with -@code{__attribute__((naked))}, there is no stack frame, and the compiler -cannot safely move arguments from the registers in which they are passed -to the stack. Therefore, this hook should return true in general, but -false for naked functions. The default implementation always returns true. -@end deftypefn @hook TARGET_CONST_ANCHOR -On some architectures it can take multiple instructions to synthesize -a constant. If there is another constant already in a register that -is close enough in value then it is preferable that the new constant -is computed from this register using immediate addition or -subtraction. We accomplish this through CSE. Besides the value of -the constant we also add a lower and an upper constant anchor to the -available expressions. These are then queried when encountering new -constants. The anchors are computed by rounding the constant up and -down to a multiple of the value of @code{TARGET_CONST_ANCHOR}. -@code{TARGET_CONST_ANCHOR} should be the maximum positive value -accepted by immediate-add plus one. We currently assume that the -value of @code{TARGET_CONST_ANCHOR} is a power of 2. For example, on -MIPS, where add-immediate takes a 16-bit signed value, -@code{TARGET_CONST_ANCHOR} is set to @samp{0x8000}. The default value -is zero, which disables this optimization. -@end deftypevr @hook TARGET_ASAN_SHADOW_OFFSET @hook TARGET_MEMMODEL_CHECK -Validate target specific memory model mask bits. When NULL no target specific -memory model bits are allowed. -@end deftypefn @hook TARGET_ATOMIC_TEST_AND_SET_TRUEVAL diff --git a/gcc/target.def b/gcc/target.def index 3ba3e0a2454..e18ef87b5cc 100644 --- a/gcc/target.def +++ b/gcc/target.def @@ -35,14 +35,32 @@ HOOK_VECTOR (TARGET_ASM_OUT, asm_out) /* Opening and closing parentheses for asm expression grouping. */ DEFHOOKPOD (open_paren, - "", + "These target hooks are C string constants, describing the syntax in the\n\ +assembler for grouping arithmetic expressions. If not overridden, they\n\ +default to normal parentheses, which is correct for most assemblers.", const char *, "(") DEFHOOKPODX (close_paren, const char *, ")") /* Assembler instructions for creating various kinds of integer object. */ DEFHOOKPOD (byte_op, - "", + "@deftypevrx {Target Hook} {const char *} TARGET_ASM_ALIGNED_HI_OP\n\ +@deftypevrx {Target Hook} {const char *} TARGET_ASM_ALIGNED_SI_OP\n\ +@deftypevrx {Target Hook} {const char *} TARGET_ASM_ALIGNED_DI_OP\n\ +@deftypevrx {Target Hook} {const char *} TARGET_ASM_ALIGNED_TI_OP\n\ +@deftypevrx {Target Hook} {const char *} TARGET_ASM_UNALIGNED_HI_OP\n\ +@deftypevrx {Target Hook} {const char *} TARGET_ASM_UNALIGNED_SI_OP\n\ +@deftypevrx {Target Hook} {const char *} TARGET_ASM_UNALIGNED_DI_OP\n\ +@deftypevrx {Target Hook} {const char *} TARGET_ASM_UNALIGNED_TI_OP\n\ +These hooks specify assembly directives for creating certain kinds\n\ +of integer object. The @code{TARGET_ASM_BYTE_OP} directive creates a\n\ +byte-sized object, the @code{TARGET_ASM_ALIGNED_HI_OP} one creates an\n\ +aligned two-byte object, and so on. Any of the hooks may be\n\ +@code{NULL}, indicating that no suitable directive is available.\n\ +\n\ +The compiler will print these strings at the start of a new line,\n\ +followed immediately by the object's initial value. In most cases,\n\ +the string should contain a tab, a pseudo-op, and then another tab.", const char *, "\t.byte\t") DEFHOOKPOD (aligned_op, "*", struct asm_int_op, TARGET_ASM_ALIGNED_INT_OP) DEFHOOKPOD (unaligned_op, "*", struct asm_int_op, TARGET_ASM_UNALIGNED_INT_OP) @@ -51,7 +69,9 @@ DEFHOOKPOD (unaligned_op, "*", struct asm_int_op, TARGET_ASM_UNALIGNED_INT_OP) LABEL_ALIGN_AFTER_BARRIER. */ DEFHOOK (label_align_after_barrier_max_skip, - "", + "The maximum number of bytes to skip before @var{label} when applying\n\ +@code{LABEL_ALIGN_AFTER_BARRIER}. This works only if\n\ +@code{ASM_OUTPUT_MAX_SKIP_ALIGN} is defined.", int, (rtx label), default_label_align_after_barrier_max_skip) @@ -59,7 +79,9 @@ DEFHOOK LOOP_ALIGN. */ DEFHOOK (loop_align_max_skip, - "", + "The maximum number of bytes to skip when applying @code{LOOP_ALIGN} to\n\ +@var{label}. This works only if @code{ASM_OUTPUT_MAX_SKIP_ALIGN} is\n\ +defined.", int, (rtx label), default_loop_align_max_skip) @@ -67,7 +89,9 @@ DEFHOOK LABEL_ALIGN. */ DEFHOOK (label_align_max_skip, - "", + "The maximum number of bytes to skip when applying @code{LABEL_ALIGN}\n\ +to @var{label}. This works only if @code{ASM_OUTPUT_MAX_SKIP_ALIGN}\n\ +is defined.", int, (rtx label), default_label_align_max_skip) @@ -75,7 +99,9 @@ DEFHOOK JUMP_ALIGN. */ DEFHOOK (jump_align_max_skip, - "", + "The maximum number of bytes to skip before @var{label} when applying\n\ +@code{JUMP_ALIGN}. This works only if\n\ +@code{ASM_OUTPUT_MAX_SKIP_ALIGN} is defined.", int, (rtx label), default_jump_align_max_skip) @@ -86,7 +112,16 @@ DEFHOOK and UNALIGNED_OP are NULL. */ DEFHOOK (integer, - "", + "The @code{assemble_integer} function uses this hook to output an\n\ +integer object. @var{x} is the object's value, @var{size} is its size\n\ +in bytes and @var{aligned_p} indicates whether it is aligned. The\n\ +function should return @code{true} if it was able to output the\n\ +object. If it returns false, @code{assemble_integer} will try to\n\ +split the object into smaller parts.\n\ +\n\ +The default implementation of this hook will use the\n\ +@code{TARGET_ASM_BYTE_OP} family of strings, returning @code{false}\n\ +when the relevant string is @code{NULL}.", /* Only handles cases for which BYTE_OP, ALIGNED_OP and UNALIGNED_OP are NULL. */ bool, (rtx x, unsigned int size, int aligned_p), @@ -95,14 +130,23 @@ DEFHOOK /* Output code that will globalize a label. */ DEFHOOK (globalize_label, - "", + "This target hook is a function to output to the stdio stream\n\ +@var{stream} some commands that will make the label @var{name} global;\n\ +that is, available for reference from other files.\n\ +\n\ +The default implementation relies on a proper definition of\n\ +@code{GLOBAL_ASM_OP}.", void, (FILE *stream, const char *name), default_globalize_label) /* Output code that will globalize a declaration. */ DEFHOOK (globalize_decl_name, - "", + "This target hook is a function to output to the stdio stream\n\ +@var{stream} some commands that will make the name associated with @var{decl}\n\ +global; that is, available for reference from other files.\n\ +\n\ +The default implementation uses the TARGET_ASM_GLOBALIZE_LABEL target hook.", void, (FILE *stream, tree decl), default_globalize_decl_name) /* Output code that will emit a label for unwind info, if this @@ -112,14 +156,26 @@ DEFHOOK this is only a placeholder for an omitted FDE. */ DEFHOOK (emit_unwind_label, - "", + "This target hook emits a label at the beginning of each FDE@. It\n\ +should be defined on targets where FDEs need special labels, and it\n\ +should write the appropriate label, for the FDE associated with the\n\ +function declaration @var{decl}, to the stdio stream @var{stream}.\n\ +The third argument, @var{for_eh}, is a boolean: true if this is for an\n\ +exception table. The fourth argument, @var{empty}, is a boolean:\n\ +true if this is a placeholder label for an omitted FDE@.\n\ +\n\ +The default is that FDEs are not given nonlocal labels.", void, (FILE *stream, tree decl, int for_eh, int empty), default_emit_unwind_label) /* Output code that will emit a label to divide up the exception table. */ DEFHOOK (emit_except_table_label, - "", + "This target hook emits a label at the beginning of the exception table.\n\ +It should be defined on targets where it is desirable for the table\n\ +to be broken up according to function.\n\ +\n\ +The default is that no label is emitted.", void, (FILE *stream), default_emit_except_table_label) @@ -135,7 +191,9 @@ DEFHOOK /* Emit any directives required to unwind this instruction. */ DEFHOOK (unwind_emit, - "", + "This target hook emits assembly directives required to unwind the\n\ +given instruction. This is only used when @code{TARGET_EXCEPT_UNWIND_INFO}\n\ +returns @code{UI_TARGET}.", void, (FILE *stream, rtx insn), NULL) @@ -157,21 +215,47 @@ DEFHOOK_UNDOC /* Output an internal label. */ DEFHOOK (internal_label, - "", + "A function to output to the stdio stream @var{stream} a label whose\n\ +name is made from the string @var{prefix} and the number @var{labelno}.\n\ +\n\ +It is absolutely essential that these labels be distinct from the labels\n\ +used for user-level functions and variables. Otherwise, certain programs\n\ +will have name conflicts with internal labels.\n\ +\n\ +It is desirable to exclude internal labels from the symbol table of the\n\ +object file. Most assemblers have a naming convention for labels that\n\ +should be excluded; on many systems, the letter @samp{L} at the\n\ +beginning of a label has this effect. You should find out what\n\ +convention your system uses, and follow it.\n\ +\n\ +The default version of this function utilizes @code{ASM_GENERATE_INTERNAL_LABEL}.", void, (FILE *stream, const char *prefix, unsigned long labelno), default_internal_label) /* Output label for the constant. */ DEFHOOK (declare_constant_name, - "", + "A target hook to output to the stdio stream @var{file} any text necessary\n\ +for declaring the name @var{name} of a constant which is being defined. This\n\ +target hook is responsible for outputting the label definition (perhaps using\n\ +@code{assemble_label}). The argument @var{exp} is the value of the constant,\n\ +and @var{size} is the size of the constant in bytes. The @var{name}\n\ +will be an internal label.\n\ +\n\ +The default version of this target hook, define the @var{name} in the\n\ +usual manner as a label (by means of @code{assemble_label}).\n\ +\n\ +You may wish to use @code{ASM_OUTPUT_TYPE_DIRECTIVE} in this target hook.", void, (FILE *file, const char *name, const_tree expr, HOST_WIDE_INT size), default_asm_declare_constant_name) /* Emit a ttype table reference to a typeinfo object. */ DEFHOOK (ttype, - "", + "This hook is used to output a reference from a frame unwinding table to\n\ +the type_info object identified by @var{sym}. It should return @code{true}\n\ +if the reference was output. Returning @code{false} will cause the\n\ +reference to be output using the normal Dwarf2 routines.", bool, (rtx sym), hook_bool_rtx_false) @@ -179,42 +263,140 @@ DEFHOOK associated with the tree decl. */ DEFHOOK (assemble_visibility, - "", + "This target hook is a function to output to @var{asm_out_file} some\n\ +commands that will make the symbol(s) associated with @var{decl} have\n\ +hidden, protected or internal visibility as specified by @var{visibility}.", void, (tree decl, int visibility), default_assemble_visibility) /* Output the assembler code for entry to a function. */ DEFHOOK (function_prologue, - "", + "If defined, a function that outputs the assembler code for entry to a\n\ +function. The prologue is responsible for setting up the stack frame,\n\ +initializing the frame pointer register, saving registers that must be\n\ +saved, and allocating @var{size} additional bytes of storage for the\n\ +local variables. @var{size} is an integer. @var{file} is a stdio\n\ +stream to which the assembler code should be output.\n\ +\n\ +The label for the beginning of the function need not be output by this\n\ +macro. That has already been done when the macro is run.\n\ +\n\ +@findex regs_ever_live\n\ +To determine which registers to save, the macro can refer to the array\n\ +@code{regs_ever_live}: element @var{r} is nonzero if hard register\n\ +@var{r} is used anywhere within the function. This implies the function\n\ +prologue should save register @var{r}, provided it is not one of the\n\ +call-used registers. (@code{TARGET_ASM_FUNCTION_EPILOGUE} must likewise use\n\ +@code{regs_ever_live}.)\n\ +\n\ +On machines that have ``register windows'', the function entry code does\n\ +not save on the stack the registers that are in the windows, even if\n\ +they are supposed to be preserved by function calls; instead it takes\n\ +appropriate steps to ``push'' the register stack, if any non-call-used\n\ +registers are used in the function.\n\ +\n\ +@findex frame_pointer_needed\n\ +On machines where functions may or may not have frame-pointers, the\n\ +function entry code must vary accordingly; it must set up the frame\n\ +pointer if one is wanted, and not otherwise. To determine whether a\n\ +frame pointer is in wanted, the macro can refer to the variable\n\ +@code{frame_pointer_needed}. The variable's value will be 1 at run\n\ +time in a function that needs a frame pointer. @xref{Elimination}.\n\ +\n\ +The function entry code is responsible for allocating any stack space\n\ +required for the function. This stack space consists of the regions\n\ +listed below. In most cases, these regions are allocated in the\n\ +order listed, with the last listed region closest to the top of the\n\ +stack (the lowest address if @code{STACK_GROWS_DOWNWARD} is defined, and\n\ +the highest address if it is not defined). You can use a different order\n\ +for a machine if doing so is more convenient or required for\n\ +compatibility reasons. Except in cases where required by standard\n\ +or by a debugger, there is no reason why the stack layout used by GCC\n\ +need agree with that used by other compilers for a machine.", void, (FILE *file, HOST_WIDE_INT size), default_function_pro_epilogue) /* Output the assembler code for end of prologue. */ DEFHOOK (function_end_prologue, - "", + "If defined, a function that outputs assembler code at the end of a\n\ +prologue. This should be used when the function prologue is being\n\ +emitted as RTL, and you have some extra assembler that needs to be\n\ +emitted. @xref{prologue instruction pattern}.", void, (FILE *file), no_asm_to_stream) /* Output the assembler code for start of epilogue. */ DEFHOOK (function_begin_epilogue, - "", + "If defined, a function that outputs assembler code at the start of an\n\ +epilogue. This should be used when the function epilogue is being\n\ +emitted as RTL, and you have some extra assembler that needs to be\n\ +emitted. @xref{epilogue instruction pattern}.", void, (FILE *file), no_asm_to_stream) /* Output the assembler code for function exit. */ DEFHOOK (function_epilogue, - "", + "If defined, a function that outputs the assembler code for exit from a\n\ +function. The epilogue is responsible for restoring the saved\n\ +registers and stack pointer to their values when the function was\n\ +called, and returning control to the caller. This macro takes the\n\ +same arguments as the macro @code{TARGET_ASM_FUNCTION_PROLOGUE}, and the\n\ +registers to restore are determined from @code{regs_ever_live} and\n\ +@code{CALL_USED_REGISTERS} in the same way.\n\ +\n\ +On some machines, there is a single instruction that does all the work\n\ +of returning from the function. On these machines, give that\n\ +instruction the name @samp{return} and do not define the macro\n\ +@code{TARGET_ASM_FUNCTION_EPILOGUE} at all.\n\ +\n\ +Do not define a pattern named @samp{return} if you want the\n\ +@code{TARGET_ASM_FUNCTION_EPILOGUE} to be used. If you want the target\n\ +switches to control whether return instructions or epilogues are used,\n\ +define a @samp{return} pattern with a validity condition that tests the\n\ +target switches appropriately. If the @samp{return} pattern's validity\n\ +condition is false, epilogues will be used.\n\ +\n\ +On machines where functions may or may not have frame-pointers, the\n\ +function exit code must vary accordingly. Sometimes the code for these\n\ +two cases is completely different. To determine whether a frame pointer\n\ +is wanted, the macro can refer to the variable\n\ +@code{frame_pointer_needed}. The variable's value will be 1 when compiling\n\ +a function that needs a frame pointer.\n\ +\n\ +Normally, @code{TARGET_ASM_FUNCTION_PROLOGUE} and\n\ +@code{TARGET_ASM_FUNCTION_EPILOGUE} must treat leaf functions specially.\n\ +The C variable @code{current_function_is_leaf} is nonzero for such a\n\ +function. @xref{Leaf Functions}.\n\ +\n\ +On some machines, some functions pop their arguments on exit while\n\ +others leave that for the caller to do. For example, the 68020 when\n\ +given @option{-mrtd} pops arguments in functions that take a fixed\n\ +number of arguments.\n\ +\n\ +@findex pops_args\n\ +@findex crtl->args.pops_args\n\ +Your definition of the macro @code{RETURN_POPS_ARGS} decides which\n\ +functions pop their own arguments. @code{TARGET_ASM_FUNCTION_EPILOGUE}\n\ +needs to know what was decided. The number of bytes of the current\n\ +function's arguments that this function should pop is available in\n\ +@code{crtl->args.pops_args}. @xref{Scalar Return}.", void, (FILE *file, HOST_WIDE_INT size), default_function_pro_epilogue) /* Initialize target-specific sections. */ DEFHOOK (init_sections, - "", + "Define this hook if you need to do something special to set up the\n\ +@file{varasm.c} sections, or if your target has some special sections\n\ +of its own that you need to create.\n\ +\n\ +GCC calls this hook after processing the command line, but before writing\n\ +any assembly code, and before calling any of the section-returning hooks\n\ +described below.", void, (void), hook_void_void) @@ -223,7 +405,11 @@ DEFHOOK which this section is associated. */ DEFHOOK (named_section, - "", + "Output assembly directives to switch to section @var{name}. The section\n\ +should have attributes as specified by @var{flags}, which is a bit mask\n\ +of the @code{SECTION_*} flags defined in @file{output.h}. If @var{decl}\n\ +is non-NULL, it is the @code{VAR_DECL} or @code{FUNCTION_DECL} with which\n\ +this section is associated.", void, (const char *name, unsigned int flags, tree decl), default_no_named_section) @@ -236,7 +422,13 @@ DEFHOOK Return NULL if function should go to default text section. */ DEFHOOK (function_section, - "", + "Return preferred text (sub)section for function @var{decl}.\n\ +Main purpose of this function is to separate cold, normal and hot\n\ +functions. @var{startup} is true when function is known to be used only\n\ +at startup (from static constructors or it is @code{main()}).\n\ +@var{exit} is true when function is known to be used only at exit\n\ +(from static destructors).\n\ +Return NULL if function should go to default text section.", section *, (tree decl, enum node_frequency freq, bool startup, bool exit), default_function_section) @@ -257,7 +449,15 @@ DEFHOOK local relocations should be placed in a read-write section. */ DEFHOOK (reloc_rw_mask, - "", + "Return a mask describing how relocations should be treated when\n\ +selecting sections. Bit 1 should be set if global relocations\n\ +should be placed in a read-write section; bit 0 should be set if\n\ +local relocations should be placed in a read-write section.\n\ +\n\ +The default version of this function returns 3 when @option{-fpic}\n\ +is in effect, and 0 otherwise. The hook is typically redefined\n\ +when the target cannot support (some kinds of) dynamic relocations\n\ +in read-only sections even in executables.", int, (void), default_reloc_rw_mask) @@ -267,7 +467,17 @@ DEFHOOK ALIGN is the required alignment of the data. */ DEFHOOK (select_section, - "", + "Return the section into which @var{exp} should be placed. You can\n\ +assume that @var{exp} is either a @code{VAR_DECL} node or a constant of\n\ +some sort. @var{reloc} indicates whether the initial value of @var{exp}\n\ +requires link-time relocations. Bit 0 is set when variable contains\n\ +local relocations only, while bit 1 is set for global relocations.\n\ +@var{align} is the constant alignment in bits.\n\ +\n\ +The default version of this function takes care of putting read-only\n\ +variables in @code{readonly_data_section}.\n\ +\n\ +See also @var{USE_SELECT_SECTION_FOR_FUNCTIONS}.", section *, (tree exp, int reloc, unsigned HOST_WIDE_INT align), default_select_section) @@ -275,7 +485,15 @@ DEFHOOK alignment in bits. */ DEFHOOK (select_rtx_section, - "", + "Return the section into which a constant @var{x}, of mode @var{mode},\n\ +should be placed. You can assume that @var{x} is some kind of\n\ +constant in RTL@. The argument @var{mode} is redundant except in the\n\ +case of a @code{const_int} rtx. @var{align} is the constant alignment\n\ +in bits.\n\ +\n\ +The default version of this function takes care of putting symbolic\n\ +constants in @code{flag_pic} mode in @code{data_section} and everything\n\ +else in @code{readonly_data_section}.", section *, (enum machine_mode mode, rtx x, unsigned HOST_WIDE_INT align), default_select_rtx_section) @@ -283,14 +501,27 @@ DEFHOOK for SELECT_SECTION. */ DEFHOOK (unique_section, - "", + "Build up a unique section name, expressed as a @code{STRING_CST} node,\n\ +and assign it to @samp{DECL_SECTION_NAME (@var{decl})}.\n\ +As with @code{TARGET_ASM_SELECT_SECTION}, @var{reloc} indicates whether\n\ +the initial value of @var{exp} requires link-time relocations.\n\ +\n\ +The default version of this function appends the symbol name to the\n\ +ELF section name that would normally be used for the symbol. For\n\ +example, the function @code{foo} would be placed in @code{.text.foo}.\n\ +Whatever the actual target object format, this is often good enough.", void, (tree decl, int reloc), default_unique_section) /* Return the readonly data section associated with function DECL. */ DEFHOOK (function_rodata_section, - "", + "Return the readonly data section associated with\n\ +@samp{DECL_SECTION_NAME (@var{decl})}.\n\ +The default version of this function selects @code{.gnu.linkonce.r.name} if\n\ +the function's section is @code{.gnu.linkonce.t.name}, @code{.rodata.name}\n\ +if function is in @code{.text.name}, and the normal readonly-data section\n\ +otherwise.", section *, (tree decl), default_function_rodata_section) @@ -313,13 +544,25 @@ DEFHOOK /* Output a constructor for a symbol with a given priority. */ DEFHOOK (constructor, - "", + "If defined, a function that outputs assembler code to arrange to call\n\ +the function referenced by @var{symbol} at initialization time.\n\ +\n\ +Assume that @var{symbol} is a @code{SYMBOL_REF} for a function taking\n\ +no arguments and with no return value. If the target supports initialization\n\ +priorities, @var{priority} is a value between 0 and @code{MAX_INIT_PRIORITY};\n\ +otherwise it must be @code{DEFAULT_INIT_PRIORITY}.\n\ +\n\ +If this macro is not defined by the target, a suitable default will\n\ +be chosen if (1) the target supports arbitrary section names, (2) the\n\ +target defines @code{CTORS_SECTION_ASM_OP}, or (3) @code{USE_COLLECT2}\n\ +is not defined.", void, (rtx symbol, int priority), NULL) /* Output a destructor for a symbol with a given priority. */ DEFHOOK (destructor, - "", + "This is like @code{TARGET_ASM_CONSTRUCTOR} but used for termination\n\ +functions rather than initialization functions.", void, (rtx symbol, int priority), NULL) /* Output the assembler code for a thunk function. THUNK_DECL is the @@ -329,7 +572,45 @@ DEFHOOK *(*this + vcall_offset) should be added to THIS. */ DEFHOOK (output_mi_thunk, - "", + "A function that outputs the assembler code for a thunk\n\ +function, used to implement C++ virtual function calls with multiple\n\ +inheritance. The thunk acts as a wrapper around a virtual function,\n\ +adjusting the implicit object parameter before handing control off to\n\ +the real function.\n\ +\n\ +First, emit code to add the integer @var{delta} to the location that\n\ +contains the incoming first argument. Assume that this argument\n\ +contains a pointer, and is the one used to pass the @code{this} pointer\n\ +in C++. This is the incoming argument @emph{before} the function prologue,\n\ +e.g.@: @samp{%o0} on a sparc. The addition must preserve the values of\n\ +all other incoming arguments.\n\ +\n\ +Then, if @var{vcall_offset} is nonzero, an additional adjustment should be\n\ +made after adding @code{delta}. In particular, if @var{p} is the\n\ +adjusted pointer, the following adjustment should be made:\n\ +\n\ +@smallexample\n\ +p += (*((ptrdiff_t **)p))[vcall_offset/sizeof(ptrdiff_t)]\n\ +@end smallexample\n\ +\n\ +After the additions, emit code to jump to @var{function}, which is a\n\ +@code{FUNCTION_DECL}. This is a direct pure jump, not a call, and does\n\ +not touch the return address. Hence returning from @var{FUNCTION} will\n\ +return to whoever called the current @samp{thunk}.\n\ +\n\ +The effect must be as if @var{function} had been called directly with\n\ +the adjusted first argument. This macro is responsible for emitting all\n\ +of the code for a thunk function; @code{TARGET_ASM_FUNCTION_PROLOGUE}\n\ +and @code{TARGET_ASM_FUNCTION_EPILOGUE} are not invoked.\n\ +\n\ +The @var{thunk_fndecl} is redundant. (@var{delta} and @var{function}\n\ +have already been extracted from it.) It might possibly be useful on\n\ +some targets, but probably not.\n\ +\n\ +If you do not define this macro, the target-independent code in the C++\n\ +front end will generate a less efficient heavyweight thunk that calls\n\ +@var{function} instead of jumping to it. The generic approach does\n\ +not support varargs.", void, (FILE *file, tree thunk_fndecl, HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset, tree function), NULL) @@ -342,7 +623,11 @@ DEFHOOK text to the output file. */ DEFHOOK (can_output_mi_thunk, - "", + "A function that returns true if TARGET_ASM_OUTPUT_MI_THUNK would be able\n\ +to output the assembler code for the thunk function specified by the\n\ +arguments it is passed, and false otherwise. In the latter case, the\n\ +generic approach will be used by the C++ front end, with the limitations\n\ +previously exposed.", bool, (const_tree thunk_fndecl, HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset, const_tree function), hook_bool_const_tree_hwi_hwi_const_tree_false) @@ -351,14 +636,20 @@ DEFHOOK translation unit. */ DEFHOOK (file_start, - "", + "Output to @code{asm_out_file} any text which the assembler expects to\n\ +find at the beginning of a file. The default behavior is controlled\n\ +by two flags, documented below. Unless your target's assembler is\n\ +quite unusual, if you override the default, you should call\n\ +@code{default_file_start} at some point in your target hook. This\n\ +lets other target files rely on these variables.", void, (void), default_file_start) /* Output any boilerplate text needed at the end of a translation unit. */ DEFHOOK (file_end, - "", + "Output to @code{asm_out_file} any text which the assembler expects\n\ +to find at the end of a file. The default is to output nothing.", void, (void), hook_void_void) @@ -366,7 +657,9 @@ DEFHOOK LTO output stream. */ DEFHOOK (lto_start, - "", + "Output to @code{asm_out_file} any text which the assembler expects\n\ +to find at the start of an LTO section. The default is to output\n\ +nothing.", void, (void), hook_void_void) @@ -374,7 +667,9 @@ DEFHOOK LTO output stream. */ DEFHOOK (lto_end, - "", + "Output to @code{asm_out_file} any text which the assembler expects\n\ +to find at the end of an LTO section. The default is to output\n\ +nothing.", void, (void), hook_void_void) @@ -382,7 +677,11 @@ DEFHOOK translation unit before debug and unwind info is emitted. */ DEFHOOK (code_end, - "", + "Output to @code{asm_out_file} any text which is needed before emitting\n\ +unwind info and debug info at the end of a file. Some targets emit\n\ +here PIC setup thunks that cannot be emitted at the end of file,\n\ +because they couldn't have unwind info then. The default is to output\n\ +nothing.", void, (void), hook_void_void) @@ -390,7 +689,9 @@ DEFHOOK external. */ DEFHOOK (external_libcall, - "", + "This target hook is a function to output to @var{asm_out_file} an assembler\n\ +pseudo-op to declare a library function name external. The name of the\n\ +library function is given by @var{symref}, which is a @code{symbol_ref}.", void, (rtx symref), default_external_libcall) @@ -398,14 +699,58 @@ DEFHOOK linker to not dead code strip this symbol. */ DEFHOOK (mark_decl_preserved, - "", + "This target hook is a function to output to @var{asm_out_file} an assembler\n\ +directive to annotate @var{symbol} as used. The Darwin target uses the\n\ +.no_dead_code_strip directive.", void, (const char *symbol), hook_void_constcharptr) /* Output a record of the command line switches that have been passed. */ DEFHOOK (record_gcc_switches, - "", + "Provides the target with the ability to record the gcc command line\n\ +switches that have been passed to the compiler, and options that are\n\ +enabled. The @var{type} argument specifies what is being recorded.\n\ +It can take the following values:\n\ +\n\ +@table @gcctabopt\n\ +@item SWITCH_TYPE_PASSED\n\ +@var{text} is a command line switch that has been set by the user.\n\ +\n\ +@item SWITCH_TYPE_ENABLED\n\ +@var{text} is an option which has been enabled. This might be as a\n\ +direct result of a command line switch, or because it is enabled by\n\ +default or because it has been enabled as a side effect of a different\n\ +command line switch. For example, the @option{-O2} switch enables\n\ +various different individual optimization passes.\n\ +\n\ +@item SWITCH_TYPE_DESCRIPTIVE\n\ +@var{text} is either NULL or some descriptive text which should be\n\ +ignored. If @var{text} is NULL then it is being used to warn the\n\ +target hook that either recording is starting or ending. The first\n\ +time @var{type} is SWITCH_TYPE_DESCRIPTIVE and @var{text} is NULL, the\n\ +warning is for start up and the second time the warning is for\n\ +wind down. This feature is to allow the target hook to make any\n\ +necessary preparations before it starts to record switches and to\n\ +perform any necessary tidying up after it has finished recording\n\ +switches.\n\ +\n\ +@item SWITCH_TYPE_LINE_START\n\ +This option can be ignored by this target hook.\n\ +\n\ +@item SWITCH_TYPE_LINE_END\n\ +This option can be ignored by this target hook.\n\ +@end table\n\ +\n\ +The hook's return value must be zero. Other return values may be\n\ +supported in the future.\n\ +\n\ +By default this hook is set to NULL, but an example implementation is\n\ +provided for ELF based targets. Called @var{elf_record_gcc_switches},\n\ +it records the switches as ASCII text inside a new, string mergeable\n\ +section in the assembler output file. The name of the new section is\n\ +provided by the @code{TARGET_ASM_RECORD_GCC_SWITCHES_SECTION} target\n\ +hook.", int, (print_switch_type type, const char *text), NULL) @@ -415,13 +760,23 @@ DEFHOOK this information. */ DEFHOOKPOD (record_gcc_switches_section, - "", + "This is the name of the section that will be created by the example\n\ +ELF implementation of the @code{TARGET_ASM_RECORD_GCC_SWITCHES} target\n\ +hook.", const char *, ".GCC.command.line") /* Output the definition of a section anchor. */ DEFHOOK (output_anchor, - "", + "Write the assembly code to define section anchor @var{x}, which is a\n\ +@code{SYMBOL_REF} for which @samp{SYMBOL_REF_ANCHOR_P (@var{x})} is true.\n\ +The hook is called with the assembly output position set to the beginning\n\ +of @code{SYMBOL_REF_BLOCK (@var{x})}.\n\ +\n\ +If @code{ASM_OUTPUT_DEF} is available, the hook's default definition uses\n\ +it to define the symbol as @samp{. + SYMBOL_REF_BLOCK_OFFSET (@var{x})}.\n\ +If @code{ASM_OUTPUT_DEF} is not available, the hook's default definition\n\ +is @code{NULL}, which disables the use of section anchors altogether.", void, (rtx x), default_asm_output_anchor) @@ -437,21 +792,39 @@ DEFHOOK /* Output a DTP-relative reference to a TLS symbol. */ DEFHOOK (output_dwarf_dtprel, - "", + "If defined, this target hook is a function which outputs a DTP-relative\n\ +reference to the given TLS symbol of the specified size.", void, (FILE *file, int size, rtx x), NULL) /* Some target machines need to postscan each insn after it is output. */ DEFHOOK (final_postscan_insn, - "", + "If defined, this target hook is a function which is executed just after the\n\ +output of assembler code for @var{insn}, to change the mode of the assembler\n\ +if necessary.\n\ +\n\ +Here the argument @var{opvec} is the vector containing the operands\n\ +extracted from @var{insn}, and @var{noperands} is the number of\n\ +elements of the vector which contain meaningful data for this insn.\n\ +The contents of this vector are what was used to convert the insn\n\ +template into assembler code, so you can change the assembler mode\n\ +by checking the contents of the vector.", void, (FILE *file, rtx insn, rtx *opvec, int noperands), NULL) /* Emit the trampoline template. This hook may be NULL. */ DEFHOOK (trampoline_template, - "", + "This hook is called by @code{assemble_trampoline_template} to output,\n\ +on the stream @var{f}, assembler code for a block of data that contains\n\ +the constant parts of a trampoline. This code should not include a\n\ +label---the label is taken care of automatically.\n\ +\n\ +If you do not define this hook, it means no template is needed\n\ +for the target. Do not define this hook on systems where the block move\n\ +code to copy the trampoline into place would be larger than the code\n\ +to generate it on the spot.", void, (FILE *f), NULL) @@ -468,7 +841,15 @@ DEFHOOK DEFHOOK (output_addr_const_extra, - "", + "A target hook to recognize @var{rtx} patterns that @code{output_addr_const}\n\ +can't deal with, and output assembly code to @var{file} corresponding to\n\ +the pattern @var{x}. This may be used to allow machine-dependent\n\ +@code{UNSPEC}s to appear within constants.\n\ +\n\ +If target hook fails to recognize a pattern, it must return @code{false},\n\ +so that a standard error message is printed. If it prints an error message\n\ +itself, by calling, for example, @code{output_operand_lossage}, it may just\n\ +return @code{true}.", bool, (FILE *file, rtx x), hook_bool_FILEptr_rtx_false) @@ -531,13 +912,28 @@ HOOK_VECTOR (TARGET_SCHED, sched) the dependence LINK. The default is to make no adjustment. */ DEFHOOK (adjust_cost, - "", + "This function corrects the value of @var{cost} based on the\n\ +relationship between @var{insn} and @var{dep_insn} through the\n\ +dependence @var{link}. It should return the new value. The default\n\ +is to make no adjustment to @var{cost}. This can be used for example\n\ +to specify to the scheduler using the traditional pipeline description\n\ +that an output- or anti-dependence does not incur the same cost as a\n\ +data-dependence. If the scheduler using the automaton based pipeline\n\ +description, the cost of anti-dependence is zero and the cost of\n\ +output-dependence is maximum of one and the difference of latency\n\ +times of the first and the second insns. If these values are not\n\ +acceptable, you could use the hook to modify them too. See also\n\ +@pxref{Processor pipeline description}.", int, (rtx insn, rtx link, rtx dep_insn, int cost), NULL) /* Adjust the priority of an insn as you see fit. Returns the new priority. */ DEFHOOK (adjust_priority, - "", + "This hook adjusts the integer scheduling priority @var{priority} of\n\ +@var{insn}. It should return the new priority. Increase the priority to\n\ +execute @var{insn} earlier, reduce the priority to execute @var{insn}\n\ +later. Do not define this hook if you do not need to adjust the\n\ +scheduling priorities of insns.", int, (rtx insn, int priority), NULL) /* Function which returns the maximum number of insns that can be @@ -545,50 +941,104 @@ DEFHOOK over an entire compilation. The default is 1. */ DEFHOOK (issue_rate, - "", + "This hook returns the maximum number of instructions that can ever\n\ +issue at the same time on the target machine. The default is one.\n\ +Although the insn scheduler can define itself the possibility of issue\n\ +an insn on the same cycle, the value can serve as an additional\n\ +constraint to issue insns on the same simulated processor cycle (see\n\ +hooks @samp{TARGET_SCHED_REORDER} and @samp{TARGET_SCHED_REORDER2}).\n\ +This value must be constant over the entire compilation. If you need\n\ +it to vary depending on what the instructions are, you must use\n\ +@samp{TARGET_SCHED_VARIABLE_ISSUE}.", int, (void), NULL) /* Calculate how much this insn affects how many more insns we can emit this cycle. Default is they all cost the same. */ DEFHOOK (variable_issue, - "", + "This hook is executed by the scheduler after it has scheduled an insn\n\ +from the ready list. It should return the number of insns which can\n\ +still be issued in the current cycle. The default is\n\ +@samp{@w{@var{more} - 1}} for insns other than @code{CLOBBER} and\n\ +@code{USE}, which normally are not counted against the issue rate.\n\ +You should define this hook if some insns take more machine resources\n\ +than others, so that fewer insns can follow them in the same cycle.\n\ +@var{file} is either a null pointer, or a stdio stream to write any\n\ +debug output to. @var{verbose} is the verbose level provided by\n\ +@option{-fsched-verbose-@var{n}}. @var{insn} is the instruction that\n\ +was scheduled.", int, (FILE *file, int verbose, rtx insn, int more), NULL) /* Initialize machine-dependent scheduling code. */ DEFHOOK (init, - "", + "This hook is executed by the scheduler at the beginning of each block of\n\ +instructions that are to be scheduled. @var{file} is either a null\n\ +pointer, or a stdio stream to write any debug output to. @var{verbose}\n\ +is the verbose level provided by @option{-fsched-verbose-@var{n}}.\n\ +@var{max_ready} is the maximum number of insns in the current scheduling\n\ +region that can be live at the same time. This can be used to allocate\n\ +scratch space if it is needed, e.g.@: by @samp{TARGET_SCHED_REORDER}.", void, (FILE *file, int verbose, int max_ready), NULL) /* Finalize machine-dependent scheduling code. */ DEFHOOK (finish, - "", + "This hook is executed by the scheduler at the end of each block of\n\ +instructions that are to be scheduled. It can be used to perform\n\ +cleanup of any actions done by the other scheduling hooks. @var{file}\n\ +is either a null pointer, or a stdio stream to write any debug output\n\ +to. @var{verbose} is the verbose level provided by\n\ +@option{-fsched-verbose-@var{n}}.", void, (FILE *file, int verbose), NULL) /* Initialize machine-dependent function wide scheduling code. */ DEFHOOK (init_global, - "", + "This hook is executed by the scheduler after function level initializations.\n\ +@var{file} is either a null pointer, or a stdio stream to write any debug output to.\n\ +@var{verbose} is the verbose level provided by @option{-fsched-verbose-@var{n}}.\n\ +@var{old_max_uid} is the maximum insn uid when scheduling begins.", void, (FILE *file, int verbose, int old_max_uid), NULL) /* Finalize machine-dependent function wide scheduling code. */ DEFHOOK (finish_global, - "", + "This is the cleanup hook corresponding to @code{TARGET_SCHED_INIT_GLOBAL}.\n\ +@var{file} is either a null pointer, or a stdio stream to write any debug output to.\n\ +@var{verbose} is the verbose level provided by @option{-fsched-verbose-@var{n}}.", void, (FILE *file, int verbose), NULL) /* Reorder insns in a machine-dependent fashion, in two different places. Default does nothing. */ DEFHOOK (reorder, - "", + "This hook is executed by the scheduler after it has scheduled the ready\n\ +list, to allow the machine description to reorder it (for example to\n\ +combine two small instructions together on @samp{VLIW} machines).\n\ +@var{file} is either a null pointer, or a stdio stream to write any\n\ +debug output to. @var{verbose} is the verbose level provided by\n\ +@option{-fsched-verbose-@var{n}}. @var{ready} is a pointer to the ready\n\ +list of instructions that are ready to be scheduled. @var{n_readyp} is\n\ +a pointer to the number of elements in the ready list. The scheduler\n\ +reads the ready list in reverse order, starting with\n\ +@var{ready}[@var{*n_readyp} @minus{} 1] and going to @var{ready}[0]. @var{clock}\n\ +is the timer tick of the scheduler. You may modify the ready list and\n\ +the number of ready insns. The return value is the number of insns that\n\ +can issue this cycle; normally this is just @code{issue_rate}. See also\n\ +@samp{TARGET_SCHED_REORDER2}.", int, (FILE *file, int verbose, rtx *ready, int *n_readyp, int clock), NULL) DEFHOOK (reorder2, - "", + "Like @samp{TARGET_SCHED_REORDER}, but called at a different time. That\n\ +function is called whenever the scheduler starts a new cycle. This one\n\ +is called once per iteration over a cycle, immediately after\n\ +@samp{TARGET_SCHED_VARIABLE_ISSUE}; it can reorder the ready list and\n\ +return the number of insns to be scheduled in the same cycle. Defining\n\ +this hook can be useful if there are frequent situations where\n\ +scheduling one insn causes other insns to become ready in the same\n\ +cycle. These other insns can then be taken into account properly.", int, (FILE *file, int verbose, rtx *ready, int *n_readyp, int clock), NULL) /* The following member value is a pointer to a function called @@ -596,7 +1046,13 @@ DEFHOOK by two parameter values (head and tail correspondingly). */ DEFHOOK (dependencies_evaluation_hook, - "", + "This hook is called after evaluation forward dependencies of insns in\n\ +chain given by two parameter values (@var{head} and @var{tail}\n\ +correspondingly) but before insns scheduling of the insn chain. For\n\ +example, it can be used for better insn classification if it requires\n\ +analysis of dependencies. This hook can use backward and forward\n\ +dependencies of the insn scheduler because they are already\n\ +calculated.", void, (rtx head, rtx tail), NULL) /* The values of the following four members are pointers to functions @@ -611,22 +1067,31 @@ DEFHOOK DEFHOOK (init_dfa_pre_cycle_insn, - "", + "The hook can be used to initialize data used by the previous hook.", void, (void), NULL) DEFHOOK (dfa_pre_cycle_insn, - "", + "The hook returns an RTL insn. The automaton state used in the\n\ +pipeline hazard recognizer is changed as if the insn were scheduled\n\ +when the new simulated processor cycle starts. Usage of the hook may\n\ +simplify the automaton pipeline description for some @acronym{VLIW}\n\ +processors. If the hook is defined, it is used only for the automaton\n\ +based pipeline description. The default is not to change the state\n\ +when the new simulated processor cycle starts.", rtx, (void), NULL) DEFHOOK (init_dfa_post_cycle_insn, - "", + "The hook is analogous to @samp{TARGET_SCHED_INIT_DFA_PRE_CYCLE_INSN} but\n\ +used to initialize data used by the previous hook.", void, (void), NULL) DEFHOOK (dfa_post_cycle_insn, - "", + "The hook is analogous to @samp{TARGET_SCHED_DFA_PRE_CYCLE_INSN} but used\n\ +to changed the state as if the insn were scheduled when the new\n\ +simulated processor cycle finishes.", rtx, (void), NULL) /* The values of the following two members are pointers to @@ -636,12 +1101,18 @@ DEFHOOK DEFHOOK (dfa_pre_advance_cycle, - "", + "The hook to notify target that the current simulated cycle is about to finish.\n\ +The hook is analogous to @samp{TARGET_SCHED_DFA_PRE_CYCLE_INSN} but used\n\ +to change the state in more complicated situations - e.g., when advancing\n\ +state on a single insn is not enough.", void, (void), NULL) DEFHOOK (dfa_post_advance_cycle, - "", + "The hook to notify target that new simulated cycle has just started.\n\ +The hook is analogous to @samp{TARGET_SCHED_DFA_POST_CYCLE_INSN} but used\n\ +to change the state in more complicated situations - e.g., when advancing\n\ +state on a single insn is not enough.", void, (void), NULL) /* The following member value is a pointer to a function returning value @@ -653,7 +1124,32 @@ DEFHOOK insns on the same cycle. */ DEFHOOK (first_cycle_multipass_dfa_lookahead, - "", + "This hook controls better choosing an insn from the ready insn queue\n\ +for the @acronym{DFA}-based insn scheduler. Usually the scheduler\n\ +chooses the first insn from the queue. If the hook returns a positive\n\ +value, an additional scheduler code tries all permutations of\n\ +@samp{TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD ()}\n\ +subsequent ready insns to choose an insn whose issue will result in\n\ +maximal number of issued insns on the same cycle. For the\n\ +@acronym{VLIW} processor, the code could actually solve the problem of\n\ +packing simple insns into the @acronym{VLIW} insn. Of course, if the\n\ +rules of @acronym{VLIW} packing are described in the automaton.\n\ +\n\ +This code also could be used for superscalar @acronym{RISC}\n\ +processors. Let us consider a superscalar @acronym{RISC} processor\n\ +with 3 pipelines. Some insns can be executed in pipelines @var{A} or\n\ +@var{B}, some insns can be executed only in pipelines @var{B} or\n\ +@var{C}, and one insn can be executed in pipeline @var{B}. The\n\ +processor may issue the 1st insn into @var{A} and the 2nd one into\n\ +@var{B}. In this case, the 3rd insn will wait for freeing @var{B}\n\ +until the next cycle. If the scheduler issues the 3rd insn the first,\n\ +the processor could issue all 3 insns per cycle.\n\ +\n\ +Actually this code demonstrates advantages of the automaton based\n\ +pipeline hazard recognizer. We try quickly and easy many insn\n\ +schedules to choose the best one.\n\ +\n\ +The default is no multipass scheduling.", int, (void), NULL) /* The following member value is pointer to a function controlling @@ -662,7 +1158,13 @@ DEFHOOK passed as the parameter, the insn will be not chosen to be issued. */ DEFHOOK (first_cycle_multipass_dfa_lookahead_guard, - "", + "\n\ +This hook controls what insns from the ready insn queue will be\n\ +considered for the multipass insn scheduling. If the hook returns\n\ +zero for @var{insn}, the insn will be not chosen to\n\ +be issued.\n\ +\n\ +The default is that any ready insns can be chosen to be issued.", int, (rtx insn), NULL) /* This hook prepares the target for a new round of multipass @@ -676,7 +1178,8 @@ DEFHOOK scheduling on current cycle. */ DEFHOOK (first_cycle_multipass_begin, - "", + "This hook prepares the target backend for a new round of multipass\n\ +scheduling.", void, (void *data, char *ready_try, int n_ready, bool first_cycle_insn_p), NULL) @@ -692,7 +1195,7 @@ DEFHOOK to a state before issuing INSN. */ DEFHOOK (first_cycle_multipass_issue, - "", + "This hook is called when multipass scheduling evaluates instruction INSN.", void, (void *data, char *ready_try, int n_ready, rtx insn, const void *prev_data), NULL) @@ -707,7 +1210,8 @@ DEFHOOK elements in READY_TRY to non-zero. */ DEFHOOK (first_cycle_multipass_backtrack, - "", + "This is called when multipass scheduling backtracks from evaluation of\n\ +an instruction.", void, (const void *data, char *ready_try, int n_ready), NULL) /* This hook notifies the target about the result of the concluded current @@ -720,7 +1224,8 @@ DEFHOOK usually after advancing the cycle count. */ DEFHOOK (first_cycle_multipass_end, - "", + "This hook notifies the target about the result of the concluded current\n\ +round of multipass scheduling.", void, (const void *data), NULL) /* This hook is called to initialize target-specific data for multipass @@ -730,7 +1235,7 @@ DEFHOOK described in DFA. */ DEFHOOK (first_cycle_multipass_init, - "", + "This hook initializes target-specific data used in multipass scheduling.", void, (void *data), NULL) /* This hook is called to finalize target-specific data for multipass @@ -740,7 +1245,7 @@ DEFHOOK described in DFA. */ DEFHOOK (first_cycle_multipass_fini, - "", + "This hook finalizes target-specific data used in multipass scheduling.", void, (void *data), NULL) /* The following member value is pointer to a function called by @@ -756,7 +1261,16 @@ DEFHOOK the previous insn has been issued and the current processor cycle. */ DEFHOOK (dfa_new_cycle, - "", + "This hook is called by the insn scheduler before issuing @var{insn}\n\ +on cycle @var{clock}. If the hook returns nonzero,\n\ +@var{insn} is not issued on this processor cycle. Instead,\n\ +the processor cycle is advanced. If *@var{sort_p}\n\ +is zero, the insn ready queue is not sorted on the new cycle\n\ +start as usually. @var{dump} and @var{verbose} specify the file and\n\ +verbosity level to use for debugging output.\n\ +@var{last_clock} and @var{clock} are, respectively, the\n\ +processor cycle on which the previous insn has been issued,\n\ +and the current processor cycle.", int, (FILE *dump, int verbose, rtx insn, int last_clock, int clock, int *sort_p), NULL) @@ -772,7 +1286,24 @@ DEFHOOK second insn (second parameter). */ DEFHOOK (is_costly_dependence, - "", + "This hook is used to define which dependences are considered costly by\n\ +the target, so costly that it is not advisable to schedule the insns that\n\ +are involved in the dependence too close to one another. The parameters\n\ +to this hook are as follows: The first parameter @var{_dep} is the dependence\n\ +being evaluated. The second parameter @var{cost} is the cost of the\n\ +dependence as estimated by the scheduler, and the third\n\ +parameter @var{distance} is the distance in cycles between the two insns.\n\ +The hook returns @code{true} if considering the distance between the two\n\ +insns the dependence between them is considered costly by the target,\n\ +and @code{false} otherwise.\n\ +\n\ +Defining this hook can be useful in multiple-issue out-of-order machines,\n\ +where (a) it's practically hopeless to predict the actual data/resource\n\ +delays, however: (b) there's a better chance to predict the actual grouping\n\ +that will be formed, and (c) correctly emulating the grouping can be very\n\ +important. In such targets one may want to allow issuing dependent insns\n\ +closer to one another---i.e., closer than the dependence distance; however,\n\ +not in cases of ``costly dependences'', which this hooks allows to define.", bool, (struct _dep *_dep, int cost, int distance), NULL) DEFHOOK_UNDOC @@ -787,7 +1318,9 @@ DEFHOOK_UNDOC that new instructions were emitted. */ DEFHOOK (h_i_d_extended, - "", + "This hook is called by the insn scheduler after emitting a new instruction to\n\ +the instruction stream. The hook notifies a target backend to extend its\n\ +per instruction data structures.", void, (void), NULL) /* Next 5 functions are for multi-point scheduling. */ @@ -795,31 +1328,33 @@ DEFHOOK /* Allocate memory for scheduler context. */ DEFHOOK (alloc_sched_context, - "", + "Return a pointer to a store large enough to hold target scheduling context.", void *, (void), NULL) /* Fills the context from the local machine scheduler context. */ DEFHOOK (init_sched_context, - "", + "Initialize store pointed to by @var{tc} to hold target scheduling context.\n\ +It @var{clean_p} is true then initialize @var{tc} as if scheduler is at the\n\ +beginning of the block. Otherwise, copy the current context into @var{tc}.", void, (void *tc, bool clean_p), NULL) /* Sets local machine scheduler context to a saved value. */ DEFHOOK (set_sched_context, - "", + "Copy target scheduling context pointed to by @var{tc} to the current context.", void, (void *tc), NULL) /* Clears a scheduler context so it becomes like after init. */ DEFHOOK (clear_sched_context, - "", + "Deallocate internal data in target scheduling context pointed to by @var{tc}.", void, (void *tc), NULL) /* Frees the scheduler context. */ DEFHOOK (free_sched_context, - "", + "Deallocate a store for target scheduling context pointed to by @var{tc}.", void, (void *tc), NULL) /* The following member value is a pointer to a function called @@ -834,7 +1369,14 @@ DEFHOOK generated one. */ DEFHOOK (speculate_insn, - "", + "This hook is called by the insn scheduler when @var{insn} has only\n\ +speculative dependencies and therefore can be scheduled speculatively.\n\ +The hook is used to check if the pattern of @var{insn} has a speculative\n\ +version and, in case of successful check, to generate that speculative\n\ +pattern. The hook should return 1, if the instruction has a speculative form,\n\ +or @minus{}1, if it doesn't. @var{request} describes the type of requested\n\ +speculation. If the return value equals 1 then @var{new_pat} is assigned\n\ +the generated speculative pattern.", int, (rtx insn, unsigned int dep_status, rtx *new_pat), NULL) /* The following member value is a pointer to a function called @@ -842,7 +1384,9 @@ DEFHOOK passed as the parameter needs a recovery block. */ DEFHOOK (needs_block_p, - "", + "This hook is called by the insn scheduler during generation of recovery code\n\ +for @var{insn}. It should return @code{true}, if the corresponding check\n\ +instruction should branch to recovery code, or @code{false} otherwise.", bool, (unsigned int dep_status), NULL) /* The following member value is a pointer to a function called @@ -854,7 +1398,14 @@ DEFHOOK is being performed. */ DEFHOOK (gen_spec_check, - "", + "This hook is called by the insn scheduler to generate a pattern for recovery\n\ +check instruction. If @var{mutate_p} is zero, then @var{insn} is a\n\ +speculative instruction for which the check should be generated.\n\ +@var{label} is either a label of a basic block, where recovery code should\n\ +be emitted, or a null pointer, when requested check doesn't branch to\n\ +recovery code (a simple check). If @var{mutate_p} is nonzero, then\n\ +a pattern for a branchy check corresponding to a simple check denoted by\n\ +@var{insn} should be generated. In this case @var{label} can't be null.", rtx, (rtx insn, rtx label, unsigned int ds), NULL) /* The following member value is a pointer to a function controlling @@ -865,7 +1416,16 @@ DEFHOOK that stand at the first position of the ready list. */ DEFHOOK (first_cycle_multipass_dfa_lookahead_guard_spec, - "", + "This hook is used as a workaround for\n\ +@samp{TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD} not being\n\ +called on the first instruction of the ready list. The hook is used to\n\ +discard speculative instructions that stand first in the ready list from\n\ +being scheduled on the current cycle. If the hook returns @code{false},\n\ +@var{insn} will not be chosen to be issued.\n\ +For non-speculative instructions,\n\ +the hook should always return @code{true}. For example, in the ia64 backend\n\ +the hook is used to cancel data speculative insns when the ALAT table\n\ +is nearly full.", bool, (const_rtx insn), NULL) /* The following member value is a pointer to a function that provides @@ -873,7 +1433,10 @@ DEFHOOK The parameter is a pointer to spec_info variable. */ DEFHOOK (set_sched_flags, - "", + "This hook is used by the insn scheduler to find out what features should be\n\ +enabled/used.\n\ +The structure *@var{spec_info} should be filled in by the target.\n\ +The structure describes speculation types that can be used in the scheduler.", void, (struct spec_info_def *spec_info), NULL) DEFHOOK_UNDOC @@ -898,7 +1461,12 @@ DEFHOOK_UNDOC to ddg variable. */ DEFHOOK (sms_res_mii, - "", + "This hook is called by the swing modulo scheduler to calculate a\n\ +resource-based lower bound which is based on the resources available in\n\ +the machine and the resources required by each instruction. The target\n\ +backend can use @var{g} to calculate such bound. A very simple lower\n\ +bound will be used in case this hook is not implemented: the total number\n\ +of instructions divided by the issue rate.", int, (struct ddg *g), NULL) /* The following member value is a function that initializes dispatch @@ -906,7 +1474,8 @@ DEFHOOK parameters. */ DEFHOOK (dispatch_do, -"", +"This hook is called by Haifa Scheduler. It performs the operation specified\n\ +in its second parameter.", void, (rtx insn, int x), hook_void_rtx_int) @@ -915,7 +1484,8 @@ hook_void_rtx_int) as the second parameter is true. */ DEFHOOK (dispatch, -"", +"This hook is called by Haifa Scheduler. It returns true if dispatch scheduling\n\ +is supported in hardware and the condition specified in the parameter is true.", bool, (rtx insn, int x), hook_bool_rtx_int_false) @@ -948,14 +1518,44 @@ HOOK_VECTOR (TARGET_VECTORIZE, vectorize) function. */ DEFHOOK (builtin_mask_for_load, - "", + "This hook should return the DECL of a function @var{f} that given an\n\ +address @var{addr} as an argument returns a mask @var{m} that can be\n\ +used to extract from two vectors the relevant data that resides in\n\ +@var{addr} in case @var{addr} is not properly aligned.\n\ +\n\ +The autovectorizer, when vectorizing a load operation from an address\n\ +@var{addr} that may be unaligned, will generate two vector loads from\n\ +the two aligned addresses around @var{addr}. It then generates a\n\ +@code{REALIGN_LOAD} operation to extract the relevant data from the\n\ +two loaded vectors. The first two arguments to @code{REALIGN_LOAD},\n\ +@var{v1} and @var{v2}, are the two vectors, each of size @var{VS}, and\n\ +the third argument, @var{OFF}, defines how the data will be extracted\n\ +from these two vectors: if @var{OFF} is 0, then the returned vector is\n\ +@var{v2}; otherwise, the returned vector is composed from the last\n\ +@var{VS}-@var{OFF} elements of @var{v1} concatenated to the first\n\ +@var{OFF} elements of @var{v2}.\n\ +\n\ +If this hook is defined, the autovectorizer will generate a call\n\ +to @var{f} (using the DECL tree that this hook returns) and will\n\ +use the return value of @var{f} as the argument @var{OFF} to\n\ +@code{REALIGN_LOAD}. Therefore, the mask @var{m} returned by @var{f}\n\ +should comply with the semantics expected by @code{REALIGN_LOAD}\n\ +described above.\n\ +If this hook is not defined, then @var{addr} will be used as\n\ +the argument @var{OFF} to @code{REALIGN_LOAD}, in which case the low\n\ +log2(@var{VS}) @minus{} 1 bits of @var{addr} will be considered.", tree, (void), NULL) /* Returns a code for builtin that realizes vectorized version of function, or NULL_TREE if not available. */ DEFHOOK (builtin_vectorized_function, - "", + "This hook should return the decl of a function that implements the\n\ +vectorized variant of the builtin function with builtin function code\n\ +@var{code} or @code{NULL_TREE} if such a function is not available.\n\ +The value of @var{fndecl} is the builtin function declaration. The\n\ +return type of the vectorized function shall be of vector type\n\ +@var{vec_type_out} and the argument types should be @var{vec_type_in}.", tree, (tree fndecl, tree vec_type_out, tree vec_type_in), default_builtin_vectorized_function) @@ -963,7 +1563,15 @@ DEFHOOK vector conversion, or NULL_TREE if not available. */ DEFHOOK (builtin_conversion, - "", + "This hook should return the DECL of a function that implements conversion of the\n\ +input vector of type @var{src_type} to type @var{dest_type}.\n\ +The value of @var{code} is one of the enumerators in @code{enum tree_code} and\n\ +specifies how the conversion is to be applied\n\ +(truncation, rounding, etc.).\n\ +\n\ +If this hook is defined, the autovectorizer will use the\n\ +@code{TARGET_VECTORIZE_BUILTIN_CONVERSION} target hook when vectorizing\n\ +conversion. Otherwise, it will return @code{NULL_TREE}.", tree, (unsigned code, tree dest_type, tree src_type), default_builtin_vectorized_conversion) @@ -972,7 +1580,9 @@ DEFHOOK on the data type and misalignment value. */ DEFHOOK (builtin_vectorization_cost, - "", + "Returns cost of different scalar or vector statements for vectorization cost model.\n\ +For vector memory operations the cost may depend on type (@var{vectype}) and\n\ +misalignment value (@var{misalign}).", int, (enum vect_cost_for_stmt type_of_cost, tree vectype, int misalign), default_builtin_vectorization_cost) @@ -980,7 +1590,7 @@ DEFHOOK iterations) for the given type. */ DEFHOOK (vector_alignment_reachable, - "", + "Return true if vector alignment is reachable (by peeling N iterations) for the given type.", bool, (const_tree type, bool is_packed), default_builtin_vector_alignment_reachable) @@ -988,7 +1598,7 @@ DEFHOOK A NULL indicates that all constants are valid permutations. */ DEFHOOK (vec_perm_const_ok, - "", + "Return true if a vector created for @code{vec_perm_const} is valid.", bool, (enum machine_mode, const unsigned char *sel), NULL) @@ -997,7 +1607,11 @@ DEFHOOK is true if the access is defined in a packed struct. */ DEFHOOK (support_vector_misalignment, - "", + "This hook should return true if the target supports misaligned vector\n\ +store/load of a specific factor denoted in the @var{misalignment}\n\ +parameter. The vector store/load should be of machine mode @var{mode} and\n\ +the elements in the vectors should be of type @var{type}. @var{is_packed}\n\ +parameter is true if the memory access is defined in a packed struct.", bool, (enum machine_mode mode, const_tree type, int misalignment, bool is_packed), default_builtin_support_vector_misalignment) @@ -1024,7 +1638,10 @@ DEFHOOK scalar mode. */ DEFHOOK (preferred_simd_mode, - "", + "This hook should return the preferred mode for vectorizing scalar\n\ +mode @var{mode}. The default is\n\ +equal to @code{word_mode}, because the vectorizer can do some\n\ +transformations even in absence of specialized @acronym{SIMD} hardware.", enum machine_mode, (enum machine_mode mode), default_preferred_simd_mode) @@ -1033,7 +1650,10 @@ DEFHOOK after processing the preferred one derived from preferred_simd_mode. */ DEFHOOK (autovectorize_vector_sizes, - "", + "This hook should return a mask of sizes that should be iterated over\n\ +after trying to autovectorize using the vector size derived from the\n\ +mode returned by @code{TARGET_VECTORIZE_PREFERRED_SIMD_MODE}.\n\ +The default is zero which means to not iterate over other vector sizes.", unsigned int, (void), default_autovectorize_vector_sizes) @@ -1041,7 +1661,11 @@ DEFHOOK /* Target builtin that implements vector gather operation. */ DEFHOOK (builtin_gather, - "", + "Target builtin that implements vector gather operation. @var{mem_vectype}\n\ +is the vector type of the load and @var{index_type} is scalar type of\n\ +the index, scaled by @var{scale}.\n\ +The default is @code{NULL_TREE} which means to not vectorize gather\n\ +loads.", tree, (const_tree mem_vectype, const_tree index_type, int scale), NULL) @@ -1110,7 +1734,13 @@ HOOK_VECTOR_END (vectorize) end of the code affected by an attribute or pragma. */ DEFHOOK (override_options_after_change, - "", + "This target function is similar to the hook @code{TARGET_OPTION_OVERRIDE}\n\ +but is called when the optimize level is changed via an attribute or\n\ +pragma or when it is reset at the end of the code affected by the\n\ +attribute or pragma. It is not called at the beginning of compilation\n\ +when @code{TARGET_OPTION_OVERRIDE} is called so if you want to perform these\n\ +actions then, you should have @code{TARGET_OPTION_OVERRIDE} call\n\ +@code{TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE}.", void, (void), hook_void_void) @@ -1123,35 +1753,65 @@ DEFHOOK_UNDOC /* Return machine mode for libgcc expanded cmp instructions. */ DEFHOOK (libgcc_cmp_return_mode, - "", + "This target hook should return the mode to be used for the return value\n\ +of compare instructions expanded to libgcc calls. If not defined\n\ +@code{word_mode} is returned which is the right choice for a majority of\n\ +targets.", enum machine_mode, (void), default_libgcc_cmp_return_mode) /* Return machine mode for libgcc expanded shift instructions. */ DEFHOOK (libgcc_shift_count_mode, - "", + "This target hook should return the mode to be used for the shift count operand\n\ +of shift instructions expanded to libgcc calls. If not defined\n\ +@code{word_mode} is returned which is the right choice for a majority of\n\ +targets.", enum machine_mode, (void), default_libgcc_shift_count_mode) /* Return machine mode to be used for _Unwind_Word type. */ DEFHOOK (unwind_word_mode, - "", + "Return machine mode to be used for @code{_Unwind_Word} type.\n\ +The default is to use @code{word_mode}.", enum machine_mode, (void), default_unwind_word_mode) /* Given two decls, merge their attributes and return the result. */ DEFHOOK (merge_decl_attributes, - "", + "Define this target hook if the merging of decl attributes needs special\n\ +handling. If defined, the result is a list of the combined\n\ +@code{DECL_ATTRIBUTES} of @var{olddecl} and @var{newdecl}.\n\ +@var{newdecl} is a duplicate declaration of @var{olddecl}. Examples of\n\ +when this is needed are when one attribute overrides another, or when an\n\ +attribute is nullified by a subsequent definition. This function may\n\ +call @code{merge_attributes} to handle machine-independent merging.\n\ +\n\ +@findex TARGET_DLLIMPORT_DECL_ATTRIBUTES\n\ +If the only target-specific handling you require is @samp{dllimport}\n\ +for Microsoft Windows targets, you should define the macro\n\ +@code{TARGET_DLLIMPORT_DECL_ATTRIBUTES} to @code{1}. The compiler\n\ +will then define a function called\n\ +@code{merge_dllimport_decl_attributes} which can then be defined as\n\ +the expansion of @code{TARGET_MERGE_DECL_ATTRIBUTES}. You can also\n\ +add @code{handle_dll_attribute} in the attribute table for your port\n\ +to perform initial processing of the @samp{dllimport} and\n\ +@samp{dllexport} attributes. This is done in @file{i386/cygwin.h} and\n\ +@file{i386/i386.c}, for example.", tree, (tree olddecl, tree newdecl), merge_decl_attributes) /* Given two types, merge their attributes and return the result. */ DEFHOOK (merge_type_attributes, - "", + "Define this target hook if the merging of type attributes needs special\n\ +handling. If defined, the result is a list of the combined\n\ +@code{TYPE_ATTRIBUTES} of @var{type1} and @var{type2}. It is assumed\n\ +that @code{comptypes} has already been called and returned 1. This\n\ +function may call @code{merge_attributes} to handle machine-independent\n\ +merging.", tree, (tree type1, tree type2), merge_type_attributes) @@ -1159,14 +1819,22 @@ DEFHOOK Ignored if NULL. */ DEFHOOKPOD (attribute_table, - "", + "If defined, this target hook points to an array of @samp{struct\n\ +attribute_spec} (defined in @file{tree.h}) specifying the machine\n\ +specific attributes for this target and some of the restrictions on the\n\ +entities to which these attributes are applied and the arguments they\n\ +take.", const struct attribute_spec *, NULL) /* Return true iff attribute NAME expects a plain identifier as its first argument. */ DEFHOOK (attribute_takes_identifier_p, - "", + "If defined, this target hook is a function which returns true if the\n\ +machine-specific attribute named @var{name} expects an identifier\n\ +given as its first argument to be passed on as a plain identifier, not\n\ +subjected to name lookup. If this is not defined, the default is\n\ +false for all machine-specific attributes.", bool, (const_tree name), hook_bool_const_tree_false) @@ -1175,21 +1843,35 @@ DEFHOOK (which causes a warning to be generated). */ DEFHOOK (comp_type_attributes, - "", + "If defined, this target hook is a function which returns zero if the attributes on\n\ +@var{type1} and @var{type2} are incompatible, one if they are compatible,\n\ +and two if they are nearly compatible (which causes a warning to be\n\ +generated). If this is not defined, machine-specific attributes are\n\ +supposed always to be compatible.", int, (const_tree type1, const_tree type2), hook_int_const_tree_const_tree_1) /* Assign default attributes to the newly defined TYPE. */ DEFHOOK (set_default_type_attributes, - "", + "If defined, this target hook is a function which assigns default attributes to\n\ +the newly defined @var{type}.", void, (tree type), hook_void_tree) /* Insert attributes on the newly created DECL. */ DEFHOOK (insert_attributes, - "", + "Define this target hook if you want to be able to add attributes to a decl\n\ +when it is being created. This is normally useful for back ends which\n\ +wish to implement a pragma by using the attributes which correspond to\n\ +the pragma's effect. The @var{node} argument is the decl which is being\n\ +created. The @var{attr_ptr} argument is a pointer to the attribute list\n\ +for this decl. The list itself should not be modified, since it may be\n\ +shared with other decls, but attributes may be chained on the head of\n\ +the list and @code{*@var{attr_ptr}} modified to point to the new\n\ +attributes, or a copy of the list may be made if further changes are\n\ +needed.", void, (tree node, tree *attr_ptr), hook_void_tree_treeptr) @@ -1197,7 +1879,11 @@ DEFHOOK can be inlined despite its machine attributes, false otherwise. */ DEFHOOK (function_attribute_inlinable_p, - "", + "@cindex inlining\n\ +This target hook returns @code{true} if it is ok to inline @var{fndecl}\n\ +into the current function, despite its having target-specific\n\ +attributes, @code{false} otherwise. By default, if a function has a\n\ +target specific attribute attached to it, it will not be inlined.", bool, (const_tree fndecl), hook_bool_const_tree_false) @@ -1205,7 +1891,31 @@ DEFHOOK Microsoft Visual C++ bitfield layout rules. */ DEFHOOK (ms_bitfield_layout_p, - "", + "This target hook returns @code{true} if bit-fields in the given\n\ +@var{record_type} are to be laid out following the rules of Microsoft\n\ +Visual C/C++, namely: (i) a bit-field won't share the same storage\n\ +unit with the previous bit-field if their underlying types have\n\ +different sizes, and the bit-field will be aligned to the highest\n\ +alignment of the underlying types of itself and of the previous\n\ +bit-field; (ii) a zero-sized bit-field will affect the alignment of\n\ +the whole enclosing structure, even if it is unnamed; except that\n\ +(iii) a zero-sized bit-field will be disregarded unless it follows\n\ +another bit-field of nonzero size. If this hook returns @code{true},\n\ +other macros that control bit-field layout are ignored.\n\ +\n\ +When a bit-field is inserted into a packed record, the whole size\n\ +of the underlying type is used by one or more same-size adjacent\n\ +bit-fields (that is, if its long:3, 32 bits is used in the record,\n\ +and any additional adjacent long bit-fields are packed into the same\n\ +chunk of 32 bits. However, if the size changes, a new field of that\n\ +size is allocated). In an unpacked record, this is the same as using\n\ +alignment, but not equivalent when packing.\n\ +\n\ +If both MS bit-fields and @samp{__attribute__((packed))} are used,\n\ +the latter will take precedence. If @samp{__attribute__((packed))} is\n\ +used on a single field when MS bit-fields are in use, it will take\n\ +precedence for that field, but the alignment of the rest of the structure\n\ +may affect its placement.", bool, (const_tree record_type), hook_bool_const_tree_false) @@ -1228,21 +1938,24 @@ DEFHOOK_UNDOC /* True if the target supports decimal floating point. */ DEFHOOK (decimal_float_supported_p, - "", + "Returns true if the target supports decimal floating point.", bool, (void), default_decimal_float_supported_p) /* True if the target supports fixed-point. */ DEFHOOK (fixed_point_supported_p, - "", + "Returns true if the target supports fixed-point arithmetic.", bool, (void), default_fixed_point_supported_p) /* Return true if anonymous bitfields affect structure alignment. */ DEFHOOK (align_anon_bitfield, - "", + "When @code{PCC_BITFIELD_TYPE_MATTERS} is true this hook will determine\n\ +whether unnamed bitfields affect the alignment of the containing\n\ +structure. The hook should return true if the structure should inherit\n\ +the alignment requirements of an unnamed bitfield's type.", bool, (void), hook_bool_void_false) @@ -1250,14 +1963,32 @@ DEFHOOK Return false if they should use the container type. */ DEFHOOK (narrow_volatile_bitfield, - "", + "This target hook should return @code{true} if accesses to volatile bitfields\n\ +should use the narrowest mode possible. It should return @code{false} if\n\ +these accesses should use the bitfield container type.\n\ +\n\ +The default is @code{!TARGET_STRICT_ALIGN}.", bool, (void), hook_bool_void_false) /* Set up target-specific built-in functions. */ DEFHOOK (init_builtins, - "", + "Define this hook if you have any machine-specific built-in functions\n\ +that need to be defined. It should be a function that performs the\n\ +necessary setup.\n\ +\n\ +Machine specific built-in functions can be useful to expand special machine\n\ +instructions that would otherwise not normally be generated because\n\ +they have no equivalent in the source language (for example, SIMD vector\n\ +instructions or prefetch instructions).\n\ +\n\ +To create a built-in function, call the function\n\ +@code{lang_hooks.builtin_function}\n\ +which is defined by the language front end. You can use any type nodes set\n\ +up by @code{build_common_tree_nodes};\n\ +only language front ends that use those two functions will call\n\ +@samp{TARGET_INIT_BUILTINS}.", void, (void), hook_void_void) @@ -1267,13 +1998,27 @@ DEFHOOK is outside of the range of valid target builtin function codes. */ DEFHOOK (builtin_decl, - "", + "Define this hook if you have any machine-specific built-in functions\n\ +that need to be defined. It should be a function that returns the\n\ +builtin function declaration for the builtin function code @var{code}.\n\ +If there is no such builtin and it cannot be initialized at this time\n\ +if @var{initialize_p} is true the function should return @code{NULL_TREE}.\n\ +If @var{code} is out of range the function should return\n\ +@code{error_mark_node}.", tree, (unsigned code, bool initialize_p), NULL) /* Expand a target-specific builtin. */ DEFHOOK (expand_builtin, - "", + "\n\ +Expand a call to a machine specific built-in function that was set up by\n\ +@samp{TARGET_INIT_BUILTINS}. @var{exp} is the expression for the\n\ +function call; the result should go to @var{target} if that is\n\ +convenient, and have mode @var{mode} if that is convenient.\n\ +@var{subtarget} may be used as the target for computing one of\n\ +@var{exp}'s operands. @var{ignore} is nonzero if the value is to be\n\ +ignored. This function should return the result of the call to the\n\ +built-in function.", rtx, (tree exp, rtx target, rtx subtarget, enum machine_mode mode, int ignore), default_expand_builtin) @@ -1285,14 +2030,28 @@ DEFHOOK has type VEC(tree,gc)*, but we don't want to include tree.h here. */ DEFHOOK (resolve_overloaded_builtin, - "", + "Select a replacement for a machine specific built-in function that\n\ +was set up by @samp{TARGET_INIT_BUILTINS}. This is done\n\ +@emph{before} regular type checking, and so allows the target to\n\ +implement a crude form of function overloading. @var{fndecl} is the\n\ +declaration of the built-in function. @var{arglist} is the list of\n\ +arguments passed to the built-in function. The result is a\n\ +complete expression that implements the operation, usually\n\ +another @code{CALL_EXPR}.\n\ +@var{arglist} really has type @samp{VEC(tree,gc)*}", tree, (unsigned int /*location_t*/ loc, tree fndecl, void *arglist), NULL) /* Fold a target-specific builtin to a tree valid for both GIMPLE and GENERIC. */ DEFHOOK (fold_builtin, - "", + "Fold a call to a machine specific built-in function that was set up by\n\ +@samp{TARGET_INIT_BUILTINS}. @var{fndecl} is the declaration of the\n\ +built-in function. @var{n_args} is the number of arguments passed to\n\ +the function; the arguments themselves are pointed to by @var{argp}.\n\ +The result is another tree, valid for both GIMPLE and GENERIC,\n\ +containing a simplified expression for the call's result. If\n\ +@var{ignore} is true the value will be ignored.", tree, (tree fndecl, int n_args, tree *argp, bool ignore), hook_tree_tree_int_treep_bool_null) @@ -1316,7 +2075,12 @@ was made to the GIMPLE stream.", and 0 if they are the same. */ DEFHOOK (compare_version_priority, - "", + "This hook is used to compare the target attributes in two functions to\n\ +determine which function's features get higher priority. This is used\n\ +during function multi-versioning to figure out the order in which two\n\ +versions must be dispatched. A function version with a higher priority\n\ +is checked for dispatching earlier. @var{decl1} and @var{decl2} are\n\ + the two function decls that will be compared.", int, (tree decl1, tree decl2), NULL) /* Target hook is used to generate the dispatcher logic to invoke the right @@ -1325,7 +2089,10 @@ DEFHOOK must be generated. */ DEFHOOK (generate_version_dispatcher_body, - "", + "This hook is used to generate the dispatcher logic to invoke the right\n\ +function version at run-time for a given set of function versions.\n\ +@var{arg} points to the callgraph node of the dispatcher function whose\n\ +body must be generated.", tree, (void *arg), NULL) /* Target hook is used to get the dispatcher function for a set of function @@ -1334,14 +2101,23 @@ DEFHOOK identical versions. */ DEFHOOK (get_function_versions_dispatcher, - "", + "This hook is used to get the dispatcher function for a set of function\n\ +versions. The dispatcher function is called to invoke the right function\n\ +version at run-time. @var{decl} is one version from a set of semantically\n\ +identical versions.", tree, (void *decl), NULL) /* Returns a code for a target-specific builtin that implements reciprocal of the function, or NULL_TREE if not available. */ DEFHOOK (builtin_reciprocal, - "", + "This hook should return the DECL of a function that implements reciprocal of\n\ +the builtin function with builtin function code @var{fn}, or\n\ +@code{NULL_TREE} if such a function is not available. @var{md_fn} is true\n\ +when @var{fn} is a code of a machine-dependent builtin function. When\n\ +@var{sqrt} is true, additional optimizations that apply only to the reciprocal\n\ +of a square root function are performed, and only reciprocals of @code{sqrt}\n\ +function are valid.", tree, (unsigned fn, bool md_fn, bool sqrt), default_builtin_reciprocal) @@ -1350,14 +2126,50 @@ DEFHOOK NULL. */ DEFHOOK (mangle_type, - "", + "If your target defines any fundamental types, or any types your target\n\ +uses should be mangled differently from the default, define this hook\n\ +to return the appropriate encoding for these types as part of a C++\n\ +mangled name. The @var{type} argument is the tree structure representing\n\ +the type to be mangled. The hook may be applied to trees which are\n\ +not target-specific fundamental types; it should return @code{NULL}\n\ +for all such types, as well as arguments it does not recognize. If the\n\ +return value is not @code{NULL}, it must point to a statically-allocated\n\ +string constant.\n\ +\n\ +Target-specific fundamental types might be new fundamental types or\n\ +qualified versions of ordinary fundamental types. Encode new\n\ +fundamental types as @samp{@w{u @var{n} @var{name}}}, where @var{name}\n\ +is the name used for the type in source code, and @var{n} is the\n\ +length of @var{name} in decimal. Encode qualified versions of\n\ +ordinary types as @samp{@w{U @var{n} @var{name} @var{code}}}, where\n\ +@var{name} is the name used for the type qualifier in source code,\n\ +@var{n} is the length of @var{name} as above, and @var{code} is the\n\ +code used to represent the unqualified version of this type. (See\n\ +@code{write_builtin_type} in @file{cp/mangle.c} for the list of\n\ +codes.) In both cases the spaces are for clarity; do not include any\n\ +spaces in your string.\n\ +\n\ +This hook is applied to types prior to typedef resolution. If the mangled\n\ +name for a particular type depends only on that type's main variant, you\n\ +can perform typedef resolution yourself using @code{TYPE_MAIN_VARIANT}\n\ +before mangling.\n\ +\n\ +The default version of this hook always returns @code{NULL}, which is\n\ +appropriate for a target that does not define any new fundamental\n\ +types.", const char *, (const_tree type), hook_constcharptr_const_tree_null) /* Make any adjustments to libfunc names needed for this target. */ DEFHOOK (init_libfuncs, - "", + "This hook should declare additional library routines or rename\n\ +existing ones, using the functions @code{set_optab_libfunc} and\n\ +@code{init_one_libfunc} defined in @file{optabs.c}.\n\ +@code{init_optabs} calls this macro after initializing all the normal\n\ +library routines.\n\ +\n\ +The default is to do nothing. Most ports don't need to define this hook.", void, (void), hook_void_void) @@ -1377,7 +2189,15 @@ is set to true, the @file{tm.h} file must also\n\ /* ??? Should be merged with SELECT_SECTION and UNIQUE_SECTION. */ DEFHOOK (section_type_flags, - "", + "Choose a set of section attributes for use by @code{TARGET_ASM_NAMED_SECTION}\n\ +based on a variable or function decl, a section name, and whether or not the\n\ +declaration's initializer may contain runtime relocations. @var{decl} may be\n\ +null, in which case read-write data should be assumed.\n\ +\n\ +The default version of this function handles choosing code vs data,\n\ +read-only vs read-write data, and @code{flag_pic}. You should only\n\ +need to override this if your target has special flags that might be\n\ +set via @code{__attribute__}.", unsigned int, (tree decl, const char *name, int reloc), default_section_type_flags) @@ -1385,7 +2205,18 @@ DEFHOOK not, at the current point in the compilation. */ DEFHOOK (cannot_modify_jumps_p, - "", + "This target hook returns @code{true} past the point in which new jump\n\ +instructions could be created. On machines that require a register for\n\ +every jump such as the SHmedia ISA of SH5, this point would typically be\n\ +reload, so this target hook should be defined to a function such as:\n\ +\n\ +@smallexample\n\ +static bool\n\ +cannot_modify_jumps_past_reload_p ()\n\ +@{\n\ + return (reload_completed || reload_in_progress);\n\ +@}\n\ +@end smallexample", bool, (void), hook_bool_void_false) @@ -1404,7 +2235,11 @@ DEFHOOK optimizations should be applied. */ DEFHOOK (branch_target_register_class, - "", + "This target hook returns a register class for which branch target register\n\ +optimizations should be applied. All registers in this class should be\n\ +usable interchangeably. After reload, registers in this class will be\n\ +re-allocated and loads will be hoisted out of loops and be subjected\n\ +to inter-block scheduling.", reg_class_t, (void), default_branch_target_register_class) @@ -1414,35 +2249,66 @@ DEFHOOK already been generated. */ DEFHOOK (branch_target_register_callee_saved, - "", + "Branch target register optimization will by default exclude callee-saved\n\ +registers\n\ +that are not already live during the current function; if this target hook\n\ +returns true, they will be included. The target code must than make sure\n\ +that all target registers in the class returned by\n\ +@samp{TARGET_BRANCH_TARGET_REGISTER_CLASS} that might need saving are\n\ +saved. @var{after_prologue_epilogue_gen} indicates if prologues and\n\ +epilogues have already been generated. Note, even if you only return\n\ +true when @var{after_prologue_epilogue_gen} is false, you still are likely\n\ +to have to make special provisions in @code{INITIAL_ELIMINATION_OFFSET}\n\ +to reserve space for caller-saved target registers.", bool, (bool after_prologue_epilogue_gen), hook_bool_bool_false) /* Return true if the target supports conditional execution. */ DEFHOOK (have_conditional_execution, - "", + "This target hook returns true if the target supports conditional execution.\n\ +This target hook is required only when the target has several different\n\ +modes and they have different conditional execution capability, such as ARM.", bool, (void), default_have_conditional_execution) /* Return a new value for loop unroll size. */ DEFHOOK (loop_unroll_adjust, - "", + "This target hook returns a new value for the number of times @var{loop}\n\ +should be unrolled. The parameter @var{nunroll} is the number of times\n\ +the loop is to be unrolled. The parameter @var{loop} is a pointer to\n\ +the loop, which is going to be checked for unrolling. This target hook\n\ +is required only when the target has special constraints like maximum\n\ +number of memory accesses.", unsigned, (unsigned nunroll, struct loop *loop), NULL) /* True if X is a legitimate MODE-mode immediate operand. */ DEFHOOK (legitimate_constant_p, - "", + "This hook returns true if @var{x} is a legitimate constant for a\n\ +@var{mode}-mode immediate operand on the target machine. You can assume that\n\ +@var{x} satisfies @code{CONSTANT_P}, so you need not check this.\n\ +\n\ +The default definition returns true.", bool, (enum machine_mode mode, rtx x), hook_bool_mode_rtx_true) /* True if the constant X cannot be placed in the constant pool. */ DEFHOOK (cannot_force_const_mem, - "", + "This hook should return true if @var{x} is of a form that cannot (or\n\ +should not) be spilled to the constant pool. @var{mode} is the mode\n\ +of @var{x}.\n\ +\n\ +The default version of this hook returns false.\n\ +\n\ +The primary reason to define this hook is to prevent reload from\n\ +deciding that a non-legitimate constant would be better reloaded\n\ +from the constant pool instead of spilling and reloading a register\n\ +holding the constant. This restriction is often true of addresses\n\ +of TLS symbols for various targets.", bool, (enum machine_mode mode, rtx x), hook_bool_mode_rtx_false) @@ -1454,7 +2320,10 @@ DEFHOOK_UNDOC /* True if X is considered to be commutative. */ DEFHOOK (commutative_p, - "", + "This target hook returns @code{true} if @var{x} is considered to be commutative.\n\ +Usually, this is just COMMUTATIVE_P (@var{x}), but the HP PA doesn't consider\n\ +PLUS to be commutative inside a MEM@. @var{outer_code} is the rtx code\n\ +of the enclosing rtl, if known, otherwise it is UNKNOWN.", bool, (const_rtx x, int outer_code), hook_bool_const_rtx_commutative_p) @@ -1462,7 +2331,20 @@ DEFHOOK on the mode of the memory reference it is used in. */ DEFHOOK (mode_dependent_address_p, - "", + "This hook returns @code{true} if memory address @var{addr} in address\n\ +space @var{addrspace} can have\n\ +different meanings depending on the machine mode of the memory\n\ +reference it is used for or if the address is valid for some modes\n\ +but not others.\n\ +\n\ +Autoincrement and autodecrement addresses typically have mode-dependent\n\ +effects because the amount of the increment or decrement is the size\n\ +of the operand being addressed. Some machines have other mode-dependent\n\ +addresses. Many RISC machines have no mode-dependent addresses.\n\ +\n\ +You may assume that @var{addr} is a valid address for the machine.\n\ +\n\ +The default version of this hook returns @code{false}.", bool, (const_rtx addr, addr_space_t addrspace), default_mode_dependent_address_p) @@ -1470,14 +2352,39 @@ DEFHOOK ways to make it legitimate. Return X or an invalid address on failure. */ DEFHOOK (legitimize_address, - "", + "This hook is given an invalid memory address @var{x} for an\n\ +operand of mode @var{mode} and should try to return a valid memory\n\ +address.\n\ +\n\ +@findex break_out_memory_refs\n\ +@var{x} will always be the result of a call to @code{break_out_memory_refs},\n\ +and @var{oldx} will be the operand that was given to that function to produce\n\ +@var{x}.\n\ +\n\ +The code of the hook should not alter the substructure of\n\ +@var{x}. If it transforms @var{x} into a more legitimate form, it\n\ +should return the new @var{x}.\n\ +\n\ +It is not necessary for this hook to come up with a legitimate address,\n\ +with the exception of native TLS addresses (@pxref{Emulated TLS}).\n\ +The compiler has standard ways of doing so in all cases. In fact, if\n\ +the target supports only emulated TLS, it\n\ +is safe to omit this hook or make it return @var{x} if it cannot find\n\ +a valid way to legitimize the address. But often a machine-dependent\n\ +strategy can generate better code.", rtx, (rtx x, rtx oldx, enum machine_mode mode), default_legitimize_address) /* Given an address RTX, undo the effects of LEGITIMIZE_ADDRESS. */ DEFHOOK (delegitimize_address, - "", + "This hook is used to undo the possibly obfuscating effects of the\n\ +@code{LEGITIMIZE_ADDRESS} and @code{LEGITIMIZE_RELOAD_ADDRESS} target\n\ +macros. Some backend implementations of these macros wrap symbol\n\ +references inside an @code{UNSPEC} rtx to represent PIC or similar\n\ +addressing modes. This target hook allows GCC's optimizers to understand\n\ +the semantics of these opaque @code{UNSPEC}s by converting them back\n\ +into their original form.", rtx, (rtx x), delegitimize_mem_from_attrs) @@ -1485,46 +2392,126 @@ DEFHOOK section. */ DEFHOOK (const_not_ok_for_debug_p, - "", + "This hook should return true if @var{x} should not be emitted into\n\ +debug sections.", bool, (rtx x), hook_bool_rtx_false) /* Given an address RTX, say whether it is valid. */ DEFHOOK (legitimate_address_p, - "", + "A function that returns whether @var{x} (an RTX) is a legitimate memory\n\ +address on the target machine for a memory operand of mode @var{mode}.\n\ +\n\ +Legitimate addresses are defined in two variants: a strict variant and a\n\ +non-strict one. The @var{strict} parameter chooses which variant is\n\ +desired by the caller.\n\ +\n\ +The strict variant is used in the reload pass. It must be defined so\n\ +that any pseudo-register that has not been allocated a hard register is\n\ +considered a memory reference. This is because in contexts where some\n\ +kind of register is required, a pseudo-register with no hard register\n\ +must be rejected. For non-hard registers, the strict variant should look\n\ +up the @code{reg_renumber} array; it should then proceed using the hard\n\ +register number in the array, or treat the pseudo as a memory reference\n\ +if the array holds @code{-1}.\n\ +\n\ +The non-strict variant is used in other passes. It must be defined to\n\ +accept all pseudo-registers in every context where some kind of\n\ +register is required.\n\ +\n\ +Normally, constant addresses which are the sum of a @code{symbol_ref}\n\ +and an integer are stored inside a @code{const} RTX to mark them as\n\ +constant. Therefore, there is no need to recognize such sums\n\ +specifically as legitimate addresses. Normally you would simply\n\ +recognize any @code{const} as legitimate.\n\ +\n\ +Usually @code{PRINT_OPERAND_ADDRESS} is not prepared to handle constant\n\ +sums that are not marked with @code{const}. It assumes that a naked\n\ +@code{plus} indicates indexing. If so, then you @emph{must} reject such\n\ +naked constant sums as illegitimate addresses, so that none of them will\n\ +be given to @code{PRINT_OPERAND_ADDRESS}.\n\ +\n\ +@cindex @code{TARGET_ENCODE_SECTION_INFO} and address validation\n\ +On some machines, whether a symbolic address is legitimate depends on\n\ +the section that the address refers to. On these machines, define the\n\ +target hook @code{TARGET_ENCODE_SECTION_INFO} to store the information\n\ +into the @code{symbol_ref}, and then check for it here. When you see a\n\ +@code{const}, you will have to look inside it to find the\n\ +@code{symbol_ref} in order to determine the section. @xref{Assembler\n\ +Format}.\n\ +\n\ +@cindex @code{GO_IF_LEGITIMATE_ADDRESS}\n\ +Some ports are still using a deprecated legacy substitute for\n\ +this hook, the @code{GO_IF_LEGITIMATE_ADDRESS} macro. This macro\n\ +has this syntax:\n\ +\n\ +@example\n\ +#define GO_IF_LEGITIMATE_ADDRESS (@var{mode}, @var{x}, @var{label})\n\ +@end example\n\ +\n\ +@noindent\n\ +and should @code{goto @var{label}} if the address @var{x} is a valid\n\ +address on the target machine for a memory operand of mode @var{mode}.\n\ +\n\ +@findex REG_OK_STRICT\n\ +Compiler source files that want to use the strict variant of this\n\ +macro define the macro @code{REG_OK_STRICT}. You should use an\n\ +@code{#ifdef REG_OK_STRICT} conditional to define the strict variant in\n\ +that case and the non-strict variant otherwise.\n\ +\n\ +Using the hook is usually simpler because it limits the number of\n\ +files that are recompiled when changes are made.", bool, (enum machine_mode mode, rtx x, bool strict), default_legitimate_address_p) /* True if the given constant can be put into an object_block. */ DEFHOOK (use_blocks_for_constant_p, - "", + "This hook should return true if pool entries for constant @var{x} can\n\ +be placed in an @code{object_block} structure. @var{mode} is the mode\n\ +of @var{x}.\n\ +\n\ +The default version returns false for all constants.", bool, (enum machine_mode mode, const_rtx x), hook_bool_mode_const_rtx_false) /* True if the given decl can be put into an object_block. */ DEFHOOK (use_blocks_for_decl_p, - "", + "This hook should return true if pool entries for @var{decl} should\n\ +be placed in an @code{object_block} structure.\n\ +\n\ +The default version returns true for all decls.", bool, (const_tree decl), hook_bool_const_tree_true) /* The minimum and maximum byte offsets for anchored addresses. */ DEFHOOKPOD (min_anchor_offset, - "", + "The minimum offset that should be applied to a section anchor.\n\ +On most targets, it should be the smallest offset that can be\n\ +applied to a base register while still giving a legitimate address\n\ +for every mode. The default value is 0.", HOST_WIDE_INT, 0) DEFHOOKPOD (max_anchor_offset, - "", + "Like @code{TARGET_MIN_ANCHOR_OFFSET}, but the maximum (inclusive)\n\ +offset that should be applied to section anchors. The default\n\ +value is 0.", HOST_WIDE_INT, 0) /* True if section anchors can be used to access the given symbol. */ DEFHOOK (use_anchors_for_symbol_p, - "", + "Return true if GCC should attempt to use anchors to access @code{SYMBOL_REF}\n\ +@var{x}. You can assume @samp{SYMBOL_REF_HAS_BLOCK_INFO_P (@var{x})} and\n\ +@samp{!SYMBOL_REF_ANCHOR_P (@var{x})}.\n\ +\n\ +The default version is correct for most targets, but you might need to\n\ +intercept this hook to handle things like target-specific attributes\n\ +or target-specific sections.", bool, (const_rtx x), default_use_anchors_for_symbol_p) @@ -1542,7 +2529,16 @@ The default value of this hook is based on target's libc.", this is an indirect call. */ DEFHOOK (function_ok_for_sibcall, - "", + "True if it is ok to do sibling call optimization for the specified\n\ +call expression @var{exp}. @var{decl} will be the called function,\n\ +or @code{NULL} if this is an indirect call.\n\ +\n\ +It is not uncommon for limitations of calling conventions to prevent\n\ +tail calls to functions outside the current unit of translation, or\n\ +during PIC compilation. The hook is used to enforce these restrictions,\n\ +as the @code{sibcall} md pattern can not fail, or fall over to a\n\ +``normal'' call. The criteria for successful sibling call optimization\n\ +may vary greatly between different architectures.", bool, (tree decl, tree exp), hook_bool_tree_tree_false) @@ -1551,13 +2547,29 @@ DEFHOOK level, outside of any function scope. */ DEFHOOK (set_current_function, - "", + "The compiler invokes this hook whenever it changes its current function\n\ +context (@code{cfun}). You can define this function if\n\ +the back end needs to perform any initialization or reset actions on a\n\ +per-function basis. For example, it may be used to implement function\n\ +attributes that affect register usage or code generation patterns.\n\ +The argument @var{decl} is the declaration for the new function context,\n\ +and may be null to indicate that the compiler has left a function context\n\ +and is returning to processing at the top level.\n\ +The default hook function does nothing.\n\ +\n\ +GCC sets @code{cfun} to a dummy function context during initialization of\n\ +some parts of the back end. The hook function is not invoked in this\n\ +situation; you need not worry about the hook being invoked recursively,\n\ +or when the back end is in a partially-initialized state.\n\ +@code{cfun} might be @code{NULL} to indicate processing at top level,\n\ +outside of any function scope.", void, (tree decl), hook_void_tree) /* True if EXP should be placed in a "small data" section. */ DEFHOOK (in_small_data_p, - "", + "Returns true if @var{exp} should be placed into a ``small data'' section.\n\ +The default version of this hook always returns false.", bool, (const_tree exp), hook_bool_const_tree_false) @@ -1565,7 +2577,13 @@ DEFHOOK to the current executable or shared library. */ DEFHOOK (binds_local_p, - "", + "Returns true if @var{exp} names an object for which name resolution\n\ +rules must resolve to the current ``module'' (dynamic shared library\n\ +or executable image).\n\ +\n\ +The default version of this hook implements the name resolution rules\n\ +for ELF, which has a looser model of global name binding than other\n\ +currently supported object file formats.", bool, (const_tree exp), default_binds_local_p) @@ -1584,7 +2602,13 @@ The default version of this hook use the target macro\n\ The default is to return ID without modification. */ DEFHOOK (mangle_decl_assembler_name, - "", + "Define this hook if you need to postprocess the assembler name generated\n\ +by target-independent code. The @var{id} provided to this hook will be\n\ +the computed name (e.g., the macro @code{DECL_NAME} of the @var{decl} in C,\n\ +or the mangled name of the @var{decl} in C++). The return value of the\n\ +hook is an @code{IDENTIFIER_NODE} for the appropriate mangled name on\n\ +your target system. The default implementation of this hook just\n\ +returns the @var{id} provided.", tree, (tree decl, tree id), default_mangle_decl_assembler_name) @@ -1592,14 +2616,50 @@ DEFHOOK the associated SYMBOL_REF. */ DEFHOOK (encode_section_info, - "", + "Define this hook if references to a symbol or a constant must be\n\ +treated differently depending on something about the variable or\n\ +function named by the symbol (such as what section it is in).\n\ +\n\ +The hook is executed immediately after rtl has been created for\n\ +@var{decl}, which may be a variable or function declaration or\n\ +an entry in the constant pool. In either case, @var{rtl} is the\n\ +rtl in question. Do @emph{not} use @code{DECL_RTL (@var{decl})}\n\ +in this hook; that field may not have been initialized yet.\n\ +\n\ +In the case of a constant, it is safe to assume that the rtl is\n\ +a @code{mem} whose address is a @code{symbol_ref}. Most decls\n\ +will also have this form, but that is not guaranteed. Global\n\ +register variables, for instance, will have a @code{reg} for their\n\ +rtl. (Normally the right thing to do with such unusual rtl is\n\ +leave it alone.)\n\ +\n\ +The @var{new_decl_p} argument will be true if this is the first time\n\ +that @code{TARGET_ENCODE_SECTION_INFO} has been invoked on this decl. It will\n\ +be false for subsequent invocations, which will happen for duplicate\n\ +declarations. Whether or not anything must be done for the duplicate\n\ +declaration depends on whether the hook examines @code{DECL_ATTRIBUTES}.\n\ +@var{new_decl_p} is always true when the hook is called for a constant.\n\ +\n\ +@cindex @code{SYMBOL_REF_FLAG}, in @code{TARGET_ENCODE_SECTION_INFO}\n\ +The usual thing for this hook to do is to record flags in the\n\ +@code{symbol_ref}, using @code{SYMBOL_REF_FLAG} or @code{SYMBOL_REF_FLAGS}.\n\ +Historically, the name string was modified if it was necessary to\n\ +encode more than one bit of information, but this practice is now\n\ +discouraged; use @code{SYMBOL_REF_FLAGS}.\n\ +\n\ +The default definition of this hook, @code{default_encode_section_info}\n\ +in @file{varasm.c}, sets a number of commonly-useful bits in\n\ +@code{SYMBOL_REF_FLAGS}. Check whether the default does what you need\n\ +before overriding it.", void, (tree decl, rtx rtl, int new_decl_p), default_encode_section_info) /* Undo the effects of encode_section_info on the symbol string. */ DEFHOOK (strip_name_encoding, - "", + "Decode @var{name} and return the real name part, sans\n\ +the characters that @code{TARGET_ENCODE_SECTION_INFO}\n\ +may have added.", const char *, (const char *name), default_strip_name_encoding) @@ -1607,7 +2667,27 @@ DEFHOOK return the mask that they apply. Return 0 otherwise. */ DEFHOOK (shift_truncation_mask, - "", + "This function describes how the standard shift patterns for @var{mode}\n\ +deal with shifts by negative amounts or by more than the width of the mode.\n\ +@xref{shift patterns}.\n\ +\n\ +On many machines, the shift patterns will apply a mask @var{m} to the\n\ +shift count, meaning that a fixed-width shift of @var{x} by @var{y} is\n\ +equivalent to an arbitrary-width shift of @var{x} by @var{y & m}. If\n\ +this is true for mode @var{mode}, the function should return @var{m},\n\ +otherwise it should return 0. A return value of 0 indicates that no\n\ +particular behavior is guaranteed.\n\ +\n\ +Note that, unlike @code{SHIFT_COUNT_TRUNCATED}, this function does\n\ +@emph{not} apply to general shift rtxes; it applies only to instructions\n\ +that are generated by the named shift patterns.\n\ +\n\ +The default implementation of this function returns\n\ +@code{GET_MODE_BITSIZE (@var{mode}) - 1} if @code{SHIFT_COUNT_TRUNCATED}\n\ +and 0 otherwise. This definition is always safe, but if\n\ +@code{SHIFT_COUNT_TRUNCATED} is false, and some shift patterns\n\ +nevertheless truncate the shift count, you may get better code\n\ +by overriding it.", unsigned HOST_WIDE_INT, (enum machine_mode mode), default_shift_truncation_mask) @@ -1616,7 +2696,12 @@ DEFHOOK the reciprocal. */ DEFHOOK (min_divisions_for_recip_mul, - "", + "When @option{-ffast-math} is in effect, GCC tries to optimize\n\ +divisions by the same divisor, by turning them into multiplications by\n\ +the reciprocal. This target hook specifies the minimum number of divisions\n\ +that should be there for GCC to perform the optimization for a variable\n\ +of mode @var{mode}. The default implementation returns 3 if the machine\n\ +has an instruction for the division, and 2 if it does not.", unsigned int, (enum machine_mode mode), default_min_divisions_for_recip_mul) @@ -1627,14 +2712,40 @@ DEFHOOK necessarily defined at this point. */ DEFHOOK (mode_rep_extended, - "", + "The representation of an integral mode can be such that the values\n\ +are always extended to a wider integral mode. Return\n\ +@code{SIGN_EXTEND} if values of @var{mode} are represented in\n\ +sign-extended form to @var{rep_mode}. Return @code{UNKNOWN}\n\ +otherwise. (Currently, none of the targets use zero-extended\n\ +representation this way so unlike @code{LOAD_EXTEND_OP},\n\ +@code{TARGET_MODE_REP_EXTENDED} is expected to return either\n\ +@code{SIGN_EXTEND} or @code{UNKNOWN}. Also no target extends\n\ +@var{mode} to @var{rep_mode} so that @var{rep_mode} is not the next\n\ +widest integral mode and currently we take advantage of this fact.)\n\ +\n\ +Similarly to @code{LOAD_EXTEND_OP} you may return a non-@code{UNKNOWN}\n\ +value even if the extension is not performed on certain hard registers\n\ +as long as for the @code{REGNO_REG_CLASS} of these hard registers\n\ +@code{CANNOT_CHANGE_MODE_CLASS} returns nonzero.\n\ +\n\ +Note that @code{TARGET_MODE_REP_EXTENDED} and @code{LOAD_EXTEND_OP}\n\ +describe two related properties. If you define\n\ +@code{TARGET_MODE_REP_EXTENDED (mode, word_mode)} you probably also want\n\ +to define @code{LOAD_EXTEND_OP (mode)} to return the same type of\n\ +extension.\n\ +\n\ +In order to enforce the representation of @code{mode},\n\ +@code{TRULY_NOOP_TRUNCATION} should return false when truncating to\n\ +@code{mode}.", int, (enum machine_mode mode, enum machine_mode rep_mode), default_mode_rep_extended) /* True if MODE is valid for a pointer in __attribute__((mode("MODE"))). */ DEFHOOK (valid_pointer_mode, - "", + "Define this to return nonzero if the port can handle pointers\n\ +with machine mode @var{mode}. The default version of this\n\ +hook returns true for both @code{ptr_mode} and @code{Pmode}.", bool, (enum machine_mode mode), default_valid_pointer_mode) @@ -1657,14 +2768,20 @@ HOOK_VECTOR (TARGET_ADDR_SPACE_HOOKS, addr_space) /* MODE to use for a pointer into another address space. */ DEFHOOK (pointer_mode, - "", + "Define this to return the machine mode to use for pointers to\n\ +@var{address_space} if the target supports named address spaces.\n\ +The default version of this hook returns @code{ptr_mode} for the\n\ +generic address space only.", enum machine_mode, (addr_space_t address_space), default_addr_space_pointer_mode) /* MODE to use for an address in another address space. */ DEFHOOK (address_mode, - "", + "Define this to return the machine mode to use for addresses in\n\ +@var{address_space} if the target supports named address spaces.\n\ +The default version of this hook returns @code{Pmode} for the\n\ +generic address space only.", enum machine_mode, (addr_space_t address_space), default_addr_space_address_mode) @@ -1672,7 +2789,13 @@ DEFHOOK in another address space. */ DEFHOOK (valid_pointer_mode, - "", + "Define this to return nonzero if the port can handle pointers\n\ +with machine mode @var{mode} to address space @var{as}. This target\n\ +hook is the same as the @code{TARGET_VALID_POINTER_MODE} target hook,\n\ +except that it includes explicit named address space support. The default\n\ +version of this hook returns true for the modes returned by either the\n\ +@code{TARGET_ADDR_SPACE_POINTER_MODE} or @code{TARGET_ADDR_SPACE_ADDRESS_MODE}\n\ +target hooks for the given address space.", bool, (enum machine_mode mode, addr_space_t as), default_addr_space_valid_pointer_mode) @@ -1680,7 +2803,12 @@ DEFHOOK space for a given mode. */ DEFHOOK (legitimate_address_p, - "", + "Define this to return true if @var{exp} is a valid address for mode\n\ +@var{mode} in the named address space @var{as}. The @var{strict}\n\ +parameter says whether strict addressing is in effect after reload has\n\ +finished. This target hook is the same as the\n\ +@code{TARGET_LEGITIMATE_ADDRESS_P} target hook, except that it includes\n\ +explicit named address space support.", bool, (enum machine_mode mode, rtx exp, bool strict, addr_space_t as), default_addr_space_legitimate_address_p) @@ -1689,21 +2817,34 @@ DEFHOOK independent methods to make the address valid. */ DEFHOOK (legitimize_address, - "", + "Define this to modify an invalid address @var{x} to be a valid address\n\ +with mode @var{mode} in the named address space @var{as}. This target\n\ +hook is the same as the @code{TARGET_LEGITIMIZE_ADDRESS} target hook,\n\ +except that it includes explicit named address space support.", rtx, (rtx x, rtx oldx, enum machine_mode mode, addr_space_t as), default_addr_space_legitimize_address) /* True if one named address space is a subset of another named address. */ DEFHOOK (subset_p, - "", + "Define this to return whether the @var{subset} named address space is\n\ +contained within the @var{superset} named address space. Pointers to\n\ +a named address space that is a subset of another named address space\n\ +will be converted automatically without a cast if used together in\n\ +arithmetic operations. Pointers to a superset address space can be\n\ +converted to pointers to a subset address space via explicit casts.", bool, (addr_space_t subset, addr_space_t superset), default_addr_space_subset_p) /* Function to convert an rtl expression from one address space to another. */ DEFHOOK (convert, - "", + "Define this to convert the pointer expression represented by the RTL\n\ +@var{op} with type @var{from_type} that points to a named address\n\ +space to a new pointer expression with type @var{to_type} that points\n\ +to a different named address space. When this hook it called, it is\n\ +guaranteed that one of the two address spaces is a subset of the other,\n\ +as determined by the @code{TARGET_ADDR_SPACE_SUBSET_P} target hook.", rtx, (rtx op, tree from_type, tree to_type), default_addr_space_convert) @@ -1717,7 +2858,15 @@ HOOK_VECTOR_END (addr_space) the arithmetic is supported. */ DEFHOOK (scalar_mode_supported_p, - "", + "Define this to return nonzero if the port is prepared to handle\n\ +insns involving scalar mode @var{mode}. For a scalar mode to be\n\ +considered supported, all the basic arithmetic and comparisons\n\ +must work.\n\ +\n\ +The default version of this hook returns true for any mode\n\ +required to handle the basic C types (as defined by the port).\n\ +Included here are the double-word arithmetic supported by the\n\ +code in @file{optabs.c}.", bool, (enum machine_mode mode), default_scalar_mode_supported_p) @@ -1726,7 +2875,9 @@ DEFHOOK for further details. */ DEFHOOK (vector_mode_supported_p, - "", + "Define this to return nonzero if the port is prepared to handle\n\ +insns involving vector mode @var{mode}. At the very least, it\n\ +must have move patterns for this mode.", bool, (enum machine_mode mode), hook_bool_mode_false) @@ -1776,7 +2927,24 @@ If this hook allows @code{val} to have a scalar mode, then\n\ TO, using MODE. */ DEFHOOK (register_move_cost, - "", + "This target hook should return the cost of moving data of mode @var{mode}\n\ +from a register in class @var{from} to one in class @var{to}. The classes\n\ +are expressed using the enumeration values such as @code{GENERAL_REGS}.\n\ +A value of 2 is the default; other values are interpreted relative to\n\ +that.\n\ +\n\ +It is not required that the cost always equal 2 when @var{from} is the\n\ +same as @var{to}; on some machines it is expensive to move between\n\ +registers if they are not general registers.\n\ +\n\ +If reload sees an insn consisting of a single @code{set} between two\n\ +hard registers, and if @code{TARGET_REGISTER_MOVE_COST} applied to their\n\ +classes returns a value of 2, reload does not check to ensure that the\n\ +constraints of the insn are met. Setting a cost of other than 2 will\n\ +allow reload to verify that the constraints are met. You should do this\n\ +if the @samp{mov@var{m}} pattern's constraints do not allow such copying.\n\ +\n\ +The default version of this function returns 2.", int, (enum machine_mode mode, reg_class_t from, reg_class_t to), default_register_move_cost) @@ -1785,7 +2953,27 @@ DEFHOOK license grant. Also, the documentation uses a different name for RCLASS. */ DEFHOOK (memory_move_cost, - "", + "This target hook should return the cost of moving data of mode @var{mode}\n\ +between a register of class @var{rclass} and memory; @var{in} is @code{false}\n\ +if the value is to be written to memory, @code{true} if it is to be read in.\n\ +This cost is relative to those in @code{TARGET_REGISTER_MOVE_COST}.\n\ +If moving between registers and memory is more expensive than between two\n\ +registers, you should add this target hook to express the relative cost.\n\ +\n\ +If you do not add this target hook, GCC uses a default cost of 4 plus\n\ +the cost of copying via a secondary reload register, if one is\n\ +needed. If your machine requires a secondary reload register to copy\n\ +between memory and a register of @var{rclass} but the reload mechanism is\n\ +more complex than copying via an intermediate, use this target hook to\n\ +reflect the actual cost of the move.\n\ +\n\ +GCC defines the function @code{memory_move_secondary_cost} if\n\ +secondary reloads are needed. It computes the costs due to copying via\n\ +a secondary register. If your machine copies from memory using a\n\ +secondary register in the conventional way but the default base value of\n\ +4 is not correct for your machine, use this target hook to add some other\n\ +value to the result of that function. The arguments to that function\n\ +are the same as to this target hook.", int, (enum machine_mode mode, reg_class_t rclass, bool in), default_memory_move_cost) @@ -1795,7 +2983,35 @@ DEFHOOK but it should prevent extending the lifetime of these registers. */ DEFHOOK (small_register_classes_for_mode_p, - "", + "Define this to return nonzero for machine modes for which the port has\n\ +small register classes. If this target hook returns nonzero for a given\n\ +@var{mode}, the compiler will try to minimize the lifetime of registers\n\ +in @var{mode}. The hook may be called with @code{VOIDmode} as argument.\n\ +In this case, the hook is expected to return nonzero if it returns nonzero\n\ +for any mode.\n\ +\n\ +On some machines, it is risky to let hard registers live across arbitrary\n\ +insns. Typically, these machines have instructions that require values\n\ +to be in specific registers (like an accumulator), and reload will fail\n\ +if the required hard register is used for another purpose across such an\n\ +insn.\n\ +\n\ +Passes before reload do not know which hard registers will be used\n\ +in an instruction, but the machine modes of the registers set or used in\n\ +the instruction are already known. And for some machines, register\n\ +classes are small for, say, integer registers but not for floating point\n\ +registers. For example, the AMD x86-64 architecture requires specific\n\ +registers for the legacy x86 integer instructions, but there are many\n\ +SSE registers for floating point operations. On such targets, a good\n\ +strategy may be to return nonzero from this hook for @code{INTEGRAL_MODE_P}\n\ +machine modes but zero for the SSE register classes.\n\ +\n\ +The default version of this hook returns false for any mode. It is always\n\ +safe to redefine this hook to return with a nonzero value. But if you\n\ +unnecessarily define it, you will reduce the amount of optimizations\n\ +that can be performed in some cases. If you do not define this hook\n\ +to return a nonzero value when it is required, the compiler will run out\n\ +of spill registers and print a fatal error message.", bool, (enum machine_mode mode), hook_bool_mode_false) @@ -1815,7 +3031,35 @@ DEFHOOKPOD not necessarily defined at this point. */ DEFHOOK (rtx_costs, - "", + "This target hook describes the relative costs of RTL expressions.\n\ +\n\ +The cost may depend on the precise form of the expression, which is\n\ +available for examination in @var{x}, and the fact that @var{x} appears\n\ +as operand @var{opno} of an expression with rtx code @var{outer_code}.\n\ +That is, the hook can assume that there is some rtx @var{y} such\n\ +that @samp{GET_CODE (@var{y}) == @var{outer_code}} and such that\n\ +either (a) @samp{XEXP (@var{y}, @var{opno}) == @var{x}} or\n\ +(b) @samp{XVEC (@var{y}, @var{opno})} contains @var{x}.\n\ +\n\ +@var{code} is @var{x}'s expression code---redundant, since it can be\n\ +obtained with @code{GET_CODE (@var{x})}.\n\ +\n\ +In implementing this hook, you can use the construct\n\ +@code{COSTS_N_INSNS (@var{n})} to specify a cost equal to @var{n} fast\n\ +instructions.\n\ +\n\ +On entry to the hook, @code{*@var{total}} contains a default estimate\n\ +for the cost of the expression. The hook should modify this value as\n\ +necessary. Traditionally, the default costs are @code{COSTS_N_INSNS (5)}\n\ +for multiplications, @code{COSTS_N_INSNS (7)} for division and modulus\n\ +operations, and @code{COSTS_N_INSNS (1)} for all other operations.\n\ +\n\ +When optimizing for code size, i.e.@: when @code{speed} is\n\ +false, this target hook should be used to estimate the relative\n\ +size cost of an expression, again relative to @code{COSTS_N_INSNS}.\n\ +\n\ +The hook returns true when all subexpressions of @var{x} have been\n\ +processed, and false when @code{rtx_cost} should recurse.", bool, (rtx x, int code, int outer_code, int opno, int *total, bool speed), hook_bool_rtx_int_int_int_intp_bool_false) @@ -1823,21 +3067,75 @@ DEFHOOK invalid addresses. */ DEFHOOK (address_cost, - "", + "This hook computes the cost of an addressing mode that contains\n\ +@var{address}. If not defined, the cost is computed from\n\ +the @var{address} expression and the @code{TARGET_RTX_COST} hook.\n\ +\n\ +For most CISC machines, the default cost is a good approximation of the\n\ +true cost of the addressing mode. However, on RISC machines, all\n\ +instructions normally have the same length and execution time. Hence\n\ +all addresses will have equal costs.\n\ +\n\ +In cases where more than one form of an address is known, the form with\n\ +the lowest cost will be used. If multiple forms have the same, lowest,\n\ +cost, the one that is the most complex will be used.\n\ +\n\ +For example, suppose an address that is equal to the sum of a register\n\ +and a constant is used twice in the same basic block. When this macro\n\ +is not defined, the address will be computed in a register and memory\n\ +references will be indirect through that register. On machines where\n\ +the cost of the addressing mode containing the sum is no higher than\n\ +that of a simple indirect reference, this will produce an additional\n\ +instruction and possibly require an additional register. Proper\n\ +specification of this macro eliminates this overhead for such machines.\n\ +\n\ +This hook is never called with an invalid address.\n\ +\n\ +On machines where an address involving more than one register is as\n\ +cheap as an address computation involving only one register, defining\n\ +@code{TARGET_ADDRESS_COST} to reflect this can cause two registers to\n\ +be live over a region of code where only one would have been if\n\ +@code{TARGET_ADDRESS_COST} were not defined in that manner. This effect\n\ +should be considered in the definition of this macro. Equivalent costs\n\ +should probably only be given to addresses with different numbers of\n\ +registers on machines with lots of registers.", int, (rtx address, enum machine_mode mode, addr_space_t as, bool speed), default_address_cost) /* Return where to allocate pseudo for a given hard register initial value. */ DEFHOOK (allocate_initial_value, - "", + "\n\ +When the initial value of a hard register has been copied in a pseudo\n\ +register, it is often not necessary to actually allocate another register\n\ +to this pseudo register, because the original hard register or a stack slot\n\ +it has been saved into can be used. @code{TARGET_ALLOCATE_INITIAL_VALUE}\n\ +is called at the start of register allocation once for each hard register\n\ +that had its initial value copied by using\n\ +@code{get_func_hard_reg_initial_val} or @code{get_hard_reg_initial_val}.\n\ +Possible values are @code{NULL_RTX}, if you don't want\n\ +to do any special allocation, a @code{REG} rtx---that would typically be\n\ +the hard register itself, if it is known not to be clobbered---or a\n\ +@code{MEM}.\n\ +If you are returning a @code{MEM}, this is only a hint for the allocator;\n\ +it might decide to use another register anyways.\n\ +You may use @code{current_function_is_leaf} or \n\ +@code{REG_N_SETS} in the hook to determine if the hard\n\ +register in question will not be clobbered.\n\ +The default value of this hook is @code{NULL}, which disables any special\n\ +allocation.", rtx, (rtx hard_reg), NULL) /* Return nonzero if evaluating UNSPEC X might cause a trap. FLAGS has the same meaning as in rtlanal.c: may_trap_p_1. */ DEFHOOK (unspec_may_trap_p, - "", + "This target hook returns nonzero if @var{x}, an @code{unspec} or\n\ +@code{unspec_volatile} operation, might cause a trap. Targets can use\n\ +this hook to enhance precision of analysis for @code{unspec} and\n\ +@code{unspec_volatile} operations. You may call @code{may_trap_p_1}\n\ +to analyze inner elements of @var{x} in which case @var{flags} should be\n\ +passed along.", int, (const_rtx x, unsigned flags), default_unspec_may_trap_p) @@ -1849,7 +3147,12 @@ DEFHOOK hook should return NULL_RTX. */ DEFHOOK (dwarf_register_span, - "", + "Given a register, this hook should return a parallel of registers to\n\ +represent where to find the register pieces. Define this hook if the\n\ +register and its mode are represented in Dwarf in non-contiguous\n\ +locations, or if the register should be represented in more than one\n\ +register in Dwarf. Otherwise, this hook should return @code{NULL_RTX}.\n\ +If not defined, the default is to return @code{NULL_RTX}.", rtx, (rtx reg), hook_rtx_rtx_null) @@ -1859,7 +3162,12 @@ DEFHOOK code, given the address of the table. */ DEFHOOK (init_dwarf_reg_sizes_extra, - "", + "If some registers are represented in Dwarf-2 unwind information in\n\ +multiple pieces, define this hook to fill in information about the\n\ +sizes of those pieces in the table used by the unwinder at runtime.\n\ +It will be called by @code{expand_builtin_init_dwarf_reg_sizes} after\n\ +filling in a single size corresponding to each hard register;\n\ +@var{address} is the address of the table.", void, (tree address), hook_void_tree) @@ -1872,7 +3180,18 @@ DEFHOOK at by the second argument should be set to -1. */ DEFHOOK (fixed_condition_code_regs, - "", + "On targets which do not use @code{(cc0)}, and which use a hard\n\ +register rather than a pseudo-register to hold condition codes, the\n\ +regular CSE passes are often not able to identify cases in which the\n\ +hard register is set to a common value. Use this hook to enable a\n\ +small pass which optimizes such cases. This hook should return true\n\ +to enable this pass, and it should set the integers to which its\n\ +arguments point to the hard register numbers used for condition codes.\n\ +When there is only one such register, as is true on most systems, the\n\ +integer pointed to by @var{p2} should be set to\n\ +@code{INVALID_REGNUM}.\n\ +\n\ +The default version of this hook returns false.", bool, (unsigned int *p1, unsigned int *p2), hook_bool_uintp_uintp_false) @@ -1883,7 +3202,16 @@ DEFHOOK VOIDmode. */ DEFHOOK (cc_modes_compatible, - "", + "On targets which use multiple condition code modes in class\n\ +@code{MODE_CC}, it is sometimes the case that a comparison can be\n\ +validly done in more than one mode. On such a system, define this\n\ +target hook to take two mode arguments and to return a mode in which\n\ +both comparisons may be validly done. If there is no such mode,\n\ +return @code{VOIDmode}.\n\ +\n\ +The default version of this hook checks whether the modes are the\n\ +same. If they are, it returns that mode. If they are different, it\n\ +returns @code{VOIDmode}.", enum machine_mode, (enum machine_mode m1, enum machine_mode m2), default_cc_modes_compatible) @@ -1891,34 +3219,59 @@ DEFHOOK delayed-branch scheduling. */ DEFHOOK (machine_dependent_reorg, - "", + "If non-null, this hook performs a target-specific pass over the\n\ +instruction stream. The compiler will run it at all optimization levels,\n\ +just before the point at which it normally does delayed-branch scheduling.\n\ +\n\ +The exact purpose of the hook varies from target to target. Some use\n\ +it to do transformations that are necessary for correctness, such as\n\ +laying out in-function constant pools or avoiding hardware hazards.\n\ +Others use it as an opportunity to do some machine-dependent optimizations.\n\ +\n\ +You need not implement the hook if it has nothing to do. The default\n\ +definition is null.", void, (void), NULL) /* Create the __builtin_va_list type. */ DEFHOOK (build_builtin_va_list, - "", + "This hook returns a type node for @code{va_list} for the target.\n\ +The default version of the hook returns @code{void*}.", tree, (void), std_build_builtin_va_list) /* Enumerate the va list variants. */ DEFHOOK (enum_va_list_p, - "", + "This target hook is used in function @code{c_common_nodes_and_builtins}\n\ +to iterate through the target specific builtin types for va_list. The\n\ +variable @var{idx} is used as iterator. @var{pname} has to be a pointer\n\ +to a @code{const char *} and @var{ptree} a pointer to a @code{tree} typed\n\ +variable.\n\ +The arguments @var{pname} and @var{ptree} are used to store the result of\n\ +this macro and are set to the name of the va_list builtin type and its\n\ +internal type.\n\ +If the return value of this macro is zero, then there is no more element.\n\ +Otherwise the @var{IDX} should be increased for the next call of this\n\ +macro to iterate through all types.", int, (int idx, const char **pname, tree *ptree), NULL) /* Get the cfun/fndecl calling abi __builtin_va_list type. */ DEFHOOK (fn_abi_va_list, - "", + "This hook returns the va_list type of the calling convention specified by\n\ +@var{fndecl}.\n\ +The default version of this hook returns @code{va_list_type_node}.", tree, (tree fndecl), std_fn_abi_va_list) /* Get the __builtin_va_list type dependent on input type. */ DEFHOOK (canonical_va_list_type, - "", + "This hook returns the va_list type of the calling convention specified by the\n\ +type of @var{type}. If @var{type} is not a valid va_list type, it returns\n\ +@code{NULL_TREE}.", tree, (tree type), std_canonical_va_list_type) @@ -1931,7 +3284,10 @@ DEFHOOK_UNDOC /* Gimplifies a VA_ARG_EXPR. */ DEFHOOK (gimplify_va_arg_expr, - "", + "This hook performs target-specific gimplification of\n\ +@code{VA_ARG_EXPR}. The first two parameters correspond to the\n\ +arguments to @code{va_arg}; the latter two are as in\n\ +@code{gimplify.c:gimplify_expr}.", tree, (tree valist, tree type, gimple_seq *pre_p, gimple_seq *post_p), std_gimplify_va_arg_expr) @@ -1942,13 +3298,26 @@ DEFHOOK or an error message if not. */ DEFHOOK (get_pch_validity, - "", + "This hook returns a pointer to the data needed by\n\ +@code{TARGET_PCH_VALID_P} and sets\n\ +@samp{*@var{sz}} to the size of the data in bytes.", void *, (size_t *sz), default_get_pch_validity) DEFHOOK (pch_valid_p, - "", + "This hook checks whether the options used to create a PCH file are\n\ +compatible with the current settings. It returns @code{NULL}\n\ +if so and a suitable error message if not. Error messages will\n\ +be presented to the user and must be localized using @samp{_(@var{msg})}.\n\ +\n\ +@var{data} is the data that was returned by @code{TARGET_GET_PCH_VALIDITY}\n\ +when the PCH file was created and @var{sz} is the size of that data in bytes.\n\ +It's safe to assume that the data was created by the same version of the\n\ +compiler, so no format checking is needed.\n\ +\n\ +The default definition of @code{default_pch_valid_p} should be\n\ +suitable for most targets.", const char *, (const void *data, size_t sz), default_pch_valid_p) @@ -1966,7 +3335,11 @@ to do anything here.", otherwise it returns an error message. */ DEFHOOK (check_pch_target_flags, - "", + "If this hook is nonnull, the default implementation of\n\ +@code{TARGET_PCH_VALID_P} will use it to check for compatible values\n\ +of @code{target_flags}. @var{pch_flags} specifies the value that\n\ +@code{target_flags} had when the PCH file was created. The return\n\ +value is the same as for @code{TARGET_PCH_VALID_P}.", const char *, (int pch_flags), NULL) /* True if the compiler should give an enum type only as many @@ -1974,7 +3347,12 @@ DEFHOOK that type. */ DEFHOOK (default_short_enums, - "", + "This target hook should return true if the compiler should give an\n\ +@code{enum} type only as many bytes as it takes to represent the range\n\ +of possible values of that type. It should return false if all\n\ +@code{enum} types should be allocated like @code{int}.\n\ +\n\ +The default is to return false.", bool, (void), hook_bool_void_false) @@ -1982,7 +3360,11 @@ DEFHOOK of the current frame into the built-in setjmp buffer. */ DEFHOOK (builtin_setjmp_frame_value, - "", + "This target hook should return an rtx that is used to store\n\ +the address of the current frame into the built in @code{setjmp} buffer.\n\ +The default value, @code{virtual_stack_vars_rtx}, is correct for most\n\ +machines. One reason you may need to define this target hook is if\n\ +@code{hard_frame_pointer_rtx} is the appropriate value on your machine.", rtx, (void), default_builtin_setjmp_frame_value) @@ -1990,7 +3372,14 @@ DEFHOOK the port wishes to automatically clobber for an asm. */ DEFHOOK (md_asm_clobbers, - "", + "This target hook should add to @var{clobbers} @code{STRING_CST} trees for\n\ +any hard regs the port wishes to automatically clobber for an asm.\n\ +It should return the result of the last @code{tree_cons} used to add a\n\ +clobber. The @var{outputs}, @var{inputs} and @var{clobber} lists are the\n\ +corresponding parameters to the asm and may be inspected to avoid\n\ +clobbering a register that is an input or output of the asm. You can use\n\ +@code{tree_overlaps_hard_reg_set}, declared in @file{tree.h}, to test\n\ +for overlap with regards to asm-declared registers.", tree, (tree outputs, tree inputs, tree clobbers), hook_tree_tree_tree_tree_3rd_identity) @@ -2001,7 +3390,9 @@ DEFHOOK the function is being declared as an int. */ DEFHOOK (dwarf_calling_convention, - "", + "Define this to enable the dwarf attribute @code{DW_AT_calling_convention} to\n\ +be emitted for each function. Instead of an integer return the enum\n\ +value for the @code{DW_CC_} tag.", int, (const_tree function), hook_int_const_tree_0) @@ -2014,7 +3405,19 @@ DEFHOOK to let the backend emit the call frame instructions. */ DEFHOOK (dwarf_handle_frame_unspec, - "", + "This target hook allows the backend to emit frame-related insns that\n\ +contain UNSPECs or UNSPEC_VOLATILEs. The DWARF 2 call frame debugging\n\ +info engine will invoke it on insns of the form\n\ +@smallexample\n\ +(set (reg) (unspec [@dots{}] UNSPEC_INDEX))\n\ +@end smallexample\n\ +and\n\ +@smallexample\n\ +(set (reg) (unspec_volatile [@dots{}] UNSPECV_INDEX)).\n\ +@end smallexample\n\ +to let the backend emit the call frame instructions. @var{label} is\n\ +the CFI label attached to the insn, @var{pattern} is the pattern of\n\ +the insn and @var{index} is @code{UNSPEC_INDEX} or @code{UNSPECV_INDEX}.", void, (const char *label, rtx pattern, int index), NULL) /* ??? Documenting this hook requires a GFDL license grant. */ @@ -2030,7 +3433,14 @@ DEFHOOK_UNDOC protection guard variable. The type of this DECL is ptr_type_node. */ DEFHOOK (stack_protect_guard, - "", + "This hook returns a @code{DECL} node for the external variable to use\n\ +for the stack protection guard. This variable is initialized by the\n\ +runtime to some random value and is used to initialize the guard value\n\ +that is placed at the top of the local stack frame. The type of this\n\ +variable must be @code{ptr_type_node}.\n\ +\n\ +The default version of this hook creates a variable called\n\ +@samp{__stack_chk_guard}, which is normally defined in @file{libgcc2.c}.", tree, (void), default_stack_protect_guard) @@ -2038,7 +3448,13 @@ DEFHOOK that is invoked when a check vs the guard variable fails. */ DEFHOOK (stack_protect_fail, - "", + "This hook returns a @code{CALL_EXPR} that alerts the runtime that the\n\ +stack protect guard variable has been modified. This expression should\n\ +involve a call to a @code{noreturn} function.\n\ +\n\ +The default version of this hook invokes a function called\n\ +@samp{__stack_chk_fail}, taking no arguments. This function is\n\ +normally defined in @file{libgcc2.c}.", tree, (void), default_external_stack_protect_fail) @@ -2046,7 +3462,16 @@ DEFHOOK otherwise it returns an error message. */ DEFHOOK (invalid_within_doloop, - "", + "\n\ +Take an instruction in @var{insn} and return NULL if it is valid within a\n\ +low-overhead loop, otherwise return a string explaining why doloop\n\ +could not be applied.\n\ +\n\ +Many targets use special registers for low-overhead looping. For any\n\ +instruction that clobbers these this function should return a string indicating\n\ +the reason why the doloop could not be applied.\n\ +By default, the RTL loop optimizer does not use a present doloop pattern for\n\ +loops containing function calls or branch on table instructions.", const char *, (const_rtx insn), default_invalid_within_doloop) @@ -2071,13 +3496,28 @@ DEFHOOK value. */ DEFHOOKPOD (const_anchor, - "", + "On some architectures it can take multiple instructions to synthesize\n\ +a constant. If there is another constant already in a register that\n\ +is close enough in value then it is preferable that the new constant\n\ +is computed from this register using immediate addition or\n\ +subtraction. We accomplish this through CSE. Besides the value of\n\ +the constant we also add a lower and an upper constant anchor to the\n\ +available expressions. These are then queried when encountering new\n\ +constants. The anchors are computed by rounding the constant up and\n\ +down to a multiple of the value of @code{TARGET_CONST_ANCHOR}.\n\ +@code{TARGET_CONST_ANCHOR} should be the maximum positive value\n\ +accepted by immediate-add plus one. We currently assume that the\n\ +value of @code{TARGET_CONST_ANCHOR} is a power of 2. For example, on\n\ +MIPS, where add-immediate takes a 16-bit signed value,\n\ +@code{TARGET_CONST_ANCHOR} is set to @samp{0x8000}. The default value\n\ +is zero, which disables this optimization.", unsigned HOST_WIDE_INT, 0) /* Defines, which target-dependent bits (upper 16) are used by port */ DEFHOOK (memmodel_check, - "", + "Validate target specific memory model mask bits. When NULL no target specific\n\ +memory model bits are allowed.", unsigned HOST_WIDE_INT, (unsigned HOST_WIDE_INT val), NULL) /* Defines an offset bitwise ored into shifted address to get corresponding @@ -2097,31 +3537,96 @@ HOOK_VECTOR (TARGET_CALLS, calls) DEFHOOK (promote_function_mode, - "", + "Like @code{PROMOTE_MODE}, but it is applied to outgoing function arguments or\n\ +function return values. The target hook should return the new mode\n\ +and possibly change @code{*@var{punsignedp}} if the promotion should\n\ +change signedness. This function is called only for scalar @emph{or\n\ +pointer} types.\n\ +\n\ +@var{for_return} allows to distinguish the promotion of arguments and\n\ +return values. If it is @code{1}, a return value is being promoted and\n\ +@code{TARGET_FUNCTION_VALUE} must perform the same promotions done here.\n\ +If it is @code{2}, the returned mode should be that of the register in\n\ +which an incoming parameter is copied, or the outgoing result is computed;\n\ +then the hook should return the same mode as @code{promote_mode}, though\n\ +the signedness may be different.\n\ +\n\ +@var{type} can be NULL when promoting function arguments of libcalls.\n\ +\n\ +The default is to not promote arguments and return values. You can\n\ +also define the hook to @code{default_promote_function_mode_always_promote}\n\ +if you would like to apply the same rules given by @code{PROMOTE_MODE}.", enum machine_mode, (const_tree type, enum machine_mode mode, int *punsignedp, const_tree funtype, int for_return), default_promote_function_mode) DEFHOOK (promote_prototypes, - "", + "This target hook returns @code{true} if an argument declared in a\n\ +prototype as an integral type smaller than @code{int} should actually be\n\ +passed as an @code{int}. In addition to avoiding errors in certain\n\ +cases of mismatch, it also makes for better code on certain machines.\n\ +The default is to not promote prototypes.", bool, (const_tree fntype), hook_bool_const_tree_false) DEFHOOK (struct_value_rtx, - "", + "This target hook should return the location of the structure value\n\ +address (normally a @code{mem} or @code{reg}), or 0 if the address is\n\ +passed as an ``invisible'' first argument. Note that @var{fndecl} may\n\ +be @code{NULL}, for libcalls. You do not need to define this target\n\ +hook if the address is always passed as an ``invisible'' first\n\ +argument.\n\ +\n\ +On some architectures the place where the structure value address\n\ +is found by the called function is not the same place that the\n\ +caller put it. This can be due to register windows, or it could\n\ +be because the function prologue moves it to a different place.\n\ +@var{incoming} is @code{1} or @code{2} when the location is needed in\n\ +the context of the called function, and @code{0} in the context of\n\ +the caller.\n\ +\n\ +If @var{incoming} is nonzero and the address is to be found on the\n\ +stack, return a @code{mem} which refers to the frame pointer. If\n\ +@var{incoming} is @code{2}, the result is being used to fetch the\n\ +structure value address at the beginning of a function. If you need\n\ +to emit adjusting code, you should do it at this point.", rtx, (tree fndecl, int incoming), hook_rtx_tree_int_null) DEFHOOK (return_in_memory, - "", + "This target hook should return a nonzero value to say to return the\n\ +function value in memory, just as large structures are always returned.\n\ +Here @var{type} will be the data type of the value, and @var{fntype}\n\ +will be the type of the function doing the returning, or @code{NULL} for\n\ +libcalls.\n\ +\n\ +Note that values of mode @code{BLKmode} must be explicitly handled\n\ +by this function. Also, the option @option{-fpcc-struct-return}\n\ +takes effect regardless of this macro. On most systems, it is\n\ +possible to leave the hook undefined; this causes a default\n\ +definition to be used, whose value is the constant 1 for @code{BLKmode}\n\ +values, and 0 otherwise.\n\ +\n\ +Do not use this hook to indicate that structures and unions should always\n\ +be returned in memory. You should instead use @code{DEFAULT_PCC_STRUCT_RETURN}\n\ +to indicate this.", bool, (const_tree type, const_tree fntype), default_return_in_memory) DEFHOOK (return_in_msb, - "", + "This hook should return true if values of type @var{type} are returned\n\ +at the most significant end of a register (in other words, if they are\n\ +padded at the least significant end). You can assume that @var{type}\n\ +is returned in a register; the caller is required to check this.\n\ +\n\ +Note that the register provided by @code{TARGET_FUNCTION_VALUE} must\n\ +be able to hold the complete return value. For example, if a 1-, 2-\n\ +or 3-byte structure is returned at the most significant end of a\n\ +4-byte register, @code{TARGET_FUNCTION_VALUE} should provide an\n\ +@code{SImode} rtx.", bool, (const_tree type), hook_bool_const_tree_false) @@ -2130,28 +3635,81 @@ DEFHOOK from __builtin_va_arg. */ DEFHOOK (pass_by_reference, - "", + "This target hook should return @code{true} if an argument at the\n\ +position indicated by @var{cum} should be passed by reference. This\n\ +predicate is queried after target independent reasons for being\n\ +passed by reference, such as @code{TREE_ADDRESSABLE (type)}.\n\ +\n\ +If the hook returns true, a copy of that argument is made in memory and a\n\ +pointer to the argument is passed instead of the argument itself.\n\ +The pointer is passed in whatever way is appropriate for passing a pointer\n\ +to that type.", bool, (cumulative_args_t cum, enum machine_mode mode, const_tree type, bool named), hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false) DEFHOOK (expand_builtin_saveregs, - "", + "If defined, this hook produces the machine-specific code for a call to\n\ +@code{__builtin_saveregs}. This code will be moved to the very\n\ +beginning of the function, before any parameter access are made. The\n\ +return value of this function should be an RTX that contains the value\n\ +to use as the return of @code{__builtin_saveregs}.", rtx, (void), default_expand_builtin_saveregs) /* Returns pretend_argument_size. */ DEFHOOK (setup_incoming_varargs, - "", + "This target hook offers an alternative to using\n\ +@code{__builtin_saveregs} and defining the hook\n\ +@code{TARGET_EXPAND_BUILTIN_SAVEREGS}. Use it to store the anonymous\n\ +register arguments into the stack so that all the arguments appear to\n\ +have been passed consecutively on the stack. Once this is done, you can\n\ +use the standard implementation of varargs that works for machines that\n\ +pass all their arguments on the stack.\n\ +\n\ +The argument @var{args_so_far} points to the @code{CUMULATIVE_ARGS} data\n\ +structure, containing the values that are obtained after processing the\n\ +named arguments. The arguments @var{mode} and @var{type} describe the\n\ +last named argument---its machine mode and its data type as a tree node.\n\ +\n\ +The target hook should do two things: first, push onto the stack all the\n\ +argument registers @emph{not} used for the named arguments, and second,\n\ +store the size of the data thus pushed into the @code{int}-valued\n\ +variable pointed to by @var{pretend_args_size}. The value that you\n\ +store here will serve as additional offset for setting up the stack\n\ +frame.\n\ +\n\ +Because you must generate code to push the anonymous arguments at\n\ +compile time without knowing their data types,\n\ +@code{TARGET_SETUP_INCOMING_VARARGS} is only useful on machines that\n\ +have just a single category of argument register and use it uniformly\n\ +for all data types.\n\ +\n\ +If the argument @var{second_time} is nonzero, it means that the\n\ +arguments of the function are being analyzed for the second time. This\n\ +happens for an inline function, which is not actually compiled until the\n\ +end of the source file. The hook @code{TARGET_SETUP_INCOMING_VARARGS} should\n\ +not generate any instructions in this case.", void, (cumulative_args_t args_so_far, enum machine_mode mode, tree type, int *pretend_args_size, int second_time), default_setup_incoming_varargs) DEFHOOK (strict_argument_naming, - "", + "Define this hook to return @code{true} if the location where a function\n\ +argument is passed depends on whether or not it is a named argument.\n\ +\n\ +This hook controls how the @var{named} argument to @code{TARGET_FUNCTION_ARG}\n\ +is set for varargs and stdarg functions. If this hook returns\n\ +@code{true}, the @var{named} argument is always true for named\n\ +arguments, and false for unnamed arguments. If it returns @code{false},\n\ +but @code{TARGET_PRETEND_OUTGOING_VARARGS_NAMED} returns @code{true},\n\ +then all arguments are treated as named. Otherwise, all named arguments\n\ +except the last are treated as named.\n\ +\n\ +You need not define this hook if it always returns @code{false}.", bool, (cumulative_args_t ca), hook_bool_CUMULATIVE_ARGS_false) @@ -2160,7 +3718,12 @@ DEFHOOK targetm.calls.strict_argument_naming(). */ DEFHOOK (pretend_outgoing_varargs_named, - "", + "If you need to conditionally change ABIs so that one works with\n\ +@code{TARGET_SETUP_INCOMING_VARARGS}, but the other works like neither\n\ +@code{TARGET_SETUP_INCOMING_VARARGS} nor @code{TARGET_STRICT_ARGUMENT_NAMING} was\n\ +defined, then define this hook to return @code{true} if\n\ +@code{TARGET_SETUP_INCOMING_VARARGS} is used, @code{false} otherwise.\n\ +Otherwise, you should not define this hook.", bool, (cumulative_args_t ca), default_pretend_outgoing_varargs_named) @@ -2168,7 +3731,16 @@ DEFHOOK should be passed as two scalars. */ DEFHOOK (split_complex_arg, - "", + "This hook should return true if parameter of type @var{type} are passed\n\ +as two scalar parameters. By default, GCC will attempt to pack complex\n\ +arguments into the target's word size. Some ABIs require complex arguments\n\ +to be split and treated as their individual components. For example, on\n\ +AIX64, complex floats should be passed in a pair of floating point\n\ +registers, even though a complex float would fit in one 64-bit floating\n\ +point register.\n\ +\n\ +The default value of this hook is @code{NULL}, which is treated as always\n\ +false.", bool, (const_tree type), NULL) /* Return true if type T, mode MODE, may not be passed in registers, @@ -2177,7 +3749,10 @@ DEFHOOK Need audit to verify that this is the case. */ DEFHOOK (must_pass_in_stack, - "", + "This target hook should return @code{true} if we should not pass @var{type}\n\ +solely in registers. The file @file{expr.h} defines a\n\ +definition that is usually appropriate, refer to @file{expr.h} for additional\n\ +documentation.", bool, (enum machine_mode mode, const_tree type), must_pass_in_stack_var_size_or_pad) @@ -2186,7 +3761,16 @@ DEFHOOK the caller. It is never called for TYPE requiring constructors. */ DEFHOOK (callee_copies, - "", + "The function argument described by the parameters to this hook is\n\ +known to be passed by reference. The hook should return true if the\n\ +function argument should be copied by the callee instead of copied\n\ +by the caller.\n\ +\n\ +For any argument for which the hook returns true, if it can be\n\ +determined that the argument is not modified, then a copy need\n\ +not be generated.\n\ +\n\ +The default version of this hook always returns false.", bool, (cumulative_args_t cum, enum machine_mode mode, const_tree type, bool named), hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false) @@ -2196,7 +3780,22 @@ DEFHOOK in registers; the balance is therefore passed on the stack. */ DEFHOOK (arg_partial_bytes, - "", + "This target hook returns the number of bytes at the beginning of an\n\ +argument that must be put in registers. The value must be zero for\n\ +arguments that are passed entirely in registers or that are entirely\n\ +pushed on the stack.\n\ +\n\ +On some machines, certain arguments must be passed partially in\n\ +registers and partially in memory. On these machines, typically the\n\ +first few words of arguments are passed in registers, and the rest\n\ +on the stack. If a multi-word argument (a @code{double} or a\n\ +structure) crosses that boundary, its first few words must be passed\n\ +in registers and the rest must be pushed. This macro tells the\n\ +compiler when this occurs, and how many bytes should go in registers.\n\ +\n\ +@code{TARGET_FUNCTION_ARG} for these arguments should return the first\n\ +register to be used by the caller for this argument; likewise\n\ +@code{TARGET_FUNCTION_INCOMING_ARG}, for the called function.", int, (cumulative_args_t cum, enum machine_mode mode, tree type, bool named), hook_int_CUMULATIVE_ARGS_mode_tree_bool_0) @@ -2205,7 +3804,15 @@ DEFHOOK argument. */ DEFHOOK (function_arg_advance, - "", + "This hook updates the summarizer variable pointed to by @var{ca} to\n\ +advance past an argument in the argument list. The values @var{mode},\n\ +@var{type} and @var{named} describe that argument. Once this is done,\n\ +the variable @var{cum} is suitable for analyzing the @emph{following}\n\ +argument with @code{TARGET_FUNCTION_ARG}, etc.\n\ +\n\ +This hook need not do anything if the argument in question was passed\n\ +on the stack. The compiler knows how to track the amount of stack space\n\ +used for arguments without any special help.", void, (cumulative_args_t ca, enum machine_mode mode, const_tree type, bool named), default_function_arg_advance) @@ -2216,7 +3823,56 @@ DEFHOOK argument. */ DEFHOOK (function_arg, - "", + "Return an RTX indicating whether a function argument is passed in a\n\ +register and if so, which register.\n\ +\n\ +The arguments are @var{ca}, which summarizes all the previous\n\ +arguments; @var{mode}, the machine mode of the argument; @var{type},\n\ +the data type of the argument as a tree node or 0 if that is not known\n\ +(which happens for C support library functions); and @var{named},\n\ +which is @code{true} for an ordinary argument and @code{false} for\n\ +nameless arguments that correspond to @samp{@dots{}} in the called\n\ +function's prototype. @var{type} can be an incomplete type if a\n\ +syntax error has previously occurred.\n\ +\n\ +The return value is usually either a @code{reg} RTX for the hard\n\ +register in which to pass the argument, or zero to pass the argument\n\ +on the stack.\n\ +\n\ +The value of the expression can also be a @code{parallel} RTX@. This is\n\ +used when an argument is passed in multiple locations. The mode of the\n\ +@code{parallel} should be the mode of the entire argument. The\n\ +@code{parallel} holds any number of @code{expr_list} pairs; each one\n\ +describes where part of the argument is passed. In each\n\ +@code{expr_list} the first operand must be a @code{reg} RTX for the hard\n\ +register in which to pass this part of the argument, and the mode of the\n\ +register RTX indicates how large this part of the argument is. The\n\ +second operand of the @code{expr_list} is a @code{const_int} which gives\n\ +the offset in bytes into the entire argument of where this part starts.\n\ +As a special exception the first @code{expr_list} in the @code{parallel}\n\ +RTX may have a first operand of zero. This indicates that the entire\n\ +argument is also stored on the stack.\n\ +\n\ +The last time this hook is called, it is called with @code{MODE ==\n\ +VOIDmode}, and its result is passed to the @code{call} or @code{call_value}\n\ +pattern as operands 2 and 3 respectively.\n\ +\n\ +@cindex @file{stdarg.h} and register arguments\n\ +The usual way to make the ISO library @file{stdarg.h} work on a\n\ +machine where some arguments are usually passed in registers, is to\n\ +cause nameless arguments to be passed on the stack instead. This is\n\ +done by making @code{TARGET_FUNCTION_ARG} return 0 whenever\n\ +@var{named} is @code{false}.\n\ +\n\ +@cindex @code{TARGET_MUST_PASS_IN_STACK}, and @code{TARGET_FUNCTION_ARG}\n\ +@cindex @code{REG_PARM_STACK_SPACE}, and @code{TARGET_FUNCTION_ARG}\n\ +You may use the hook @code{targetm.calls.must_pass_in_stack}\n\ +in the definition of this macro to determine if this argument is of a\n\ +type that must be passed in the stack. If @code{REG_PARM_STACK_SPACE}\n\ +is not defined and @code{TARGET_FUNCTION_ARG} returns nonzero for such an\n\ +argument, the compiler will abort. If @code{REG_PARM_STACK_SPACE} is\n\ +defined, the argument will be computed in the stack and then loaded into\n\ +a register.", rtx, (cumulative_args_t ca, enum machine_mode mode, const_tree type, bool named), default_function_arg) @@ -2225,14 +3881,28 @@ DEFHOOK location where the argument will appear to the callee. */ DEFHOOK (function_incoming_arg, - "", + "Define this hook if the target machine has ``register windows'', so\n\ +that the register in which a function sees an arguments is not\n\ +necessarily the same as the one in which the caller passed the\n\ +argument.\n\ +\n\ +For such machines, @code{TARGET_FUNCTION_ARG} computes the register in\n\ +which the caller passes the value, and\n\ +@code{TARGET_FUNCTION_INCOMING_ARG} should be defined in a similar\n\ +fashion to tell the function being called where the arguments will\n\ +arrive.\n\ +\n\ +If @code{TARGET_FUNCTION_INCOMING_ARG} is not defined,\n\ +@code{TARGET_FUNCTION_ARG} serves both purposes.", rtx, (cumulative_args_t ca, enum machine_mode mode, const_tree type, bool named), default_function_incoming_arg) DEFHOOK (function_arg_boundary, - "", + "This hook returns the alignment boundary, in bits, of an argument\n\ +with the specified mode and type. The default hook returns\n\ +@code{PARM_BOUNDARY} for all arguments.", unsigned int, (enum machine_mode mode, const_tree type), default_function_arg_boundary) @@ -2249,7 +3919,9 @@ value.", is not allowed for this 'val' argument; NULL otherwise. */ DEFHOOK (invalid_arg_for_unprototyped_fn, - "", + "If defined, this macro returns the diagnostic message when it is\n\ +illegal to pass argument @var{val} to function @var{funcdecl}\n\ +with prototype @var{typelist}.", const char *, (const_tree typelist, const_tree funcdecl, const_tree val), hook_invalid_arg_for_unprototyped_fn) @@ -2257,7 +3929,47 @@ DEFHOOK specified by FN_DECL_OR_TYPE with a return type of RET_TYPE. */ DEFHOOK (function_value, - "", + "\n\ +Define this to return an RTX representing the place where a function\n\ +returns or receives a value of data type @var{ret_type}, a tree node\n\ +representing a data type. @var{fn_decl_or_type} is a tree node\n\ +representing @code{FUNCTION_DECL} or @code{FUNCTION_TYPE} of a\n\ +function being called. If @var{outgoing} is false, the hook should\n\ +compute the register in which the caller will see the return value.\n\ +Otherwise, the hook should return an RTX representing the place where\n\ +a function returns a value.\n\ +\n\ +On many machines, only @code{TYPE_MODE (@var{ret_type})} is relevant.\n\ +(Actually, on most machines, scalar values are returned in the same\n\ +place regardless of mode.) The value of the expression is usually a\n\ +@code{reg} RTX for the hard register where the return value is stored.\n\ +The value can also be a @code{parallel} RTX, if the return value is in\n\ +multiple places. See @code{TARGET_FUNCTION_ARG} for an explanation of the\n\ +@code{parallel} form. Note that the callee will populate every\n\ +location specified in the @code{parallel}, but if the first element of\n\ +the @code{parallel} contains the whole return value, callers will use\n\ +that element as the canonical location and ignore the others. The m68k\n\ +port uses this type of @code{parallel} to return pointers in both\n\ +@samp{%a0} (the canonical location) and @samp{%d0}.\n\ +\n\ +If @code{TARGET_PROMOTE_FUNCTION_RETURN} returns true, you must apply\n\ +the same promotion rules specified in @code{PROMOTE_MODE} if\n\ +@var{valtype} is a scalar type.\n\ +\n\ +If the precise function being called is known, @var{func} is a tree\n\ +node (@code{FUNCTION_DECL}) for it; otherwise, @var{func} is a null\n\ +pointer. This makes it possible to use a different value-returning\n\ +convention for specific functions when all their calls are\n\ +known.\n\ +\n\ +Some target machines have ``register windows'' so that the register in\n\ +which a function returns its value is not the same as the one in which\n\ +the caller sees the value. For such machines, you should return\n\ +different RTX depending on @var{outgoing}.\n\ +\n\ +@code{TARGET_FUNCTION_VALUE} is not used for return values with\n\ +aggregate data types, because these are returned in another way. See\n\ +@code{TARGET_STRUCT_VALUE_RTX} and related macros, below.", rtx, (const_tree ret_type, const_tree fn_decl_or_type, bool outgoing), default_function_value) @@ -2265,7 +3977,14 @@ DEFHOOK calling the function FN_NAME. */ DEFHOOK (libcall_value, - "", + "Define this hook if the back-end needs to know the name of the libcall\n\ +function in order to determine where the result should be returned.\n\ +\n\ +The mode of the result is given by @var{mode} and the name of the called\n\ +library function is given by @var{fun}. The hook should return an RTX\n\ +representing the place where the library function result will be returned.\n\ +\n\ +If this hook is not defined, then LIBCALL_VALUE will be used.", rtx, (enum machine_mode mode, const_rtx fun), default_libcall_value) @@ -2273,7 +3992,18 @@ DEFHOOK a function value as seen by the caller. */ DEFHOOK (function_value_regno_p, - "", + "A target hook that return @code{true} if @var{regno} is the number of a hard\n\ +register in which the values of called function may come back.\n\ +\n\ +A register whose use for returning values is limited to serving as the\n\ +second of a pair (for a value of type @code{double}, say) need not be\n\ +recognized by this target hook.\n\ +\n\ +If the machine has register windows, so that the caller and the called\n\ +function use different registers for the return value, this target hook\n\ +should recognize only the caller's register numbers.\n\ +\n\ +If this hook is not defined, then FUNCTION_VALUE_REGNO_P will be used.", bool, (const unsigned int regno), default_function_value_regno_p) @@ -2288,21 +4018,32 @@ DEFHOOK_UNDOC /* Update the current function stack boundary if needed. */ DEFHOOK (update_stack_boundary, - "", + "Define this macro to update the current function stack boundary if\n\ +necessary.", void, (void), NULL) /* Handle stack alignment and return an rtx for Dynamic Realign Argument Pointer if necessary. */ DEFHOOK (get_drap_rtx, - "", + "This hook should return an rtx for Dynamic Realign Argument Pointer (DRAP) if a\n\ +different argument pointer register is needed to access the function's\n\ +argument list due to stack realignment. Return @code{NULL} if no DRAP\n\ +is needed.", rtx, (void), NULL) /* Return true if all function parameters should be spilled to the stack. */ DEFHOOK (allocate_stack_slots_for_args, - "", + "When optimization is disabled, this hook indicates whether or not\n\ +arguments should be allocated to stack slots. Normally, GCC allocates\n\ +stacks slots for arguments when not optimizing in order to make\n\ +debugging easier. However, when a function is declared with\n\ +@code{__attribute__((naked))}, there is no stack frame, and the compiler\n\ +cannot safely move arguments from the registers in which they are passed\n\ +to the stack. Therefore, this hook should return true in general, but\n\ +false for naked functions. The default implementation always returns true.", bool, (void), hook_bool_void_true) @@ -2310,7 +4051,25 @@ DEFHOOK then it should be for the callee; otherwise for the caller. */ DEFHOOK (static_chain, - "", + "This hook replaces the use of @code{STATIC_CHAIN_REGNUM} et al for\n\ +targets that may use different static chain locations for different\n\ +nested functions. This may be required if the target has function\n\ +attributes that affect the calling conventions of the function and\n\ +those calling conventions use different static chain locations.\n\ +\n\ +The default version of this hook uses @code{STATIC_CHAIN_REGNUM} et al.\n\ +\n\ +If the static chain is passed in memory, this hook should be used to\n\ +provide rtx giving @code{mem} expressions that denote where they are stored.\n\ +Often the @code{mem} expression as seen by the caller will be at an offset\n\ +from the stack pointer and the @code{mem} expression as seen by the callee\n\ +will be at an offset from the frame pointer.\n\ +@findex stack_pointer_rtx\n\ +@findex frame_pointer_rtx\n\ +@findex arg_pointer_rtx\n\ +The variables @code{stack_pointer_rtx}, @code{frame_pointer_rtx}, and\n\ +@code{arg_pointer_rtx} will have been initialized and should be used\n\ +to refer to those items.", rtx, (const_tree fndecl, bool incoming_p), default_static_chain) @@ -2318,14 +4077,35 @@ DEFHOOK static chain value of CHAIN. */ DEFHOOK (trampoline_init, - "", + "This hook is called to initialize a trampoline.\n\ +@var{m_tramp} is an RTX for the memory block for the trampoline; @var{fndecl}\n\ +is the @code{FUNCTION_DECL} for the nested function; @var{static_chain} is an\n\ +RTX for the static chain value that should be passed to the function\n\ +when it is called.\n\ +\n\ +If the target defines @code{TARGET_ASM_TRAMPOLINE_TEMPLATE}, then the\n\ +first thing this hook should do is emit a block move into @var{m_tramp}\n\ +from the memory block returned by @code{assemble_trampoline_template}.\n\ +Note that the block move need only cover the constant parts of the\n\ +trampoline. If the target isolates the variable parts of the trampoline\n\ +to the end, not all @code{TRAMPOLINE_SIZE} bytes need be copied.\n\ +\n\ +If the target requires any other actions, such as flushing caches or\n\ +enabling stack execution, these actions should be performed after\n\ +initializing the trampoline proper.", void, (rtx m_tramp, tree fndecl, rtx static_chain), default_trampoline_init) /* Adjust the address of the trampoline in a target-specific way. */ DEFHOOK (trampoline_adjust_address, - "", + "This hook should perform any machine-specific adjustment in\n\ +the address of the trampoline. Its argument contains the address of the\n\ +memory block that was passed to @code{TARGET_TRAMPOLINE_INIT}. In case\n\ +the address to be used for a function call should be different from the\n\ +address at which the template was stored, the different address should\n\ +be returned; otherwise @var{addr} should be returned unchanged.\n\ +If this hook is not defined, @var{addr} will be used for function calls.", rtx, (rtx addr), NULL) /* Return the number of bytes of its own arguments that a function @@ -2334,7 +4114,41 @@ DEFHOOK /* ??? tm.texi has no types for the parameters. */ DEFHOOK (return_pops_args, - "", + "This target hook returns the number of bytes of its own arguments that\n\ +a function pops on returning, or 0 if the function pops no arguments\n\ +and the caller must therefore pop them all after the function returns.\n\ +\n\ +@var{fundecl} is a C variable whose value is a tree node that describes\n\ +the function in question. Normally it is a node of type\n\ +@code{FUNCTION_DECL} that describes the declaration of the function.\n\ +From this you can obtain the @code{DECL_ATTRIBUTES} of the function.\n\ +\n\ +@var{funtype} is a C variable whose value is a tree node that\n\ +describes the function in question. Normally it is a node of type\n\ +@code{FUNCTION_TYPE} that describes the data type of the function.\n\ +From this it is possible to obtain the data types of the value and\n\ +arguments (if known).\n\ +\n\ +When a call to a library function is being considered, @var{fundecl}\n\ +will contain an identifier node for the library function. Thus, if\n\ +you need to distinguish among various library functions, you can do so\n\ +by their names. Note that ``library function'' in this context means\n\ +a function used to perform arithmetic, whose name is known specially\n\ +in the compiler and was not mentioned in the C code being compiled.\n\ +\n\ +@var{size} is the number of bytes of arguments passed on the\n\ +stack. If a variable number of bytes is passed, it is zero, and\n\ +argument popping will always be the responsibility of the calling function.\n\ +\n\ +On the VAX, all functions always pop their arguments, so the definition\n\ +of this macro is @var{size}. On the 68000, using the standard\n\ +calling convention, no functions pop their arguments, so the value of\n\ +the macro is always 0 in this case. But an alternative calling\n\ +convention is available in which functions that take a fixed number of\n\ +arguments pop them but other functions (such as @code{printf}) pop\n\ +nothing (the caller pops all). When this convention is in use,\n\ +@var{funtype} is examined to determine whether a function takes a fixed\n\ +number of arguments.", int, (tree fundecl, tree funtype, int size), default_return_pops_args) @@ -2364,7 +4178,9 @@ HOOK_VECTOR_END (calls) to TOTYPE is not allowed, NULL otherwise. */ DEFHOOK (invalid_conversion, - "", + "If defined, this macro returns the diagnostic message when it is\n\ +invalid to convert from @var{fromtype} to @var{totype}, or @code{NULL}\n\ +if validity should be determined by the front end.", const char *, (const_tree fromtype, const_tree totype), hook_constcharptr_const_tree_const_tree_null) @@ -2372,7 +4188,10 @@ DEFHOOK not permitted on TYPE, NULL otherwise. */ DEFHOOK (invalid_unary_op, - "", + "If defined, this macro returns the diagnostic message when it is\n\ +invalid to apply operation @var{op} (where unary plus is denoted by\n\ +@code{CONVERT_EXPR}) to an operand of type @var{type}, or @code{NULL}\n\ +if validity should be determined by the front end.", const char *, (int op, const_tree type), hook_constcharptr_int_const_tree_null) @@ -2380,7 +4199,10 @@ DEFHOOK is not permitted on TYPE1 and TYPE2, NULL otherwise. */ DEFHOOK (invalid_binary_op, - "", + "If defined, this macro returns the diagnostic message when it is\n\ +invalid to apply operation @var{op} to operands of types @var{type1}\n\ +and @var{type2}, or @code{NULL} if validity should be determined by\n\ +the front end.", const char *, (int op, const_tree type1, const_tree type2), hook_constcharptr_int_const_tree_const_tree_null) @@ -2388,7 +4210,10 @@ DEFHOOK function parameter type, NULL otherwise. */ DEFHOOK (invalid_parameter_type, - "", + "If defined, this macro returns the diagnostic message when it is\n\ +invalid for functions to include parameters of type @var{type},\n\ +or @code{NULL} if validity should be determined by\n\ +the front end. This is currently used only by the C and C++ front ends.", const char *, (const_tree type), hook_constcharptr_const_tree_null) @@ -2396,7 +4221,10 @@ DEFHOOK function return type, NULL otherwise. */ DEFHOOK (invalid_return_type, - "", + "If defined, this macro returns the diagnostic message when it is\n\ +invalid for functions to have return type @var{type},\n\ +or @code{NULL} if validity should be determined by\n\ +the front end. This is currently used only by the C and C++ front ends.", const char *, (const_tree type), hook_constcharptr_const_tree_null) @@ -2405,7 +4233,12 @@ DEFHOOK or NULL_TREE otherwise. */ DEFHOOK (promoted_type, - "", + "If defined, this target hook returns the type to which values of\n\ +@var{type} should be promoted when they appear in expressions,\n\ +analogous to the integer promotions, or @code{NULL_TREE} to use the\n\ +front end's normal promotion rules. This hook is useful when there are\n\ +target-specific types with special promotion rules.\n\ +This is currently used only by the C and C++ front ends.", tree, (const_tree type), hook_tree_const_tree_null) @@ -2414,7 +4247,12 @@ DEFHOOK the standard conversion rules. */ DEFHOOK (convert_to_type, - "", + "If defined, this hook returns the result of converting @var{expr} to\n\ +@var{type}. It should return the converted expression,\n\ +or @code{NULL_TREE} to apply the front end's normal conversion rules.\n\ +This hook is useful when there are target-specific types with special\n\ +conversion rules.\n\ +This is currently used only by the C and C++ front ends.", tree, (tree type, tree expr), hook_tree_tree_tree_null) @@ -2496,14 +4334,104 @@ DEFHOOK be accessed using BLKmode. */ DEFHOOK (member_type_forces_blk, - "", + "Return true if a structure, union or array containing @var{field} should\n\ +be accessed using @code{BLKMODE}.\n\ +\n\ +If @var{field} is the only field in the structure, @var{mode} is its\n\ +mode, otherwise @var{mode} is VOIDmode. @var{mode} is provided in the\n\ +case where structures of one field would require the structure's mode to\n\ +retain the field's mode.\n\ +\n\ +Normally, this is not needed.", bool, (const_tree field, enum machine_mode mode), default_member_type_forces_blk) /* Return the class for a secondary reload, and fill in extra information. */ DEFHOOK (secondary_reload, - "", + "Many machines have some registers that cannot be copied directly to or\n\ +from memory or even from other types of registers. An example is the\n\ +@samp{MQ} register, which on most machines, can only be copied to or\n\ +from general registers, but not memory. Below, we shall be using the\n\ +term 'intermediate register' when a move operation cannot be performed\n\ +directly, but has to be done by copying the source into the intermediate\n\ +register first, and then copying the intermediate register to the\n\ +destination. An intermediate register always has the same mode as\n\ +source and destination. Since it holds the actual value being copied,\n\ +reload might apply optimizations to re-use an intermediate register\n\ +and eliding the copy from the source when it can determine that the\n\ +intermediate register still holds the required value.\n\ +\n\ +Another kind of secondary reload is required on some machines which\n\ +allow copying all registers to and from memory, but require a scratch\n\ +register for stores to some memory locations (e.g., those with symbolic\n\ +address on the RT, and those with certain symbolic address on the SPARC\n\ +when compiling PIC)@. Scratch registers need not have the same mode\n\ +as the value being copied, and usually hold a different value than\n\ +that being copied. Special patterns in the md file are needed to\n\ +describe how the copy is performed with the help of the scratch register;\n\ +these patterns also describe the number, register class(es) and mode(s)\n\ +of the scratch register(s).\n\ +\n\ +In some cases, both an intermediate and a scratch register are required.\n\ +\n\ +For input reloads, this target hook is called with nonzero @var{in_p},\n\ +and @var{x} is an rtx that needs to be copied to a register of class\n\ +@var{reload_class} in @var{reload_mode}. For output reloads, this target\n\ +hook is called with zero @var{in_p}, and a register of class @var{reload_class}\n\ +needs to be copied to rtx @var{x} in @var{reload_mode}.\n\ +\n\ +If copying a register of @var{reload_class} from/to @var{x} requires\n\ +an intermediate register, the hook @code{secondary_reload} should\n\ +return the register class required for this intermediate register.\n\ +If no intermediate register is required, it should return NO_REGS.\n\ +If more than one intermediate register is required, describe the one\n\ +that is closest in the copy chain to the reload register.\n\ +\n\ +If scratch registers are needed, you also have to describe how to\n\ +perform the copy from/to the reload register to/from this\n\ +closest intermediate register. Or if no intermediate register is\n\ +required, but still a scratch register is needed, describe the\n\ +copy from/to the reload register to/from the reload operand @var{x}.\n\ +\n\ +You do this by setting @code{sri->icode} to the instruction code of a pattern\n\ +in the md file which performs the move. Operands 0 and 1 are the output\n\ +and input of this copy, respectively. Operands from operand 2 onward are\n\ +for scratch operands. These scratch operands must have a mode, and a\n\ +single-register-class\n\ +@c [later: or memory]\n\ +output constraint.\n\ +\n\ +When an intermediate register is used, the @code{secondary_reload}\n\ +hook will be called again to determine how to copy the intermediate\n\ +register to/from the reload operand @var{x}, so your hook must also\n\ +have code to handle the register class of the intermediate operand.\n\ +\n\ +@c [For later: maybe we'll allow multi-alternative reload patterns -\n\ +@c the port maintainer could name a mov pattern that has clobbers -\n\ +@c and match the constraints of input and output to determine the required\n\ +@c alternative. A restriction would be that constraints used to match\n\ +@c against reloads registers would have to be written as register class\n\ +@c constraints, or we need a new target macro / hook that tells us if an\n\ +@c arbitrary constraint can match an unknown register of a given class.\n\ +@c Such a macro / hook would also be useful in other places.]\n\ +\n\ +\n\ +@var{x} might be a pseudo-register or a @code{subreg} of a\n\ +pseudo-register, which could either be in a hard register or in memory.\n\ +Use @code{true_regnum} to find out; it will return @minus{}1 if the pseudo is\n\ +in memory and the hard register number if it is in a register.\n\ +\n\ +Scratch operands in memory (constraint @code{\"=m\"} / @code{\"=&m\"}) are\n\ +currently not supported. For the time being, you will have to continue\n\ +to use @code{SECONDARY_MEMORY_NEEDED} for that purpose.\n\ +\n\ +@code{copy_cost} also uses this target hook to find out how values are\n\ +copied. If you want it to include some extra cost for the need to allocate\n\ +(a) scratch register(s), set @code{sri->extra_cost} to the additional cost.\n\ +Or if two dependent moves are supposed to have a lower cost than the sum\n\ +of the individual moves due to expected fortuitous scheduling and/or special\n\ +forwarding logic, you can set @code{sri->extra_cost} to a negative amount.", reg_class_t, (bool in_p, rtx x, reg_class_t reload_class, enum machine_mode reload_mode, secondary_reload_info *sri), @@ -2513,7 +4441,37 @@ DEFHOOK return the class of reg to actually use. */ DEFHOOK (preferred_reload_class, - "", + "A target hook that places additional restrictions on the register class\n\ +to use when it is necessary to copy value @var{x} into a register in class\n\ +@var{rclass}. The value is a register class; perhaps @var{rclass}, or perhaps\n\ +another, smaller class.\n\ +\n\ +The default version of this hook always returns value of @code{rclass} argument.\n\ +\n\ +Sometimes returning a more restrictive class makes better code. For\n\ +example, on the 68000, when @var{x} is an integer constant that is in range\n\ +for a @samp{moveq} instruction, the value of this macro is always\n\ +@code{DATA_REGS} as long as @var{rclass} includes the data registers.\n\ +Requiring a data register guarantees that a @samp{moveq} will be used.\n\ +\n\ +One case where @code{TARGET_PREFERRED_RELOAD_CLASS} must not return\n\ +@var{rclass} is if @var{x} is a legitimate constant which cannot be\n\ +loaded into some register class. By returning @code{NO_REGS} you can\n\ +force @var{x} into a memory location. For example, rs6000 can load\n\ +immediate values into general-purpose registers, but does not have an\n\ +instruction for loading an immediate value into a floating-point\n\ +register, so @code{TARGET_PREFERRED_RELOAD_CLASS} returns @code{NO_REGS} when\n\ +@var{x} is a floating-point constant. If the constant can't be loaded\n\ +into any kind of register, code generation will be better if\n\ +@code{TARGET_LEGITIMATE_CONSTANT_P} makes the constant illegitimate instead\n\ +of using @code{TARGET_PREFERRED_RELOAD_CLASS}.\n\ +\n\ +If an insn has pseudos in it after register allocation, reload will go\n\ +through the alternatives and call repeatedly @code{TARGET_PREFERRED_RELOAD_CLASS}\n\ +to find the best one. Returning @code{NO_REGS}, in this case, makes\n\ +reload add a @code{!} in front of the constraint: the x86 back-end uses\n\ +this feature to discourage usage of 387 registers when math is done in\n\ +the SSE registers (and vice versa).", reg_class_t, (rtx x, reg_class_t rclass), default_preferred_reload_class) @@ -2522,14 +4480,33 @@ DEFHOOK input reloads. */ DEFHOOK (preferred_output_reload_class, - "", + "Like @code{TARGET_PREFERRED_RELOAD_CLASS}, but for output reloads instead of\n\ +input reloads.\n\ +\n\ +The default version of this hook always returns value of @code{rclass}\n\ +argument.\n\ +\n\ +You can also use @code{TARGET_PREFERRED_OUTPUT_RELOAD_CLASS} to discourage\n\ +reload from using some alternatives, like @code{TARGET_PREFERRED_RELOAD_CLASS}.", reg_class_t, (rtx x, reg_class_t rclass), default_preferred_output_reload_class) DEFHOOK (class_likely_spilled_p, - "", + "A target hook which returns @code{true} if pseudos that have been assigned\n\ +to registers of class @var{rclass} would likely be spilled because\n\ +registers of @var{rclass} are needed for spill registers.\n\ +\n\ +The default version of this target hook returns @code{true} if @var{rclass}\n\ +has exactly one register and @code{false} otherwise. On most machines, this\n\ +default should be used. For generally register-starved machines, such as\n\ +i386, or machines with right register constraints, such as SH, this hook\n\ +can be used to avoid excessive spilling.\n\ +\n\ +This hook is also used by some of the global intra-procedural code\n\ +transformations to throtle code motion, to avoid increasing register\n\ +pressure.", bool, (reg_class_t rclass), default_class_likely_spilled_p) @@ -2537,7 +4514,20 @@ DEFHOOK needed to represent mode MODE in a register of class RCLASS. */ DEFHOOK (class_max_nregs, - "", + "A target hook returns the maximum number of consecutive registers\n\ +of class @var{rclass} needed to hold a value of mode @var{mode}.\n\ +\n\ +This is closely related to the macro @code{HARD_REGNO_NREGS}. In fact,\n\ +the value returned by @code{TARGET_CLASS_MAX_NREGS (@var{rclass},\n\ +@var{mode})} target hook should be the maximum value of\n\ +@code{HARD_REGNO_NREGS (@var{regno}, @var{mode})} for all @var{regno}\n\ +values in the class @var{rclass}.\n\ +\n\ +This target hook helps control the handling of multiple-word values\n\ +in the reload pass.\n\ +\n\ +The default version of this target hook returns the size of @var{mode}\n\ +in words.", unsigned char, (reg_class_t rclass, enum machine_mode mode), default_class_max_nregs) @@ -2560,7 +4550,12 @@ DEFHOOK processing while initializing for variable expansion. */ DEFHOOK (expand_to_rtl_hook, - "", + "This hook is called just before expansion into rtl, allowing the target\n\ +to perform additional initializations or analysis before the expansion.\n\ +For example, the rs6000 port uses it to allocate a scratch stack slot\n\ +for use in copying SDmode values between memory and floating point\n\ +registers whenever the function being expanded has any SDmode\n\ +usage.", void, (void), hook_void_void) @@ -2569,7 +4564,8 @@ DEFHOOK but will be later. */ DEFHOOK (instantiate_decls, - "", + "This hook allows the backend to perform additional instantiations on rtl\n\ +that are not actually in any insns yet, but will be later.", void, (void), hook_void_void) @@ -2577,7 +4573,13 @@ DEFHOOK in peephole2. */ DEFHOOK (hard_regno_scratch_ok, - "", + "This target hook should return @code{true} if it is OK to use a hard register\n\ +@var{regno} as scratch reg in peephole2.\n\ +\n\ +One common use of this macro is to prevent using of a register that\n\ +is not saved by a prologue in an interrupt handler.\n\ +\n\ +The default version of this hook always returns @code{true}.", bool, (unsigned int regno), default_hard_regno_scratch_ok) @@ -2585,14 +4587,38 @@ DEFHOOK use a jump-table instead of a tree of conditional branches. */ DEFHOOK (case_values_threshold, - "", + "This function return the smallest number of different values for which it\n\ +is best to use a jump-table instead of a tree of conditional branches.\n\ +The default is four for machines with a @code{casesi} instruction and\n\ +five otherwise. This is best for most machines.", unsigned int, (void), default_case_values_threshold) /* Retutn true if a function must have and use a frame pointer. */ DEFHOOK (frame_pointer_required, - "", + "This target hook should return @code{true} if a function must have and use\n\ +a frame pointer. This target hook is called in the reload pass. If its return\n\ +value is @code{true} the function will have a frame pointer.\n\ +\n\ +This target hook can in principle examine the current function and decide\n\ +according to the facts, but on most machines the constant @code{false} or the\n\ +constant @code{true} suffices. Use @code{false} when the machine allows code\n\ +to be generated with no frame pointer, and doing so saves some time or space.\n\ +Use @code{true} when there is no possible advantage to avoiding a frame\n\ +pointer.\n\ +\n\ +In certain cases, the compiler does not know how to produce valid code\n\ +without a frame pointer. The compiler recognizes those cases and\n\ +automatically gives the function a frame pointer regardless of what\n\ +@code{TARGET_FRAME_POINTER_REQUIRED} returns. You don't need to worry about\n\ +them.\n\ +\n\ +In a function that does not require a frame pointer, the frame pointer\n\ +register can be allocated for ordinary usage, unless you mark it as a\n\ +fixed register. See @code{FIXED_REGISTERS} for more information.\n\ +\n\ +Default return value is @code{false}.", bool, (void), hook_bool_void_false) @@ -2600,7 +4626,14 @@ DEFHOOK from-reg with register number to-reg. */ DEFHOOK (can_eliminate, - "", + "This target hook should returns @code{true} if the compiler is allowed to\n\ +try to replace register number @var{from_reg} with register number\n\ +@var{to_reg}. This target hook need only be defined if @code{ELIMINABLE_REGS}\n\ +is defined, and will usually be @code{true}, since most of the cases\n\ +preventing register elimination are things that the compiler already\n\ +knows about.\n\ +\n\ +Default return value is @code{true}.", bool, (const int from_reg, const int to_reg), hook_bool_const_int_const_int_true) @@ -2609,7 +4642,35 @@ DEFHOOK target. */ DEFHOOK (conditional_register_usage, - "", + "This hook may conditionally modify five variables\n\ +@code{fixed_regs}, @code{call_used_regs}, @code{global_regs},\n\ +@code{reg_names}, and @code{reg_class_contents}, to take into account\n\ +any dependence of these register sets on target flags. The first three\n\ +of these are of type @code{char []} (interpreted as Boolean vectors).\n\ +@code{global_regs} is a @code{const char *[]}, and\n\ +@code{reg_class_contents} is a @code{HARD_REG_SET}. Before the macro is\n\ +called, @code{fixed_regs}, @code{call_used_regs},\n\ +@code{reg_class_contents}, and @code{reg_names} have been initialized\n\ +from @code{FIXED_REGISTERS}, @code{CALL_USED_REGISTERS},\n\ +@code{REG_CLASS_CONTENTS}, and @code{REGISTER_NAMES}, respectively.\n\ +@code{global_regs} has been cleared, and any @option{-ffixed-@var{reg}},\n\ +@option{-fcall-used-@var{reg}} and @option{-fcall-saved-@var{reg}}\n\ +command options have been applied.\n\ +\n\ +@cindex disabling certain registers\n\ +@cindex controlling register usage\n\ +If the usage of an entire class of registers depends on the target\n\ +flags, you may indicate this to GCC by using this macro to modify\n\ +@code{fixed_regs} and @code{call_used_regs} to 1 for each of the\n\ +registers in the classes which should not be used by GCC@. Also define\n\ +the macro @code{REG_CLASS_FROM_LETTER} / @code{REG_CLASS_FROM_CONSTRAINT}\n\ +to return @code{NO_REGS} if it\n\ +is called with a letter for a class that shouldn't be used.\n\ +\n\ +(However, if this class is not included in @code{GENERAL_REGS} and all\n\ +of the insn patterns whose constraints permit this class are\n\ +controlled by target switches, then GCC will automatically avoid using\n\ +these registers when the target switches are opposed to them.)", void, (void), hook_void_void) @@ -2636,28 +4697,37 @@ HOOK_VECTOR (TARGET_CXX, cxx) /* Return the integer type used for guard variables. */ DEFHOOK (guard_type, - "", + "Define this hook to override the integer type used for guard variables.\n\ +These are used to implement one-time construction of static objects. The\n\ +default is long_long_integer_type_node.", tree, (void), default_cxx_guard_type) /* Return true if only the low bit of the guard should be tested. */ DEFHOOK (guard_mask_bit, - "", + "This hook determines how guard variables are used. It should return\n\ +@code{false} (the default) if the first byte should be used. A return value of\n\ +@code{true} indicates that only the least significant bit should be used.", bool, (void), hook_bool_void_false) /* Returns the size of the array cookie for an array of type. */ DEFHOOK (get_cookie_size, - "", + "This hook returns the size of the cookie to use when allocating an array\n\ +whose elements have the indicated @var{type}. Assumes that it is already\n\ +known that a cookie is needed. The default is\n\ +@code{max(sizeof (size_t), alignof(type))}, as defined in section 2.7 of the\n\ +IA64/Generic C++ ABI@.", tree, (tree type), default_cxx_get_cookie_size) /* Returns true if the element size should be stored in the array cookie. */ DEFHOOK (cookie_has_size, - "", + "This hook should return @code{true} if the element size should be stored in\n\ +array cookies. The default is to return @code{false}.", bool, (void), hook_bool_void_false) @@ -2665,13 +4735,20 @@ DEFHOOK deciding if a class should be exported or imported. */ DEFHOOK (import_export_class, - "", + "If defined by a backend this hook allows the decision made to export\n\ +class @var{type} to be overruled. Upon entry @var{import_export}\n\ +will contain 1 if the class is going to be exported, @minus{}1 if it is going\n\ +to be imported and 0 otherwise. This function should return the\n\ +modified value and perform any other actions necessary to support the\n\ +backend's targeted operating system.", int, (tree type, int import_export), NULL) /* Returns true if constructors and destructors return "this". */ DEFHOOK (cdtor_returns_this, - "", + "This hook should return @code{true} if constructors and destructors return\n\ +the address of the object created/destroyed. The default is to return\n\ +@code{false}.", bool, (void), hook_bool_void_false) @@ -2680,7 +4757,13 @@ DEFHOOK itself. Returning true is the behavior required by the Itanium C++ ABI. */ DEFHOOK (key_method_may_be_inline, - "", + "This hook returns true if the key method for a class (i.e., the method\n\ +which, if defined in the current translation unit, causes the virtual\n\ +table to be emitted) may be an inline function. Under the standard\n\ +Itanium C++ ABI the key method may be an inline function so long as\n\ +the function is not declared inline in the class definition. Under\n\ +some variants of the ABI, an inline function can never be the key\n\ +method. The default is to return @code{true}.", bool, (void), hook_bool_void_true) @@ -2702,7 +4785,11 @@ DEFHOOK only one translation unit will not be COMDAT. */ DEFHOOK (class_data_always_comdat, - "", + "This hook returns true (the default) if virtual tables and other\n\ +similar implicit class data objects are always COMDAT if they have\n\ +external linkage. If this hook returns false, then class data for\n\ +classes whose virtual table will be emitted in only one translation\n\ +unit will not be COMDAT.", bool, (void), hook_bool_void_true) @@ -2711,7 +4798,9 @@ DEFHOOK false if it should not be COMDAT. */ DEFHOOK (library_rtti_comdat, - "", + "This hook returns true (the default) if the RTTI information for\n\ +the basic types which is defined in the C++ runtime should always\n\ +be COMDAT, false if it should not be COMDAT.", bool, (void), hook_bool_void_true) @@ -2719,7 +4808,9 @@ DEFHOOK destructors. */ DEFHOOK (use_aeabi_atexit, - "", + "This hook returns true if @code{__aeabi_atexit} (as defined by the ARM EABI)\n\ +should be used to register static destructors when @option{-fuse-cxa-atexit}\n\ +is in effect. The default is to return false to use @code{__cxa_atexit}.", bool, (void), hook_bool_void_false) @@ -2727,7 +4818,11 @@ DEFHOOK __cxa_atexit to register static destructors. */ DEFHOOK (use_atexit_for_cxa_atexit, - "", + "This hook returns true if the target @code{atexit} function can be used\n\ +in the same manner as @code{__cxa_atexit} to register C++ static\n\ +destructors. This requires that @code{atexit}-registered functions in\n\ +shared libraries are run in the correct order when the libraries are\n\ +unloaded. The default is to return false.", bool, (void), hook_bool_void_false) @@ -2755,47 +4850,66 @@ HOOK_VECTOR (TARGET_EMUTLS, emutls) /* Name of the address and common functions. */ DEFHOOKPOD (get_address, - "", + "Contains the name of the helper function that uses a TLS control\n\ +object to locate a TLS instance. The default causes libgcc's\n\ +emulated TLS helper function to be used.", const char *, "__builtin___emutls_get_address") DEFHOOKPOD (register_common, - "", + "Contains the name of the helper function that should be used at\n\ +program startup to register TLS objects that are implicitly\n\ +initialized to zero. If this is @code{NULL}, all TLS objects will\n\ +have explicit initializers. The default causes libgcc's emulated TLS\n\ +registration function to be used.", const char *, "__builtin___emutls_register_common") /* Prefixes for proxy variable and template. */ DEFHOOKPOD (var_section, - "", + "Contains the name of the section in which TLS control variables should\n\ +be placed. The default of @code{NULL} allows these to be placed in\n\ +any section.", const char *, NULL) DEFHOOKPOD (tmpl_section, - "", + "Contains the name of the section in which TLS initializers should be\n\ +placed. The default of @code{NULL} allows these to be placed in any\n\ +section.", const char *, NULL) /* Prefixes for proxy variable and template. */ DEFHOOKPOD (var_prefix, - "", + "Contains the prefix to be prepended to TLS control variable names.\n\ +The default of @code{NULL} uses a target-specific prefix.", const char *, NULL) DEFHOOKPOD (tmpl_prefix, - "", + "Contains the prefix to be prepended to TLS initializer objects. The\n\ +default of @code{NULL} uses a target-specific prefix.", const char *, NULL) /* Function to generate field definitions of the proxy variable. */ DEFHOOK (var_fields, - "", + "Specifies a function that generates the FIELD_DECLs for a TLS control\n\ +object type. @var{type} is the RECORD_TYPE the fields are for and\n\ +@var{name} should be filled with the structure tag, if the default of\n\ +@code{__emutls_object} is unsuitable. The default creates a type suitable\n\ +for libgcc's emulated TLS function.", tree, (tree type, tree *name), default_emutls_var_fields) /* Function to initialize a proxy variable. */ DEFHOOK (var_init, - "", + "Specifies a function that generates the CONSTRUCTOR to initialize a\n\ +TLS control object. @var{var} is the TLS control object, @var{decl}\n\ +is the TLS object and @var{tmpl_addr} is the address of the\n\ +initializer. The default initializes libgcc's emulated TLS control object.", tree, (tree var, tree decl, tree tmpl_addr), default_emutls_var_init) @@ -2803,13 +4917,16 @@ DEFHOOK proxy variable. */ DEFHOOKPOD (var_align_fixed, - "", + "Specifies whether the alignment of TLS control variable objects is\n\ +fixed and should not be increased as some backends may do to optimize\n\ +single objects. The default is false.", bool, false) /* Whether we can emit debug information for TLS vars. */ DEFHOOKPOD (debug_form_tls_address, - "", + "Specifies whether a DWARF @code{DW_OP_form_tls_address} location descriptor\n\ +may be used to describe emulated TLS control objects.", bool, false) HOOK_VECTOR_END (emutls) @@ -2823,28 +4940,43 @@ HOOK_VECTOR (TARGET_OPTION_HOOKS, target_option_hooks) DECL_FUNCTION_SPECIFIC_TARGET in the function decl node. */ DEFHOOK (valid_attribute_p, - "", + "This hook is called to parse @code{attribute(target(\"...\"))}, which\n\ +allows setting target-specific options on individual functions.\n\ +These function-specific options may differ\n\ +from the options specified on the command line. The hook should return\n\ +@code{true} if the options are valid.\n\ +\n\ +The hook should set the @code{DECL_FUNCTION_SPECIFIC_TARGET} field in\n\ +the function declaration to hold a pointer to a target-specific\n\ +@code{struct cl_target_option} structure.", bool, (tree fndecl, tree name, tree args, int flags), default_target_option_valid_attribute_p) /* Function to save any extra target state in the target options structure. */ DEFHOOK (save, - "", + "This hook is called to save any additional target-specific information\n\ +in the @code{struct cl_target_option} structure for function-specific\n\ +options.\n\ +@xref{Option file format}.", void, (struct cl_target_option *ptr), NULL) /* Function to restore any extra target state from the target options structure. */ DEFHOOK (restore, - "", + "This hook is called to restore any additional target-specific\n\ +information in the @code{struct cl_target_option} structure for\n\ +function-specific options.", void, (struct cl_target_option *ptr), NULL) /* Function to print any extra target state from the target options structure. */ DEFHOOK (print, - "", + "This hook is called to print any additional target-specific\n\ +information in the @code{struct cl_target_option} structure for\n\ +function-specific options.", void, (FILE *file, int indent, struct cl_target_option *ptr), NULL) /* Function to parse arguments to be validated for #pragma target, and to @@ -2853,14 +4985,27 @@ DEFHOOK true if the options are valid, and set the current state. */ DEFHOOK (pragma_parse, - "", + "This target hook parses the options for @code{#pragma GCC target}, which\n\ +sets the target-specific options for functions that occur later in the\n\ +input stream. The options accepted should be the same as those handled by the\n\ +@code{TARGET_OPTION_VALID_ATTRIBUTE_P} hook.", bool, (tree args, tree pop_target), default_target_option_pragma_parse) /* Do option overrides for the target. */ DEFHOOK (override, - "", + "Sometimes certain combinations of command options do not make sense on\n\ +a particular target machine. You can override the hook\n\ +@code{TARGET_OPTION_OVERRIDE} to take account of this. This hooks is called\n\ +once just after all the command options have been parsed.\n\ +\n\ +Don't use this hook to turn on various extra optimizations for\n\ +@option{-O}. That is what @code{TARGET_OPTION_OPTIMIZATION} is for.\n\ +\n\ +If you need to do something whenever the optimization level is\n\ +changed via the optimize attribute or pragma, see\n\ +@code{TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE}", void, (void), hook_void_void) @@ -2870,7 +5015,11 @@ DEFHOOK that is, they are compiled for different target machines. */ DEFHOOK (function_versions, - "", + "This target hook returns @code{true} if @var{DECL1} and @var{DECL2} are\n\ +versions of the same function. @var{DECL1} and @var{DECL2} are function\n\ +versions if and only if they have the same function signature and\n\ +different target specific attributes, that is, they are compiled for\n\ +different target machines.", bool, (tree decl1, tree decl2), hook_bool_tree_tree_false) @@ -2879,7 +5028,10 @@ DEFHOOK #define HOOK_PREFIX "TARGET_" DEFHOOK (can_inline_p, - "", + "This target hook returns @code{false} if the @var{caller} function\n\ +cannot inline @var{callee}, based on target specific information. By\n\ +default, inlining is not allowed if the callee function has function\n\ +specific target options and the caller does not use the same options.", bool, (tree caller, tree callee), default_target_can_inline_p) @@ -2890,7 +5042,12 @@ HOOK_VECTOR_END (target_option) bits in the bitmap passed in. */ DEFHOOK (extra_live_on_entry, - "", + "Add any hard registers to @var{regs} that are live on entry to the\n\ +function. This hook only needs to be defined to provide registers that\n\ +cannot be found by examination of FUNCTION_ARG_REGNO_P, the callee saved\n\ +registers, STATIC_CHAIN_INCOMING_REGNUM, STATIC_CHAIN_REGNUM,\n\ +TARGET_STRUCT_VALUE_RTX, FRAME_POINTER_REGNUM, EH_USES,\n\ +FRAME_POINTER_REGNUM, ARG_POINTER_REGNUM, and the PIC_OFFSET_TABLE_REGNUM.", void, (bitmap regs), hook_void_bitmap) @@ -2914,7 +5071,16 @@ DEFHOOK /* Determine the type of unwind info to emit for debugging. */ DEFHOOK (debug_unwind_info, - "", + "This hook defines the mechanism that will be used for describing frame\n\ +unwind information to the debugger. Normally the hook will return\n\ +@code{UI_DWARF2} if DWARF 2 debug information is enabled, and\n\ +return @code{UI_NONE} otherwise.\n\ +\n\ +A target may return @code{UI_DWARF2} even when DWARF 2 debug information\n\ +is disabled in order to always output DWARF 2 frame information.\n\ +\n\ +A target may return @code{UI_TARGET} if it has ABI specified unwind tables.\n\ +This will suppress generation of the normal debug frame unwind information.", enum unwind_info_type, (void), default_debug_unwind_info) @@ -2922,7 +5088,25 @@ DEFHOOK defined at this time. */ DEFHOOK (canonicalize_comparison, - "", + "On some machines not all possible comparisons are defined, but you can\n\ +convert an invalid comparison into a valid one. For example, the Alpha\n\ +does not have a @code{GT} comparison, but you can use an @code{LT}\n\ +comparison instead and swap the order of the operands.\n\ +\n\ +On such machines, implement this hook to do any required conversions.\n\ +@var{code} is the initial comparison code and @var{op0} and @var{op1}\n\ +are the left and right operands of the comparison, respectively. If\n\ +@var{op0_preserve_value} is @code{true} the implementation is not\n\ +allowed to change the value of @var{op0} since the value might be used\n\ +in RTXs which aren't comparisons. E.g. the implementation is not\n\ +allowed to swap operands in that case.\n\ +\n\ +GCC will not assume that the comparison resulting from this macro is\n\ +valid but will see if the resulting insn matches a pattern in the\n\ +@file{md} file.\n\ +\n\ +You need not to implement this hook if it would never change the\n\ +comparison code or operands.", void, (int *code, rtx *op0, rtx *op1, bool op0_preserve_value), default_canonicalize_comparison) @@ -2939,59 +5123,90 @@ DEFHOOKPOD and then using ASM_OUTPUT_SKIP to allocate the space. */ DEFHOOKPOD (have_switchable_bss_sections, - "", + "This flag is true if we can create zeroed data by switching to a BSS\n\ +section and then using @code{ASM_OUTPUT_SKIP} to allocate the space.\n\ +This is true on most ELF targets.", bool, false) /* True if "native" constructors and destructors are supported, false if we're using collect2 for the job. */ DEFHOOKPOD (have_ctors_dtors, - "", + "This value is true if the target supports some ``native'' method of\n\ +collecting constructors and destructors to be run at startup and exit.\n\ +It is false if we must use @command{collect2}.", bool, false) /* True if thread-local storage is supported. */ DEFHOOKPOD (have_tls, - "", + "Contains the value true if the target supports thread-local storage.\n\ +The default value is false.", bool, false) /* True if a small readonly data section is supported. */ DEFHOOKPOD (have_srodata_section, - "", + "Contains the value true if the target places read-only\n\ +``small data'' into a separate section. The default value is false.", bool, false) /* True if EH frame info sections should be zero-terminated. */ DEFHOOKPOD (terminate_dw2_eh_frame_info, - "", + "Contains the value true if the target should add a zero word onto the\n\ +end of a Dwarf-2 frame info section when used for exception handling.\n\ +Default value is false if @code{EH_FRAME_SECTION_NAME} is defined, and\n\ +true otherwise.", bool, true) /* True if #NO_APP should be emitted at the beginning of assembly output. */ DEFHOOKPOD (asm_file_start_app_off, - "", + "If this flag is true, the text of the macro @code{ASM_APP_OFF} will be\n\ +printed as the very first line in the assembly file, unless\n\ +@option{-fverbose-asm} is in effect. (If that macro has been defined\n\ +to the empty string, this variable has no effect.) With the normal\n\ +definition of @code{ASM_APP_OFF}, the effect is to notify the GNU\n\ +assembler that it need not bother stripping comments or extra\n\ +whitespace from its input. This allows it to work a bit faster.\n\ +\n\ +The default is false. You should not set it to true unless you have\n\ +verified that your port does not generate any extra whitespace or\n\ +comments that will cause GAS to issue errors in NO_APP mode.", bool, false) /* True if output_file_directive should be called for main_input_filename at the beginning of assembly output. */ DEFHOOKPOD (asm_file_start_file_directive, - "", + "If this flag is true, @code{output_file_directive} will be called\n\ +for the primary source file, immediately after printing\n\ +@code{ASM_APP_OFF} (if that is enabled). Most ELF assemblers expect\n\ +this to be done. The default is false.", bool, false) /* True if the target is allowed to reorder memory accesses unless synchronization is explicitly requested. */ DEFHOOKPOD (relaxed_ordering, - "", + "If set to @code{true}, means that the target's memory model does not\n\ +guarantee that loads which do not depend on one another will access\n\ +main memory in the order of the instruction stream; if ordering is\n\ +important, an explicit memory barrier must be used. This is true of\n\ +many recent processors which implement a policy of ``relaxed,''\n\ +``weak,'' or ``release'' memory consistency, such as Alpha, PowerPC,\n\ +and ia64. The default is @code{false}.", bool, false) /* Returns true if we should generate exception tables for use with the ARM EABI. The effects the encoding of function exception specifications. */ DEFHOOKPOD (arm_eabi_unwinder, - "", + "This flag should be set to @code{true} on targets that use an ARM EABI\n\ +based unwinding library, and @code{false} on other targets. This effects\n\ +the format of unwinding tables, and how the unwinder in entered after\n\ +running a cleanup. The default is @code{false}.", bool, false) DEFHOOKPOD -- 2.11.4.GIT