?? rtl.texi
字號:
This is a catchall mode class for modes which don't fit into the aboveclasses. Currently @code{VOIDmode} and @code{BLKmode} are in@code{MODE_RANDOM}.@end tableHere are some C macros that relate to machine modes:@table @code@findex GET_MODE@item GET_MODE (@var{x})Returns the machine mode of the RTX @var{x}.@findex PUT_MODE@item PUT_MODE (@var{x}, @var{newmode})Alters the machine mode of the RTX @var{x} to be @var{newmode}.@findex NUM_MACHINE_MODES@item NUM_MACHINE_MODESStands for the number of machine modes available on the targetmachine. This is one greater than the largest numeric value of anymachine mode.@findex GET_MODE_NAME@item GET_MODE_NAME (@var{m})Returns the name of mode @var{m} as a string.@findex GET_MODE_CLASS@item GET_MODE_CLASS (@var{m})Returns the mode class of mode @var{m}.@findex GET_MODE_WIDER_MODE@item GET_MODE_WIDER_MODE (@var{m})Returns the next wider natural mode. For example, the expression@code{GET_MODE_WIDER_MODE (QImode)} returns @code{HImode}.@findex GET_MODE_SIZE@item GET_MODE_SIZE (@var{m})Returns the size in bytes of a datum of mode @var{m}.@findex GET_MODE_BITSIZE@item GET_MODE_BITSIZE (@var{m})Returns the size in bits of a datum of mode @var{m}.@findex GET_MODE_IBIT@item GET_MODE_IBIT (@var{m})Returns the number of integral bits of a datum of fixed-point mode @var{m}.@findex GET_MODE_FBIT@item GET_MODE_FBIT (@var{m})Returns the number of fractional bits of a datum of fixed-point mode @var{m}.@findex GET_MODE_MASK@item GET_MODE_MASK (@var{m})Returns a bitmask containing 1 for all bits in a word that fit withinmode @var{m}. This macro can only be used for modes whose bitsize isless than or equal to @code{HOST_BITS_PER_INT}.@findex GET_MODE_ALIGNMENT@item GET_MODE_ALIGNMENT (@var{m})Return the required alignment, in bits, for an object of mode @var{m}.@findex GET_MODE_UNIT_SIZE@item GET_MODE_UNIT_SIZE (@var{m})Returns the size in bytes of the subunits of a datum of mode @var{m}.This is the same as @code{GET_MODE_SIZE} except in the case of complexmodes. For them, the unit size is the size of the real or imaginarypart.@findex GET_MODE_NUNITS@item GET_MODE_NUNITS (@var{m})Returns the number of units contained in a mode, i.e.,@code{GET_MODE_SIZE} divided by @code{GET_MODE_UNIT_SIZE}.@findex GET_CLASS_NARROWEST_MODE@item GET_CLASS_NARROWEST_MODE (@var{c})Returns the narrowest mode in mode class @var{c}.@end table@findex byte_mode@findex word_modeThe global variables @code{byte_mode} and @code{word_mode} contain modeswhose classes are @code{MODE_INT} and whose bitsizes are either@code{BITS_PER_UNIT} or @code{BITS_PER_WORD}, respectively. On 32-bitmachines, these are @code{QImode} and @code{SImode}, respectively.@node Constants@section Constant Expression Types@cindex RTL constants@cindex RTL constant expression typesThe simplest RTL expressions are those that represent constant values.@table @code@findex const_int@item (const_int @var{i})This type of expression represents the integer value @var{i}. @var{i}is customarily accessed with the macro @code{INTVAL} as in@code{INTVAL (@var{exp})}, which is equivalent to @code{XWINT (@var{exp}, 0)}.Constants generated for modes with fewer bits than @code{HOST_WIDE_INT}must be sign extended to full width (e.g., with @code{gen_int_mode}).@findex const0_rtx@findex const1_rtx@findex const2_rtx@findex constm1_rtxThere is only one expression object for the integer value zero; it isthe value of the variable @code{const0_rtx}. Likewise, the onlyexpression for integer value one is found in @code{const1_rtx}, the onlyexpression for integer value two is found in @code{const2_rtx}, and theonly expression for integer value negative one is found in@code{constm1_rtx}. Any attempt to create an expression of code@code{const_int} and value zero, one, two or negative one will return@code{const0_rtx}, @code{const1_rtx}, @code{const2_rtx} or@code{constm1_rtx} as appropriate.@findex const_true_rtxSimilarly, there is only one object for the integer whose value is@code{STORE_FLAG_VALUE}. It is found in @code{const_true_rtx}. If@code{STORE_FLAG_VALUE} is one, @code{const_true_rtx} and@code{const1_rtx} will point to the same object. If@code{STORE_FLAG_VALUE} is @minus{}1, @code{const_true_rtx} and@code{constm1_rtx} will point to the same object.@findex const_double@item (const_double:@var{m} @var{addr} @var{i0} @var{i1} @dots{})Represents either a floating-point constant of mode @var{m} or aninteger constant too large to fit into @code{HOST_BITS_PER_WIDE_INT}bits but small enough to fit within twice that number of bits (GCCdoes not provide a mechanism to represent even larger constants). Inthe latter case, @var{m} will be @code{VOIDmode}.@findex const_fixed@item (const_fixed:@var{m} @var{addr})Represents a fixed-point constant of mode @var{m}.The data structure, which contains data with the size of two@code{HOST_BITS_PER_WIDE_INT} and the associated fixed-point mode,is access with the macro @code{CONST_FIXED_VALUE}. The high part of datais accessed with @code{CONST_FIXED_VALUE_HIGH}; the low part is accessedwith @code{CONST_FIXED_VALUE_LOW}.@findex const_vector@item (const_vector:@var{m} [@var{x0} @var{x1} @dots{}])Represents a vector constant. The square brackets stand for the vectorcontaining the constant elements. @var{x0}, @var{x1} and so on arethe @code{const_int} or @code{const_double} elements.The number of units in a @code{const_vector} is obtained with the macro@code{CONST_VECTOR_NUNITS} as in @code{CONST_VECTOR_NUNITS (@var{v})}.Individual elements in a vector constant are accessed with the macro@code{CONST_VECTOR_ELT} as in @code{CONST_VECTOR_ELT (@var{v}, @var{n})}where @var{v} is the vector constant and @var{n} is the elementdesired.@findex CONST_DOUBLE_MEM@findex CONST_DOUBLE_CHAIN@var{addr} is used to contain the @code{mem} expression that correspondsto the location in memory that at which the constant can be found. Ifit has not been allocated a memory location, but is on the chain of all@code{const_double} expressions in this compilation (maintained using anundisplayed field), @var{addr} contains @code{const0_rtx}. If it is noton the chain, @var{addr} contains @code{cc0_rtx}. @var{addr} iscustomarily accessed with the macro @code{CONST_DOUBLE_MEM} and thechain field via @code{CONST_DOUBLE_CHAIN}.@findex CONST_DOUBLE_LOWIf @var{m} is @code{VOIDmode}, the bits of the value are stored in@var{i0} and @var{i1}. @var{i0} is customarily accessed with the macro@code{CONST_DOUBLE_LOW} and @var{i1} with @code{CONST_DOUBLE_HIGH}.If the constant is floating point (regardless of its precision), thenthe number of integers used to store the value depends on the size of@code{REAL_VALUE_TYPE} (@pxref{Floating Point}). The integersrepresent a floating point number, but not precisely in the targetmachine's or host machine's floating point format. To convert them tothe precise bit pattern used by the target machine, use the macro@code{REAL_VALUE_TO_TARGET_DOUBLE} and friends (@pxref{Data Output}).@findex CONST0_RTX@findex CONST1_RTX@findex CONST2_RTXThe macro @code{CONST0_RTX (@var{mode})} refers to an expression withvalue 0 in mode @var{mode}. If mode @var{mode} is of mode class@code{MODE_INT}, it returns @code{const0_rtx}. If mode @var{mode} is ofmode class @code{MODE_FLOAT}, it returns a @code{CONST_DOUBLE}expression in mode @var{mode}. Otherwise, it returns a@code{CONST_VECTOR} expression in mode @var{mode}. Similarly, the macro@code{CONST1_RTX (@var{mode})} refers to an expression with value 1 inmode @var{mode} and similarly for @code{CONST2_RTX}. The@code{CONST1_RTX} and @code{CONST2_RTX} macros are undefinedfor vector modes.@findex const_string@item (const_string @var{str})Represents a constant string with value @var{str}. Currently this isused only for insn attributes (@pxref{Insn Attributes}) since constantstrings in C are placed in memory.@findex symbol_ref@item (symbol_ref:@var{mode} @var{symbol})Represents the value of an assembler label for data. @var{symbol} isa string that describes the name of the assembler label. If it startswith a @samp{*}, the label is the rest of @var{symbol} not includingthe @samp{*}. Otherwise, the label is @var{symbol}, usually prefixedwith @samp{_}.The @code{symbol_ref} contains a mode, which is usually @code{Pmode}.Usually that is the only mode for which a symbol is directly valid.@findex label_ref@item (label_ref:@var{mode} @var{label})Represents the value of an assembler label for code. It contains oneoperand, an expression, which must be a @code{code_label} or a @code{note}of type @code{NOTE_INSN_DELETED_LABEL} that appears in the instructionsequence to identify the place where the label should go.The reason for using a distinct expression type for code labelreferences is so that jump optimization can distinguish them.The @code{label_ref} contains a mode, which is usually @code{Pmode}.Usually that is the only mode for which a label is directly valid.@item (const:@var{m} @var{exp})Represents a constant that is the result of an assembly-timearithmetic computation. The operand, @var{exp}, is an expression thatcontains only constants (@code{const_int}, @code{symbol_ref} and@code{label_ref} expressions) combined with @code{plus} and@code{minus}. However, not all combinations are valid, since theassembler cannot do arbitrary arithmetic on relocatable symbols.@var{m} should be @code{Pmode}.@findex high@item (high:@var{m} @var{exp})Represents the high-order bits of @var{exp}, usually a@code{symbol_ref}. The number of bits is machine-dependent and isnormally the number of bits specified in an instruction that initializesthe high order bits of a register. It is used with @code{lo_sum} torepresent the typical two-instruction sequence used in RISC machines toreference a global memory location.@var{m} should be @code{Pmode}.@end table@node Regs and Memory@section Registers and Memory@cindex RTL register expressions@cindex RTL memory expressionsHere are the RTL expression types for describing access to machineregisters and to main memory.@table @code@findex reg@cindex hard registers@cindex pseudo registers@item (reg:@var{m} @var{n})For small values of the integer @var{n} (those that are less than@code{FIRST_PSEUDO_REGISTER}), this stands for a reference to machineregister number @var{n}: a @dfn{hard register}. For larger values of@var{n}, it stands for a temporary value or @dfn{pseudo register}.The compiler's strategy is to generate code assuming an unlimitednumber of such pseudo registers, and later convert them into hardregisters or into memory references.@var{m} is the machine mode of the reference. It is necessary becausemachines can generally refer to each register in more than one mode.For example, a register may contain a full word but there may beinstructions to refer to it as a half word or as a single byte, aswell as instructions to refer to it as a floating point number ofvarious precisions.Even for a register that the machine can access in only one mode,the mode must always be specified.The symbol @code{FIRST_PSEUDO_REGISTER} is defined by the machinedescription, since the number of hard registers on the machine is aninvariant characteristic of the machine. Note, however, that notall of the machine registers must be general registers. All themachine registers that can be used for storage of data are givenhard register numbers, even those that can be used only in certaininstructions or can hold only certain types of data.A hard register may be accessed in various modes throughout onefunction, but each pseudo register is given a natural modeand is accessed only in that mode. When it is necessary to describean access to a pseudo register using a nonnatural mode, a @code{subreg}expression is used.A @code{reg} expression with a machine mode that specifies more thanone word of data may actually stand for several consecutive registers.If in addition the register number specifies a hardware register, thenit actually represents several consecutive hardware registers startingwith the specified one.Each pseudo register number used in a function's RTL code isrepresented by a unique @code{reg} expression.@findex FIRST_VIRTUAL_REGISTER@findex LAST_VIRTUAL_REGISTERSome pseudo register numbers, those within the range of@code{FIRST_VIRTUAL_REGISTER} to @code{LAST_VIRTUAL_REGISTER} onlyappear during the RTL generation phase and are eliminated before theoptimization phases. These represent locations in the stack frame thatcannot be determined until RTL generation for the function has beencompleted. The following virtual register numbers are defined:@table @code@findex VIRTUAL_INCOMING_ARGS_REGNUM@item VIRTUAL_INCOMING_ARGS_REGNUMThis points to the first word of the incoming arguments passed on thestack. Normally these arguments are placed there by the caller, but thecallee may have pushed some arguments that were previously passed inregisters.@cindex @code{FIRST_PARM_OFFSET} and virtual registers@cindex @code{ARG_POINTER_REGNUM} and virtual registersWhen RTL generation is complete, this virtual register is replacedby the sum of the register given by @code{ARG_POINTER_REGNUM} and thevalue of @code{FIRST_PARM_OFFSET}.@findex VIRTUAL_STACK_VARS_REGNUM@cindex @code{FRAME_GROWS_DOWNWARD} and virtual registers@item VIRTUAL_STACK_VARS_REGNUMIf @code{FRAME_GROWS_DOWNWARD} is defined to a nonzero value, this pointsto immediately above the first variable on the stack. Otherwise, it pointsto the first variable on the stack.@cindex @code{STARTING_FRAME_OFFSET} and virtual registers@cindex @code{FRAME_POINTER_REGNUM} and virtual registers@code{VIRTUAL_STACK_VARS_REGNUM} is replaced with the sum of theregister given by @code{FRAME_POINTER_REGNUM} and the value@code{STARTING_FRAME_OFFSET}.@findex VIRTUAL_STACK_DYNAMIC_REGNUM@item VIRTUAL_STACK_DYNAMIC_REGNUMThis points to the location of dynamic
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -