OSDN Git Service

2003-02-12 Phil Edwards <pme@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / genattrtab.c
index f5b2681..0270945 100644 (file)
@@ -100,8 +100,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #define ATTR_PERMANENT_P(RTX) (RTX_FLAG((RTX), integrated))
 #define ATTR_EQ_ATTR_P(RTX) (RTX_FLAG((RTX), volatil))
 
-#include "hconfig.h"
+#include "bconfig.h"
 #include "system.h"
+#include "coretypes.h"
+#include "tm.h"
 #include "rtl.h"
 #include "ggc.h"
 #include "gensupport.h"
@@ -1159,6 +1161,10 @@ check_attr_value (exp, attr)
       break;
 
     case FFS:
+    case CLZ:
+    case CTZ:
+    case POPCOUNT:
+    case PARITY:
       XEXP (exp, 0) = check_attr_value (XEXP (exp, 0), attr);
       break;
 
@@ -1838,7 +1844,7 @@ operate_exp (op, left, right)
    The first produces a function `function_units_used' which is given an
    insn and produces an encoding showing which function units are required
    for the execution of that insn.  If the value is non-negative, the insn
-   uses that unit; otherwise, the value is a one's compliment mask of units
+   uses that unit; otherwise, the value is a one's complement mask of units
    used.
 
    The second produces a function `result_ready_cost' which is used to
@@ -2083,7 +2089,7 @@ expand_units ()
             every possible C.
 
             The issue delay function for C is op->issue_exp and is used to
-            write the `<name>_unit_conflict_cost' function.  Symbolicly
+            write the `<name>_unit_conflict_cost' function.  Symbolically
             this is "ISSUE-DELAY (E,C)".
 
             The pipeline delay results form the FIFO constraint on the
@@ -2093,7 +2099,7 @@ expand_units ()
             fill the unit given the minimum issue delay.  FILL-TIME is the
             constant "MIN (ISSUE-DELAY (*,*)) * (SIMULTANEITY - 1)", and
             the simultaneity constraint is "READY-COST (E) - FILL-TIME"
-            if SIMULTANEITY is non-zero and zero otherwise.
+            if SIMULTANEITY is nonzero and zero otherwise.
 
             Thus, BLOCKAGE (E,C) when SIMULTANEITY is zero is
 
@@ -2246,7 +2252,7 @@ simplify_knowing (exp, known_true)
 /* Translate the CONST_STRING expressions in X to change the encoding of
    value.  On input, the value is a bitmask with a one bit for each unit
    used; on output, the value is the unit number (zero based) if one
-   and only one unit is used or the one's compliment of the bitmask.  */
+   and only one unit is used or the one's complement of the bitmask.  */
 
 static rtx
 encode_units_mask (x)
@@ -2264,7 +2270,7 @@ encode_units_mask (x)
     case CONST_STRING:
       i = atoi (XSTR (x, 0));
       if (i < 0)
-       /* The sign bit encodes a one's compliment mask.  */
+       /* The sign bit encodes a one's complement mask.  */
        abort ();
       else if (i != 0 && i == (i & -i))
        /* Only one bit is set, so yield that unit number.  */
@@ -2562,11 +2568,10 @@ simplify_cond (exp, insn_code, insn_index)
   int len = XVECLEN (exp, 0);
   rtx *tests = (rtx *) xmalloc (len * sizeof (rtx));
   int allsame = 1;
-  char *first_spacer;
   rtx ret;
 
   /* This lets us free all storage allocated below, if appropriate.  */
-  first_spacer = (char *) obstack_finish (rtl_obstack);
+  obstack_finish (rtl_obstack);
 
   memcpy (tests, XVEC (exp, 0)->elem, len * sizeof (rtx));
 
@@ -3197,8 +3202,8 @@ attr_rtx_cost (x)
 \f
 
 /* Simplify test expression and use temporary obstack in order to avoid
-   memory bloat.  Use ATTR_IND_SIMPLIFIED to avoid unnecesary simplifications
-   and avoid unnecesary copying if possible.  */
+   memory bloat.  Use ATTR_IND_SIMPLIFIED to avoid unnecessary simplifications
+   and avoid unnecessary copying if possible.  */
 
 static rtx
 simplify_test_exp_in_temp (exp, insn_code, insn_index)
@@ -4315,7 +4320,7 @@ count_alternatives (exp)
   return 0;
 }
 \f
-/* Returns non-zero if the given expression contains an EQ_ATTR with the
+/* Returns nonzero if the given expression contains an EQ_ATTR with the
    `alternative' attribute.  */
 
 static int
@@ -4348,7 +4353,7 @@ compares_alternatives_p (exp)
   return 0;
 }
 \f
-/* Returns non-zero is INNER is contained in EXP.  */
+/* Returns nonzero is INNER is contained in EXP.  */
 
 static int
 contained_in_p (inner, exp)
@@ -4558,7 +4563,7 @@ gen_unit (def, lineno)
 /* Given a piece of RTX, print a C expression to test its truth value.
    We use AND and IOR both for logical and bit-wise operations, so
    interpret them as logical unless they are inside a comparison expression.
-   The first bit of FLAGS will be non-zero in that case.
+   The first bit of FLAGS will be nonzero in that case.
 
    Set the second bit of FLAGS to make references to attribute values use
    a cached local variable instead of calling a function.  */
@@ -5020,7 +5025,7 @@ write_attr_get (attr)
       return;
     }
 
-  printf ("     rtx insn;\n");
+  printf ("     rtx insn ATTRIBUTE_UNUSED;\n");
   printf ("{\n");
 
   if (GET_CODE (common_av->value) == FFS)
@@ -5488,7 +5493,7 @@ write_indent (indent)
 }
 \f
 /* Write a subroutine that is given an insn that requires a delay slot, a
-   delay slot ordinal, and a candidate insn.  It returns non-zero if the
+   delay slot ordinal, and a candidate insn.  It returns nonzero if the
    candidate can be placed in the specified delay slot of the insn.
 
    We can write as many as three subroutines.  `eligible_for_delay'
@@ -5807,7 +5812,7 @@ next_comma_elt (pstr)
 }
 
 /* Return a `struct attr_desc' pointer for a given named attribute.  If CREATE
-   is non-zero, build a new attribute, if one does not exist.  */
+   is nonzero, build a new attribute, if one does not exist.  */
 
 static struct attr_desc *
 find_attr (name, create)
@@ -6114,10 +6119,18 @@ from the machine description file `md'.  */\n\n");
          gen_presence_set (desc);
          break;
          
+       case FINAL_PRESENCE_SET:
+         gen_final_presence_set (desc);
+         break;
+         
        case ABSENCE_SET:
          gen_absence_set (desc);
          break;
          
+       case FINAL_ABSENCE_SET:
+         gen_final_absence_set (desc);
+         break;
+         
        case DEFINE_AUTOMATON:
          gen_automaton (desc);
          break;
@@ -6169,6 +6182,8 @@ from the machine description file `md'.  */\n\n");
 
   printf ("#include \"config.h\"\n");
   printf ("#include \"system.h\"\n");
+  printf ("#include \"coretypes.h\"\n");
+  printf ("#include \"tm.h\"\n");
   printf ("#include \"rtl.h\"\n");
   printf ("#include \"tm_p.h\"\n");
   printf ("#include \"insn-config.h\"\n");
@@ -6226,7 +6241,18 @@ from the machine description file `md'.  */\n\n");
     for (attr = attrs[i]; attr; attr = attr->next)
       {
        if (! attr->is_special && ! attr->is_const)
-         write_attr_get (attr);
+         {
+           int insn_alts_p;
+
+           insn_alts_p
+             = (attr->name [0] == '*'
+                && strcmp (&attr->name [1], INSN_ALTS_FUNC_NAME) == 0);
+           if (insn_alts_p)
+             printf ("\n#if AUTOMATON_ALTS\n");
+           write_attr_get (attr);
+           if (insn_alts_p)
+             printf ("#endif\n\n");
+         }
       }
 
   /* Write out delay eligibility information, if DEFINE_DELAY present.