home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 7 / FreshFishVol7.bin / bbs / gnu / gcc-2.3.3-src.lha / GNU / src / amiga / gcc-2.3.3 / rtl.def < prev    next >
Text File  |  1994-02-06  |  32KB  |  751 lines

  1. /* This file contains the definitions and documentation for the
  2.    Register Transfer Expressions (rtx's) that make up the
  3.    Register Transfer Language (rtl) used in the Back End of the GNU compiler.
  4.    Copyright (C) 1987-1991 Free Software Foundation, Inc.
  5.  
  6. This file is part of GNU CC.
  7.  
  8. GNU CC is free software; you can redistribute it and/or modify
  9. it under the terms of the GNU General Public License as published by
  10. the Free Software Foundation; either version 2, or (at your option)
  11. any later version.
  12.  
  13. GNU CC is distributed in the hope that it will be useful,
  14. but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16. GNU General Public License for more details.
  17.  
  18. You should have received a copy of the GNU General Public License
  19. along with GNU CC; see the file COPYING.  If not, write to
  20. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  21.  
  22.  
  23. /* Expression definitions and descriptions for all targets are in this file.
  24.    Some will not be used for some targets.
  25.  
  26.    The fields in the cpp macro call "DEF_RTL_EXPR()"
  27.    are used to create declarations in the C source of the compiler.
  28.  
  29.    The fields are:
  30.  
  31.    1.  The internal name of the rtx used in the C source.
  32.    It is a tag in the enumeration "enum rtx_code" defined in "rtl.h".
  33.    By convention these are in UPPER_CASE.
  34.  
  35.    2.  The name of the rtx in the external ASCII format read by
  36.    read_rtx(), and printed by print_rtx().
  37.    These names are stored in rtx_name[].
  38.    By convention these are the internal (field 1) names in lower_case.
  39.  
  40.    3.  The print format, and type of each rtx->fld[] (field) in this rtx.
  41.    These formats are stored in rtx_format[].
  42.    The meaning of the formats is documented in front of this array in rtl.c
  43.    
  44.    4.  The class of the rtx.  These are stored in rtx_class and are accessed
  45.    via the GET_RTX_CLASS macro.  They are defined as follows:
  46.  
  47.      "o" an rtx code that can be used to represent an object (e.g, REG, MEM)
  48.      "<" an rtx code for a comparison (e.g, EQ, NE, LT)
  49.      "1" an rtx code for a unary arithmetic expression (e.g, NEG, NOT)
  50.      "c" an rtx code for a commutative binary operation (e.g,, PLUS, MULT)
  51.      "3" an rtx code for a non-bitfield three input operation (IF_THEN_ELSE)
  52.      "2" an rtx code for a non-commutative binary operation (e.g., MINUS, DIV)
  53.      "b" an rtx code for a bit-field operation (ZERO_EXTRACT, SIGN_EXTRACT)
  54.      "i" an rtx code for a machine insn (INSN, JUMP_INSN, CALL_INSN)
  55.      "m" an rtx code for something that matches in insns (e.g, MATCH_DUP)
  56.      "x" everything else
  57.      
  58.    */
  59.  
  60. /* ---------------------------------------------------------------------
  61.    Expressions (and "meta" expressions) used for structuring the
  62.    rtl representation of a program.
  63.    --------------------------------------------------------------------- */
  64.  
  65. /* an expression code name unknown to the reader */
  66. DEF_RTL_EXPR(UNKNOWN, "UnKnown", "*", 'x')
  67.  
  68. /* (NIL) is used by rtl reader and printer to represent a null pointer.  */
  69.  
  70. DEF_RTL_EXPR(NIL, "nil", "*", 'x')
  71.  
  72. /* ---------------------------------------------------------------------
  73.    Expressions used in constructing lists.
  74.    --------------------------------------------------------------------- */
  75.  
  76. /* a linked list of expressions */
  77. DEF_RTL_EXPR(EXPR_LIST, "expr_list", "ee", 'x')
  78.  
  79. /* a linked list of instructions.
  80.    The insns are represented in print by their uids.  */
  81. DEF_RTL_EXPR(INSN_LIST, "insn_list", "ue", 'x')
  82.  
  83. /* ----------------------------------------------------------------------
  84.    Expression types for machine descriptions.
  85.    These do not appear in actual rtl code in the compiler.
  86.    ---------------------------------------------------------------------- */
  87.  
  88. /* Appears only in machine descriptions.
  89.    Means use the function named by the second arg (the string)
  90.    as a predicate; if matched, store the structure that was matched
  91.    in the operand table at index specified by the first arg (the integer).
  92.    If the second arg is the null string, the structure is just stored.
  93.  
  94.    A third string argument indicates to the register allocator restrictions
  95.    on where the operand can be allocated.
  96.  
  97.    If the target needs no restriction on any instruction this field should
  98.    be the null string.
  99.  
  100.    The string is prepended by:
  101.    '=' to indicate the operand is only written to.
  102.    '+' to indicate the operand is both read and written to.
  103.  
  104.    Each character in the string represents an allocatable class for an operand.
  105.    'g' indicates the operand can be any valid class.
  106.    'i' indicates the operand can be immediate (in the instruction) data.
  107.    'r' indicates the operand can be in a register.
  108.    'm' indicates the operand can be in memory.
  109.    'o' a subset of the 'm' class.  Those memory addressing modes that
  110.        can be offset at compile time (have a constant added to them).
  111.  
  112.    Other characters indicate target dependent operand classes and
  113.    are described in each target's machine description.
  114.  
  115.    For instructions with more than one operand, sets of classes can be
  116.    separated by a comma to indicate the appropriate multi-operand constraints.
  117.    There must be a 1 to 1 correspondence between these sets of classes in
  118.    all operands for an instruction.
  119.    */
  120. DEF_RTL_EXPR(MATCH_OPERAND, "match_operand", "iss", 'm')
  121.  
  122. /* Appears only in machine descriptions.
  123.    Means match a SCRATCH or a register.  When used to generate rtl, a
  124.    SCRATCH is generated.  As for MATCH_OPERAND, the mode specifies
  125.    the desired mode and the first argument is the operand number.
  126.    The second argument is the constraint.  */
  127. DEF_RTL_EXPR(MATCH_SCRATCH, "match_scratch", "is", 'm')
  128.  
  129. /* Appears only in machine descriptions.
  130.    Means match only something equal to what is stored in the operand table
  131.    at the index specified by the argument.  */
  132. DEF_RTL_EXPR(MATCH_DUP, "match_dup", "i", 'm')
  133.  
  134. /* Appears only in machine descriptions.
  135.    Means apply a predicate, AND match recursively the operands of the rtx.
  136.    Operand 0 is the operand-number, as in match_operand.
  137.    Operand 1 is a predicate to apply (as a string, a function name).
  138.    Operand 2 is a vector of expressions, each of which must match
  139.    one subexpression of the rtx this construct is matching.  */
  140. DEF_RTL_EXPR(MATCH_OPERATOR, "match_operator", "isE", 'm')
  141.  
  142. /* Appears only in machine descriptions.
  143.    Means to match a PARALLEL of arbitrary length.  The predicate is applied
  144.    to the PARALLEL and the initial expressions in the PARALLEL are matched.
  145.    Operand 0 is the operand-number, as in match_operand.
  146.    Operand 1 is a predicate to apply to the PARALLEL.
  147.    Operand 2 is a vector of expressions, each of which must match the 
  148.    corresponding element in the PARALLEL.  */
  149. DEF_RTL_EXPR(MATCH_PARALLEL, "match_parallel", "isE", 'm')
  150.  
  151. /* Appears only in machine descriptions.
  152.    Means match only something equal to what is stored in the operand table
  153.    at the index specified by the argument.  For MATCH_OPERATOR.  */
  154. DEF_RTL_EXPR(MATCH_OP_DUP, "match_op_dup", "iE", 'm')
  155.  
  156. /* Appears only in machine descriptions.
  157.    Means match only something equal to what is stored in the operand table
  158.    at the index specified by the argument.  For MATCH_PARALLEL.  */
  159. DEF_RTL_EXPR(MATCH_PAR_DUP, "match_par_dup", "iE", 'm')
  160.  
  161. /* Appears only in machine descriptions.
  162.    Defines the pattern for one kind of instruction.
  163.    Operand:
  164.    0: names this instruction.
  165.       If the name is the null string, the instruction is in the
  166.       machine description just to be recognized, and will never be emitted by
  167.       the tree to rtl expander.
  168.    1: is the pattern.
  169.    2: is a string which is a C expression
  170.       giving an additional condition for recognizing this pattern.
  171.       A null string means no extra condition.
  172.    3: is the action to execute if this pattern is matched.
  173.       If this assembler code template starts with a * then it is a fragment of
  174.       C code to run to decide on a template to use.  Otherwise, it is the
  175.       template to use.
  176.    4: optionally, a vector of attributes for this insn.
  177.      */
  178. DEF_RTL_EXPR(DEFINE_INSN, "define_insn", "sEssV", 'x')
  179.  
  180. /* Definition of a peephole optimization.
  181.    1st operand: vector of ins