home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / gnu / info / gcc.info-13 (.txt) < prev    next >
GNU Info File  |  1994-12-22  |  45KB  |  789 lines

  1. This is Info file gcc.info, produced by Makeinfo-1.55 from the input
  2. file gcc.texi.
  3.    This file documents the use and the internals of the GNU compiler.
  4.    Published by the Free Software Foundation 675 Massachusetts Avenue
  5. Cambridge, MA 02139 USA
  6.    Copyright (C) 1988, 1989, 1992, 1993, 1994 Free Software Foundation,
  7.    Permission is granted to make and distribute verbatim copies of this
  8. manual provided the copyright notice and this permission notice are
  9. preserved on all copies.
  10.    Permission is granted to copy and distribute modified versions of
  11. this manual under the conditions for verbatim copying, provided also
  12. that the sections entitled "GNU General Public License," "Funding for
  13. Free Software," and "Protect Your Freedom--Fight `Look And Feel'" are
  14. included exactly as in the original, and provided that the entire
  15. resulting derived work is distributed under the terms of a permission
  16. notice identical to this one.
  17.    Permission is granted to copy and distribute translations of this
  18. manual into another language, under the above conditions for modified
  19. versions, except that the sections entitled "GNU General Public
  20. License," "Funding for Free Software," and "Protect Your Freedom--Fight
  21. `Look And Feel'", and this permission notice, may be included in
  22. translations approved by the Free Software Foundation instead of in the
  23. original English.
  24. File: gcc.info,  Node: Regs and Memory,  Next: Arithmetic,  Prev: Constants,  Up: RTL
  25. Registers and Memory
  26. ====================
  27.    Here are the RTL expression types for describing access to machine
  28. registers and to main memory.
  29. `(reg:M N)'
  30.      For small values of the integer N (those that are less than
  31.      `FIRST_PSEUDO_REGISTER'), this stands for a reference to machine
  32.      register number N: a "hard register".  For larger values of N, it
  33.      stands for a temporary value or "pseudo register".  The compiler's
  34.      strategy is to generate code assuming an unlimited number of such
  35.      pseudo registers, and later convert them into hard registers or
  36.      into memory references.
  37.      M is the machine mode of the reference.  It is necessary because
  38.      machines can generally refer to each register in more than one
  39.      mode.  For example, a register may contain a full word but there
  40.      may be instructions to refer to it as a half word or as a single
  41.      byte, as well as instructions to refer to it as a floating point
  42.      number of various precisions.
  43.      Even for a register that the machine can access in only one mode,
  44.      the mode must always be specified.
  45.      The symbol `FIRST_PSEUDO_REGISTER' is defined by the machine
  46.      description, since the number of hard registers on the machine is
  47.      an invariant characteristic of the machine.  Note, however, that
  48.      not all of the machine registers must be general registers.  All
  49.      the machine registers that can be used for storage of data are
  50.      given hard register numbers, even those that can be used only in
  51.      certain instructions or can hold only certain types of data.
  52.      A hard register may be accessed in various modes throughout one
  53.      function, but each pseudo register is given a natural mode and is
  54.      accessed only in that mode.  When it is necessary to describe an
  55.      access to a pseudo register using a nonnatural mode, a `subreg'
  56.      expression is used.
  57.      A `reg' expression with a machine mode that specifies more than
  58.      one word of data may actually stand for several consecutive
  59.      registers.  If in addition the register number specifies a
  60.      hardware register, then it actually represents several consecutive
  61.      hardware registers starting with the specified one.
  62.      Each pseudo register number used in a function's RTL code is
  63.      represented by a unique `reg' expression.
  64.      Some pseudo register numbers, those within the range of
  65.      `FIRST_VIRTUAL_REGISTER' to `LAST_VIRTUAL_REGISTER' only appear
  66.      during the RTL generation phase and are eliminated before the
  67.      optimization phases.  These represent locations in the stack frame
  68.      that cannot be determined until RTL generation for the function
  69.      has been completed.  The following virtual register numbers are
  70.      defined:
  71.     `VIRTUAL_INCOMING_ARGS_REGNUM'
  72.           This points to the first word of the incoming arguments
  73.           passed on the stack.  Normally these arguments are placed
  74.           there by the caller, but the callee may have pushed some
  75.           arguments that were previously passed in registers.
  76.           When RTL generation is complete, this virtual register is
  77.           replaced by the sum of the register given by
  78.           `ARG_POINTER_REGNUM' and the value of `FIRST_PARM_OFFSET'.
  79.     `VIRTUAL_STACK_VARS_REGNUM'
  80.           If `FRAME_GROWS_DOWNWARD' is defined, this points to
  81.           immediately above the first variable on the stack.
  82.           Otherwise, it points to the first variable on the stack.
  83.           `VIRTUAL_STACK_VARS_REGNUM' is replaced with the sum of the
  84.           register given by `FRAME_POINTER_REGNUM' and the value
  85.           `STARTING_FRAME_OFFSET'.
  86.     `VIRTUAL_STACK_DYNAMIC_REGNUM'
  87.           This points to the location of dynamically allocated memory
  88.           on the stack immediately after the stack pointer has been
  89.           adjusted by the amount of memory desired.
  90.           This virtual register is replaced by the sum of the register
  91.           given by `STACK_POINTER_REGNUM' and the value
  92.           `STACK_DYNAMIC_OFFSET'.
  93.     `VIRTUAL_OUTGOING_ARGS_REGNUM'
  94.           This points to the location in the stack at which outgoing
  95.           arguments should be written when the stack is pre-pushed
  96.           (arguments pushed using push insns should always use
  97.           `STACK_POINTER_REGNUM').
  98.           This virtual register is replaced by the sum of the register
  99.           given by `STACK_POINTER_REGNUM' and the value
  100.           `STACK_POINTER_OFFSET'.
  101. `(subreg:M REG WORDNUM)'
  102.      `subreg' expressions are used to refer to a register in a machine
  103.      mode other than its natural one, or to refer to one register of a
  104.      multi-word `reg' that actually refers to several registers.
  105.      Each pseudo-register has a natural mode.  If it is necessary to
  106.      operate on it in a different mode--for example, to perform a
  107.      fullword move instruction on a pseudo-register that contains a
  108.      single byte--the pseudo-register must be enclosed in a `subreg'.
  109.      In such a case, WORDNUM is zero.
  110.      Usually M is at least as narrow as the mode of REG, in which case
  111.      it is restricting consideration to only the bits of REG that are
  112.      in M.
  113.      Sometimes M is wider than the mode of REG.  These `subreg'
  114.      expressions are often called "paradoxical".  They are used in
  115.      cases where we want to refer to an object in a wider mode but do
  116.      not care what value the additional bits have.  The reload pass
  117.      ensures that paradoxical references are only made to hard
  118.      registers.
  119.      The other use of `subreg' is to extract the individual registers of
  120.      a multi-register value.  Machine modes such as `DImode' and
  121.      `TImode' can indicate values longer than a word, values which
  122.      usually require two or more consecutive registers.  To access one
  123.      of the registers, use a `subreg' with mode `SImode' and a WORDNUM
  124.      that says which register.
  125.      Storing in a non-paradoxical `subreg' has undefined results for
  126.      bits belonging to the same word as the `subreg'.  This laxity makes
  127.      it easier to generate efficient code for such instructions.  To
  128.      represent an instruction that preserves all the bits outside of
  129.      those in the `subreg', use `strict_low_part' around the `subreg'.
  130.      The compilation parameter `WORDS_BIG_ENDIAN', if set to 1, says
  131.      that word number zero is the most significant part; otherwise, it
  132.      is the least significant part.
  133.      Between the combiner pass and the reload pass, it is possible to
  134.      have a paradoxical `subreg' which contains a `mem' instead of a
  135.      `reg' as its first operand.  After the reload pass, it is also
  136.      possible to have a non-paradoxical `subreg' which contains a
  137.      `mem'; this usually occurs when the `mem' is a stack slot which
  138.      replaced a p