genattrtab.h (INSN_ALTS_FUNC_NAME): Move it from genautomata.c.
authorVladimir Makarov <vmakarov@redhat.com>
Mon, 20 Jan 2003 22:49:33 +0000 (22:49 +0000)
committerVladimir Makarov <vmakarov@gcc.gnu.org>
Mon, 20 Jan 2003 22:49:33 +0000 (22:49 +0000)
2003-01-20  Vladimir Makarov  <vmakarov@redhat.com>

        * genattrtab.h (INSN_ALTS_FUNC_NAME): Move it from genautomata.c.

* genautomata.c (INSN_ALTS_FUNC_NAME): Move it into genattrtab.h.

* genattr.c (main): Output default definition of AUTOMATON_ALTS.
Wrap up definition `insn_alts'.

* genattrtab.c (main): Wrap up `insn_alts'.

From-SVN: r61513

gcc/ChangeLog
gcc/genattr.c
gcc/genattrtab.c
gcc/genattrtab.h
gcc/genautomata.c

index edbce49c4554f69c278f440a630c893f6b5f5822..2bada01e48f85f90c366b080874b969304ad9001 100644 (file)
@@ -1,3 +1,14 @@
+2003-01-20  Vladimir Makarov  <vmakarov@redhat.com>
+
+        * genattrtab.h (INSN_ALTS_FUNC_NAME): Move it from genautomata.c.
+       
+       * genautomata.c (INSN_ALTS_FUNC_NAME): Move it into genattrtab.h.
+
+       * genattr.c (main): Output default definition of AUTOMATON_ALTS.
+       Wrap up definition of `insn_alts'.
+
+       * genattrtab.c (main): Wrap up `insn_alts'.
+
 2003-01-20  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * collect2.c (ldgetname): Check HAVE_DECL_LDGETNAME before
index 72d13f59826c62381620831efa8e45c364761f46..9f512a7ce9f9ccbb24a82986e7b1c08099a61f85 100644 (file)
@@ -361,6 +361,9 @@ main (argc, argv)
       /* Output interface for pipeline hazards recognition based on
         DFA (deterministic finite state automata.  */
       printf ("\n/* DFA based pipeline interface.  */");
+      printf ("\n#ifndef AUTOMATON_ALTS\n");
+      printf ("#define AUTOMATON_ALTS 0\n");
+      printf ("#endif\n\n");
       printf ("\n#ifndef AUTOMATON_STATE_ALTS\n");
       printf ("#define AUTOMATON_STATE_ALTS 0\n");
       printf ("#endif\n\n");
@@ -384,10 +387,12 @@ main (argc, argv)
       printf ("   Use the function if bypass_p returns nonzero for\n");
       printf ("   the 1st insn. */\n");
       printf ("extern int insn_latency PARAMS ((rtx, rtx));\n\n");
+      printf ("\n#if AUTOMATON_ALTS\n");
       printf ("/* The following function returns number of alternative\n");
       printf ("   reservations of given insn.  It may be used for better\n");
       printf ("   insns scheduling heuristics. */\n");
       printf ("extern int insn_alts PARAMS ((rtx));\n\n");
+      printf ("#endif\n\n");
       printf ("/* Maximal possible number of insns waiting results being\n");
       printf ("   produced by insns whose execution is not finished. */\n");
       printf ("extern int max_insn_queue_index;\n\n");
index b1f04bb5e7a8cec9cdf3c70f768ad8c32b3a142b..d07618877d2ecef90eec4f05bb6296994ad15b2a 100644 (file)
@@ -6237,7 +6237,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.
index 8d0d35ecf8d6b257314375b8d6899d401f02eede..c64ae64fe175c3c2b97e04bb6cb524128ada41dc 100644 (file)
@@ -18,6 +18,10 @@ along with GNU CC; see the file COPYING.  If not, write to
 the Free Software Foundation, 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
+/* Name of function (attribute) to translate insn into number of insn
+   alternatives reservation.  */
+#define INSN_ALTS_FUNC_NAME "insn_alts"
+
 /* Defined in genattrtab.c: */
 extern rtx check_attr_test     PARAMS ((rtx, int, int));
 extern rtx make_numeric_value  PARAMS ((int));
index d3d6a8b38181c90ebf4ed56ad965591e73686866..384405834a349096605c367bf2158c8192249b2b 100644 (file)
@@ -7577,10 +7577,6 @@ output_reserved_units_table_name (f, automaton)
 /* Name of result variable in some functions.  */
 #define RESULT_VARIABLE_NAME "res"
 
-/* Name of function (attribute) to translate insn into number of insn
-   alternatives reservation.  */
-#define INSN_ALTS_FUNC_NAME "insn_alts"
-
 /* Name of function (attribute) to translate insn into internal insn
    code.  */
 #define INTERNAL_DFA_INSN_CODE_FUNC_NAME "internal_dfa_insn_code"