home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / gnu / info / gcc.info-16 (.txt) < prev    next >
GNU Info File  |  1994-12-22  |  49KB  |  875 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: Standard Names,  Next: Pattern Ordering,  Prev: Constraints,  Up: Machine Desc
  25. Standard Pattern Names For Generation
  26. =====================================
  27.    Here is a table of the instruction names that are meaningful in the
  28. RTL generation pass of the compiler.  Giving one of these names to an
  29. instruction pattern tells the RTL generation pass that it can use the
  30. pattern in to accomplish a certain task.
  31. `movM'
  32.      Here M stands for a two-letter machine mode name, in lower case.
  33.      This instruction pattern moves data with that machine mode from
  34.      operand 1 to operand 0.  For example, `movsi' moves full-word data.
  35.      If operand 0 is a `subreg' with mode M of a register whose own
  36.      mode is wider than M, the effect of this instruction is to store
  37.      the specified value in the part of the register that corresponds
  38.      to mode M.  The effect on the rest of the register is undefined.
  39.      This class of patterns is special in several ways.  First of all,
  40.      each of these names *must* be defined, because there is no other
  41.      way to copy a datum from one place to another.
  42.      Second, these patterns are not used solely in the RTL generation
  43.      pass.  Even the reload pass can generate move insns to copy values
  44.      from stack slots into temporary registers.  When it does so, one
  45.      of the operands is a hard register and the other is an operand
  46.      that can need to be reloaded into a register.
  47.      Therefore, when given such a pair of operands, the pattern must
  48.      generate RTL which needs no reloading and needs no temporary
  49.      registers--no registers other than the operands.  For example, if
  50.      you support the pattern with a `define_expand', then in such a
  51.      case the `define_expand' mustn't call `force_reg' or any other such
  52.      function which might generate new pseudo registers.
  53.      This requirement exists even for subword modes on a RISC machine
  54.      where fetching those modes from memory normally requires several
  55.      insns and some temporary registers.  Look in `spur.md' to see how
  56.      the requirement can be satisfied.
  57.      During reload a memory reference with an invalid address may be
  58.      passed as an operand.  Such an address will be replaced with a
  59.      valid address later in the reload pass.  In this case, nothing may
  60.      be done with the address except to use it as it stands.  If it is
  61.      copied, it will not be replaced with a valid address.  No attempt
  62.      should be made to make such an address into a valid address and no
  63.      routine (such as `change_address') that will do so may be called.
  64.      Note that `general_operand' will fail when applied to such an
  65.      address.
  66.      The global variable `reload_in_progress' (which must be explicitly
  67.      declared if required) can be used to determine whether such special
  68.      handling is required.
  69.      The variety of operands that have reloads depends on the rest of
  70.      the machine description, but typically on a RISC machine these can
  71.      only be pseudo registers that did not get hard registers, while on
  72.      other machines explicit memory references will get optional
  73.      reloads.
  74.      If a scratch register is required to move an object to or from
  75.      memory, it can be allocated using `gen_reg_rtx' prior to reload.
  76.      But this is impossible during and after reload.  If there are
  77.      cases needing scratch registers after reload, you must define
  78.      `SECONDARY_INPUT_RELOAD_CLASS' and perhaps also
  79.      `SECONDARY_OUTPUT_RELOAD_CLASS' to detect them, and provide
  80.      patterns `reload_inM' or `reload_outM' to handle them.  *Note
  81.      Register Classes::.
  82.      The constraints on a `moveM' must permit moving any hard register
  83.      to any other hard register provided that `HARD_REGNO_MODE_OK'
  84.      permits mode M in both registers and `REGISTER_MOVE_COST' applied
  85.      to their classes returns a value of 2.
  86.      It is obligatory to support floating point `moveM' instructions
  87.      into and out of any registers that can hold fixed point values,
  88.      because unions and structures (which have modes `SImode' or
  89.      `DImode') can be in those registers and they may have floating
  90.      point members.
  91.      There may also be a need to support fixed point `moveM'
  92.      instructions in and out of floating point registers.
  93.      Unfortunately, I have forgotten why this was so, and I don't know
  94.      whether it is still true.  If `HARD_REGNO_MODE_OK' rejects fixed
  95.      point values in floating point registers, then the constraints of
  96.      the fixed point `moveM' instructions must be designed to avoid
  97.      ever trying to reload into a floating point register.
  98. `reload_inM'
  99. `reload_outM'
  100.      Like `movM', but used when a scratch register is required to move
  101.      between operand 0 and operand 1.  Operand 2 describes the scratch
  102.      register.  See the discussion of the `SECONDARY_RELOAD_CLASS'
  103.      macro in *note Register Classes::..
  104. `movstrictM'
  105.      Like `movM' except that if operand 0 is a `subreg' with mode M of
  106.      a register whose natural mode is wider, the `movstrictM'
  107.      instruction is guaranteed not to alter any of the register except
  108.      the part which belongs to mode M.
  109. `load_multiple'
  110.      Load several consecutive memory locations into consecutive
  111.      registers.  Operand 0 is the first of the consecutive registers,
  112.      operand 1 is the first memory location, and operand 2 is a
  113.      constant: the number of consecutive registers.
  114.      Define this only if the target machine really has such an
  115.      instruction; do not define this if the most efficient way of
  116.      loading consecutive registers from memory is to do them one at a
  117.      time.
  118.      On some machines, there are restrictions as to which consecutive
  119.      registers can be stored into memory, such as particular starting or
  120.      ending register numbers or only a range of valid counts.  For those
  121.      machines, use a `define_expand' (*note Expander Definitions::.)
  122.      and make the pattern fail if the restrictions are not met.
  123.      Write the generated insn as a `parallel' with elements being a
  124.      `set' of one register from the appropriate memory location (you may
  125.      also need `use' or `clobber' elements).  Use a `match_parallel'
  126.      (*note RTL Template::.) to recognize the insn.  See `a29k.md' and
  127.      `rs6000.md' for examples of the use of this insn pattern.
  128. `store_multiple'
  129.      Similar to `load_multiple', but store several consecutive registers
  130.      into consecutive memory locations.  Operand 0 is the first of the
  131.      consecutive memory locations, operand 1 is the first register, and
  132.      operand 2 is a constant: the number of consecutive registers.
  133. `addM3'
  134.      Add operand 2 and operand 1, storing the result in operand 0.  All
  135.      operands must have mode M.  This can be used even on two-address
  136.      machines, by means of constraints requiring ope