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