OSDN Git Service

boehm-gc:
[pf3gnuchains/gcc-fork.git] / gcc / rtl.def
index e45004d..711cf75 100644 (file)
@@ -1,7 +1,8 @@
 /* This file contains the definitions and documentation for the
    Register Transfer Expressions (rtx's) that make up the
    Register Transfer Language (rtl) used in the Back End of the GNU compiler.
-   Copyright (C) 1987, 1988, 1992, 1994, 1995, 1997, 1998, 1999, 2000, 2004
+   Copyright (C) 1987, 1988, 1992, 1994, 1995, 1997, 1998, 1999, 2000, 2004,
+   2005, 2006, 2007
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -18,8 +19,8 @@ for more details.
 
 You should have received a copy of the GNU General Public License
 along with GCC; see the file COPYING.  If not, write to the Free
-Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.  */
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA.  */
 
 
 /* Expression definitions and descriptions for all targets are in this file.
@@ -136,20 +137,12 @@ DEF_RTL_EXPR(BARRIER, "barrier", "iuu000000", RTX_EXTRA)
    7: is the user-given name of the label, if any.  */
 DEF_RTL_EXPR(CODE_LABEL, "code_label", "iuuB00is", RTX_EXTRA)
 
-#ifdef USE_MAPPED_LOCATION
 /* Say where in the code a source line starts, for symbol table's sake.
    Operand:
-   4: unused if line number > 0, note-specific data otherwise.
-   5: line number if > 0, enum note_insn otherwise.
-   6: CODE_LABEL_NUMBER if line number == NOTE_INSN_DELETED_LABEL.  */
-#else
-/* Say where in the code a source line starts, for symbol table's sake.
-   Operand:
-   4: filename, if line number > 0, note-specific data otherwise.
-   5: line number if > 0, enum note_insn otherwise.
+   4: note-specific data
+   5: unused (memory layout has to match code_label above)
    6: unique number if line number == note_insn_deleted_label.  */
-#endif
-DEF_RTL_EXPR(NOTE, "note", "iuuB0ni", RTX_EXTRA)
+DEF_RTL_EXPR(NOTE, "note", "iuuB00i", RTX_EXTRA)
 
 /* ----------------------------------------------------------------------
    Top level constituents of INSN, JUMP_INSN and CALL_INSN.
@@ -167,15 +160,15 @@ DEF_RTL_EXPR(COND_EXEC, "cond_exec", "ee", RTX_EXTRA)
 /* Several operations to be done in parallel (perhaps under COND_EXEC).  */
 DEF_RTL_EXPR(PARALLEL, "parallel", "E", RTX_EXTRA)
 
+#ifdef USE_MAPPED_LOCATION
 /* A string that is passed through to the assembler as input.
      One can obviously pass comments through by using the
      assembler comment syntax.
      These occur in an insn all by themselves as the PATTERN.
      They also appear inside an ASM_OPERANDS
      as a convenient way to hold a string.  */
-DEF_RTL_EXPR(ASM_INPUT, "asm_input", "s", RTX_EXTRA)
+DEF_RTL_EXPR(ASM_INPUT, "asm_input", "si", RTX_EXTRA)
 
-#ifdef USE_MAPPED_LOCATION
 /* An assembler instruction with operands.
    1st operand is the instruction template.
    2nd operand is the constraint for the output.
@@ -189,6 +182,14 @@ DEF_RTL_EXPR(ASM_INPUT, "asm_input", "s", RTX_EXTRA)
    6th is the source line number.  */
 DEF_RTL_EXPR(ASM_OPERANDS, "asm_operands", "ssiEEi", RTX_EXTRA)
 #else
+/* A string that is passed through to the assembler as input.
+     One can obviously pass comments through by using the
+     assembler comment syntax.
+     These occur in an insn all by themselves as the PATTERN.
+     They also appear inside an ASM_OPERANDS
+     as a convenient way to hold a string.  */
+DEF_RTL_EXPR(ASM_INPUT, "asm_input", "ssi", RTX_EXTRA)
+
 /* An assembler instruction with operands.
    1st operand is the instruction template.
    2nd operand is the constraint for the output.
@@ -314,7 +315,7 @@ DEF_RTL_EXPR(CONST_INT, "const_int", "w", RTX_CONST_OBJ)
 DEF_RTL_EXPR(CONST_DOUBLE, "const_double", CONST_DOUBLE_FORMAT, RTX_CONST_OBJ)
 
 /* Describes a vector constant.  */
-DEF_RTL_EXPR(CONST_VECTOR, "const_vector", "E", RTX_EXTRA)
+DEF_RTL_EXPR(CONST_VECTOR, "const_vector", "E", RTX_CONST_OBJ)
 
 /* String constant.  Used for attributes in machine descriptions and
    for special cases in DWARF2 debug output.  NOT used for source-
@@ -331,14 +332,17 @@ DEF_RTL_EXPR(CONST, "const", "e", RTX_CONST_OBJ)
    by a SET whose first operand is (PC).  */
 DEF_RTL_EXPR(PC, "pc", "", RTX_OBJ)
 
-/* Used in the cselib routines to describe a value.  */
+/* Used in the cselib routines to describe a value.  Objects of this
+   kind are only allocated in cselib.c, in an alloc pool instead of
+   in GC memory.  The only operand of a VALUE is a cselib_val_struct.  */
 DEF_RTL_EXPR(VALUE, "value", "0", RTX_OBJ)
 
 /* A register.  The "operand" is the register number, accessed with
    the REGNO macro.  If this number is less than FIRST_PSEUDO_REGISTER
    than a hardware register is being referred to.  The second operand
    holds the original register number - this will be different for a
-   pseudo register that got turned into a hard register.
+   pseudo register that got turned into a hard register.  The third
+   operand points to a reg_attrs structure.
    This rtx needs to have as many (or more) fields as a MEM, since we
    can change REG rtx's into MEMs during reload.  */
 DEF_RTL_EXPR(REG, "reg", "i00", RTX_OBJ)
@@ -379,16 +383,20 @@ DEF_RTL_EXPR(STRICT_LOW_PART, "strict_low_part", "e", RTX_EXTRA)
    in DECL_RTLs and during RTL generation, but not in the insn chain.  */
 DEF_RTL_EXPR(CONCAT, "concat", "ee", RTX_OBJ)
 
+/* (CONCATN [a1 a2 ... an]) represents the virtual concatenation of
+   all An to make a value.  This is an extension of CONCAT to larger
+   number of components.  Like CONCAT, it should not appear in the
+   insn chain.  Every element of the CONCATN is the same size.  */
+DEF_RTL_EXPR(CONCATN, "concatn", "E", RTX_OBJ)
+
 /* A memory location; operand is the address.  The second operand is the
    alias set to which this MEM belongs.  We use `0' instead of `w' for this
    field so that the field need not be specified in machine descriptions.  */
 DEF_RTL_EXPR(MEM, "mem", "e0", RTX_OBJ)
 
 /* Reference to an assembler label in the code for this function.
-   The operand is a CODE_LABEL found in the insn chain.
-   The unprinted fields 1 and 2 are used in flow.c for the
-   LABEL_NEXTREF and CONTAINING_INSN.  */
-DEF_RTL_EXPR(LABEL_REF, "label_ref", "u00", RTX_CONST_OBJ)
+   The operand is a CODE_LABEL found in the insn chain.  */
+DEF_RTL_EXPR(LABEL_REF, "label_ref", "u", RTX_CONST_OBJ)
 
 /* Reference to a named label: 
    Operand 0: label name
@@ -441,11 +449,8 @@ DEF_RTL_EXPR(UMOD, "umod", "ee", RTX_BIN_ARITH)
 
 /* Bitwise operations.  */
 DEF_RTL_EXPR(AND, "and", "ee", RTX_COMM_ARITH)
-
 DEF_RTL_EXPR(IOR, "ior", "ee", RTX_COMM_ARITH)
-
 DEF_RTL_EXPR(XOR, "xor", "ee", RTX_COMM_ARITH)
-
 DEF_RTL_EXPR(NOT, "not", "e", RTX_UNARY)
 
 /* Operand:
@@ -459,7 +464,10 @@ DEF_RTL_EXPR(ROTATERT, "rotatert", "ee", RTX_BIN_ARITH) /* rotate right */
 
 /* Minimum and maximum values of two operands.  We need both signed and
    unsigned forms.  (We cannot use MIN for SMIN because it conflicts
-   with a macro of the same name.) */
+   with a macro of the same name.)   The signed variants should be used
+   with floating point.  Further, if both operands are zeros, or if either
+   operand is NaN, then it is unspecified which of the two operands is
+   returned as the result.  */
 
 DEF_RTL_EXPR(SMIN, "smin", "ee", RTX_COMM_ARITH)
 DEF_RTL_EXPR(SMAX, "smax", "ee", RTX_COMM_ARITH)
@@ -560,6 +568,9 @@ DEF_RTL_EXPR(ABS, "abs", "e", RTX_UNARY)
 /* Square root */
 DEF_RTL_EXPR(SQRT, "sqrt", "e", RTX_UNARY)
 
+/* Swap bytes.  */
+DEF_RTL_EXPR(BSWAP, "bswap", "e", RTX_UNARY)
+
 /* Find first bit that is set.
    Value is 1 + number of trailing zeros in the arg.,
    or 0 if arg is 0.  */
@@ -585,10 +596,12 @@ DEF_RTL_EXPR(PARITY, "parity", "e", RTX_UNARY)
    If BITS_BIG_ENDIAN is defined, the first bit is the msb and
    operand 2 counts from the msb of the memory unit.
    Otherwise, the first bit is the lsb and operand 2 counts from
-   the lsb of the memory unit.  */
+   the lsb of the memory unit.
+   This kind of expression can not appear as an lvalue in RTL.  */
 DEF_RTL_EXPR(SIGN_EXTRACT, "sign_extract", "eee", RTX_BITFIELD_OPS)
 
-/* Similar for unsigned bit-field.  */
+/* Similar for unsigned bit-field.
+   But note!  This kind of expression _can_ appear as an lvalue.  */
 DEF_RTL_EXPR(ZERO_EXTRACT, "zero_extract", "eee", RTX_BITFIELD_OPS)
 
 /* For RISC machines.  These save memory when splitting insns.  */
@@ -600,44 +613,6 @@ DEF_RTL_EXPR(HIGH, "high", "e", RTX_CONST_OBJ)
    of a constant expression.  */
 DEF_RTL_EXPR(LO_SUM, "lo_sum", "ee", RTX_OBJ)
 
-/* Header for range information.  Operand 0 is the NOTE_INSN_RANGE_BEG insn.
-   Operand 1 is the NOTE_INSN_RANGE_END insn.  Operand 2 is a vector of all of
-   the registers that can be substituted within this range.  Operand 3 is the
-   number of calls in the range.  Operand 4 is the number of insns in the
-   range.  Operand 5 is the unique range number for this range.  Operand 6 is
-   the basic block # of the start of the live range.  Operand 7 is the basic
-   block # of the end of the live range.  Operand 8 is the loop depth.  Operand
-   9 is a bitmap of the registers live at the start of the range.  Operand 10
-   is a bitmap of the registers live at the end of the range.  Operand 11 is
-   marker number for the start of the range.  Operand 12 is the marker number
-   for the end of the range.  */
-DEF_RTL_EXPR(RANGE_INFO, "range_info", "uuEiiiiiibbii", RTX_EXTRA)
-
-/* Registers that can be substituted within the range.  Operand 0 is the
-   original pseudo register number.  Operand 1 will be filled in with the
-   pseudo register the value is copied for the duration of the range.  Operand
-   2 is the number of references within the range to the register.  Operand 3
-   is the number of sets or clobbers of the register in the range.  Operand 4
-   is the number of deaths the register has.  Operand 5 is the copy flags that
-   give the status of whether a copy is needed from the original register to
-   the new register at the beginning of the range, or whether a copy from the
-   new register back to the original at the end of the range.  Operand 6 is the
-   live length.  Operand 7 is the number of calls that this register is live
-   across.  Operand 8 is the symbol node of the variable if the register is a
-   user variable.  Operand 9 is the block node that the variable is declared
-   in if the register is a user variable.  */
-DEF_RTL_EXPR(RANGE_REG, "range_reg", "iiiiiiiitt", RTX_EXTRA)
-
-/* Information about a local variable's ranges.  Operand 0 is an EXPR_LIST of
-   the different ranges a variable is in where it is copied to a different
-   pseudo register.  Operand 1 is the block that the variable is declared in.
-   Operand 2 is the number of distinct ranges.  */
-DEF_RTL_EXPR(RANGE_VAR, "range_var", "eti", RTX_EXTRA)
-
-/* Information about the registers that are live at the current point.  Operand
-   0 is the live bitmap.  Operand 1 is the original block number.  */
-DEF_RTL_EXPR(RANGE_LIVE, "range_live", "bi", RTX_EXTRA)
-
 /* Describes a merge operation between two vector values.
    Operands 0 and 1 are the vectors to be merged, operand 2 is a bitmask
    that specifies where the parts of the result are taken from.  Set bits
@@ -671,6 +646,15 @@ DEF_RTL_EXPR(US_PLUS, "us_plus", "ee", RTX_COMM_ARITH)
 /* Operand 0 minus operand 1, with signed saturation.  */
 DEF_RTL_EXPR(SS_MINUS, "ss_minus", "ee", RTX_BIN_ARITH)
 
+/* Negation with signed saturation.  */
+DEF_RTL_EXPR(SS_NEG, "ss_neg", "e", RTX_UNARY)
+
+/* Absolute value with signed saturation.  */
+DEF_RTL_EXPR(SS_ABS, "ss_abs", "e", RTX_UNARY)
+
+/* Shift left with signed saturation.  */
+DEF_RTL_EXPR(SS_ASHIFT, "ss_ashift", "ee", RTX_BIN_ARITH)
+
 /* Operand 0 minus operand 1, with unsigned saturation.  */
 DEF_RTL_EXPR(US_MINUS, "us_minus", "ee", RTX_BIN_ARITH)
 
@@ -760,8 +744,13 @@ DEF_RTL_EXPR(MATCH_PAR_DUP, "match_par_dup", "iE", RTX_MATCH)
 
 /* Appears only in define_predicate/define_special_predicate
    expressions.  Evaluates true only if the operand has an RTX code
-   from the set given by the argument (a comma-separated list).  */
-DEF_RTL_EXPR(MATCH_CODE, "match_code", "s", RTX_MATCH)
+   from the set given by the argument (a comma-separated list).  If the
+   second argument is present and nonempty, it is a sequence of digits
+   and/or letters which indicates the subexpression to test, using the
+   same syntax as genextract/genrecog's location strings: 0-9 for
+   XEXP (op, n), a-z for XVECEXP (op, 0, n); each character applies to
+   the result of the one before it.  */
+DEF_RTL_EXPR(MATCH_CODE, "match_code", "ss", RTX_MATCH)
 
 /* Appears only in define_predicate/define_special_predicate
     expressions.  The argument is a C expression to be injected at this
@@ -902,6 +891,61 @@ DEF_RTL_EXPR(DEFINE_COND_EXEC, "define_cond_exec", "Ess", RTX_EXTRA)
 DEF_RTL_EXPR(DEFINE_PREDICATE, "define_predicate", "ses", RTX_EXTRA)
 DEF_RTL_EXPR(DEFINE_SPECIAL_PREDICATE, "define_special_predicate", "ses", RTX_EXTRA)
 
+/* Definition of a register operand constraint.  This simply maps the
+   constraint string to a register class.
+
+   Operand:
+   0: The name of the constraint (often, but not always, a single letter).
+   1: A C expression which evaluates to the appropriate register class for
+      this constraint.  If this is not just a constant, it should look only
+      at -m switches and the like.
+   2: A docstring for this constraint, in Texinfo syntax; not currently
+      used, in future will be incorporated into the manual's list of
+      machine-specific operand constraints.  */
+DEF_RTL_EXPR(DEFINE_REGISTER_CONSTRAINT, "define_register_constraint", "sss", RTX_EXTRA)
+
+/* Definition of a non-register operand constraint.  These look at the
+   operand and decide whether it fits the constraint.
+
+   DEFINE_CONSTRAINT gets no special treatment if it fails to match.
+   It is appropriate for constant-only constraints, and most others.
+
+   DEFINE_MEMORY_CONSTRAINT tells reload that this constraint can be made
+   to match, if it doesn't already, by converting the operand to the form
+   (mem (reg X)) where X is a base register.  It is suitable for constraints
+   that describe a subset of all memory references.
+
+   DEFINE_ADDRESS_CONSTRAINT tells reload that this constraint can be made
+   to match, if it doesn't already, by converting the operand to the form
+   (reg X) where X is a base register.  It is suitable for constraints that
+   describe a subset of all address references.
+
+   When in doubt, use plain DEFINE_CONSTRAINT.  
+
+   Operand:
+   0: The name of the constraint (often, but not always, a single letter).
+   1: A docstring for this constraint, in Texinfo syntax; not currently
+      used, in future will be incorporated into the manual's list of
+      machine-specific operand constraints.
+   2: A boolean expression which computes whether or not the constraint
+      matches.  It should follow the same rules as a define_predicate
+      expression, including the bit about specifying the set of RTX codes
+      that could possibly match.  MATCH_TEST subexpressions may make use of
+      these variables:
+        `op'    - the RTL object defining the operand.
+        `mode'  - the mode of `op'.
+       `ival'  - INTVAL(op), if op is a CONST_INT.
+        `hval'  - CONST_DOUBLE_HIGH(op), if op is an integer CONST_DOUBLE.
+        `lval'  - CONST_DOUBLE_LOW(op), if op is an integer CONST_DOUBLE.
+        `rval'  - CONST_DOUBLE_REAL_VALUE(op), if op is a floating-point
+                  CONST_DOUBLE.
+      Do not use ival/hval/lval/rval if op is not the appropriate kind of
+      RTL object.  */
+DEF_RTL_EXPR(DEFINE_CONSTRAINT, "define_constraint", "sse", RTX_EXTRA)
+DEF_RTL_EXPR(DEFINE_MEMORY_CONSTRAINT, "define_memory_constraint", "sse", RTX_EXTRA)
+DEF_RTL_EXPR(DEFINE_ADDRESS_CONSTRAINT, "define_address_constraint", "sse", RTX_EXTRA)
+   
+
 /* Constructions for CPU pipeline description described by NDFAs.  */
 
 /* (define_cpu_unit string [string]) describes cpu functional