--- gcc/gcc.texinfo 2018/04/24 16:45:37 1.1 +++ gcc/gcc.texinfo 2018/04/24 16:52:39 1.1.1.8 @@ -6,7 +6,7 @@ @ifinfo This file documents the use and the internals of the GNU compiler. -Copyright (C) 1988 Free Software Foundation, Inc. +Copyright (C) 1988, 1989 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice @@ -21,13 +21,13 @@ notice identical to this one except for @end ignore Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided also that the -section entitled ``GNU CC General Public License'' is included exactly as +section entitled ``GNU General Public License'' is included exactly as in the original, and provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, -except that the section entitled ``GNU CC General Public License'' and +except that the section entitled ``GNU General Public License'' and this permission notice may be included in translations approved by the Free Software Foundation instead of in the original English. @end ifinfo @@ -39,12 +39,12 @@ Free Software Foundation instead of in t @sp 2 @center Richard M. Stallman @sp 3 -@center last updated 3 October 1988 +@center last updated 12 September 1989 @sp 1 -@center for version 1.29 +@center for version 1.36 @page @vskip 0pt plus 1filll -Copyright @copyright{} 1988 Free Software Foundation, Inc. +Copyright @copyright{} 1988, 1989 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice @@ -52,13 +52,13 @@ are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided also that the -section entitled ``GNU CC General Public License'' is included exactly as +section entitled ``GNU General Public License'' is included exactly as in the original, and provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, -except that the section entitled ``GNU CC General Public License'' and +} (if the target machine has preincrement addressing). When the constraint letter @samp{o} is used, the reload pass may -generate instructions which copy a nonoffsetable address into an index +generate instructions which copy a nonoffsettable address into an index register. The idea is that the register can be used as a replacement -offsetable address. But this method requires that there be patterns +offsettable address. But this method requires that there be patterns to copy any kind of address into a register. Auto-increment and auto-decrement addresses are an exception; there need not be an instruction that can copy such an address into a register, because @@ -4869,7 +6158,7 @@ This is the range permitted as a shift c instructions. @item @samp{F} -An immediate floating operand (expression code @samp{const_double}) is +An immediate floating operand (expression code @code{const_double}) is allowed. @item @samp{G}, @samp{H} @@ -4912,7 +6201,8 @@ input-output operand. Matching constraints work only in circumstances like that add insn. More precisely, the matching constraint must appear in an input-only operand and the operand that it matches must be an output-only operand -with a lower number. +with a lower number. Thus, operand @var{n} must have @samp{=} in its +constraint. For operands to match in a particular case usually means that they are identical-looking RTL expressions. But in a few special cases @@ -4925,8 +6215,8 @@ use the output-operand's number when pri An operand that is a valid memory address is allowed. This is for ``load address'' and ``push address'' instructions. -If @samp{p} is used in the constraint, the test-function in the -@samp{match_operand} must be @code{address_operand}. +@samp{p} in the constraint must be accompanies by @code{address_operand} +as the predicate in the @code{match_operand}. @end table In order to have valid assembler code, each operand must satisfy @@ -5009,7 +6299,7 @@ registers is safe provided its predicate An operand whose predicate accepts only constant values is safe provided its constraints include the letter @samp{i}. If any possible constant value is accepted, then nothing less than @samp{i} will do; -if the predicate is more selective, than the constraints may also be +if the predicate is more selective, then the constraints may also be more selective. @item @@ -5020,14 +6310,15 @@ compiler knows how to copy a register in proper class in order to make an instruction valid. @item -A nonoffsetable memory reference can be reloaded by copying the +A nonoffsettable memory reference can be reloaded by copying the address into a register. So if the constraint uses the letter @samp{o}, all memory references are taken care of. @item -A constant operand can be reloaded by storing it in memory; it then -becomes an offsetable memory reference. So if the constraint uses the -letters @samp{o} or @samp{m}, constant operands are not a problem. +A constant operand can be reloaded by allocating space in memory to +hold it as preinitialized data. Then the memory reference can be used +in place of the constant. So if the constraint uses the letters +@samp{o} or @samp{m}, constant operands are not a problem. @end itemize If the operand's predicate can recognize registers, but the constraint does @@ -5086,12 +6377,12 @@ When operands must be copied into regist never choose this alternative as the one to strive for. @end table -When an insn pattern has multiple alternatives in its constraints, -often the appearance of the assembler code determined mostly by which +When an insn pattern has multiple alternatives in its constraints, often +the appearance of the assembler code is determined mostly by which alternative was matched. When this is so, the C code for writing the assembler code can use the variable @code{which_alternative}, which is -the ordinal number of the alternative that was actually satisfied -(0 for the first, 1 for the second alternative, etc.). For example: +the ordinal number of the alternative that was actually satisfied (0 for +the first, 1 for the second alternative, etc.). For example: @example (define_insn "" @@ -5213,12 +6504,14 @@ refer to its address. They would have c For such machines, instead of writing @samp{g} and @samp{p} for all the constraints, you can choose to write a description with empty constraints. -Then you write @samp{""} for the constraint in every @samp{match_operand}. -Address operands are identified by writing an @samp{address} expression -around the @samp{match_operand}, not by their constraints. +Then you write @samp{""} for the constraint in every @code{match_operand}. +Address operands are identified by writing an @code{address} expression +around the @code{match_operand}, not by their constraints. When the machine description has just empty constraints, certain parts -of compilation are skipped, making the compiler faster. +of compilation are skipped, making the compiler faster. However, +few machines actually do not need constraints; all machine descriptions +now in existence use constraints. @node Standard Names, Pattern Ordering, Constraints, Machine Desc @section Standard Names for Patterns Used in Generation @@ -5230,12 +6523,12 @@ pattern in to accomplish a certain task. @table @asis @item @samp{mov@var{m}} -Here @var{m} is a two-letter machine mode name, in lower case. This -instruction pattern moves data with that machine mode from operand 1 to -operand 0. For example, @samp{movsi} moves full-word data. +Here @var{m} stands for a two-letter machine mode name, in lower case. +This instruction pattern moves data with that machine mode from operand +1 to operand 0. For example, @samp{movsi} moves full-word data. -If operand 0 is a @samp{subreg} with mode @var{m} of a register whose -natural mode is wider than @var{m}, the effect of this instruction is +If operand 0 is a @code{subreg} with mode @var{m} of a register whose +own mode is wider than @var{m}, the effect of this instruction is to store the specified value in the part of the register that corresponds to mode @var{m}. The effect on the rest of the register is undefined. @@ -5245,20 +6538,21 @@ to copy a datum from one place to anothe Second, these patterns are not used solely in the RTL generation pass. Even the reload pass can generate move insns to copy values from stack -slots into temporary registers. When it does so, one of the operands -is a hard register and the other is an operand that can have a reload. - -Therefore, when given such a pair of operands, the pattern must -generate RTL which needs no temporary registers---no registers other -than the operands. For example, if you support the pattern with a -@code{define_expand}, then in such a case you mustn't call -@code{force_reg} or any other such function which might generate new -pseudo registers. +slots into temporary registers. When it does so, one of the operands is +a hard register and the other is an operand that can need to be reloaded +into a register. + +Therefore, when given such a pair of operands, the pattern must generate +RTL which needs no reloading and needs no temporary registers---no +registers other than the operands. For example, if you support the +pattern with a @code{define_expand}, then in such a case the +@code{define_expand} mustn't call @code{force_reg} or any other such +function which might generate new pseudo registers. This requirement exists even for subword modes on a RISC machine where fetching those modes from memory normally requires several insns and some temporary registers. Look in @file{spur.md} to see how the -requirement is satisfied. +requirement can be satisfied. The variety of operands that have reloads depends on the rest of the machine description, but typically on a RISC machine these can only be @@ -5270,7 +6564,7 @@ to any other hard register (provided tha permits mode @var{m} in each of the registers). @item @samp{movstrict@var{m}} -Like @samp{mov@var{m}} except that if operand 0 is a @samp{subreg} +Like @samp{mov@var{m}} except that if operand 0 is a @code{subreg} with mode @var{m} of a register whose natural mode is wider, the @samp{movstrict@var{m}} instruction is guaranteed not to alter any of the register except the part which belongs to mode @var{m}. @@ -5360,8 +6654,8 @@ Compare operand 0 and operand 1, and set The RTL pattern should look like this: @example -(set (cc0) (minus (match_operand:@var{m} 0 @dots{}) - (match_operand:@var{m} 1 @dots{}))) +(set (cc0) (compare (match_operand:@var{m} 0 @dots{}) + (match_operand:@var{m} 1 @dots{}))) @end example Each such definition in the machine description, for integer mode @@ -5381,6 +6675,8 @@ The RTL pattern should look like this: Block move instruction. The addresses of the destination and source strings are the first two operands, and both are in mode @code{Pmode}. The number of bytes to move is the third operand, in mode @var{m}. +The fourth operand is the known shared alignment of the source and +destination, in the form of a @code{const_int} rtx. @item @samp{cmpstr@var{m}} Block compare instruction, with operands like @samp{movstr@var{m}} @@ -5463,26 +6759,27 @@ for operands 1 and 2. Store zero or nonzero in the operand according to the condition codes. Value stored is nonzero iff the condition @var{cond} is true. @var{cond} is the name of a comparison operation expression code, such -as @samp{eq}, @samp{lt} or @samp{leu}. +as @code{eq}, @code{lt} or @code{leu}. You specify the mode that the operand must have when you write the @code{match_operand} expression. The compiler automatically sees which mode you have used and supplies an operand of that mode. -The value stored for a true condition must have 1 as its low bit. -Otherwise the instruction is not suitable and must be omitted from the -machine description. You must tell the compiler exactly which value -is stored by defining the macro @code{STORE_FLAG_VALUE}. +The value stored for a true condition must have 1 as its low bit, or +else must be negative. Otherwise the instruction is not suitable and +must be omitted from the machine description. You must tell the +compiler exactly which value is stored by defining the macro +@code{STORE_FLAG_VALUE}. @item @samp{b@var{cond}} -Conditional branch instruction. Operand 0 is a @samp{label_ref} +Conditional branch instruction. Operand 0 is a @code{label_ref} that refers to the label to jump to. Jump if the condition codes meet condition @var{cond}. @item @samp{call} Subroutine call instruction returning no value. Operand 0 is the function to call; operand 1 is the number of bytes of arguments pushed -(in mode @code{SImode}, except it is normally a @samp{const_int}); +(in mode @code{SImode}, except it is normally a @code{const_int}); operand 2 is the number of registers used as operands. On most machines, operand 2 is not actually stored into the RTL @@ -5490,7 +6787,7 @@ pattern. It is supplied for the sake of to put this information into the assembler code; they can put it in the RTL instead of operand 1. -Operand 0 should be a @samp{mem} RTX whose address is the address of +Operand 0 should be a @code{mem} RTX whose address is the address of the function. @item @samp{call_value} @@ -5507,6 +6804,11 @@ Subroutine return instruction. This ins defined only if a single instruction can do all the work of returning from a function. +@item @samp{nop} +No-op instruction. This instruction pattern name should always be defined +to output a no-op in assembler code. @code{(const_int 0)} will do as an +RTL pattern. + @item @samp{casesi} Instruction to jump through a dispatch table, including bounds checking. This instruction takes five operands: @@ -5519,7 +6821,8 @@ The index to dispatch on, which has mode The lower bound for indices in the table, an integer constant. @item -The upper bound for indices in the table, an integer constant. +The total range of indices in the table---the largest index +minus the smallest one (both inclusive). @item A label to jump to if the index has a value outside the bounds. @@ -5533,8 +6836,8 @@ but it is always provided as an operand. A label that precedes the table itself. @end enumerate -The table is a @samp{addr_vec} or @samp{addr_diff_vec} inside of a -@samp{jump_insn}. The number of elements in the table is one plus the +The table is a @code{addr_vec} or @code{addr_diff_vec} inside of a +@code{jump_insn}. The number of elements in the table is one plus the difference between the upper bound and the lower bound. @item @samp{tablejump} @@ -5661,7 +6964,7 @@ instruction. A ``compare'' instruction whose RTL looks like this: @example -(set (cc0) (minus @var{operand} (const_int 0))) +(set (cc0) (compare @var{operand} (const_int 0))) @end example @noindent @@ -5702,9 +7005,9 @@ optimized away, but they do occasionally compilations. When an instruction has the constraint letter @samp{o}, the reload -pass may generate instructions which copy a nonoffsetable address into +pass may generate instructions which copy a nonoffsettable address into an index register. The idea is that the register can be used as a -replacement offsetable address. In order for these generated +replacement offsettable address. In order for these generated instructions to work, there must be patterns to copy any kind of valid address into a register. @@ -5754,7 +7057,7 @@ output a compare-and-branch instruction It also works to define patterns for compare-and-branch instructions. In optimizing compilation, the pair of compare and branch instructions -will be combined accoprding to these patterns. But this does not happen +will be combined according to these patterns. But this does not happen if optimization is not requested. So you must use one of the solutions above in addition to any special patterns you define. @@ -5786,49 +7089,53 @@ A definition looks like this: @noindent The last string operand may be omitted if you are not using any machine-specific information in this machine description. If present, -it must obey the same rules as in a @samp{define_insn}. +it must obey the same rules as in a @code{define_insn}. In this skeleton, @var{insn-pattern-1} and so on are patterns to match -consecutive instructions. The optimization applies to a sequence of -instructions when @var{insn-pattern-1} matches the first one, -@var{insn-pattern-2} matches the next, and so on.@refill - -@var{insn-pattern-1} and so on look @emph{almost} like the second operand -of @code{define_insn}. There is one important difference: this pattern is -an RTX, not a vector. If the @code{define_insn} pattern would be a vector -of one element, the @var{insn-pattern} should be just that element, no -vector. If the @code{define_insn} pattern would have multiple elements -then the @var{insn-pattern} must place the vector inside an explicit -@code{parallel} RTX.@refill - -The operands of the instructions are matched with @code{match_operands} and -@code{match_dup}, as usual). What is not usual is that the operand numbers -apply to all the instruction patterns in the definition. So, you can check -for identical operands in two instructions by using @code{match_operand} -in one instruction and @code{match_dup} in the other. +consecutive insns. The optimization applies to a sequence of insns when +@var{insn-pattern-1} matches the first one, @var{insn-pattern-2} matches +the next, and so on.@refill + +Each of the insns matched by a peephole must also match a +@code{define_insn}. Peepholes are checked only at the last stage just +before code generation, and only optionally. Therefore, any insn which +would match a peephole but no @code{define_insn} will cause a crash in code +generation in an unoptimized compilation, or at various optimization +stages. + +The operands of the insns are matched with @code{match_operands} and +@code{match_dup}, as usual. What is not usual is that the operand numbers +apply to all the insn patterns in the definition. So, you can check for +identical operands in two insns by using @code{match_operand} in one insn +and @code{match_dup} in the other. The operand constraints used in @code{match_operand} patterns do not have -any direct effect on the applicability of the optimization, but they will -be validated afterward, so write constraints that are sure to fit whenever -the optimization is applied. It is safe to use @code{"g"} for each -operand. - -Once a sequence of instructions matches the patterns, the @var{condition} -is checked. This is a C expression which makes the final decision whether -to perform the optimization (do so if the expression is nonzero). If +any direct effect on the applicability of the peephole, but they will +be validated afterward, so make sure your constraints are general enough +to apply whenever the peephole matches. If the peephole matches +but the constraints are not satisfied, the compiler will crash. + +It is safe to omit constraints in all the operands of the peephole; or +you can write constraints which serve as a double-check on the criteria +previously tested. + +Once a sequence of insns matches the patterns, the @var{condition} is +checked. This is a C expression which makes the final decision whether to +perform the optimization (we do so if the expression is nonzero). If @var{condition} is omitted (in other words, the string is empty) then the -optimization is applied to every sequence of instructions that matches the +optimization is applied to every sequence of insns that matches the patterns. -The defined peephole optimizations are applied after register allocation is -complete. Therefore, the optimizer can check which operands have ended up -in which kinds of registers, just by looking at the operands. +The defined peephole optimizations are applied after register allocation +is complete. Therefore, the peephole definition can check which +operands have ended up in which kinds of registers, just by looking at +the operands. The way to refer to the operands in @var{condition} is to write @code{operands[@var{i}]} for operand number @var{i} (as matched by @code{(match_operand @var{i} @dots{})}). Use the variable @code{insn} to refer to the last of the insns being matched; use @code{PREV_INSN} to find -the preceding insns (but be careful to skip over any @samp{note} insns that +the preceding insns (but be careful to skip over any @code{note} insns that intervene).@refill When optimizing computations with intermediate results, you can use @@ -5839,20 +7146,19 @@ be used for the last time (from the valu of @code{PREV_INSN}), and @var{op} is the intermediate value (from @code{operands[@var{i}]}).@refill -Applying the optimization means replacing the sequence of instructions with -one new instruction. The @var{template} controls ultimate output of -assembler code for this combined instruction. It works exactly like the -template of a @code{define_insn}. Operand numbers in this template are the -same ones used in matching the original sequence of instructions. +Applying the optimization means replacing the sequence of insns with one +new insn. The @var{template} controls ultimate output of assembler code +for this combined insn. It works exactly like the template of a +@code{define_insn}. Operand numbers in this template are the same ones +used in matching the original sequence of insns. The result of a defined peephole optimizer does not need to match any of -the instruction patterns, and it does not have an opportunity to match -them. The peephole optimizer definition itself serves as the instruction -pattern to control how the instruction is output. - -Defined peephole optimizers are run in the last jump optimization pass, so -the instructions they produce are never combined or rearranged -automatically in any way. +the insn patterns in the machine description; it does not even have an +opportunity to match them. The peephole optimizer definition itself serves +as the insn pattern to control how the insn is output. + +Defined peephole optimizers are run as assembler code is being output, +so the insns they produce are never combined or rearranged in any way. Here is an example, taken from the 68000 machine description: @@ -5899,28 +7205,77 @@ movel d0,sp@@- fmoved sp@@+,fp0 @end example +@ignore +If a peephole matches a sequence including one or more jump insns, you must +take account of the flags such as @code{CC_REVERSED} which specify that the +condition codes are represented in an unusual manner. The compiler +automatically alters any ordinary conditional jumps which occur in such +situations, but the compiler cannot alter jumps which have been replaced by +peephole optimizations. So it is up to you to alter the assembler code +that the peephole produces. Supply C code to write the assembler output, +and in this C code check the condition code status flags and change the +assembler code as appropriate. +@end ignore + +@var{insn-pattern-1} and so on look @emph{almost} like the second +operand of @code{define_insn}. There is one important difference: the +second operand of @code{define_insn} consists of one or more RTX's +enclosed in square brackets. Usually, there is only one: then the same +action can be written as an element of a @code{define_peephole}. But +when there are multiple actions in a @code{define_insn}, they are +implicitly enclosed in a @code{parallel}. Then you must explicitly +write the @code{parallel}, and the square brackets within it, in the +@code{define_peephole}. Thus, if an insn pattern looks like this, + +@example +(define_insn "divmodsi4" + [(set (match_operand:SI 0 "general_operand" "=d") + (div:SI (match_operand:SI 1 "general_operand" "0") + (match_operand:SI 2 "general_operand" "dmsK"))) + (set (match_operand:SI 3 "general_operand" "=d") + (mod:SI (match_dup 1) (match_dup 2)))] + "TARGET_68020" + "divsl%.l %2,%3:%0") +@end example + +@noindent +then the way to mention this insn in a peephole is as follows: + +@example +(define_peephole + [@dots{} + (parallel + [(set (match_operand:SI 0 "general_operand" "=d") + (div:SI (match_operand:SI 1 "general_operand" "0") + (match_operand:SI 2 "general_operand" "dmsK"))) + (set (match_operand:SI 3 "general_operand" "=d") + (mod:SI (match_dup 1) (match_dup 2)))]) + @dots{}] + @dots{}) +@end example + @node Expander Definitions,, Peephole Definitions, Machine Desc @section Defining RTL Sequences for Code Generation On some target machines, some standard pattern names for RTL generation cannot be handled with single insn, but a sequence of RTL insns can represent them. For these target machines, you can write a -@samp{define_expand} to specify how to generate the sequence of RTL. +@code{define_expand} to specify how to generate the sequence of RTL. -A @samp{define_expand} is an RTL expression that looks almost like a -@samp{define_insn}; but, unlike the latter, a @samp{define_expand} is used +A @code{define_expand} is an RTL expression that looks almost like a +@code{define_insn}; but, unlike the latter, a @code{define_expand} is used only for RTL generation and it can produce more than one RTL insn. -A @samp{define_expand} RTX has four operands: +A @code{define_expand} RTX has four operands: @itemize @bullet @item -The name. Each @samp{define_expand} must have a name, since the only +The name. Each @code{define_expand} must have a name, since the only use for it is to refer to it by name. @item The RTL template. This is just like the RTL template for a -@samp{define_peephole} in that it is a vector of RTL expressions +@code{define_peephole} in that it is a vector of RTL expressions each being one insn. @item @@ -5928,7 +7283,7 @@ The condition, a string containing a C e used to express how the availability of this pattern depends on subclasses of target machine, selected by command-line options when GNU CC is run. This is just like the condition of a -@samp{define_insn} that has a standard name. +@code{define_insn} that has a standard name. @item The preparation statements, a string containing zero or more C @@ -5937,31 +7292,36 @@ the RTL template. Usually these statements prepare temporary registers for use as internal operands in the RTL template, but they can also generate RTL -insns directly by calling routines such as @samp{emit_insn}, etc. +insns directly by calling routines such as @code{emit_insn}, etc. Any such insns precede the ones that come from the RTL template. @end itemize +Every RTL insn emitted by a @code{define_expand} must match some +@code{define_insn} in the machine description. Otherwise, the compiler +will crash when trying to generate code for the insn or trying to optimize +it. + The RTL template, in addition to controlling generation of RTL insns, also describes the operands that need to be specified when this pattern is used. In particular, it gives a predicate for each operand. A true operand, which need to be specified in order to generate RTL from -the pattern, should be described with a @samp{match_operand} in its first +the pattern, should be described with a @code{match_operand} in its first occurrence in the RTL template. This enters information on the operand's predicate into the tables that record such things. GNU CC uses the information to preload the operand into a register if that is required for valid RTL code. If the operand is referred to more than once, subsequent -references should use @samp{match_dup}. +references should use @code{match_dup}. The RTL template may also refer to internal ``operands'' which are temporary registers or labels used only within the sequence made by the -@samp{define_expand}. Internal operands are substituted into the RTL -template with @samp{match_dup}, never with @samp{match_operand}. The +@code{define_expand}. Internal operands are substituted into the RTL +template with @code{match_dup}, never with @code{match_operand}. The values of the internal operands are not passed in as arguments by the compiler when it requests use of this pattern. Instead, they are computed within the pattern, in the preparation statements. These statements compute the values and store them into the appropriate elements of -@code{operands} so that @samp{match_dup} can find them. +@code{operands} so that @code{match_dup} can find them. There are two special macros defined for use in the preparation statements: @code{DONE} and @code{FAIL}. Use them with a following semicolon, @@ -6003,16 +7363,16 @@ Here is an example, the definition of le @end example @noindent -This example uses @samp{define_expand} so that it can generate an RTL insn +This example uses @code{define_expand} so that it can generate an RTL insn for shifting when the shift-count is in the supported range of 0 to 3 but fail in other cases where machine insns aren't available. When it fails, the compiler tries another strategy using different patterns (such as, a library call). If the compiler were able to handle nontrivial condition-strings in -patterns with names, then there would be possible to use a -@samp{define_insn} in that case. Here is another case (zero-extension on -the 68000) which makes more use of the power of @samp{define_expand}: +patterns with names, then it would be possible to use a +@code{define_insn} in that case. Here is another case (zero-extension +on the 68000) which makes more use of the power of @code{define_expand}: @example (define_expand "zero_extendhisi2" @@ -6020,7 +7380,7 @@ the 68000) which makes more use of the p (const_int 0)) (set (strict_low_part (subreg:HI - (match_operand:SI 0 "general_operand" "") + (match_dup 0) 0)) (match_operand:HI 1 "general_operand" ""))] "" @@ -6037,11 +7397,11 @@ temporary register if it refers to @code by emitting another RTL insn. Finally, a third example shows the use of an internal operand. -Zero-extension on the SPUR chip is done by @samp{and}-ing the result +Zero-extension on the SPUR chip is done by @code{and}-ing the result against a halfword mask. But this mask cannot be represented by a -@samp{const_int} because the constant value is too large to be legitimate +@code{const_int} because the constant value is too large to be legitimate on this machine. So it must be copied into a register with -@code{force_reg} and then the register used in the @samp{and}. +@code{force_reg} and then the register used in the @code{and}. @example (define_expand "zero_extendhisi2" @@ -6056,6 +7416,11 @@ on this machine. So it must be copied i VOIDmode, 65535)); ") @end example +@strong{Note:} If the @code{define_expand} is used to serve a standard +binary or unary arithmetic operation, then the last insn it generates +must not be a @code{code_label}, @code{barrier} or @code{note}. It must +be an @code{insn}, @code{jump_insn} or @code{call_insn}. + @node Machine Macros, Config, Machine Desc, Top @chapter Machine Description Macros @@ -6072,8 +7437,10 @@ compiler source files include @file{conf * Stack Layout:: Defining which way the stack grows and by how much. * Library Names:: Specifying names of subroutines to call automatically. * Addressing Modes:: Defining addressing modes valid for memory operands. +* Delayed Branch:: Do branches execute the following instruction? * Condition Code:: Defining how insns update the condition code. * Assembler Format:: Defining how to write insns and pseudo-ops to output. +* Cross-compilation:: Handling floating point for cross-compilers. * Misc:: Everything else. @end menu @@ -6087,12 +7454,21 @@ define the predefined macros that identi These macros will be predefined unless the @samp{-ansi} option is specified. -For example, on the Sun, one can use the value +In addition, a parallel set of macros are predefined, whose names are +made by appending @samp{__} at the beginning and at the end. These +@samp{__} macros are permitted by the ANSI standard, so they are +predefined regardless of whether @samp{-ansi} is specified. + +For example, on the Sun, one can use the following value: @example "-Dmc68000 -Dsun -Dunix" @end example +The result is to define the macros @code{__mc68000__}, @code{__sun__} +and @code{__unix__} unconditionally, and the macros @code{mc68000}, +@code{sun} and @code{unix} provided @samp{-ansi} is not specified. + @item CPP_SPEC A C string constant that tells the GNU CC driver program options to pass to CPP. It can also specify how to translate options you @@ -6180,6 +7556,9 @@ number. This means that bit-field instr significant bit. If the machine has no bit-field instructions, this macro is irrelevant. +This macro does not affect the way structure fields are packed into +bytes or words; that is controlled by @code{BYTES_BIG_ENDIAN}. + @item BYTES_BIG_ENDIAN Define this macro if the most significant byte in a word has the lowest number. @@ -6204,7 +7583,19 @@ Width of a pointer, in bits. Alignment required for pointers stored in memory, in bits. @item PARM_BOUNDARY -Alignment required for function parameters on the stack, in bits. +Normal alignment required for function parameters on the stack, in +bits. All stack parameters receive least this much alignment +regardless of data type. On most machines, this is the same as the +size of an integer. + +@item MAX_PARM_BOUNDARY +Largest alignment required for any stack parameters, in bits. If the +data type of the parameter calls for more alignment than +@code{PARM_BOUNDARY}, then it is given extra padding up to this limit. + +Don't define this macro if it would be equal to @code{PARM_BOUNDARY}; +in other words, if the alignment of a stack parameter should not +depend on its data type (as is the case on most machines). @item STACK_BOUNDARY Define this macro if you wish to preserve a certain alignment for @@ -6217,6 +7608,18 @@ Alignment required for a function entry @item BIGGEST_ALIGNMENT Biggest alignment that any data type can require on this machine, in bits. +@item CONSTANT_ALIGNMENT (@var{code}, @var{typealign}) +A C expression to compute the alignment for a constant. The argument +@var{typealign} is the alignment required for the constant's data type. +@var{code} is the tree code of the constant itself. + +If this macro is not defined, the default is to use @var{typealign}. If +you do define this macro, the value must be a multiple of +@var{typealign}. + +The purpose of defining this macro is usually to cause string constants +to be word aligned so that @file{dhrystone} can be made to run faster. + @item EMPTY_FIELD_BOUNDARY Alignment in bits to be given to a structure bit field that follows an empty field such as @code{int : 0;}. @@ -6243,6 +7646,11 @@ Just what effect that is in GNU CC depen most machines it would force the structure's alignment and size to a multiple of 32 or @code{BIGGEST_ALIGNMENT} bits. +@item MAX_FIXED_MODE_SIZE +An integer expression for the largest integer machine mode that should +actually be used. All integer machine modes of this size or smaller +can be used for structures and unions with the appropriate sizes. + @item CHECK_FLOAT_VALUE (@var{mode}, @var{value}) A C statement to validate the value @var{value} (or type @code{double}) for mode @var{mode}. This means that you check whether @@ -6299,6 +7707,13 @@ If a register has 0 in @code{CALL_USED_R automatically saves it on function entry and restores it on function exit, if the register is used within the function. +@item DEFAULT_CALLER_SAVES +Define this macro if function calls on the target machine do not preserve +any registers; in other words, if @code{CALL_USED_REGISTERS} has 1 +for all registers. This macro enables @samp{-fcaller-saves} by default. +Eventually that option will be enabled by default on all machines and both +the option and this macro will be eliminated. + @item CONDITIONAL_REGISTER_USAGE Zero or more C statements that may conditionally modify two variables @code{fixed_regs} and @code{call_used_regs} (both of type @code{char @@ -6310,9 +7725,9 @@ on target flags. You need not define this macro if it has no work to do. 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 +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 +registers in the classes which should not be used by GCC. Also define the macro @code{REG_CLASS_FROM_LETTER} to return @code{NO_REGS} if it is called with a letter for a class that shouldn't be used. @@ -6322,15 +7737,15 @@ controlled by target switches, then GCC these registers when the target switches are opposed to them.) @item OVERLAPPING_REGNO_P (@var{regno}) -If defined, this is a C expression whose value is @var{regno} is -nonzero if hard register number @var{regno} is an overlapping -register. This means a hard register which overlaps a hard register -with a different number. (Such overlap is undesirable, but -occasionally it allows a machine to be supported which otherwise could -not be.) This macro must return nonzero for @emph{all} the registers -which overlap each other. GNU CC can use an overlapping register only -in certain limited ways. It can be used for allocation within a basic -block, and may be spilled for reloading; that is all. +If defined, this is a C expression whose value is nonzero if hard +register number @var{regno} is an overlapping register. This means a +hard register which overlaps a hard register with a different number. +(Such overlap is undesirable, but occasionally it allows a machine to +be supported which otherwise could not be.) This macro must return +nonzero for @emph{all} the registers which overlap each other. GNU CC +can use an overlapping register only in certain limited ways. It can +be used for allocation within a basic block, and may be spilled for +reloading; that is all. If this macro is not defined, it means that none of the hard registers overlap each other. This is the usual situation. @@ -6353,12 +7768,12 @@ optimizations that take place after regi invalidate the death notes are not done when this register is involved. -You would arrange to preserve death info for a register when some -of the code in the machine description which is executed to write -the assembler code looks at the the death notes. This is -necessary only when the actual hardware feature which GNU CC -thinks of as a register is not actually a register of the usual sort. -(It might, for example, be a hardware stack.) +You would arrange to preserve death info for a register when some of the +code in the machine description which is executed to write the assembler +code looks at the death notes. This is necessary only when the actual +hardware feature which GNU CC thinks of as a register is not actually a +register of the usual sort. (It might, for example, be a hardware +stack.) If this macro is not defined, it means that no death notes need to be preserved. This is the usual situation. @@ -6387,8 +7802,18 @@ are equivalent, a suitable definition is #define HARD_REGNO_MODE_OK(REGNO, MODE) 1 @end example -It is not necessary for this macro to check for fixed register numbers -because the allocation mechanism considers them to be always occupied. +It is not necessary for this macro to check for the numbers of fixed +registers, because the allocation mechanism considers them to be always +occupied. + +On some machines, double-precision values must be kept in even/odd +register pairs. The way to implement that is to define this macro +to reject odd register numbers for such modes. + +GNU CC assumes that it can always move values between registers and +(suitably addressed) memory locations. If it is impossible to move a +value of a certain mode between memory and certain registers, then +@code{HARD_REGNO_MODE_OK} must not allow this mode in those registers. Many machines have special registers for floating point arithmetic. Often people assume that floating point machine modes are allowed only @@ -6397,7 +7822,7 @@ can hold integers can safely @emph{hold} mode, whether or not floating arithmetic can be done on it in those registers. -The true significance of special floating registers is rather than +The true significance of special floating registers is rather that non-floating-point machine modes @emph{may not} go in those registers. This is true if the floating registers normalize any value stored in them, because storing a non-floating value there would garble it. If @@ -6414,8 +7839,8 @@ will not be used unless some insn's cons It is obligatory to support floating point `move' instructions into and out of any registers that can hold fixed point values, because -unions and structures (which have modes @samp{SImode} or -@samp{DImode}) can be in those registers and they may have floating +unions and structures (which have modes @code{SImode} or +@code{DImode}) can be in those registers and they may have floating point members. There may also be a need to support fixed point `move' instructions in @@ -6461,9 +7886,9 @@ machine allows code to be generated with so saves some time or space. Use 1 when there is no possible advantage to avoiding a frame pointer. -In certain cases, the compiler does not know how to do without a frame -pointer. The compiler recognizes those cases and automatically gives -the function a frame pointer regardless of what +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{FRAME_POINTER_REQUIRED} says. You don't need to worry about them.@refill @@ -6501,7 +7926,7 @@ should be the number of that register. @item STRUCT_VALUE If the structure value address is not passed in a register, define @code{STRUCT_VALUE} as an expression returning an RTX for the place -where the address is passed. If it returns a @samp{mem} RTX, the +where the address is passed. If it returns a @code{mem} RTX, the address is passed as an ``invisible'' first argument. @item STRUCT_VALUE_INCOMING_REGNUM @@ -6517,8 +7942,8 @@ register, define this macro as the regis If the incoming location is not a register, define @code{STRUCT_VALUE_INCOMING} as an expression for an RTX for where the called function should find the value. If it should find the value on -the stack, define this to create a @samp{mem} which refers to the -frame pointer. If the value is a @samp{mem}, the compiler assumes it +the stack, define this to create a @code{mem} which refers to the +frame pointer. If the value is a @code{mem}, the compiler assumes it is for an invisible first argument, and leaves space for it when finding the first real argument. @@ -6576,6 +8001,12 @@ classes: for each class, which classes c contained in it; for each pair of classes, the largest class contained in their union. +When a value occupying several consecutive registers is expected in a +certain class, all the registers used must belong to that class. +Therefore, register classes cannot be used to enforce a requirement for +a register pair to start with an even-numbered register. The way to +specify this requirement is with @code{HARD_REGNO_MODE_OK}. + Register classes used for input-operands of bitwise-and or shift instructions have a special requirement: each such class must have, for each fixed-point machine mode, a subclass whose registers can transfer that @@ -6683,7 +8114,7 @@ for a @samp{moveq} instruction, the valu @code{DATA_REGS} as long as @var{class} includes the data registers. Requiring a data register guarantees that a @samp{moveq} will be used. -If @var{x} is a @samp{const_double}, by returning @code{NO_REGS} +If @var{x} is a @code{const_double}, by returning @code{NO_REGS} you can force @var{x} into a memory constant. This is useful on certain machines where immediate floating values cannot be loaded into certain kinds of registers. @@ -6733,7 +8164,7 @@ not one of those letters, the value shou A C expression that defines the machine-dependent operand constraint letters that specify particular ranges of floating values. If @var{c} is one of those letters, the expression should check that @var{value}, an RTX -of code @samp{const_double}, is in the appropriate range and return 1 if +of code @code{const_double}, is in the appropriate range and return 1 if so, 0 otherwise. If @var{c} is not one of those letters, the value should be 0 regardless of @var{value}. @end table @@ -6804,6 +8235,26 @@ of the first parameter's shadow location pointer value. (That value is itself computed by adding the value of @code{STACK_POINTER_OFFSET} to the stack pointer register.) +@item STACK_ARGS_ADJUST (@var{size}) +Define this macro if the machine requires padding on the stack for +certain function calls. This is padding on a per-function-call basis, +not padding for individual arguments. + +The argument @var{size} will be a C variable of type @code{struct +arg_data} which contains two fields, an integer named @code{constant} +and an RTX named @code{var}. These together represent a size measured +in bytes which is the sum of the integer and the RTX. Most of the +time @code{var} is 0, which means that the size is simply the integer. + +The definition should be a C statement or compound statement +which alters the variable supplied in whatever way you wish. + +Note that the value you leave in the variable @code{size} will +ultimately be rounded up to a multiple of @code{STACK_BOUNDARY} bits. + +This macro is not fully implemented for machines which have push +instructions (i.e., on which @code{PUSH_ROUNDING} is defined). + @item RETURN_POPS_ARGS (@var{funtype}) A C expression that should be 1 if a function pops its own arguments on returning, or 0 if the function pops no arguments and the caller @@ -6860,6 +8311,19 @@ to tell the function where to put the va If @code{FUNCTION_OUTGOING_VALUE} is not defined, @code{FUNCTION_VALUE} serves both purposes.@refill +@item RETURN_IN_MEMORY (@var{type}) +A C expression which can inhibit the returning of certain function +values in registers, based on the type of value. A nonzero value says +to return the function value in memory, just as large structures are +always returned. Here @var{type} will be a C expression of type +@code{tree}, representing the data type of the value. + +Note that values of mode @code{BLKmode} are returned in memory +regardless of this macro. Also, the option @samp{-fpcc-struct-return} +takes effect regardless of this macro. On most systems, it is +possible to leave the macro undefined; this causes a default +definition to be used, whose value is the constant 0. + @item LIBCALL_VALUE (@var{mode}) A C expression to create an RTX representing the place where a library function returns a value of mode @var{mode}. If the precise function @@ -6900,15 +8364,20 @@ arguments; @var{mode}, the machine mode 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 1 for an ordinary argument and 0 for nameless arguments that -correspond to @samp{...} in the called function's prototype. +correspond to @samp{@dots{}} in the called function's prototype. -The value of the expression should either be a @samp{reg} RTX for the +The value of the expression should either be a @code{reg} RTX for the hard register in which to pass the argument, or zero to pass the argument on the stack. For the Vax and 68000, where normally all arguments are pushed, zero suffices as a definition. +The usual way to make the ANSI library @file{stdarg.h} work on a machine +where some arguments are usually passed in registers, is to cause +nameless arguments to be passed on the stack instead. This is done +by making @code{FUNCTION_ARG} return 0 whenever @var{named} is 0. + @item FUNCTION_INCOMING_ARG (@var{cum}, @var{mode}, @var{type}, @var{named}) Define this macro if the target machine has ``register windows'', so that the register in which a function sees an arguments is not @@ -6956,11 +8425,11 @@ for the data type of the function which if the args are to a compiler support library function. @item FUNCTION_ARG_ADVANCE (@var{cum}, @var{mode}, @var{type}, @var{named}) -Update the summarizer variable @var{cum} 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{FUNCTION_ARG}, etc.@refill +A C statement (sans semicolon) to update the summarizer variable +@var{cum} 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{FUNCTION_ARG}, etc.@refill @item FUNCTION_ARG_REGNO_P (@var{regno}) A C expression that is nonzero if @var{regno} is the number of a hard @@ -7012,6 +8481,20 @@ frame pointer is in wanted, the macro ca @code{frame_pointer_needed}. The variable's value will be 1 at run time in a function that needs a frame pointer. +On machines where arguments may be passed in registers, and not have +stack space allocated, this macro must examine the variable +@code{current_function_pretend_args_size}, and allocate that many bytes +of uninitialized space on the stack just underneath the first argument +arriving on the stack. (This may not be at the very end of the stack, +if the calling sequence has pushed anything else since pushing the stack +arguments. But usually, on such machines, nothing else has been pushed +yet, because the function prologue itself does all the pushing.) + +This ``pretend argument'' space is allocated in functions that use the +ANSI library @file{stdarg.h} to accept anonymous arguments of +unspecified types; the last named argument is copied into the space, so +that the anonymous arguments follow it consecutively. + @item FUNCTION_PROFILER (@var{file}, @var{labelno}) A C statement or compound statement to output to @var{file} some assembler code to call the profiling subroutine @code{mcount}. @@ -7027,16 +8510,55 @@ figure them out, compile a small program system's installed C compiler and look at the assembler code that results. +@item FUNCTION_BLOCK_PROFILER (@var{file}, @var{labelno}) +A C statement or compound statement to output to @var{file} some +assembler code to initialize basic-block profiling for the current +object module. This code should call the subroutine +@code{__bb_init_func} once per object module, passing it as its sole +argument the address of a block allocated in the object module. + +The name of the block is a local symbol made with this statement: + +@example +ASM_GENERATE_INTERNAL_LABEL (@var{buffer}, "LPBX", 0); +@end example + +Of course, since you are writing the definition of +@code{ASM_GENERATE_INTERNAL_LABEL} as well as that of this macro, you +can take a short cut in the definition of this macro and use the name +that you know will result. + +The first word of this block is a flag which will be nonzero if the +object module has already been initialized. So test this word first, +and do not call @code{__bb_init_func} if the flag is nonzero. + +@item BLOCK_PROFILER (@var{file}, @var{blockno}) +A C statement or compound statement to increment the count associated +with the basic block number @var{blockno}. Basic blocks are numbered +separately from zero within each compilation. The count associated +with block number @var{blockno} is at index @var{blockno} in a vector +of words; the name of this array is a local symbol made with this +statement: + +@example +ASM_GENERATE_INTERNAL_LABEL (@var{buffer}, "LPBX", 2); +@end example + +Of course, since you are writing the definition of +@code{ASM_GENERATE_INTERNAL_LABEL} as well as that of this macro, you +can take a short cut in the definition of this macro and use the name +that you know will result. + @item EXIT_IGNORES_STACK Define this macro as a C expression that is nonzero if the return instruction or the function epilogue ignores the value of the stack pointer; in other words, if it is safe to delete an instruction to adjust the stack pointer before a return from the function. -Note that this macro's value is relevant only for for which frame -pointers are maintained. It is never possible to delete a final stack -adjustment in a function that has no frame pointer, and the compiler -knows this regardless of @code{EXIT_IGNORES_STACK}. +Note that this macro's value is relevant only for functions for which +frame pointers are maintained. It is never safe to delete a final +stack adjustment in a function that has no frame pointer, and the +compiler knows this regardless of @code{EXIT_IGNORES_STACK}. @item FUNCTION_EPILOGUE (@var{file}, @var{size}) A C compound statement that outputs the assembler code for exit from a @@ -7094,23 +8616,53 @@ Even if your machine description specifi frame pointer in the frame pointer register, you must still define @code{FIX_FRAME_POINTER_ADDRESS}, but the definition will never be executed at run time, so it may be empty. + +@item LONGJMP_RESTORE_FROM_STACK +Define this macro if the @code{longjmp} function restores registers +from the stack frames, rather than from those saved specifically by +@code{setjmp}. Certain quantities must not be kept in registers +across a call to @code{setjmp} on such machines. @end table @node Library Names, Addressing Modes, Stack Layout, Machine Macros @section Library Subroutine Names @table @code +@item MULSI3_LIBCALL +A C string constant giving the name of the function to call for +multiplication of one signed full-word by another. If you do not +define this macro, the default name is used, which is @code{__mulsi3}, +a function defined in @file{gnulib}. + +@item UMULSI3_LIBCALL +A C string constant giving the name of the function to call for +multiplication of one unsigned full-word by another. If you do not +define this macro, the default name is used, which is +@code{__umulsi3}, a function defined in @file{gnulib}. + +@item DIVSI3_LIBCALL +A C string constant giving the name of the function to call for +division of one signed full-word by another. If you do not define +this macro, the default name is used, which is @code{__divsi3}, a +function defined in @file{gnulib}. + @item UDIVSI3_LIBCALL A C string constant giving the name of the function to call for -division of a full-word by a full-word. If you do not define this -macro, the default name is used, which is @code{_udivsi3}, a function -defined in @file{gnulib}. +division of one unsigned full-word by another. If you do not define +this macro, the default name is used, which is @code{__udivsi3}, a +function defined in @file{gnulib}. + +@item MODSI3_LIBCALL +A C string constant giving the name of the function to call for the +remainder in division of one signed full-word by another. If you do +not define this macro, the default name is used, which is +@code{__modsi3}, a function defined in @file{gnulib}. @item UMODSI3_LIBCALL A C string constant giving the name of the function to call for the -remainder in division of a full-word by a full-word. If you do not -define this macro, the default name is used, which is @code{_umodsi3}, -a function defined in @file{gnulib}. +remainder in division of one unsigned full-word by another. If you do +not define this macro, the default name is used, which is +@code{__umodsi3}, a function defined in @file{gnulib}. @item TARGET_MEM_FUNCTIONS Define this macro if GNU CC should generate calls to the System V @@ -7118,7 +8670,7 @@ Define this macro if GNU CC should gener rather than the BSD functions @code{bcopy} and @code{bzero}. @end table -@node Addressing Modes, Misc, Library Names, Machine Macros +@node Addressing Modes, Delayed Branch, Library Names, Machine Macros @section Addressing Modes @table @code @@ -7133,8 +8685,8 @@ Similar for other kinds of addressing. @item CONSTANT_ADDRESS_P (@var{x}) A C expression that is 1 if the RTX @var{x} is a constant whose value is an integer. This includes integers whose values are not explicitly -known, such as @samp{symbol_ref} and @samp{label_ref} expressions and -@samp{const} arithmetic expressions. +known, such as @code{symbol_ref} and @code{label_ref} expressions and +@code{const} arithmetic expressions. On most machines, this can be defined as @code{CONSTANT_P (@var{x})}, but a few machines are more restrictive in which constant addresses @@ -7176,8 +8728,19 @@ for index registers, and so on). Then o need have two variants; the higher levels of macros may be the same whether strict or not.@refill +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 as +legitimate addresses. + +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}.@refill + @item REG_OK_FOR_BASE_P (@var{x}) -A C expression that is nonzero if @var{x} (asumed to be a @code{reg} +A C expression that is nonzero if @var{x} (assumed to be a @code{reg} RTX) is valid for use as a base register. For hard registers, it should always accept those which the hardware permits and reject the others. Whether the macro accepts or rejects pseudo registers must be @@ -7186,7 +8749,7 @@ requires two variant definitions, of whi controls the one actually used. @item REG_OK_FOR_INDEX_P (@var{x}) -A C expression that is nonzero if @var{x} (asumed to be a @code{reg} +A C expression that is nonzero if @var{x} (assumed to be a @code{reg} RTX) is valid for use as an index register. The difference between an index register and a base register is that @@ -7239,13 +8802,228 @@ You may assume that @var{addr} is a vali @item LEGITIMATE_CONSTANT_P (@var{x}) A C expression that is nonzero if @var{x} is a legitimate constant for an immediate operand on the target machine. You can assume that -either @var{x} is a @samp{const_double} or it satisfies +either @var{x} is a @code{const_double} or it satisfies @code{CONSTANT_P}, so you need not check these things. In fact, @samp{1} is a suitable definition for this macro on machines where any -@samp{const_double} is valid and anything @code{CONSTANT_P} is valid.@refill +@code{const_double} is valid and anything @code{CONSTANT_P} is valid.@refill +@end table + +@node Delayed Branch, Condition Code, Addressing Modes, Machine Macros +@section Parameters for Delayed Branch Optimization + +@table @code +@item HAVE_DELAYED_BRANCH +Define this macro if the target machine has delayed branches, that is, +a branch does not take effect immediately, and the actual branch +instruction may be followed by one or more instructions that will be +issued before the PC is actually changed. + +If defined, this allows a special scheduling pass to be run after the +second jump optimization to attempt to reorder instructions to exploit +this. Defining this macro also requires the definition of certain +other macros described below. + +@item DBR_SLOTS_AFTER (@var{insn}) +This macro must be defined if @code{HAVE_DELAYED_BRANCH} is defined. +Its definition should be a C expression returning the number of +available delay slots following the instruction(s) output by the +pattern for @var{insn}. The definition of ``slot'' is +machine-dependent, and may denote instructions, bytes, or whatever. + +@item DBR_INSN_SLOTS (@var{insn}) +This macro must be defined if @code{HAVE_DELAYED_BRANCH} is defined. +It should be a C expression returning the number of slots (typically +the number of machine instructions) consumed by @var{insn}. + +You may assume that @var{insn} is truly an insn, not a note, label, +barrier, dispatch table, @code{use}, or @code{clobber}. + +@item DBR_INSN_ELIGIBLE_P (@var{insn}, @var{dinsn}) +A C expression whose value is non-zero if it is legitimate to put +@var{insn} in the delay slot following @var{dinsn}. + +You do not need to take account of data flow considerations in the +definition of this macro, because the delayed branch optimizer always +does that. This macro is needed only when certain insns may not be +placed in certain delay slots for reasons not evident from the RTL +expressions themselves. If there are no such problems, you don't need +to define this macro. + +You may assume that @var{insn} is truly an insn, not a note, label, +barrier, dispatch table, @code{use}, or @code{clobber}. You may +assume that @var{dinsn} is a jump insn with a delay slot. + +@item DBR_OUTPUT_SEQEND(@var{file}) +A C statement, to be executed after all slot-filler instructions have +been output. If necessary, call @code{dbr_sequence_length} to +determine the number of slots filled in a sequence (zero if not +currently outputting a sequence), to decide how many no-ops to output, +or whatever. + +Don't define this macro if it has nothing to do, but it is helpful in +reading assembly output if the extent of the delay sequence is made +explicit (e.g. with white space). + +Note that output routines for instructions with delay slots must be +prepared to deal with not being output as part of a sequence (i.e. +when the scheduling pass is not run, or when no slot fillers could be +found.) The variable @code{final_sequence} is null when not +processing a sequence, otherwise it contains the @code{sequence} rtx +being output. +@end table + +@node Condition Code, Misc, Delayed Branch, Machine Macros +@section Condition Code Information + +The file @file{conditions.h} defines a variable @code{cc_status} to +describe how the condition code was computed (in case the interpretation of +the condition code depends on the instruction that it was set by). This +variable contains the RTL expressions on which the condition code is +currently based, and several standard flags. + +Sometimes additional machine-specific flags must be defined in the machine +description header file. It can also add additional machine-specific +information by defining @code{CC_STATUS_MDEP}. + +@table @code +@item CC_STATUS_MDEP +C code for a data type which is used for declaring the @code{mdep} +component of @code{cc_status}. It defaults to @code{int}. + +@item CC_STATUS_MDEP_INIT +A C expression for the initial value of the @code{mdep} field. It +defaults to 0. + +@item NOTICE_UPDATE_CC (@var{exp}, @var{insn}) +A C compound statement to set the components of @code{cc_status} +appropriately for an insn @var{insn} whose body is @var{exp}. It is +this macro's responsibility to recognize insns that set the condition +code as a byproduct of other activity as well as those that explicitly +set @code{(cc0)}. + +If there are insn that do not set the condition code but do alter +other machine registers, this macro must check to see whether they +invalidate the expressions that the condition code is recorded as +reflecting. For example, on the 68000, insns that store in address +registers do not set the condition code, which means that usually +@code{NOTICE_UPDATE_CC} can leave @code{cc_status} unaltered for such +insns. But suppose that the previous insn set the condition code +based on location @samp{a4@@(102)} and the current insn stores a new +value in @samp{a4}. Although the condition code is not changed by +this, it will no longer be true that it reflects the contents of +@samp{a4@@(102)}. Therefore, @code{NOTICE_UPDATE_CC} must alter +@code{cc_status} in this case to say that nothing is known about the +condition code value. + +The definition of @code{NOTICE_UPDATE_CC} must be prepared to deal +with the results of peephole optimization: insns whose patterns are +@code{parallel} RTXs containing various @code{reg}, @code{mem} or +constants which are just the operands. The RTL structure of these +insns is not sufficient to indicate what the insns actually do. What +@code{NOTICE_UPDATE_CC} should do when it sees one is just to run +@code{CC_STATUS_INIT}. +@end table + +@node Cross-compilation, Misc, Condition Code, Machine Macros +@section Cross Compilation and Floating-Point Format + +While all modern machines use 2's compliment representation for integers, +there are a variety of representations for floating point numbers. This +means that in a cross-compiler the representation of floating point numbers +in the compiled program may be different from that used in the machine +doing the compilation. + +Because different representation systems may offer different amounts of +range and precision, the cross compiler cannot safely use the host +machine's floating point arithmetic. Therefore, floating point constants +must be represented in the target machine's format. This means that the +cross compiler cannot use @code{atof} to parse a floating point constant; +it must have its own special routine to use instead. Also, constant +folding must emulate the target machine's arithmetic (or must not be done +at all). + +The macros in the following table should be defined only if you are cross +compiling between different floating point formats. + +Otherwise, don't define them. Then default definitions will be set up which +use @code{double} as the data type, @code{==} to test for equality, etc. + +You don't need to worry about how many times you use an operand of any +of these macros. The compiler never uses operands which have side effects. + +@table @code +@item REAL_VALUE_TYPE +A macro for the C data type to be used to hold a floating point value +in the target machine's format. Typically this would be a +@code{struct} containing an array of @code{int}. + +@item REAL_VALUES_EQUAL (@var{x}, @var{y}) +A macro for a C expression which compares for equality the two values, +@var{x} and @var{y}, both of type @code{REAL_VALUE_TYPE}. + +@item REAL_VALUES_LESS (@var{x}, @var{y}) +A macro for a C expression which tests whether @var{x} is less than +@var{y}, both values being of type @code{REAL_VALUE_TYPE} and +interpreted as floating point numbers in the target machine's +representation. + +@item REAL_VALUE_LDEXP (@var{x}, @var{scale}) +A macro for a C expression which performs the standard library +function @code{ldexp}, but using the target machine's floating point +representation. Both @var{x} and the value of the expression have +type @code{REAL_VALUE_TYPE}. The second argument, @var{scale}, is an +integer. + +@item REAL_VALUE_ATOF (@var{string}) +A macro for a C expression which converts @var{string}, an expression +of type @code{char *}, into a floating point number in the target +machine's representation. The value has type @code{REAL_VALUE_TYPE}. +@end table + +Define the following additional macros if you want to make floating +point constant folding work while cross compiling. If you don't +define them, cross compilation is still possible, but constant folding +will not happen for floating point values. + +@table @code +@item REAL_ARITHMETIC (@var{output}, @var{code}, @var{x}, @var{y}) +A macro for a C statement which calculates an arithmetic operation of +the two floating point values @var{x} and @var{y}, both of type +@code{REAL_VALUE_TYPE} in the target machine's representation, to +produce a result of the same type and representation which is stored +in @var{output} (which will be a variable). + +The operation to be performed is specified by @var{code}, a tree code +which will always be one of the following: @code{PLUS_EXPR}, +@code{MINUS_EXPR}, @code{MULT_EXPR}, @code{RDIV_EXPR}, +@code{MAX_EXPR}, @code{MIN_EXPR}.@refill + +The expansion of this macro is responsible for checking for overflow. +If overflow happens, the macro expansion should execute the statement +@code{return 0;}, which indicates the inability to perform the +arithmetic operation requested. + +@item REAL_VALUE_NEGATE (@var{x}) +A macro for a C expression which returns the negative of the floating +point value @var{x}. Both @var{x} and the value of the expression +have type @code{REAL_VALUE_TYPE} and are in the target machine's +floating point representation. + +There is no way for this macro to report overflow, since overflow +can't happen in the negation operation. + +@item REAL_VALUE_TO_INT (@var{low}, @var{high}, @var{x}) +A macro for a C expression which converts a floating point value +@var{x} into a double-precision integer which is then stored into +@var{low} and @var{high}, two variables of type @var{int}. + +@item REAL_VALUE_FROM_INT (@var{x}, @var{low}, @var{high}) +A macro for a C expression which converts a double-precision integer +found in @var{low} and @var{high}, two variables of type @var{int}, +into a floating point value which is then stored into @var{x}. @end table -@node Misc, Condition Code, Addressing Modes, Machine Macros +@node Misc, Assembler Format, Cross-compilation, Machine Macros @section Miscellaneous Parameters @table @code @@ -7290,9 +9068,9 @@ and @samp{-funsigned-char}. Define this if the preprocessor should ignore @code{#sccs} directives and print no error message. -@item IDENT_DIRECTIVE -Define this if the preprocessor should ignore @code{#ident} directives -and print no error message. +@item HAVE_VPRINTF +Define this if the library function @code{vprintf} is available on your +system. @item MOVE_MAX The maximum number of bytes that a single instruction can move quickly @@ -7300,7 +9078,42 @@ from memory to memory. @item INT_TYPE_SIZE A C expression for the size in bits of the type @code{int} on the -target machine. +target machine. If you don't define this, the default is one word. + +@item SHORT_TYPE_SIZE +A C expression for the size in bits of the type @code{short} on the +target machine. If you don't define this, the default is half a word. +(If this would be less than one storage unit, it is rounded up to one +unit.) + +@item LONG_TYPE_SIZE +A C expression for the size in bits of the type @code{long} on the +target machine. If you don't define this, the default is one word. + +@item LONG_LONG_TYPE_SIZE +A C expression for the size in bits of the type @code{long long} on the +target machine. If you don't define this, the default is two +words. + +@item CHAR_TYPE_SIZE +A C expression for the size in bits of the type @code{char} on the +target machine. If you don't define this, the default is one quarter +of a word. (If this would be less than one storage unit, it is rounded up +to one unit.) + +@item FLOAT_TYPE_SIZE +A C expression for the size in bits of the type @code{float} on the +target machine. If you don't define this, the default is one word. + +@item DOUBLE_TYPE_SIZE +A C expression for the size in bits of the type @code{double} on the +target machine. If you don't define this, the default is two +words. + +@item LONG_DOUBLE_TYPE_SIZE +A C expression for the size in bits of the type @code{long double} on +the target machine. If you don't define this, the default is two +words. @item SLOW_BYTE_ACCESS Define this macro as a C expression which is nonzero if accessing less @@ -7363,24 +9176,31 @@ can be @item FUNCTION_MODE An alias for the machine mode used for memory references to functions -being called, in @samp{call} RTL expressions. On most machines this +being called, in @code{call} RTL expressions. On most machines this should be @code{QImode}. @item INSN_MACHINE_INFO This macro should expand into a C structure type to use for the machine-dependent info field specified with the optional last argument -in @samp{define_insn} and @samp{define_peephole} patterns. For example, -it might expand into @samp{struct machine_info}; then it would be up +in @code{define_insn} and @code{define_peephole} patterns. For example, +it might expand into @code{struct machine_info}; then it would be up to you to define this structure in the @file{tm.h} file. You do not need to define this macro if you do not write the optional last argument in any of the patterns in the machine description. +@item DEFAULT_MACHINE_INFO +This macro should expand into a C initializer to use to initialize +the machine-dependent info for one insn pattern. It is used for patterns +that do not specify the machine-dependent info. + +If you do not define this macro, zero is used. + @item CONST_COSTS (@var{x}, @var{code}) A part of a C @code{switch} statement that describes the relative costs of constant RTL expressions. It must contain @code{case} labels -for expression codes @samp{const_int}, @samp{const}, @samp{symbol_ref}, @samp{label_ref} -and @samp{const_double}. Each case must ultimately reach a +for expression codes @code{const_int}, @code{const}, @code{symbol_ref}, @code{label_ref} +and @code{const_double}. Each case must ultimately reach a @code{return} statement to return the relative cost of the use of that kind of constant value in an expression. The cost may depend on the precise value of the constant, which is available for examination in @@ -7392,61 +9212,34 @@ obtained with @code{GET_CODE (@var{x})}. @item DOLLARS_IN_IDENTIFIERS Define this to be nonzero if the character @samp{$} should be allowed by default in identifier names. -@end table - -@node Condition Code, Assembler Format, Misc, Machine Macros -@section Condition Code Information - -The file @file{conditions.h} defines a variable @code{cc_status} to -describe how the condition code was computed (in case the interpretation of -the condition code depends on the instruction that it was set by). This -variable contains the RTL expressions on which the condition code is -currently based, and several standard flags. - -Sometimes additional machine-specific flags must be defined in the machine -description header file. It can also add additional machine-specific -information by defining @code{CC_STATUS_MDEP}. -@table @code -@item CC_STATUS_MDEP -C code for a data type which is used for declaring the @code{mdep} -component of @code{cc_status}. It defaults to @code{int}. +@item USE_C_ALLOCA +Define this macro to indicate that the compiler is running with the +@code{alloca} implemented in C. This version of @code{alloca} can be +found in the file @file{alloca.c}; to use it, you must also edit the +@file{Makefile}. + +This macro, unlike most, describes the machine that the compiler is +running on, rather than the one the compiler is compiling for. +Therefore, it should be set in the @file{xm-@var{machine}.h} file +rather than in the @file{tm-@var{machine}.h} file. -@item CC_STATUS_MDEP_INIT -A C expression for the initial value of the @code{mdep} field. It -defaults to 0. - -@item NOTICE_UPDATE_CC (@var{exp}, @var{insn}) -A C compound statement to set the components of @code{cc_status} -appropriately for an insn @var{insn} whose body is @var{exp}. It is -this macro's responsibility to recognize insns that set the condition -code as a byproduct of other activity as well as those that explicitly -set @code{(cc0)}. +If you do define this macro, you should probably do it as follows: -If there are insn that do not set the condition code but do alter -other machine registers, this macro must check to see whether they -invalidate the expressions that the condition code is recorded as -reflecting. For example, on the 68000, insns that store in address -registers do not set the condition code, which means that usually -@code{NOTICE_UPDATE_CC} can leave @code{cc_status} unaltered for such -insns. But suppose that the previous insn set the condition code -based on location @samp{a4@@(102)} and the current insn stores a new -value in @samp{a4}. Although the condition code is not changed by -this, it will no longer be true that it reflects the contents of -@samp{a4@@(102)}. Therefore, @code{NOTICE_UPDATE_CC} must alter -@code{cc_status} in this case to say that nothing is known about the -condition code value. +@example +#ifndef __GNUC__ +#define USE_C_ALLOCA +#else +#define alloca __builtin_alloca +#endif +@end example -The definition of @code{NOTICE_UPDATE_CC} must be prepared to deal -with the results of peephole optimization: insns whose patterns are -@samp{parallel} RTXs containing various @samp{reg}, @samp{mem} or -constants which are just the operands. The RTL structure of these -insns is not sufficient to indicate what the insns actually do. What -@code{NOTICE_UPDATE_CC} should do when it sees one is just to run -@code{CC_STATUS_INIT}. +@noindent +so that when the compiler is compiled with GNU CC it uses the more +efficient built-in @code{alloca} function. @end table -@node Assembler Format,, Condition Code, Machine Macros +@node Assembler Format,, Misc, Machine Macros @section Output of Assembler Code @table @code @@ -7481,6 +9274,26 @@ the very beginning of the command given If this macro is not defined, a default is provided that loads the standard C startup file from the usual place. See @file{gcc.c}. +@item STANDARD_EXEC_PREFIX +Define this macro as a C string constant if you wish to override the +standard choice of @file{/usr/local/lib/gcc-} as the default prefix to +try when searching for the executable files of the compiler. + +The prefix specified by the @samp{-B} option, if any, is tried before +the default prefix. After the default prefix, if the executable is +not found that way, @file{/usr/lib/gcc-} is tried next; then the +directories in your search path for shell commands are searched. + +@item STANDARD_STARTFILE_PREFIX +Define this macro as a C string constant if you wish to override the +standard choice of @file{/usr/local/lib/} as the default prefix to try +when searching for startup files such as @file{crt0.o}. + +In this search, all the prefixes tried for executable files are tried +first. Then comes the default startfile prefix specified by this +macro, followed by the prefixes @file{/lib/} and @file{/usr/lib/} as +last resorts. + @item ASM_FILE_START (@var{stream}) A C expression which outputs to the stdio stream @var{stream} some appropriate text to go at the start of an assembler file. @@ -7493,6 +9306,32 @@ checking for certain assembler construct On systems that use SDB, it is necessary to output certain commands; see @file{tm-attasm.h}. +@item ASM_FILE_END (@var{stream}) +A C expression which outputs to the stdio stream @var{stream} +some appropriate text to go at the end of an assembler file. + +If this macro is not defined, the default is to output nothing +special at the end of the file. Most systems don't require any +definition. + +On systems that use SDB, it is necessary to output certain commands; +see @file{tm-attasm.h}. + +@item ASM_IDENTIFY_GCC (@var{file}) +A C statement to output assembler commands which will identify +the object file as having been compiled with GNU CC (or another +GNU compiler). + +If you don't define this macro, the string @samp{gcc_compiled.:} +is output. This string is calculated to define a symbol which, +on BSD systems, will never be defined for any other reason. +GDB checks for the presence of this symbol when reading the +symbol table of an executable. + +On non-BSD systems, you must arrange communication with GDB in +some other fashion. If GDB is not used on your system, you can +define this macro with an empty body. + @item ASM_APP_ON A C string constant for text to be output before each @code{asm} statement or group of consecutive ones. Normally this is @@ -7515,6 +9354,38 @@ A C string constant for the assembler op following data as writable initialized data. Normally @code{".data"} is right. +@item EXTRA_SECTIONS +A list of names for sections other than the standard two, which are +@code{in_text} and @code{in_data}. You need not define this macro +on a system with no other sections (that GCC needs to use). + +@item EXTRA_SECTION_FUNCTIONS +One or more functions to be defined in @file{varasm.c}. These +functions should do jobs analogous to those of @code{text_section} and +@code{data_section}, for your additional sections. Do not define this +macro if you do not define @code{EXTRA_SECTIONS}. + +@item SELECT_SECTION (@var{exp}) +A C statement or statements to switch to the appropriate section for +output of @var{exp}. You can assume that @var{exp} is either a +@code{VAR_DECL} node or a constant of some sort. Select the section +by calling @code{text_section} or one of the alternatives for other +sections. + +Do not define this macro if you use only the standard two sections +and put all read-only variables and constants in the text section. + +@item SELECT_RTX_SECTION (@var{mode}, @var{rtx}) +A C statement or statements to switch to the appropriate section for +output of @var{rtx} in mode @var{mode}. You can assume that @var{rtx} +is some kind of constant in RTL. The argument @var{mode} is redundant +except in the case of a @code{const_int} rtx. Select the section by +calling @code{text_section} or one of the alternatives for other +sections. + +Do not define this macro if you use only the standard two sections and +put all constants in the text section. + @item REGISTER_NAMES A C initializer containing the assembler's names for the machine registers, each one as a C string constant. This is what translates @@ -7569,11 +9440,16 @@ a different character instead, define th constant for the character you want to use. Do not define this macro if backslash is correct for your system. +@item DBX_STATIC_STAB_DATA_SECTION +Define this macro if it is necessary to go to the data section before +outputting the @samp{.stabs} pseudo-op for a non-global static +variable. + @item ASM_OUTPUT_LABEL (@var{stream}, @var{name}) A C statement (sans semicolon) to output to the stdio stream -@var{stream} the assembler definition of a label named @var{name}. Use -the expression @code{assemble_name (@var{stream}, @var{name})} to output -the name itself; before and after that, output the additional +@var{stream} the assembler definition of a label named @var{name}. +Use the expression @code{assemble_name (@var{stream}, @var{name})} to +output the name itself; before and after that, output the additional assembler syntax for defining the name, and a newline. @item ASM_DECLARE_FUNCTION_NAME (@var{stream}, @var{name}, @var{decl}) @@ -7595,7 +9471,7 @@ that is, available for reference from ot itself; before and after that, output the additional assembler syntax for making that name global, and a newline. -@item ASM_OUTPUT_EXTERNAL (@var{stream}, @var{name}, @var{decl}) +@item ASM_OUTPUT_EXTERNAL (@var{stream}, @var{decl}, @var{name}) A C statement (sans semicolon) to output to the stdio stream @var{stream} any text necessary for declaring the name of an external symbol named @var{name} which is referenced in this compilation but @@ -7606,15 +9482,15 @@ This macro need not be defined if it doe The GNU assembler and most Unix assemblers don't require anything. @item ASM_OUTPUT_LABELREF (@var{stream}, @var{name}) -A C statement to output to the stdio stream @var{stream} a reference in -assembler syntax to a label named @var{name}. The character @samp{_} -should be added to the front of the name, if that is customary on your -operating system, as it is in most Berkeley Unix systems. This macro -is used in @code{assemble_name}. +A C statement to output to the stdio stream @var{stream} a reference +in assembler syntax to a label named @var{name}. The character +@samp{_} should be added to the front of the name, if that is +customary on your operating system, as it is in most Berkeley Unix +systems. This macro is used in @code{assemble_name}. @item ASM_GENERATE_INTERNAL_LABEL (@var{string}, @var{prefix}, @var{num}) -A C statement to store into the string @var{string} a label whose -name is made from the string @var{prefix} and the number @var{num}. +A C statement to store into the string @var{string} a label whose name +is made from the string @var{prefix} and the number @var{num}. This string, when output subsequently by @code{ASM_OUTPUT_LABELREF}, should produce the same output that @code{ASM_OUTPUT_INTERNAL_LABEL} @@ -7636,8 +9512,8 @@ fprintf (@var{stream}, "L%s%d:\n", @var{ Define this if the label before a jump-table needs to be output specially. The first three arguments are the same as for @code{ASM_OUTPUT_INTERNAL_LABEL}; the fourth argument is the -jump-table which follows (a @samp{jump_insn} containing an -@samp{addr_vec} or @samp{addr_diff_vec}). +jump-table which follows (a @code{jump_insn} containing an +@code{addr_vec} or @code{addr_diff_vec}). This feature is used on system V to output a @code{swbeg} statement for the table. @@ -7646,15 +9522,25 @@ If this macro is not defined, these labe @code{ASM_OUTPUT_INTERNAL_LABEL}. @item ASM_OUTPUT_CASE_END (@var{stream}, @var{num}, @var{table}) -Define this if something special must be output at the end of a jump-table. -The definition should be a C statement to be executed after the assembler -code for the table is written. It should write the appropriate code to -stdio stream @var{stream}. The argument @var{table} is the jump-table -insn, and @var{num} is the label-number of the preceding label. +Define this if something special must be output at the end of a +jump-table. The definition should be a C statement to be executed +after the assembler code for the table is written. It should write +the appropriate code to stdio stream @var{stream}. The argument +@var{table} is the jump-table insn, and @var{num} is the label-number +of the preceding label. If this macro is not defined, nothing special is output at the end of the jump-table. +@item ASM_OUTPUT_ALIGN_CODE (@var{file}) +A C expression to output text to align the location counter in the way +that is desirable at a point in the code that is reached only by +jumping. + +This macro need not be defined if you don't want any special alignment +to be done at such a time. Most machine descriptions do not currently +define the macro. + @item ASM_FORMAT_PRIVATE_NAME (@var{outvar}, @var{name}, @var{number}) A C expression to assign to @var{outvar} (which is a variable of type @code{char *}) a newly allocated string made from the string @@ -7736,6 +9622,14 @@ an RTL expression which represents a con @samp{output_addr_const (@var{exp})} to output this value as an assembler expression.@refill +@item ASM_OUTPUT_DOUBLE_INT (@var{stream}, @var{exp}) +A C statement to output to the stdio stream @var{stream} an assembler +instruction to assemble a @code{long long} constant whose value is +@var{exp}. The argument @var{exp} will be an RTL expression which +represents a constant value. It may be a @code{const_double} RTX, +or it may be an ordinary single-precision constant. In the latter +case, you should zero-extend it. + @item ASM_OUTPUT_BYTE (@var{stream}, @var{value}) A C statement to output to the stdio stream @var{stream} an assembler instruction to assemble a single byte containing the number @var{value}. @@ -7760,28 +9654,40 @@ A C statement to output to the stdio str instruction to advance the location counter to a multiple of 2 to the @var{power} bytes. @var{power} will be a C expression of type @code{int}. -@item ASM_OUTPUT_COMMON (@var{stream}, @var{name}, @var{size}) +@item ASM_OUTPUT_COMMON (@var{stream}, @var{name}, @var{size}, @var{rounded}) A C statement (sans semicolon) to output to the stdio stream -@var{stream} the assembler definition of a common-label named @var{name} -whose size is @var{size} bytes. Use the expression -@code{assemble_name (@var{stream}, @var{name})} to output the name -itself; before and after that, output the additional assembler syntax -for defining the name, and a newline. +@var{stream} the assembler definition of a common-label named +@var{name} whose size is @var{size} bytes. The variable @var{rounded} +is the size rounded up to whatever alignment the caller wants. + +Use the expression @code{assemble_name (@var{stream}, @var{name})} to +output the name itself; before and after that, output the additional +assembler syntax for defining the name, and a newline. This macro controls how the assembler definitions of uninitialized global variables are output. -@item ASM_OUTPUT_LOCAL (@var{stream}, @var{name}, @var{size}) +@item ASM_OUTPUT_LOCAL (@var{stream}, @var{name}, @var{size}, @var{rounded}) A C statement (sans semicolon) to output to the stdio stream @var{stream} the assembler definition of a local-common-label named -@var{name} whose size is @var{size} bytes. Use the expression -@code{assemble_name (@var{stream}, @var{name})} to output the name -itself; before and after that, output the additional assembler syntax -for defining the name, and a newline. +@var{name} whose size is @var{size} bytes. The variable @var{rounded} +is the size rounded up to whatever alignment the caller wants. + +Use the expression @code{assemble_name (@var{stream}, @var{name})} to +output the name itself; before and after that, output the additional +assembler syntax for defining the name, and a newline. This macro controls how the assembler definitions of uninitialized static variables are output. +@item ASM_OUTPUT_SOURCE_FILENAME (@var{stream}, @var{name}) +A C statment to output DBX or SDB debugging information which indicates +that filename @var{name} is the current source file to the stdio stream +@var{stream}. + +This macro need not be defined if the standard form of debugging +information for the debugger in use is appropriate. + @item ASM_OUTPUT_SOURCE_LINE (@var{stream}, @var{line}) A C statment to output DBX or SDB debugging information before code for line number @var{line} of the current source file to the @@ -7793,10 +9699,7 @@ information for the debugger in use is a @item ASM_OUTPUT_IDENT (@var{stream}, @var{string}) A C statement to output something to the assembler file to handle a @samp{#ident} directive containing the text @var{string}. If this -macro is not defined, the assembler code @samp{.ident "@var{string}"} -will be output by default. - -This macro is significant only if @code{IDENT_DIRECTIVE} is defined. +macro is not defined, nothing is output for a @samp{#ident} directive. @item TARGET_BELL A C constant expression for the integer value for escape sequence @@ -7833,6 +9736,9 @@ that includes @samp{%}-sequences to subs care of the substitution yourself. Just be sure to increment @var{ptr} over whatever text should not be output normally. +If you need to look at the operand values, they can be found as the +elements of @code{recog_operand}. + If the macro definition does nothing, the instruction is output in the usual way. @@ -7880,6 +9786,13 @@ When the machine description has a speci with a null pointer for @var{x} and the punctuation character for @var{code}. +@item PRINT_OPERAND_PUNCT_VALID_P (@var{code}) +A C expression which evaluates to true if @var{code} is a valid +punctuation character for use in the @code{PRINT_OPERAND} macro. If +@code{PRINT_OPERAND_PUNCT_VALID_P} is not defined, it means that no +punctuation characters (except for the standard one, @samp{%}) are used +in this way. + @item PRINT_OPERAND_ADDRESS (@var{stream}, @var{x}) A C compound statement to output to stdio stream @var{stream} the assembler syntax for an instruction operand that is a memory reference @@ -7900,10 +9813,10 @@ definitions are correct for most assembl @node Config,, Machine Macros, Top @chapter The Configuration File -The configuration file @file{config-@var{machine}.h} contains macro -definitions that describe the machine and system on which the compiler is -running. Most of the values in it are actually the same on all machines -that GNU CC runs on, so most all configuration files are identical. But +The configuration file @file{xm-@var{machine}.h} contains macro definitions +that describe the machine and system on which the compiler is running. +Most of the values in it are actually the same on all machines that GNU CC +runs on, so large parts of all configuration files are identical. But there are some macros that vary: @table @code @@ -7916,5 +9829,10 @@ A C expression for the status code to be exits without serious errors. @end table +In addition, configuration files for system V define @code{bcopy}, +@code{bzero} and @code{bcmp} as aliases. Some files define @code{alloca} +as a macro when compiled with GNU CC, in order to take advantage of the +benefit of GNU CC's built-in @code{alloca}. + @contents @bye