Annotation of gcc/internals-6, revision 1.1.1.3

1.1.1.3 ! root        1: Info file internals, produced by Makeinfo, -*- Text -*- from input
        !             2: file internals.texinfo.
        !             3: 
        !             4: This file documents the internals of the GNU compiler.
        !             5: 
        !             6: Copyright (C) 1988 Free Software Foundation, Inc.
        !             7: 
        !             8: Permission is granted to make and distribute verbatim copies of this
        !             9: manual provided the copyright notice and this permission notice are
        !            10: preserved on all copies.
        !            11: 
        !            12: Permission is granted to copy and distribute modified versions of
        !            13: this manual under the conditions for verbatim copying, provided also
        !            14: that the section entitled ``GNU CC General Public License'' is
        !            15: included exactly as in the original, and provided that the entire
        !            16: resulting derived work is distributed under the terms of a permission
        !            17: notice identical to this one.
        !            18: 
        !            19: Permission is granted to copy and distribute translations of this
        !            20: manual into another language, under the above conditions for modified
        !            21: versions, except that the section entitled ``GNU CC General Public
        !            22: License'' and this permission notice may be included in translations
        !            23: approved by the Free Software Foundation instead of in the original
        !            24: English.
        !            25: 
1.1       root       26: 
1.1.1.2   root       27: 
                     28: File: internals,  Node: Registers,  Next: Register Classes,  Prev: Storage Layout,  Up: Machine Macros
                     29: 
                     30: Register Usage
                     31: ==============
1.1       root       32: 
1.1.1.2   root       33: `FIRST_PSEUDO_REGISTER'
1.1.1.3 ! root       34:      Number of hardware registers known to the compiler.  They
        !            35:      receive numbers 0 through `FIRST_PSEUDO_REGISTER-1'; thus, the
        !            36:      first pseudo register's number really is assigned the number
        !            37:      `FIRST_PSEUDO_REGISTER'.
1.1.1.2   root       38: 
                     39: `FIXED_REGISTERS'
1.1.1.3 ! root       40:      An initializer that says which registers are used for fixed
        !            41:      purposes all throughout the compiled code and are therefore not
        !            42:      available for general allocation.  These would include the stack
        !            43:      pointer, the frame pointer (except on machines where that can be
        !            44:      used as a general register when no frame pointer is needed), the
        !            45:      program counter on machines where that is considered one of the
        !            46:      addressable registers, and any other numbered register with a
1.1.1.2   root       47:      standard use.
                     48: 
1.1.1.3 ! root       49:      This information is expressed as a sequence of numbers,
        !            50:      separated by commas and surrounded by braces.  The Nth number is
        !            51:      1 if register N is fixed, 0 otherwise.
        !            52: 
        !            53:      The table initialized from this macro, and the table initialized
        !            54:      by the following one, may be overridden at run time either
        !            55:      automatically, by the actions of the macro
        !            56:      `CONDITIONAL_REGISTER_USAGE', or by the user with the command
        !            57:      options `-ffixed-REG', `-fcall-used-REG' and `-fcall-saved-REG'.
1.1.1.2   root       58: 
                     59: `CALL_USED_REGISTERS'
1.1.1.3 ! root       60:      Like `FIXED_REGISTERS' but has 1 for each register that is
        !            61:      clobbered (in general) by function calls as well as for fixed
        !            62:      registers.  This macro therefore identifies the registers that
        !            63:      are not available for general allocation of values that must
        !            64:      live across function calls.
1.1.1.2   root       65: 
                     66:      If a register has 0 in `CALL_USED_REGISTERS', the compiler
1.1.1.3 ! root       67:      automatically saves it on function entry and restores it on
        !            68:      function exit, if the register is used within the function.
1.1.1.2   root       69: 
                     70: `CONDITIONAL_REGISTER_USAGE'
1.1.1.3 ! root       71:      Zero or more C statements that may conditionally modify two
        !            72:      variables `fixed_regs' and `call_used_regs' (both of type `char
        !            73:      []') after they have been initialized from the two preceding
        !            74:      macros.
1.1.1.2   root       75: 
1.1.1.3 ! root       76:      This is necessary in case the fixed or call-clobbered registers
        !            77:      depend on target flags.
1.1.1.2   root       78: 
                     79:      You need not define this macro if it has no work to do.
                     80: 
1.1.1.3 ! root       81:      If the usage of an entire class of registers depends on the
        !            82:      target flags, you may indicate this to gcc by using this macro
        !            83:      to modify `fixed_regs' and `call_used_regs' to 1 for each of the
        !            84:      registers in the classes which should not be used by gcc.  Also
        !            85:      define the macro `REG_CLASS_FROM_LETTER' to return `NO_REGS' if
        !            86:      it is called with a letter for a class that shouldn't be used.
        !            87: 
        !            88:      (However, if this class is not included in `GENERAL_REGS' and
        !            89:      all of the insn patterns whose constraints permit this class are
        !            90:      controlled by target switches, then GCC will automatically avoid
        !            91:      using these registers when the target switches are opposed to
        !            92:      them.)
        !            93: 
        !            94: `OVERLAPPING_REGNO_P (REGNO)'
        !            95:      If defined, this is a C expression whose value is REGNO is
        !            96:      nonzero if hard register number REGNO is an overlapping
        !            97:      register.  This means a hard register which overlaps a hard
        !            98:      register with a different number.  (Such overlap is undesirable,
        !            99:      but occasionally it allows a machine to be supported which
        !           100:      otherwise could not be.)  This macro must return nonzero for
        !           101:      *all* the registers which overlap each other.  GNU CC can use an
        !           102:      overlapping register only in certain limited ways.  It can be
        !           103:      used for allocation within a basic block, and may be spilled for
        !           104:      reloading; that is all.
        !           105: 
        !           106:      If this macro is not defined, it means that none of the hard
        !           107:      registers overlap each other.  This is the usual situation.
        !           108: 
        !           109: `INSN_CLOBBERS_REGNO_P (INSN, REGNO)'
        !           110:      If defined, this is a C expression whose value should be nonzero
        !           111:      if the insn INSN has the effect of mysteriously clobbering the
        !           112:      contents of hard register number REGNO.  By ``mysterious'' we
        !           113:      mean that the insn's RTL expression doesn't describe such an
        !           114:      effect.
        !           115: 
        !           116:      If this macro is not defined, it means that no insn clobbers
        !           117:      registers mysteriously.  This is the usual situation; all else
        !           118:      being equal, it is best for the RTL expression to show all the
        !           119:      activity.
        !           120: 
        !           121: `PRESERVE_DEATH_INFO_REGNO_P (REGNO)'
        !           122:      If defined, this is a C expression whose value is nonzero if
        !           123:      accurate `REG_DEAD' notes are needed for hard register number
        !           124:      REGNO at the time of outputting the assembler code.  When this
        !           125:      is so, a few optimizations that take place after register
        !           126:      allocation and could invalidate the death notes are not done
        !           127:      when this register is involved.
        !           128: 
        !           129:      You would arrange to preserve death info for a register when
        !           130:      some of the code in the machine description which is executed to
        !           131:      write the assembler code looks at the the death notes.  This is
        !           132:      necessary only when the actual hardware feature which GNU CC
        !           133:      thinks of as a register is not actually a register of the usual
        !           134:      sort.  (It might, for example, be a hardware stack.)
        !           135: 
        !           136:      If this macro is not defined, it means that no death notes need
        !           137:      to be preserved.  This is the usual situation.
        !           138: 
1.1.1.2   root      139: `HARD_REGNO_REGS (REGNO, MODE)'
1.1.1.3 ! root      140:      A C expression for the number of consecutive hard registers,
        !           141:      starting at register number REGNO, required to hold a value of
        !           142:      mode MODE.
1.1.1.2   root      143: 
1.1.1.3 ! root      144:      On a machine where all registers are exactly one word, a
        !           145:      suitable definition of this macro is
1.1.1.2   root      146: 
                    147:           #define HARD_REGNO_NREGS(REGNO, MODE)            \
                    148:              ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1)  \
                    149:               / UNITS_PER_WORD))
                    150: 
                    151: `HARD_REGNO_MODE_OK (REGNO, MODE)'
1.1.1.3 ! root      152:      A C expression that is nonzero if it is permissible to store a
        !           153:      value of mode MODE in hard register number REGNO (or in several
        !           154:      registers starting with that one).  For a machine where all
        !           155:      registers are equivalent, a suitable definition is
1.1.1.2   root      156: 
                    157:           #define HARD_REGNO_MODE_OK(REGNO, MODE) 1
                    158: 
1.1.1.3 ! root      159:      It is not necessary for this macro to check for fixed register
        !           160:      numbers because the allocation mechanism considers them to be
        !           161:      always occupied.
        !           162: 
        !           163:      Many machines have special registers for floating point
        !           164:      arithmetic.  Often people assume that floating point machine
        !           165:      modes are allowed only in floating point registers.  This is not
        !           166:      true.  Any registers that can hold integers can safely *hold* a
        !           167:      floating point machine mode, whether or not floating arithmetic
        !           168:      can be done on it in those registers.
        !           169: 
        !           170:      The true significance of special floating registers is rather
        !           171:      than non-floating-point machine modes *may not* go in those
        !           172:      registers.  This is true if the floating registers normalize any
        !           173:      value stored in them, because storing a non-floating value there
        !           174:      would garble it.  If the floating registers do not automatically
        !           175:      normalize, if you can store any bit pattern in one and retrieve
        !           176:      it unchanged without a trap, then any machine mode may go in a
        !           177:      floating register and this macro should say so.
        !           178: 
        !           179:      Sometimes there are floating registers that are especially slow
        !           180:      to access, so that it is better to store a value in a stack
        !           181:      frame than in such a register if floating point arithmetic is
        !           182:      not being done.  As long as the floating registers are not in
        !           183:      class `GENERAL_REGS', they will not be used unless some insn's
        !           184:      constraint asks for one.
        !           185: 
        !           186:      It is obligatory to support floating point `move' instructions
        !           187:      into and out of general registers, because unions and structures
        !           188:      (which have modes `SImode' or `DImode') can be in those
        !           189:      registers and they may have floating point members.
1.1.1.2   root      190: 
                    191: `MODES_TIEABLE_P (MODE1, MODE2)'
1.1.1.3 ! root      192:      A C expression that is nonzero if it is desirable to choose
        !           193:      register allocation so as to avoid move instructions between a
        !           194:      value of mode MODE1 and a value of mode MODE2.
        !           195: 
        !           196:      If `HARD_REGNO_MODE_OK (R, MODE1)' and `HARD_REGNO_MODE_OK (R,
        !           197:      MODE2)' are ever different for any R, then `MODES_TIEABLE_P
        !           198:      (MODE1, MODE2)' must be zero.
1.1.1.2   root      199: 
                    200: `PC_REGNUM'
1.1.1.3 ! root      201:      If the program counter has a register number, define this as
        !           202:      that register number.  Otherwise, do not define it.
1.1.1.2   root      203: 
                    204: `STACK_POINTER_REGNUM'
1.1.1.3 ! root      205:      The register number of the stack pointer register, which must
        !           206:      also be a fixed register according to `FIXED_REGISTERS'.  On
        !           207:      many machines, the hardware determines which register this is.
1.1.1.2   root      208: 
                    209: `FRAME_POINTER_REGNUM'
1.1.1.3 ! root      210:      The register number of the frame pointer register, which is used
        !           211:      to access automatic variables in the stack frame.  On some
        !           212:      machines, the hardware determines which register this is.  On
        !           213:      other machines, you can choose any register you wish for this
        !           214:      purpose.
1.1.1.2   root      215: 
                    216: `FRAME_POINTER_REQUIRED'
1.1.1.3 ! root      217:      A C expression which is nonzero if a function must have and use
        !           218:      a frame pointer.  This expression is evaluated in the reload
        !           219:      pass, in the function `reload', and it can in principle examine
        !           220:      the current function and decide according to the facts, but on
        !           221:      most machines the constant 0 or the constant 1 suffices.  Use 0
        !           222:      when the machine allows code to be generated with no frame
        !           223:      pointer, and doing so saves some time or space.  Use 1 when
        !           224:      there is no possible advantage to avoiding a frame pointer.
        !           225: 
        !           226:      In certain cases, the compiler does not know how to do without a
        !           227:      frame pointer.  The compiler recognizes those cases and
        !           228:      automatically gives the function a frame pointer regardless of
        !           229:      what `FRAME_POINTER_REQUIRED' says.  You don't need to worry
        !           230:      about them.
        !           231: 
        !           232:      In a function that does not require a frame pointer, the frame
        !           233:      pointer register can be allocated for ordinary usage, unless you
        !           234:      mark it as a fixed register.  See `FIXED_REGISTERS' for more
        !           235:      information.
1.1.1.2   root      236: 
                    237: `ARG_POINTER_REGNUM'
1.1.1.3 ! root      238:      The register number of the arg pointer register, which is used
        !           239:      to access the function's argument list.  On some machines, this
        !           240:      is the same as the frame pointer register.  On some machines,
        !           241:      the hardware determines which register this is.  On other
        !           242:      machines, you can choose any register you wish for this purpose.
        !           243:      If this is not the same register as the frame pointer register,
        !           244:      then you must mark it as a fixed register according to
        !           245:      `FIXED_REGISTERS'.
1.1.1.2   root      246: 
                    247: `STATIC_CHAIN_REGNUM'
                    248:      The register number used for passing a function's static chain
1.1.1.3 ! root      249:      pointer.  This is needed for languages such as Pascal and Algol
        !           250:      where functions defined within other functions can access the
        !           251:      local variables of the outer functions; it is not currently used
        !           252:      because C does not provide this feature, but you must define the
        !           253:      macro.
1.1.1.2   root      254: 
                    255:      The static chain register need not be a fixed register.
                    256: 
                    257: `STRUCT_VALUE_REGNUM'
1.1.1.3 ! root      258:      When a function's value's mode is `BLKmode', the value is not
        !           259:      returned according to `FUNCTION_VALUE'.  Instead, the caller
        !           260:      passes the address of a block of memory in which the value
        !           261:      should be stored.
        !           262: 
        !           263:      If this value is passed in a register, then
        !           264:      `STRUCT_VALUE_REGNUM' should be the number of that register.
        !           265: 
        !           266: `STRUCT_VALUE'
        !           267:      If the structure value address is not passed in a register,
        !           268:      define `STRUCT_VALUE' as an expression returning an RTX for the
        !           269:      place where the address is passed.  If it returns a `mem' RTX,
        !           270:      the address is passed as an ``invisible'' first argument.
        !           271: 
        !           272: `STRUCT_VALUE_INCOMING_REGNUM'
        !           273:      On some architectures the place where the structure value
        !           274:      address is found by the called function is not the same place
        !           275:      that the caller put it.  This can be due to register windows, or
        !           276:      it could be because the function prologue moves it to a
        !           277:      different place.
        !           278: 
        !           279:      If the incoming location of the structure value address is in a
        !           280:      register, define this macro as the register number.
        !           281: 
        !           282: `STRUCT_VALUE_INCOMING'
        !           283:      If the incoming location is not a register, define
        !           284:      `STRUCT_VALUE_INCOMING' as an expression for an RTX for where
        !           285:      the called function should find the value.  If it should find
        !           286:      the value on the stack, define this to create a `mem' which
        !           287:      refers to the frame pointer.  If the value is a `mem', the
        !           288:      compiler assumes it is for an invisible first argument, and
        !           289:      leaves space for it when finding the first real argument.
        !           290: 
        !           291: `REG_ALLOC_ORDER'
        !           292:      If defined, an initializer for a vector of integers, containing
        !           293:      the numbers of hard registers in the order in which the GNU CC
        !           294:      should prefer to use them (from most preferred to least).
        !           295: 
        !           296:      If this macro is not defined, registers are used lowest numbered
        !           297:      first (all else being equal).
        !           298: 
        !           299:      One use of this macro is on the 360, where the highest numbered
        !           300:      registers must always be saved and the save-multiple-registers
        !           301:      instruction supports only sequences of consecutive registers. 
        !           302:      This macro is defined to cause the highest numbered allocatable
        !           303:      registers to be used first.
        !           304: 
1.1       root      305: 
1.1.1.2   root      306: 
                    307: File: internals,  Node: Register Classes,  Next: Stack Layout,  Prev: Registers,  Up: Machine Macros
1.1       root      308: 
1.1.1.2   root      309: Register Classes
                    310: ================
1.1       root      311: 
1.1.1.2   root      312: On many machines, the numbered registers are not all equivalent.  For
                    313: example, certain registers may not be allowed for indexed addressing;
1.1.1.3 ! root      314: certain registers may not be allowed in some instructions.  These
        !           315: machine restrictions are described to the compiler using "register
        !           316: classes".
        !           317: 
        !           318: You define a number of register classes, giving each one a name and
        !           319: saying which of the registers belong to it.  Then you can specify
        !           320: register classes that are allowed as operands to particular
        !           321: instruction patterns.
        !           322: 
        !           323: In general, each register will belong to several classes.  In fact,
        !           324: one class must be named `ALL_REGS' and contain all the registers. 
        !           325: Another class must be named `NO_REGS' and contain no registers. 
        !           326: Often the union of two classes will be another class; however, this
        !           327: is not required.
        !           328: 
        !           329: One of the classes must be named `GENERAL_REGS'.  There is nothing
        !           330: terribly special about the name, but the operand constraint letters
        !           331: `r' and `g' specify this class.  If `GENERAL_REGS' is the same as
        !           332: `ALL_REGS', just define it as a macro which expands to `ALL_REGS'.
1.1.1.2   root      333: 
                    334: The way classes other than `GENERAL_REGS' are specified in operand
1.1.1.3 ! root      335: constraints is through machine-dependent operand constraint letters. 
        !           336: You can define such letters to correspond to various classes, then
        !           337: use them in operand constraints.
1.1.1.2   root      338: 
                    339: You should define a class for the union of two classes whenever some
1.1.1.3 ! root      340: instruction allows both classes.  For example, if an instruction
        !           341: allows either a floating-point (coprocessor) register or a general
        !           342: register for a certain operand, you should define a class
        !           343: `FLOAT_OR_GENERAL_REGS' which includes both of them.  Otherwise you
        !           344: will get suboptimal code.
        !           345: 
        !           346: You must also specify certain redundant information about the
        !           347: register classes: for each class, which classes contain it and which
        !           348: ones are contained in it; for each pair of classes, the largest class
        !           349: contained in their union.
        !           350: 
        !           351: Register classes used for input-operands of bitwise-and or shift
        !           352: instructions have a special requirement: each such class must have,
        !           353: for each fixed-point machine mode, a subclass whose registers can
        !           354: transfer that mode to or from memory.  For example, on some machines,
        !           355: the operations for single-byte values (`QImode') are limited to
        !           356: certain registers.  When this is so, each register class that is used
        !           357: in a bitwise-and or shift instruction must have a subclass consisting
        !           358: of registers from which single-byte values can be loaded or stored. 
        !           359: This is so that `PREFERRED_RELOAD_CLASS' can always have a possible
        !           360: value to return.
1.1.1.2   root      361: 
                    362: `enum reg_class'
1.1.1.3 ! root      363:      An enumeral type that must be defined with all the register
        !           364:      class names as enumeral values.  `NO_REGS' must be first. 
        !           365:      `ALL_REGS' must be the last register class, followed by one more
        !           366:      enumeral value, `LIM_REG_CLASSES', which is not a register class
        !           367:      but rather tells how many classes there are.
        !           368: 
        !           369:      Each register class has a number, which is the value of casting
        !           370:      the class name to type `int'.  The number serves as an index in
        !           371:      many of the tables described below.
        !           372: 
        !           373: `N_REG_CLASSES'
        !           374:      The number of distinct register classes, defined as follows:
        !           375: 
        !           376:           #define N_REG_CLASSES (int) LIM_REG_CLASSES
1.1.1.2   root      377: 
                    378: `REG_CLASS_NAMES'
                    379:      An initializer containing the names of the register classes as C
                    380:      string constants.  These names are used in writing some of the
                    381:      debugging dumps.
                    382: 
                    383: `REG_CLASS_CONTENTS'
1.1.1.3 ! root      384:      An initializer containing the contents of the register classes,
        !           385:      as integers which are bit masks.  The Nth integer specifies the
        !           386:      contents of class N.  The way the integer MASK is interpreted is
        !           387:      that register R is in the class if `MASK & (1 << R)' is 1.
1.1.1.2   root      388: 
                    389:      When the machine has more than 32 registers, an integer does not
1.1.1.3 ! root      390:      suffice.  Then the integers are replaced by sub-initializers,
        !           391:      braced groupings containing several integers.  Each
        !           392:      sub-initializer must be suitable as an initializer for the type
        !           393:      `HARD_REG_SET' which is defined in `hard-reg-set.h'.
1.1.1.2   root      394: 
                    395: `REGNO_REG_CLASS (REGNO)'
                    396:      A C expression whose value is a register class containing hard
1.1.1.3 ! root      397:      register REGNO.  In general there is more that one such class;
        !           398:      choose a class which is "minimal", meaning that no smaller class
        !           399:      also contains the register.
        !           400: 
        !           401: `BASE_REG_CLASS'
        !           402:      A macro whose definition is the name of the class to which a
        !           403:      valid base register must belong.  A base register is one used in
        !           404:      an address which is the register value plus a displacement.
1.1.1.2   root      405: 
                    406: `INDEX_REG_CLASS'
1.1.1.3 ! root      407:      A macro whose definition is the name of the class to which a
        !           408:      valid index register must belong.  An index register is one used
        !           409:      in an address where its value is either multiplied by a scale
        !           410:      factor or added to another register (as well as added to a
        !           411:      displacement).
1.1.1.2   root      412: 
                    413: `REG_CLASS_FROM_LETTER (CHAR)'
1.1.1.3 ! root      414:      A C expression which defines the machine-dependent operand
        !           415:      constraint letters for register classes.  If CHAR is such a
        !           416:      letter, the value should be the register class corresponding to
        !           417:      it.  Otherwise, the value should be `NO_REGS'.
1.1.1.2   root      418: 
                    419: `REGNO_OK_FOR_BASE_P (NUM)'
1.1.1.3 ! root      420:      A C expression which is nonzero if register number NUM is
        !           421:      suitable for use as a base register in operand addresses.  It
        !           422:      may be either a suitable hard register or a pseudo register that
        !           423:      has been allocated such a hard register.
1.1.1.2   root      424: 
                    425: `REGNO_OK_FOR_INDEX_P (NUM)'
1.1.1.3 ! root      426:      A C expression which is nonzero if register number NUM is
        !           427:      suitable for use as an index register in operand addresses.  It
        !           428:      may be either a suitable hard register or a pseudo register that
        !           429:      has been allocated such a hard register.
        !           430: 
        !           431:      The difference between an index register and a base register is
        !           432:      that the index register may be scaled.  If an address involves
        !           433:      the sum of two registers, neither one of them scaled, then
        !           434:      either one may be labeled the ``base'' and the other the
        !           435:      ``index''; but whichever labeling is used must fit the machine's
        !           436:      constraints of which registers may serve in each capacity.  The
        !           437:      compiler will try both labelings, looking for one that is valid,
        !           438:      and will reload one or both registers only if neither labeling
        !           439:      works.
1.1.1.2   root      440: 
                    441: `PREFERRED_RELOAD_CLASS (X, CLASS)'
1.1.1.3 ! root      442:      A C expression that places additional restrictions on the
        !           443:      register class to use when it is necessary to copy value X into
        !           444:      a register in class CLASS.  The value is a register class;
        !           445:      perhaps CLASS, or perhaps another, smaller class.  On many
        !           446:      machines, the definition
1.1.1.2   root      447: 
                    448:           #define PREFERRED_RELOAD_CLASS(X,CLASS) CLASS
                    449: 
1.1.1.3 ! root      450:      is safe.
        !           451: 
        !           452:      Sometimes returning a more restrictive class makes better code. 
        !           453:      For example, on the 68000, when X is an integer constant that is
        !           454:      in range for a `moveq' instruction, the value of this macro is
        !           455:      always `DATA_REGS' as long as CLASS includes the data registers.
        !           456:      Requiring a data register guarantees that a `moveq' will be used.
        !           457: 
        !           458:      If X is a `const_double', by returning `NO_REGS' you can force X
        !           459:      into a memory constant.  This is useful on certain machines
        !           460:      where immediate floating values cannot be loaded into certain
        !           461:      kinds of registers.
        !           462: 
        !           463:      In a shift instruction or a bitwise-and instruction, the mode of
        !           464:      X, the value being reloaded, may not be the same as the mode of
        !           465:      the instruction's operand.  (They will both be fixed-point
        !           466:      modes, however.)  In such a case, CLASS may not be a safe value
        !           467:      to return.  CLASS is certainly valid for the instruction, but it
        !           468:      may not be valid for reloading X.  This problem can occur on
        !           469:      machines such as the 68000 and 80386 where some registers can
        !           470:      handle full-word values but cannot handle single-byte values.
        !           471: 
        !           472:      On such machines, this macro must examine the mode of X and
        !           473:      return a subclass of CLASS which can handle loads and stores of
        !           474:      that mode.  On the 68000, where address registers cannot handle
        !           475:      `QImode', if X has `QImode' then you must return `DATA_REGS'. 
        !           476:      If CLASS is `ADDR_REGS', then there is no correct value to
        !           477:      return; but the shift and bitwise-and instructions don't use
        !           478:      `ADDR_REGS', so this fatal case never arises.
1.1.1.2   root      479: 
                    480: `CLASS_MAX_NREGS (CLASS, MODE)'
1.1.1.3 ! root      481:      A C expression for the maximum number of consecutive registers
        !           482:      of class CLASS needed to hold a value of mode MODE.
1.1.1.2   root      483: 
1.1.1.3 ! root      484:      This is closely related to the macro `HARD_REGNO_NREGS'.  In
        !           485:      fact, the value of the macro `CLASS_MAX_NREGS (CLASS, MODE)'
        !           486:      should be the maximum value of `HARD_REGNO_NREGS (REGNO, MODE)'
        !           487:      for all REGNO values in the class CLASS.
1.1.1.2   root      488: 
1.1.1.3 ! root      489:      This macro helps control the handling of multiple-word values in
        !           490:      the reload pass.
1.1.1.2   root      491: 
1.1.1.3 ! root      492: Two other special macros describe which constants fit which
        !           493: constraint letters.
1.1.1.2   root      494: 
                    495: `CONST_OK_FOR_LETTER_P (VALUE, C)'
1.1.1.3 ! root      496:      A C expression that defines the machine-dependent operand
        !           497:      constraint letters that specify particular ranges of integer
        !           498:      values.  If C is one of those letters, the expression should
        !           499:      check that VALUE, an integer, is in the appropriate range and
        !           500:      return 1 if so, 0 otherwise.  If C is not one of those letters,
        !           501:      the value should be 0 regardless of VALUE.
1.1.1.2   root      502: 
                    503: `CONST_DOUBLE_OK_FOR_LETTER_P (VALUE, C)'
1.1.1.3 ! root      504:      A C expression that defines the machine-dependent operand
        !           505:      constraint letters that specify particular ranges of floating
        !           506:      values.  If C is one of those letters, the expression should
        !           507:      check that VALUE, an RTX of code `const_double', is in the
        !           508:      appropriate range and return 1 if so, 0 otherwise.  If C is not
        !           509:      one of those letters, the value should be 0 regardless of VALUE.
        !           510: 
1.1       root      511: 
1.1.1.2   root      512: 
                    513: File: internals,  Node: Stack Layout,  Next: Library Names,  Prev: Register Classes,  Up: Machine Macros
1.1       root      514: 
1.1.1.2   root      515: Describing Stack Layout
                    516: =======================
1.1       root      517: 
1.1.1.2   root      518: `STACK_GROWS_DOWNWARD'
1.1.1.3 ! root      519:      Define this macro if pushing a word onto the stack moves the
        !           520:      stack pointer to a smaller address.
1.1.1.2   root      521: 
1.1.1.3 ! root      522:      When we say, ``define this macro if ...,'' it means that the
        !           523:      compiler checks this macro only with `#ifdef' so the precise
        !           524:      definition used does not matter.
1.1.1.2   root      525: 
                    526: `FRAME_GROWS_DOWNWARD'
1.1.1.3 ! root      527:      Define this macro if the addresses of local variable slots are
        !           528:      at negative offsets from the frame pointer.
1.1.1.2   root      529: 
                    530: `STARTING_FRAME_OFFSET'
1.1.1.3 ! root      531:      Offset from the frame pointer to the first local variable slot
        !           532:      to be allocated.
1.1.1.2   root      533: 
                    534:      If `FRAME_GROWS_DOWNWARD', the next slot's offset is found by
1.1.1.3 ! root      535:      subtracting the length of the first slot from
        !           536:      `STARTING_FRAME_OFFSET'.  Otherwise, it is found by adding the
        !           537:      length of the first slot to the value `STARTING_FRAME_OFFSET'.
1.1.1.2   root      538: 
                    539: `PUSH_ROUNDING (NPUSHED)'
1.1.1.3 ! root      540:      A C expression that is the number of bytes actually pushed onto
        !           541:      the stack when an instruction attempts to push NPUSHED bytes.
1.1.1.2   root      542: 
1.1.1.3 ! root      543:      If the target machine does not have a push instruction, do not
        !           544:      define this macro.  That directs GNU CC to use an alternate
        !           545:      strategy: to allocate the entire argument block and then store
        !           546:      the arguments into it.
1.1.1.2   root      547: 
                    548:      On some machines, the definition
                    549: 
                    550:           #define PUSH_ROUNDING(BYTES) (BYTES)
                    551: 
1.1.1.3 ! root      552:      will suffice.  But on other machines, instructions that appear
        !           553:      to push one byte actually push two bytes in an attempt to
        !           554:      maintain alignment.  Then the definition should be
1.1.1.2   root      555: 
                    556:           #define PUSH_ROUNDING(BYTES) (((BYTES) + 1) & ~1)
                    557: 
1.1.1.3 ! root      558: `FIRST_PARM_OFFSET (FUNDECL)'
        !           559:      Offset from the argument pointer register to the first
        !           560:      argument's address.  On some machines it may depend on the data
        !           561:      type of the function.  (In the next version of GNU CC, the
        !           562:      argument will be changed to the function data type rather than
        !           563:      its declaration.)
1.1.1.2   root      564: 
                    565: `RETURN_POPS_ARGS (FUNTYPE)'
1.1.1.3 ! root      566:      A C expression that should be 1 if a function pops its own
        !           567:      arguments on returning, or 0 if the function pops no arguments
        !           568:      and the caller must therefore pop them all after the function
        !           569:      returns.
        !           570: 
        !           571:      FUNTYPE is a C variable whose value is a tree node that
        !           572:      describes the function in question.  Normally it is a node of
        !           573:      type `FUNCTION_TYPE' that describes the data type of the function.
        !           574:      From this it is possible to obtain the data types of the value
        !           575:      and arguments (if known).
        !           576: 
        !           577:      When a call to a library function is being considered, FUNTYPE
        !           578:      will contain an identifier node for the library function.  Thus,
        !           579:      if you need to distinguish among various library functions, you
        !           580:      can do so by their names.  Note that ``library function'' in
        !           581:      this context means a function used to perform arithmetic, whose
        !           582:      name is known specially in the compiler and was not mentioned in
        !           583:      the C code being compiled.
1.1.1.2   root      584: 
                    585:      On the Vax, all functions always pop their arguments, so the
                    586:      definition of this macro is 1.  On the 68000, using the standard
1.1.1.3 ! root      587:      calling convention, no functions pop their arguments, so the
        !           588:      value of the macro is always 0 in this case.  But an alternative
        !           589:      calling convention is available in which functions that take a
        !           590:      fixed number of arguments pop them but other functions (such as
        !           591:      `printf') pop nothing (the caller pops all).  When this
        !           592:      convention is in use, FUNTYPE is examined to determine whether a
        !           593:      function takes a fixed number of arguments.
1.1.1.2   root      594: 
                    595: `FUNCTION_VALUE (VALTYPE, FUNC)'
                    596:      A C expression to create an RTX representing the place where a
1.1.1.3 ! root      597:      function returns a value of data type VALTYPE.  VALTYPE is a
        !           598:      tree node representing a data type.  Write `TYPE_MODE (VALTYPE)'
        !           599:      to get the machine mode used to represent that type.  On many
        !           600:      machines, only the mode is relevant.  (Actually, on most
        !           601:      machines, scalar values are returned in the same place
        !           602:      regardless of mode).
        !           603: 
        !           604:      If the precise function being called is known, FUNC is a tree
        !           605:      node (`FUNCTION_DECL') for it; otherwise, FUNC is a null
        !           606:      pointer.  This makes it possible to use a different
        !           607:      value-returning convention for specific functions when all their
        !           608:      calls are known.
1.1.1.2   root      609: 
                    610: `FUNCTION_OUTGOING_VALUE (VALTYPE, FUNC)'
1.1.1.3 ! root      611:      Define this macro if the target machine has ``register windows''
        !           612:      so that the register in which a function returns its value is
        !           613:      not the same as the one in which the caller sees the value.
        !           614: 
        !           615:      For such machines, `FUNCTION_VALUE' computes the register in
        !           616:      which the caller will see the value, and
        !           617:      `FUNCTION_OUTGOING_VALUE' should be defined in a similar fashion
        !           618:      to tell the function where to put the value.
1.1.1.2   root      619: 
1.1.1.3 ! root      620:      If `FUNCTION_OUTGOING_VALUE' is not defined, `FUNCTION_VALUE'
        !           621:      serves both purposes.
1.1.1.2   root      622: 
                    623: `LIBCALL_VALUE (MODE)'
1.1.1.3 ! root      624:      A C expression to create an RTX representing the place where a
        !           625:      library function returns a value of mode MODE.  If the precise
        !           626:      function being called is known, FUNC is a tree node
        !           627:      (`FUNCTION_DECL') for it; otherwise, FUNC is a null pointer. 
        !           628:      This makes it possible to use a different value-returning
        !           629:      convention for specific functions when all their calls are known.
1.1.1.2   root      630: 
                    631:      Note that ``library function'' in this context means a compiler
                    632:      support routine, used to perform arithmetic, whose name is known
1.1.1.3 ! root      633:      specially by the compiler and was not mentioned in the C code
        !           634:      being compiled.
1.1.1.2   root      635: 
                    636: `FUNCTION_VALUE_REGNO_P (REGNO)'
                    637:      A C expression that is nonzero if REGNO is the number of a hard
1.1.1.3 ! root      638:      register in which the values of called function may come back.
1.1.1.2   root      639: 
1.1.1.3 ! root      640:      A register whose use for returning values is limited to serving
        !           641:      as the second of a pair (for a value of type `double', say) need
        !           642:      not be recognized by this macro.  So for most machines, this
        !           643:      definition suffices:
1.1.1.2   root      644: 
                    645:           #define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)
                    646: 
1.1.1.3 ! root      647:      If the machine has register windows, so that the caller and the
        !           648:      called function use different registers for the return value,
        !           649:      this macro should recognize only the caller's register numbers.
        !           650: 
1.1.1.2   root      651: `FUNCTION_ARG (CUM, MODE, TYPE, NAMED)'
1.1.1.3 ! root      652:      A C expression that controls whether a function argument is
        !           653:      passed in a register, and which register.
1.1.1.2   root      654: 
1.1.1.3 ! root      655:      The arguments are CUM, which summarizes all the previous
        !           656:      arguments; MODE, the machine mode of the argument; TYPE, the
        !           657:      data type of the argument as a tree node or 0 if that is not
        !           658:      known (which happens for C support library functions); and
        !           659:      NAMED, which is 1 for an ordinary argument and 0 for nameless
        !           660:      arguments that correspond to `...' in the called function's
        !           661:      prototype.
        !           662: 
        !           663:      The value of the expression should either be a `reg' RTX for the
        !           664:      hard register in which to pass the argument, or zero to pass the
        !           665:      argument on the stack.
1.1.1.2   root      666: 
1.1.1.3 ! root      667:      For the Vax and 68000, where normally all arguments are pushed,
        !           668:      zero suffices as a definition.
1.1.1.2   root      669: 
                    670: `FUNCTION_INCOMING_ARG (CUM, MODE, TYPE, NAMED)'
1.1.1.3 ! root      671:      Define this macro if the target machine has ``register
        !           672:      windows'', so that the register in which a function sees an
        !           673:      arguments is not necessarily the same as the one in which the
        !           674:      caller passed the argument.
        !           675: 
        !           676:      For such machines, `FUNCTION_ARG' computes the register in which
        !           677:      the caller passes the value, and `FUNCTION_INCOMING_ARG' should
        !           678:      be defined in a similar fashion to tell the function being
        !           679:      called where the arguments will arrive.
1.1.1.2   root      680: 
1.1.1.3 ! root      681:      If `FUNCTION_INCOMING_ARG' is not defined, `FUNCTION_ARG' serves
        !           682:      both purposes.
1.1.1.2   root      683: 
                    684: `FUNCTION_ARG_PARTIAL_NREGS (CUM, MODE, TYPE, NAMED)'
                    685:      A C expression for the number of words, at the beginning of an
                    686:      argument, must be put in registers.  The value must be zero for
1.1.1.3 ! root      687:      arguments that are passed entirely in registers or that are
        !           688:      entirely pushed on the stack.
1.1.1.2   root      689: 
                    690:      On some machines, certain arguments must be passed partially in
1.1.1.3 ! root      691:      registers and partially in memory.  On these machines, typically
        !           692:      the first N words of arguments are passed in registers, and the
        !           693:      rest on the stack.  If a multi-word argument (a `double' or a
        !           694:      structure) crosses that boundary, its first few words must be
        !           695:      passed in registers and the rest must be pushed.  This macro
        !           696:      tells the compiler when this occurs, and how many of the words
        !           697:      should go in registers.
1.1.1.2   root      698: 
1.1.1.3 ! root      699:      `FUNCTION_ARG' for these arguments should return the first
        !           700:      register to be used by the caller for this argument; likewise
1.1.1.2   root      701:      `FUNCTION_INCOMING_ARG', for the called function.
                    702: 
                    703: `CUMULATIVE_ARGS'
1.1.1.3 ! root      704:      A C type for declaring a variable that is used as the first
        !           705:      argument of `FUNCTION_ARG' and other related values.  For some
        !           706:      target machines, the type `int' suffices and can hold the number
        !           707:      of bytes of argument so far.
        !           708: 
        !           709: `INIT_CUMULATIVE_ARGS (CUM, FNTYPE)'
        !           710:      A C statement (sans semicolon) for initializing the variable CUM
        !           711:      for the state at the beginning of the argument list.  The
        !           712:      variable has type `CUMULATIVE_ARGS'.  The value of FNTYPE is the
        !           713:      tree node for the data type of the function which will receive
        !           714:      the args, or 0 if the args are to a compiler support library
        !           715:      function.
1.1.1.2   root      716: 
                    717: `FUNCTION_ARG_ADVANCE (CUM, MODE, TYPE, NAMED)'
1.1.1.3 ! root      718:      Update the summarizer variable CUM to advance past an argument
        !           719:      in the argument list.  The values MODE, TYPE and NAMED describe
        !           720:      that argument.  Once this is done, the variable CUM is suitable
        !           721:      for analyzing the *following* argument with `FUNCTION_ARG', etc.
1.1.1.2   root      722: 
                    723: `FUNCTION_ARG_REGNO_P (REGNO)'
                    724:      A C expression that is nonzero if REGNO is the number of a hard
1.1.1.3 ! root      725:      register in which function arguments are sometimes passed.  This
        !           726:      does *not* include implicit arguments such as the static chain
        !           727:      and the structure-value address.  On many machines, no registers
        !           728:      can be used for this purpose since all function arguments are
        !           729:      pushed on the stack.
        !           730: 
        !           731: `FUNCTION_ARG_PADDING (MODE, SIZE)'
        !           732:      If defined, a C expression which determines whether, and in
        !           733:      which direction, to pad out an argument with extra space.  The
        !           734:      value should be of type `enum direction': either `upward' to pad
        !           735:      above the argument, `downward' to pad below, or `none' to
        !           736:      inhibit padding.
        !           737: 
        !           738:      The argument SIZE is an RTX which describes the size of the
        !           739:      argument, in bytes.  It should be used only if MODE is
        !           740:      `BLKmode'.  Otherwise, SIZE is 0.
        !           741: 
        !           742:      This macro does not control the *amount* of padding; that is
        !           743:      always just enough to reach the next multiple of `PARM_BOUNDARY'.
        !           744: 
        !           745:      This macro has a default definition which is right for most
        !           746:      systems.  For little-endian machines, the default is to pad
        !           747:      upward.  For big-endian machines, the default is to pad downward
        !           748:      for an argument of constant size shorter than an `int', and
        !           749:      upward otherwise.
1.1.1.2   root      750: 
                    751: `FUNCTION_PROLOGUE (FILE, SIZE)'
1.1.1.3 ! root      752:      A C compound statement that outputs the assembler code for entry
        !           753:      to a function.  The prologue is responsible for setting up the
        !           754:      stack frame, initializing the frame pointer register, saving
        !           755:      registers that must be saved, and allocating SIZE additional
        !           756:      bytes of storage for the local variables.  SIZE is an integer. 
        !           757:      FILE is a stdio stream to which the assembler code should be
        !           758:      output.
        !           759: 
        !           760:      The label for the beginning of the function need not be output
        !           761:      by this macro.  That has already been done when the macro is run.
        !           762: 
        !           763:      To determine which registers to save, the macro can refer to the
        !           764:      array `regs_ever_live': element R is nonzero if hard register R
        !           765:      is used anywhere within the function.  This implies the function
        !           766:      prologue should save register R, but not if it is one of the
        !           767:      call-used registers.
        !           768: 
        !           769:      On machines where functions may or may not have frame-pointers,
        !           770:      the function entry code must vary accordingly; it must set up
        !           771:      the frame pointer if one is wanted, and not otherwise.  To
        !           772:      determine whether a frame pointer is in wanted, the macro can
        !           773:      refer to the variable `frame_pointer_needed'.  The variable's
        !           774:      value will be 1 at run time in a function that needs a frame
        !           775:      pointer.
1.1.1.2   root      776: 
                    777: `FUNCTION_PROFILER (FILE, LABELNO)'
1.1.1.3 ! root      778:      A C statement or compound statement to output to FILE some
        !           779:      assembler code to call the profiling subroutine `mcount'. 
        !           780:      Before calling, the assembler code must load the address of a
        !           781:      counter variable into a register where `mcount' expects to find
        !           782:      the address.  The name of this variable is `LP' followed by the
        !           783:      number LABELNO, so you would generate the name using `LP%d' in a
        !           784:      `fprintf'.
1.1.1.2   root      785: 
                    786:      The details of how the address should be passed to `mcount' are
1.1.1.3 ! root      787:      determined by your operating system environment, not by GNU CC. 
        !           788:      To figure them out, compile a small program for profiling using
        !           789:      the system's installed C compiler and look at the assembler code
        !           790:      that results.
1.1.1.2   root      791: 
                    792: `EXIT_IGNORES_STACK'
1.1.1.3 ! root      793:      Define this macro as a C expression that is nonzero if the
        !           794:      return instruction or the function epilogue ignores the value of
        !           795:      the stack pointer; in other words, if it is safe to delete an
        !           796:      instruction to adjust the stack pointer before a return from the
        !           797:      function.
        !           798: 
        !           799:      Note that this macro's value is relevant only for for which
        !           800:      frame pointers are maintained.  It is never possible to delete a
        !           801:      final stack adjustment in a function that has no frame pointer,
        !           802:      and the compiler knows this regardless of `EXIT_IGNORES_STACK'.
1.1.1.2   root      803: 
                    804: `FUNCTION_EPILOGUE (FILE, SIZE)'
1.1.1.3 ! root      805:      A C compound statement that outputs the assembler code for exit
        !           806:      from a function.  The epilogue is responsible for restoring the
        !           807:      saved registers and stack pointer to their values when the
        !           808:      function was called, and returning control to the caller.  This
        !           809:      macro takes the same arguments as the macro `FUNCTION_PROLOGUE',
        !           810:      and the registers to restore are determined from
        !           811:      `regs_ever_live' and `CALL_USED_REGISTERS' in the same way.
        !           812: 
        !           813:      On some machines, there is a single instruction that does all
        !           814:      the work of returning from the function.  On these machines,
        !           815:      give that instruction the name `return' and do not define the
        !           816:      macro `FUNCTION_EPILOGUE' at all.
        !           817: 
        !           818:      Do not define a pattern named `return' if you want the
        !           819:      `FUNCTION_EPILOGUE' to be used.  If you want the target switches
        !           820:      to control whether return instructions or epilogues are used,
        !           821:      define a `return' pattern with a validity condition that tests
        !           822:      the target switches appropriately.  If the `return' pattern's
        !           823:      validity condition is false, epilogues will be used.
        !           824: 
        !           825:      On machines where functions may or may not have frame-pointers,
        !           826:      the function exit code must vary accordingly.  Sometimes the
        !           827:      code for these two cases is completely different.  To determine
        !           828:      whether a frame pointer is in wanted, the macro can refer to the
        !           829:      variable `frame_pointer_needed'.  The variable's value will be 1
        !           830:      at run time in a function that needs a frame pointer.
        !           831: 
        !           832:      On some machines, some functions pop their arguments on exit
        !           833:      while others leave that for the caller to do.  For example, the
        !           834:      68020 when given `-mrtd' pops arguments in functions that take a
        !           835:      fixed number of arguments.
1.1.1.2   root      836: 
                    837:      Your definition of the macro `RETURN_POPS_ARGS' decides which
1.1.1.3 ! root      838:      functions pop their own arguments.  `FUNCTION_EPILOGUE' needs to
        !           839:      know what was decided.  The variable
        !           840:      `current_function_pops_args' is nonzero if the function should
        !           841:      pop its own arguments.  If so, use the variable
        !           842:      `current_function_args_size' as the number of bytes to pop.
1.1.1.2   root      843: 
                    844: `FIX_FRAME_POINTER_ADDRESS (ADDR, DEPTH)'
1.1.1.3 ! root      845:      A C compound statement to alter a memory address that uses the
        !           846:      frame pointer register so that it uses the stack pointer
        !           847:      register instead.  This must be done in the instructions that
        !           848:      load parameter values into registers, when the reload pass
        !           849:      determines that a frame pointer is not necessary for the
        !           850:      function.  ADDR will be a C variable name, and the updated
        !           851:      address should be stored in that variable.  DEPTH will be the
1.1.1.2   root      852:      current depth of stack temporaries (number of bytes of arguments
                    853:      currently pushed).  The change in offset between a
1.1.1.3 ! root      854:      frame-pointer-relative address and a stack-pointer-relative
        !           855:      address must include DEPTH.
        !           856: 
        !           857:      Even if your machine description specifies there will always be
        !           858:      a frame pointer in the frame pointer register, you must still
        !           859:      define `FIX_FRAME_POINTER_ADDRESS', but the definition will
        !           860:      never be executed at run time, so it may be empty.
1.1.1.2   root      861: 
1.1       root      862: 
1.1.1.2   root      863: 
                    864: File: internals,  Node: Library Names,  Next: Addressing Modes,  Prev: Stack Layout,  Up: Machine Macros
                    865: 
                    866: Library Subroutine Names
                    867: ========================
1.1       root      868: 
1.1.1.2   root      869: `UDIVSI3_LIBCALL'
                    870:      A C string constant giving the name of the function to call for
1.1.1.3 ! root      871:      division of a full-word by a full-word.  If you do not define
        !           872:      this macro, the default name is used, which is `_udivsi3', a
        !           873:      function defined in `gnulib'.
1.1.1.2   root      874: 
                    875: `UMODSI3_LIBCALL'
1.1.1.3 ! root      876:      A C string constant giving the name of the function to call for
        !           877:      the remainder in division of a full-word by a full-word.  If you
        !           878:      do not define this macro, the default name is used, which is
        !           879:      `_umodsi3', a function defined in `gnulib'.
1.1.1.2   root      880: 
                    881: `TARGET_MEM_FUNCTIONS'
1.1.1.3 ! root      882:      Define this macro if GNU CC should generate calls to the System
        !           883:      V (and ANSI C) library functions `memcpy' and `memset' rather
        !           884:      than the BSD functions `bcopy' and `bzero'.
        !           885: 
1.1.1.2   root      886: 
                    887: 
                    888: File: internals,  Node: Addressing Modes,  Next: Misc,  Prev: Library Names,  Up: Machine Macros
                    889: 
                    890: Addressing Modes
                    891: ================
                    892: 
                    893: `HAVE_POST_INCREMENT'
1.1.1.3 ! root      894:      Define this macro if the machine supports post-increment
        !           895:      addressing.
1.1.1.2   root      896: 
                    897: `HAVE_PRE_INCREMENT'
                    898: `HAVE_POST_DECREMENT'
                    899: `HAVE_PRE_DECREMENT'
                    900:      Similar for other kinds of addressing.
                    901: 
                    902: `CONSTANT_ADDRESS_P (X)'
1.1.1.3 ! root      903:      A C expression that is 1 if the RTX X is a constant whose value
        !           904:      is an integer.  This includes integers whose values are not
        !           905:      explicitly known, such as `symbol_ref' and `label_ref'
        !           906:      expressions and `const' arithmetic expressions.
        !           907: 
        !           908:      On most machines, this can be defined as `CONSTANT_P (X)', but a
        !           909:      few machines are more restrictive in which constant addresses
        !           910:      are supported.
1.1.1.2   root      911: 
                    912: `MAX_REGS_PER_ADDRESS'
1.1.1.3 ! root      913:      A number, the maximum number of registers that can appear in a
        !           914:      valid memory address.
1.1.1.2   root      915: 
                    916: `GO_IF_LEGITIMATE_ADDRESS (MODE, X, LABEL)'
1.1.1.3 ! root      917:      A C compound statement with a conditional `goto LABEL;' executed
        !           918:      if X (an RTX) is a legitimate memory address on the target
        !           919:      machine for a memory operand of mode MODE.
1.1.1.2   root      920: 
                    921:      It usually pays to define several simpler macros to serve as
1.1.1.3 ! root      922:      subroutines for this one.  Otherwise it may be too complicated
        !           923:      to understand.
1.1.1.2   root      924: 
                    925:      This macro must exist in two variants: a strict variant and a
1.1.1.3 ! root      926:      non-strict one.  The strict variant is used in the reload pass. 
        !           927:      It must be defined so that any pseudo-register that has not been
1.1.1.2   root      928:      allocated a hard register is considered a memory reference.  In
1.1.1.3 ! root      929:      contexts where some kind of register is required, a
        !           930:      pseudo-register with no hard register must be rejected.
1.1.1.2   root      931: 
1.1.1.3 ! root      932:      The non-strict variant is used in other passes.  It must be
        !           933:      defined to accept all pseudo-registers in every context where
        !           934:      some kind of register is required.
        !           935: 
        !           936:      Compiler source files that want to use the strict variant of
        !           937:      this macro define the macro `REG_OK_STRICT'.  You should use an
        !           938:      `#ifdef REG_OK_STRICT' conditional to define the strict variant
        !           939:      in that case and the non-strict variant otherwise.
1.1.1.2   root      940: 
                    941:      Typically among the subroutines used to define
1.1.1.3 ! root      942:      `GO_IF_LEGITIMATE_ADDRESS' are subroutines to check for
        !           943:      acceptable registers for various purposes (one for base
        !           944:      registers, one for index registers, and so on).  Then only these
        !           945:      subroutine macros need have two variants; the higher levels of
        !           946:      macros may be the same whether strict or not.
        !           947: 
        !           948: `REG_OK_FOR_BASE_P (X)'
        !           949:      A C expression that is nonzero if X (asumed to be a `reg' RTX)
        !           950:      is valid for use as a base register.  For hard registers, it
        !           951:      should always accept those which the hardware permits and reject
        !           952:      the others.  Whether the macro accepts or rejects pseudo
        !           953:      registers must be controlled by `REG_OK_STRICT' as described
        !           954:      above.  This usually requires two variant definitions, of which
        !           955:      `REG_OK_STRICT' controls the one actually used.
        !           956: 
        !           957: `REG_OK_FOR_INDEX_P (X)'
        !           958:      A C expression that is nonzero if X (asumed to be a `reg' RTX)
        !           959:      is valid for use as an index register.
        !           960: 
        !           961:      The difference between an index register and a base register is
        !           962:      that the index register may be scaled.  If an address involves
        !           963:      the sum of two registers, neither one of them scaled, then
        !           964:      either one may be labeled the ``base'' and the other the
        !           965:      ``index''; but whichever labeling is used must fit the machine's
        !           966:      constraints of which registers may serve in each capacity.  The
        !           967:      compiler will try both labelings, looking for one that is valid,
        !           968:      and will reload one or both registers only if neither labeling
        !           969:      works.
1.1.1.2   root      970: 
                    971: `LEGITIMIZE_ADDRESS (X, OLDX, MODE, WIN)'
1.1.1.3 ! root      972:      A C compound statement that attempts to replace X with a valid
        !           973:      memory address for an operand of mode MODE.  WIN will be a C
        !           974:      statement label elsewhere in the code; the macro definition may
        !           975:      use
1.1.1.2   root      976: 
                    977:           GO_IF_LEGITIMATE_ADDRESS (MODE, X, WIN);
                    978: 
                    979:      to avoid further processing if the address has become legitimate.
                    980: 
1.1.1.3 ! root      981:      X will always be the result of a call to
        !           982:      `break_out_memory_refs', and OLDX will be the operand that was
        !           983:      given to that function to produce X.
        !           984: 
        !           985:      The code generated by this macro should not alter the
        !           986:      substructure of X.  If it transforms X into a more legitimate
        !           987:      form, it should assign X (which will always be a C variable) a
        !           988:      new value.
1.1.1.2   root      989: 
                    990:      It is not necessary for this macro to come up with a legitimate
1.1.1.3 ! root      991:      address.  The compiler has standard ways of doing so in all
        !           992:      cases.  In fact, it is safe for this macro to do nothing.  But
        !           993:      often a machine-dependent strategy can generate better code.
1.1.1.2   root      994: 
                    995: `GO_IF_MODE_DEPENDENT_ADDRESS (ADDR, LABEL)'
1.1.1.3 ! root      996:      A C statement or compound statement with a conditional `goto
        !           997:      LABEL;' executed if memory address X (an RTX) can have different
        !           998:      meanings depending on the machine mode of the memory reference
        !           999:      it is used for.
1.1.1.2   root     1000: 
                   1001:      Autoincrement and autodecrement addresses typically have
                   1002:      mode-dependent effects because the amount of the increment or
1.1.1.3 ! root     1003:      decrement is the size of the operand being addressed.  Some
        !          1004:      machines have other mode-dependent addresses.  Many RISC
        !          1005:      machines have no mode-dependent addresses.
1.1.1.2   root     1006: 
                   1007:      You may assume that ADDR is a valid address for the machine.
                   1008: 
                   1009: `LEGITIMATE_CONSTANT_P (X)'
1.1.1.3 ! root     1010:      A C expression that is nonzero if X is a legitimate constant for
        !          1011:      an immediate operand on the target machine.  You can assume that
        !          1012:      either X is a `const_double' or it satisfies `CONSTANT_P', so
        !          1013:      you need not check these things.  In fact, `1' is a suitable
        !          1014:      definition for this macro on machines where any `const_double'
        !          1015:      is valid and anything `CONSTANT_P' is valid.
1.1       root     1016: 
                   1017: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.