DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

(gcc.info.gz) Patterns

Info Catalog (gcc.info.gz) Machine Desc (gcc.info.gz) Example
 
 Everything about Instruction Patterns
 =====================================
 
    Each instruction pattern contains an incomplete RTL expression, with
 pieces to be filled in later, operand constraints that restrict how the
 pieces can be filled in, and an output pattern or C code to generate
 the assembler output, all wrapped up in a `define_insn' expression.
 
    A `define_insn' is an RTL expression containing four or five
 operands:
 
   1. An optional name.  The presence of a name indicate that this
      instruction pattern can perform a certain standard job for the
      RTL-generation pass of the compiler.  This pass knows certain
      names and will use the instruction patterns with those names, if
      the names are defined in the machine description.
 
      The absence of a name is indicated by writing an empty string
      where the name should go.  Nameless instruction patterns are never
      used for generating RTL code, but they may permit several simpler
      insns to be combined later on.
 
      Names that are not thus known and used in RTL-generation have no
      effect; they are equivalent to no name at all.
 
   2. The "RTL template" ( RTL Template.) is a vector of
      incomplete RTL expressions which show what the instruction should
      look like.  It is incomplete because it may contain
      `match_operand', `match_operator', and `match_dup' expressions
      that stand for operands of the instruction.
 
      If the vector has only one element, that element is the template
      for the instruction pattern.  If the vector has multiple elements,
      then the instruction pattern is a `parallel' expression containing
      the elements described.
 
   3. A condition.  This is a string which contains a C expression that
      is the final test to decide whether an insn body matches this
      pattern.
 
      For a named pattern, the condition (if present) may not depend on
      the data in the insn being matched, but only the
      target-machine-type flags.  The compiler needs to test these
      conditions during initialization in order to learn exactly which
      named instructions are available in a particular run.
 
      For nameless patterns, the condition is applied only when matching
      an individual insn, and only after the insn has matched the
      pattern's recognition template.  The insn's operands may be found
      in the vector `operands'.
 
   4. The "output template": a string that says how to output matching
      insns as assembler code.  `%' in this string specifies where to
      substitute the value of an operand.   Output Template.
 
      When simple substitution isn't general enough, you can specify a
      piece of C code to compute the output.   Output Statement.
 
   5. Optionally, a vector containing the values of attributes for insns
      matching this pattern.   Insn Attributes.
 
Info Catalog (gcc.info.gz) Machine Desc (gcc.info.gz) Example
automatically generated byinfo2html