From: Vladimir Makarov Date: Mon, 20 Jan 2003 22:49:33 +0000 (+0000) Subject: genattrtab.h (INSN_ALTS_FUNC_NAME): Move it from genautomata.c. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d530b07f81e389fde99a626460ea3b33a34b9a83;p=gcc.git genattrtab.h (INSN_ALTS_FUNC_NAME): Move it from genautomata.c. 2003-01-20 Vladimir Makarov * 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index edbce49c455..2bada01e48f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2003-01-20 Vladimir Makarov + + * 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 * collect2.c (ldgetname): Check HAVE_DECL_LDGETNAME before diff --git a/gcc/genattr.c b/gcc/genattr.c index 72d13f59826..9f512a7ce9f 100644 --- a/gcc/genattr.c +++ b/gcc/genattr.c @@ -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"); diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c index b1f04bb5e7a..d07618877d2 100644 --- a/gcc/genattrtab.c +++ b/gcc/genattrtab.c @@ -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. diff --git a/gcc/genattrtab.h b/gcc/genattrtab.h index 8d0d35ecf8d..c64ae64fe17 100644 --- a/gcc/genattrtab.h +++ b/gcc/genattrtab.h @@ -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)); diff --git a/gcc/genautomata.c b/gcc/genautomata.c index d3d6a8b3818..384405834a3 100644 --- a/gcc/genautomata.c +++ b/gcc/genautomata.c @@ -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"