genattr.c (internal_dfa_insn_code): Output prototype.
* genattr.c (internal_dfa_insn_code): Output prototype. * genattrtab.c: Don't output unnecessary decls, output in ISO C. * genautomata.c: Likewise. * genconditions.c: Likewise. * genemit.c: Likewise. * genextract.c: Likewise. * gengenrtl.c: Likewise. * gengtype.c: Likewise. * genopinit.c: Likewise. * genoutput.c: Likewise. * genpeep.c: Likewise. * genrecog.c: Likewise. From-SVN: r68959
This commit is contained in:
parent
3d7c150e3f
commit
6906ba4054
@ -1,3 +1,18 @@
|
||||
2003-07-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
|
||||
|
||||
* genattr.c (internal_dfa_insn_code): Output prototype.
|
||||
* genattrtab.c: Don't output unnecessary decls, output in ISO C.
|
||||
* genautomata.c: Likewise.
|
||||
* genconditions.c: Likewise.
|
||||
* genemit.c: Likewise.
|
||||
* genextract.c: Likewise.
|
||||
* gengenrtl.c: Likewise.
|
||||
* gengtype.c: Likewise.
|
||||
* genopinit.c: Likewise.
|
||||
* genoutput.c: Likewise.
|
||||
* genpeep.c: Likewise.
|
||||
* genrecog.c: Likewise.
|
||||
|
||||
2003-07-04 Zack Weinberg <zack@codesourcery.com>
|
||||
|
||||
* cpplib.h (CPP_AT_NAME, CPP_OBJC_STRING): New token types.
|
||||
|
@ -379,6 +379,7 @@ main (int argc, char **argv)
|
||||
printf (" insns scheduling heuristics. */\n");
|
||||
printf ("extern int insn_alts (rtx);\n\n");
|
||||
printf ("#endif\n\n");
|
||||
printf ("extern int internal_dfa_insn_code (rtx);\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");
|
||||
|
@ -4765,21 +4765,6 @@ write_attr_get (struct attr_desc *attr)
|
||||
switch we will generate. */
|
||||
common_av = find_most_used (attr);
|
||||
|
||||
/* Write out prototype of function. */
|
||||
if (!attr->is_numeric)
|
||||
printf ("extern enum attr_%s ", attr->name);
|
||||
else if (attr->unsigned_p)
|
||||
printf ("extern unsigned int ");
|
||||
else
|
||||
printf ("extern int ");
|
||||
/* If the attribute name starts with a star, the remainder is the name of
|
||||
the subroutine to use, instead of `get_attr_...'. */
|
||||
if (attr->name[0] == '*')
|
||||
printf ("%s (rtx);\n", &attr->name[1]);
|
||||
else
|
||||
printf ("get_attr_%s (%s);\n", attr->name,
|
||||
(attr->is_const ? "void" : "rtx"));
|
||||
|
||||
/* Write out start of function, then all values with explicit `case' lines,
|
||||
then a `default', then the value with the most uses. */
|
||||
if (!attr->is_numeric)
|
||||
@ -4792,12 +4777,12 @@ write_attr_get (struct attr_desc *attr)
|
||||
/* If the attribute name starts with a star, the remainder is the name of
|
||||
the subroutine to use, instead of `get_attr_...'. */
|
||||
if (attr->name[0] == '*')
|
||||
printf ("%s (insn)\n", &attr->name[1]);
|
||||
printf ("%s (rtx insn ATTRIBUTE_UNUSED)\n", &attr->name[1]);
|
||||
else if (attr->is_const == 0)
|
||||
printf ("get_attr_%s (insn)\n", attr->name);
|
||||
printf ("get_attr_%s (rtx insn ATTRIBUTE_UNUSED)\n", attr->name);
|
||||
else
|
||||
{
|
||||
printf ("get_attr_%s ()\n", attr->name);
|
||||
printf ("get_attr_%s (void)\n", attr->name);
|
||||
printf ("{\n");
|
||||
|
||||
for (av = attr->first_value; av; av = av->next)
|
||||
@ -4810,7 +4795,6 @@ write_attr_get (struct attr_desc *attr)
|
||||
return;
|
||||
}
|
||||
|
||||
printf (" rtx insn ATTRIBUTE_UNUSED;\n");
|
||||
printf ("{\n");
|
||||
|
||||
if (GET_CODE (common_av->value) == FFS)
|
||||
@ -5284,12 +5268,8 @@ write_eligible_delay (const char *kind)
|
||||
/* Write function prelude. */
|
||||
|
||||
printf ("int\n");
|
||||
printf ("eligible_for_%s (delay_insn, slot, candidate_insn, flags)\n",
|
||||
printf ("eligible_for_%s (rtx delay_insn ATTRIBUTE_UNUSED, int slot, rtx candidate_insn, int flags ATTRIBUTE_UNUSED)\n",
|
||||
kind);
|
||||
printf (" rtx delay_insn ATTRIBUTE_UNUSED;\n");
|
||||
printf (" int slot;\n");
|
||||
printf (" rtx candidate_insn;\n");
|
||||
printf (" int flags ATTRIBUTE_UNUSED;\n");
|
||||
printf ("{\n");
|
||||
printf (" rtx insn;\n");
|
||||
printf ("\n");
|
||||
@ -5467,11 +5447,9 @@ write_complex_function (struct function_unit *unit,
|
||||
int using_case;
|
||||
int i;
|
||||
|
||||
printf ("static int %s_unit_%s (rtx, rtx);\n", unit->name, name);
|
||||
printf ("static int\n");
|
||||
printf ("%s_unit_%s (executing_insn, candidate_insn)\n", unit->name, name);
|
||||
printf (" rtx executing_insn;\n");
|
||||
printf (" rtx candidate_insn;\n");
|
||||
printf ("%s_unit_%s (rtx executing_insn, rtx candidate_insn)\n",
|
||||
unit->name, name);
|
||||
printf ("{\n");
|
||||
printf (" rtx insn;\n");
|
||||
printf (" int casenum;\n\n");
|
||||
@ -5723,8 +5701,7 @@ write_const_num_delay_slots (void)
|
||||
|
||||
if (attr)
|
||||
{
|
||||
printf ("int\nconst_num_delay_slots (insn)\n");
|
||||
printf (" rtx insn;\n");
|
||||
printf ("int\nconst_num_delay_slots (rtx insn)\n");
|
||||
printf ("{\n");
|
||||
printf (" switch (recog_memoized (insn))\n");
|
||||
printf (" {\n");
|
||||
|
@ -8207,13 +8207,10 @@ output_automata_list_min_issue_delay_code (automata_list_el_t automata_list)
|
||||
static void
|
||||
output_internal_min_issue_delay_func (void)
|
||||
{
|
||||
fprintf (output_file, "static int %s (int, struct %s *);\n",
|
||||
INTERNAL_MIN_ISSUE_DELAY_FUNC_NAME, CHIP_NAME);
|
||||
fprintf (output_file,
|
||||
"static int\n%s (%s, %s)\n\tint %s;\n\tstruct %s *%s ATTRIBUTE_UNUSED;\n",
|
||||
"static int\n%s (int %s, struct %s *%s ATTRIBUTE_UNUSED)\n",
|
||||
INTERNAL_MIN_ISSUE_DELAY_FUNC_NAME, INTERNAL_INSN_CODE_NAME,
|
||||
CHIP_PARAMETER_NAME, INTERNAL_INSN_CODE_NAME, CHIP_NAME,
|
||||
CHIP_PARAMETER_NAME);
|
||||
CHIP_NAME, CHIP_PARAMETER_NAME);
|
||||
fprintf (output_file, "{\n int %s ATTRIBUTE_UNUSED;\n int %s = -1;\n",
|
||||
TEMPORARY_VARIABLE_NAME, RESULT_VARIABLE_NAME);
|
||||
fprintf (output_file, "\n switch (%s)\n {\n", INTERNAL_INSN_CODE_NAME);
|
||||
@ -8323,12 +8320,9 @@ output_automata_list_transition_code (automata_list_el_t automata_list)
|
||||
static void
|
||||
output_internal_trans_func (void)
|
||||
{
|
||||
fprintf (output_file, "static int %s (int, struct %s *);\n",
|
||||
INTERNAL_TRANSITION_FUNC_NAME, CHIP_NAME);
|
||||
fprintf (output_file,
|
||||
"static int\n%s (%s, %s)\n\tint %s;\n\tstruct %s *%s ATTRIBUTE_UNUSED;\n",
|
||||
"static int\n%s (int %s, struct %s *%s ATTRIBUTE_UNUSED)\n",
|
||||
INTERNAL_TRANSITION_FUNC_NAME, INTERNAL_INSN_CODE_NAME,
|
||||
CHIP_PARAMETER_NAME, INTERNAL_INSN_CODE_NAME,
|
||||
CHIP_NAME, CHIP_PARAMETER_NAME);
|
||||
fprintf (output_file, "{\n int %s ATTRIBUTE_UNUSED;\n", TEMPORARY_VARIABLE_NAME);
|
||||
fprintf (output_file, "\n switch (%s)\n {\n", INTERNAL_INSN_CODE_NAME);
|
||||
@ -8373,10 +8367,9 @@ output_dfa_insn_code_func (void)
|
||||
/* Emacs c-mode gets really confused if there's a { or } in column 0
|
||||
inside a string, so don't do that. */
|
||||
fprintf (output_file, "\
|
||||
static void dfa_insn_code_enlarge (int);\n\
|
||||
static void\n\
|
||||
dfa_insn_code_enlarge (uid)\n\
|
||||
int uid;\n{\n\
|
||||
dfa_insn_code_enlarge (int uid)\n\
|
||||
{\n\
|
||||
int i = %s;\n\
|
||||
%s = 2 * uid;\n\
|
||||
%s = xrealloc (%s,\n\
|
||||
@ -8390,15 +8383,12 @@ dfa_insn_code_enlarge (uid)\n\
|
||||
DFA_INSN_CODES_LENGTH_VARIABLE_NAME,
|
||||
DFA_INSN_CODES_VARIABLE_NAME);
|
||||
fprintf (output_file, "\
|
||||
static inline int %s (rtx);\n\
|
||||
static inline int\n%s (%s)\n\
|
||||
rtx %s;\n{\n\
|
||||
int uid = INSN_UID (%s);\n\
|
||||
int %s;\n\n",
|
||||
DFA_INSN_CODE_FUNC_NAME, DFA_INSN_CODE_FUNC_NAME,
|
||||
INSN_PARAMETER_NAME, INSN_PARAMETER_NAME,
|
||||
INSN_PARAMETER_NAME,
|
||||
INTERNAL_INSN_CODE_NAME);
|
||||
static inline int\n%s (rtx %s)\n\
|
||||
{\n\
|
||||
int uid = INSN_UID (%s);\n\
|
||||
int %s;\n\n",
|
||||
DFA_INSN_CODE_FUNC_NAME, INSN_PARAMETER_NAME,
|
||||
INSN_PARAMETER_NAME, INTERNAL_INSN_CODE_NAME);
|
||||
|
||||
fprintf (output_file,
|
||||
" if (uid >= %s)\n dfa_insn_code_enlarge (uid);\n\n",
|
||||
@ -8422,9 +8412,9 @@ static inline int\n%s (%s)\n\
|
||||
static void
|
||||
output_trans_func (void)
|
||||
{
|
||||
fprintf (output_file, "int\n%s (%s, %s)\n\t%s %s;\n\trtx %s;\n",
|
||||
TRANSITION_FUNC_NAME, STATE_NAME, INSN_PARAMETER_NAME,
|
||||
STATE_TYPE_NAME, STATE_NAME, INSN_PARAMETER_NAME);
|
||||
fprintf (output_file, "int\n%s (%s %s, rtx %s)\n",
|
||||
TRANSITION_FUNC_NAME, STATE_TYPE_NAME, STATE_NAME,
|
||||
INSN_PARAMETER_NAME);
|
||||
fprintf (output_file, "{\n int %s;\n", INTERNAL_INSN_CODE_NAME);
|
||||
output_internal_insn_code_evaluation (INSN_PARAMETER_NAME,
|
||||
INTERNAL_INSN_CODE_NAME, -1);
|
||||
@ -8497,13 +8487,10 @@ output_automata_list_state_alts_code (automata_list_el_t automata_list)
|
||||
static void
|
||||
output_internal_state_alts_func (void)
|
||||
{
|
||||
fprintf (output_file, "static int %s (int, struct %s *);\n",
|
||||
INTERNAL_STATE_ALTS_FUNC_NAME, CHIP_NAME);
|
||||
fprintf (output_file,
|
||||
"static int\n%s (%s, %s)\n\tint %s;\n\tstruct %s *%s;\n",
|
||||
"static int\n%s (int %s, struct %s *%s)\n",
|
||||
INTERNAL_STATE_ALTS_FUNC_NAME, INTERNAL_INSN_CODE_NAME,
|
||||
CHIP_PARAMETER_NAME, INTERNAL_INSN_CODE_NAME, CHIP_NAME,
|
||||
CHIP_PARAMETER_NAME);
|
||||
CHIP_NAME, CHIP_PARAMETER_NAME);
|
||||
fprintf (output_file, "{\n int %s;\n", RESULT_VARIABLE_NAME);
|
||||
fprintf (output_file, "\n switch (%s)\n {\n", INTERNAL_INSN_CODE_NAME);
|
||||
output_insn_code_cases (output_automata_list_state_alts_code);
|
||||
@ -8532,9 +8519,9 @@ output_state_alts_func (void)
|
||||
static void
|
||||
output_min_issue_delay_func (void)
|
||||
{
|
||||
fprintf (output_file, "int\n%s (%s, %s)\n\t%s %s;\n\trtx %s;\n",
|
||||
MIN_ISSUE_DELAY_FUNC_NAME, STATE_NAME, INSN_PARAMETER_NAME,
|
||||
STATE_TYPE_NAME, STATE_NAME, INSN_PARAMETER_NAME);
|
||||
fprintf (output_file, "int\n%s (%s %s, rtx %s)\n",
|
||||
MIN_ISSUE_DELAY_FUNC_NAME, STATE_TYPE_NAME, STATE_NAME,
|
||||
INSN_PARAMETER_NAME);
|
||||
fprintf (output_file, "{\n int %s;\n", INTERNAL_INSN_CODE_NAME);
|
||||
fprintf (output_file, "\n if (%s != 0)\n {\n", INSN_PARAMETER_NAME);
|
||||
fprintf (output_file, " %s = %s (%s);\n", INTERNAL_INSN_CODE_NAME,
|
||||
@ -8555,11 +8542,8 @@ output_internal_dead_lock_func (void)
|
||||
{
|
||||
automaton_t automaton;
|
||||
|
||||
fprintf (output_file, "static int %s (struct %s *);\n",
|
||||
INTERNAL_DEAD_LOCK_FUNC_NAME, CHIP_NAME);
|
||||
fprintf (output_file, "static int\n%s (%s)\n\tstruct %s *%s;\n",
|
||||
INTERNAL_DEAD_LOCK_FUNC_NAME, CHIP_PARAMETER_NAME, CHIP_NAME,
|
||||
CHIP_PARAMETER_NAME);
|
||||
fprintf (output_file, "static int\n%s (struct %s *%s)\n",
|
||||
INTERNAL_DEAD_LOCK_FUNC_NAME, CHIP_NAME, CHIP_PARAMETER_NAME);
|
||||
fprintf (output_file, "{\n");
|
||||
for (automaton = description->first_automaton;
|
||||
automaton != NULL;
|
||||
@ -8578,8 +8562,8 @@ output_internal_dead_lock_func (void)
|
||||
static void
|
||||
output_dead_lock_func (void)
|
||||
{
|
||||
fprintf (output_file, "int\n%s (%s)\n\t%s %s;\n",
|
||||
DEAD_LOCK_FUNC_NAME, STATE_NAME, STATE_TYPE_NAME, STATE_NAME);
|
||||
fprintf (output_file, "int\n%s (%s %s)\n",
|
||||
DEAD_LOCK_FUNC_NAME, STATE_TYPE_NAME, STATE_NAME);
|
||||
fprintf (output_file, "{\n return %s (%s);\n}\n\n",
|
||||
INTERNAL_DEAD_LOCK_FUNC_NAME, STATE_NAME);
|
||||
}
|
||||
@ -8588,11 +8572,8 @@ output_dead_lock_func (void)
|
||||
static void
|
||||
output_internal_reset_func (void)
|
||||
{
|
||||
fprintf (output_file, "static void %s (struct %s *);\n",
|
||||
INTERNAL_RESET_FUNC_NAME, CHIP_NAME);
|
||||
fprintf (output_file, "static void\n%s (%s)\n\tstruct %s *%s;\n",
|
||||
INTERNAL_RESET_FUNC_NAME, CHIP_PARAMETER_NAME,
|
||||
CHIP_NAME, CHIP_PARAMETER_NAME);
|
||||
fprintf (output_file, "static void\n%s (struct %s *%s)\n",
|
||||
INTERNAL_RESET_FUNC_NAME, CHIP_NAME, CHIP_PARAMETER_NAME);
|
||||
fprintf (output_file, "{\n memset (%s, 0, sizeof (struct %s));\n}\n\n",
|
||||
CHIP_PARAMETER_NAME, CHIP_NAME);
|
||||
}
|
||||
@ -8601,7 +8582,7 @@ output_internal_reset_func (void)
|
||||
static void
|
||||
output_size_func (void)
|
||||
{
|
||||
fprintf (output_file, "int\n%s ()\n", SIZE_FUNC_NAME);
|
||||
fprintf (output_file, "int\n%s (void)\n", SIZE_FUNC_NAME);
|
||||
fprintf (output_file, "{\n return sizeof (struct %s);\n}\n\n", CHIP_NAME);
|
||||
}
|
||||
|
||||
@ -8609,8 +8590,8 @@ output_size_func (void)
|
||||
static void
|
||||
output_reset_func (void)
|
||||
{
|
||||
fprintf (output_file, "void\n%s (%s)\n\t %s %s;\n",
|
||||
RESET_FUNC_NAME, STATE_NAME, STATE_TYPE_NAME, STATE_NAME);
|
||||
fprintf (output_file, "void\n%s (%s %s)\n",
|
||||
RESET_FUNC_NAME, STATE_TYPE_NAME, STATE_NAME);
|
||||
fprintf (output_file, "{\n %s (%s);\n}\n\n", INTERNAL_RESET_FUNC_NAME,
|
||||
STATE_NAME);
|
||||
}
|
||||
@ -8620,11 +8601,9 @@ static void
|
||||
output_min_insn_conflict_delay_func (void)
|
||||
{
|
||||
fprintf (output_file,
|
||||
"int\n%s (%s, %s, %s)\n\t%s %s;\n\trtx %s;\n\trtx %s;\n",
|
||||
MIN_INSN_CONFLICT_DELAY_FUNC_NAME,
|
||||
STATE_NAME, INSN_PARAMETER_NAME, INSN2_PARAMETER_NAME,
|
||||
STATE_TYPE_NAME, STATE_NAME,
|
||||
INSN_PARAMETER_NAME, INSN2_PARAMETER_NAME);
|
||||
"int\n%s (%s %s, rtx %s, rtx %s)\n",
|
||||
MIN_INSN_CONFLICT_DELAY_FUNC_NAME, STATE_TYPE_NAME,
|
||||
STATE_NAME, INSN_PARAMETER_NAME, INSN2_PARAMETER_NAME);
|
||||
fprintf (output_file, "{\n struct %s %s;\n int %s, %s;\n",
|
||||
CHIP_NAME, CHIP_NAME, INTERNAL_INSN_CODE_NAME,
|
||||
INTERNAL_INSN2_CODE_NAME);
|
||||
@ -8665,18 +8644,11 @@ output_internal_insn_latency_func (void)
|
||||
tabletype = "int";
|
||||
}
|
||||
|
||||
fprintf (output_file, "static int %s (int, int, rtx, rtx);\n",
|
||||
INTERNAL_INSN_LATENCY_FUNC_NAME);
|
||||
fprintf (output_file, "static int\n%s (%s, %s, %s, %s)",
|
||||
fprintf (output_file, "static int\n%s (int %s ATTRIBUTE_UNUSED,\n\tint %s ATTRIBUTE_UNUSED,\n\trtx %s ATTRIBUTE_UNUSED,\n\trtx %s ATTRIBUTE_UNUSED)\n",
|
||||
INTERNAL_INSN_LATENCY_FUNC_NAME, INTERNAL_INSN_CODE_NAME,
|
||||
INTERNAL_INSN2_CODE_NAME, INSN_PARAMETER_NAME,
|
||||
INSN2_PARAMETER_NAME);
|
||||
fprintf (output_file,
|
||||
"\n\tint %s ATTRIBUTE_UNUSED;\n\tint %s ATTRIBUTE_UNUSED;\n",
|
||||
INTERNAL_INSN_CODE_NAME, INTERNAL_INSN2_CODE_NAME);
|
||||
fprintf (output_file,
|
||||
"\trtx %s ATTRIBUTE_UNUSED;\n\trtx %s ATTRIBUTE_UNUSED;\n{\n",
|
||||
INSN_PARAMETER_NAME, INSN2_PARAMETER_NAME);
|
||||
fprintf (output_file, "{\n");
|
||||
|
||||
if (DECL_INSN_RESERV (advance_cycle_insn_decl)->insn_num == 0)
|
||||
{
|
||||
@ -8751,9 +8723,8 @@ output_internal_insn_latency_func (void)
|
||||
static void
|
||||
output_insn_latency_func (void)
|
||||
{
|
||||
fprintf (output_file, "int\n%s (%s, %s)\n\trtx %s;\n\trtx %s;\n",
|
||||
INSN_LATENCY_FUNC_NAME, INSN_PARAMETER_NAME, INSN2_PARAMETER_NAME,
|
||||
INSN_PARAMETER_NAME, INSN2_PARAMETER_NAME);
|
||||
fprintf (output_file, "int\n%s (rtx %s, rtx %s)\n",
|
||||
INSN_LATENCY_FUNC_NAME, INSN_PARAMETER_NAME, INSN2_PARAMETER_NAME);
|
||||
fprintf (output_file, "{\n int %s, %s;\n",
|
||||
INTERNAL_INSN_CODE_NAME, INTERNAL_INSN2_CODE_NAME);
|
||||
output_internal_insn_code_evaluation (INSN_PARAMETER_NAME,
|
||||
@ -8774,9 +8745,8 @@ output_print_reservation_func (void)
|
||||
int i, j;
|
||||
|
||||
fprintf (output_file,
|
||||
"void\n%s (%s, %s)\n\tFILE *%s;\n\trtx %s ATTRIBUTE_UNUSED;\n{\n",
|
||||
"void\n%s (FILE *%s, rtx %s ATTRIBUTE_UNUSED)\n{\n",
|
||||
PRINT_RESERVATION_FUNC_NAME, FILE_PARAMETER_NAME,
|
||||
INSN_PARAMETER_NAME, FILE_PARAMETER_NAME,
|
||||
INSN_PARAMETER_NAME);
|
||||
|
||||
if (DECL_INSN_RESERV (advance_cycle_insn_decl)->insn_num == 0)
|
||||
@ -8941,7 +8911,7 @@ static void
|
||||
output_dfa_clean_insn_cache_func (void)
|
||||
{
|
||||
fprintf (output_file,
|
||||
"void\n%s ()\n{\n int %s;\n\n",
|
||||
"void\n%s (void)\n{\n int %s;\n\n",
|
||||
DFA_CLEAN_INSN_CACHE_FUNC_NAME, I_VARIABLE_NAME);
|
||||
fprintf (output_file,
|
||||
" for (%s = 0; %s < %s; %s++)\n %s [%s] = -1;\n}\n\n",
|
||||
@ -8955,7 +8925,7 @@ static void
|
||||
output_dfa_start_func (void)
|
||||
{
|
||||
fprintf (output_file,
|
||||
"void\n%s ()\n{\n %s = get_max_uid ();\n",
|
||||
"void\n%s (void)\n{\n %s = get_max_uid ();\n",
|
||||
DFA_START_FUNC_NAME, DFA_INSN_CODES_LENGTH_VARIABLE_NAME);
|
||||
fprintf (output_file, " %s = (int *) xmalloc (%s * sizeof (int));\n",
|
||||
DFA_INSN_CODES_VARIABLE_NAME, DFA_INSN_CODES_LENGTH_VARIABLE_NAME);
|
||||
@ -8966,7 +8936,7 @@ output_dfa_start_func (void)
|
||||
static void
|
||||
output_dfa_finish_func (void)
|
||||
{
|
||||
fprintf (output_file, "void\n%s ()\n{\n free (%s);\n}\n\n",
|
||||
fprintf (output_file, "void\n%s (void)\n{\n free (%s);\n}\n\n",
|
||||
DFA_FINISH_FUNC_NAME, DFA_INSN_CODES_VARIABLE_NAME);
|
||||
}
|
||||
|
||||
|
@ -118,8 +118,7 @@ write_header (void)
|
||||
/* Dummy external declarations. */\n\
|
||||
extern rtx insn;\n\
|
||||
extern rtx ins1;\n\
|
||||
extern rtx operands[];\n\
|
||||
extern int next_insn_tests_no_inequality (rtx);\n");
|
||||
extern rtx operands[];\n");
|
||||
|
||||
puts ("\
|
||||
/* If we don't have __builtin_constant_p, or it's not acceptable in\n\
|
||||
|
@ -386,14 +386,15 @@ gen_insn (rtx insn, int lineno)
|
||||
|
||||
/* Output the function name and argument declarations. */
|
||||
printf ("rtx\ngen_%s (", XSTR (insn, 0));
|
||||
for (i = 0; i < operands; i++)
|
||||
if (i)
|
||||
printf (", operand%d", i);
|
||||
else
|
||||
printf ("operand%d", i);
|
||||
if (operands)
|
||||
for (i = 0; i < operands; i++)
|
||||
if (i)
|
||||
printf (",\n\trtx operand%d ATTRIBUTE_UNUSED", i);
|
||||
else
|
||||
printf ("rtx operand%d ATTRIBUTE_UNUSED", i);
|
||||
else
|
||||
printf ("void");
|
||||
printf (")\n");
|
||||
for (i = 0; i < operands; i++)
|
||||
printf (" rtx operand%d ATTRIBUTE_UNUSED;\n", i);
|
||||
printf ("{\n");
|
||||
|
||||
/* Output code to construct and return the rtl for the instruction body */
|
||||
@ -439,14 +440,15 @@ gen_expand (rtx expand)
|
||||
|
||||
/* Output the function name and argument declarations. */
|
||||
printf ("rtx\ngen_%s (", XSTR (expand, 0));
|
||||
for (i = 0; i < operands; i++)
|
||||
if (i)
|
||||
printf (", operand%d", i);
|
||||
else
|
||||
printf ("operand%d", i);
|
||||
if (operands)
|
||||
for (i = 0; i < operands; i++)
|
||||
if (i)
|
||||
printf (",\n\trtx operand%d", i);
|
||||
else
|
||||
printf ("rtx operand%d", i);
|
||||
else
|
||||
printf ("void");
|
||||
printf (")\n");
|
||||
for (i = 0; i < operands; i++)
|
||||
printf (" rtx operand%d;\n", i);
|
||||
printf ("{\n");
|
||||
|
||||
/* If we don't have any C code to write, only one insn is being written,
|
||||
@ -585,16 +587,13 @@ gen_split (rtx split)
|
||||
{
|
||||
printf ("extern rtx gen_%s_%d (rtx, rtx *);\n",
|
||||
name, insn_code_number);
|
||||
printf ("rtx\ngen_%s_%d (curr_insn, operands)\n",
|
||||
printf ("rtx\ngen_%s_%d (rtx curr_insn ATTRIBUTE_UNUSED, rtx *operands)\n",
|
||||
name, insn_code_number);
|
||||
printf (" rtx curr_insn ATTRIBUTE_UNUSED;\n");
|
||||
printf (" rtx *operands%s;\n", unused);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf ("extern rtx gen_split_%d (rtx *);\n", insn_code_number);
|
||||
printf ("rtx\ngen_%s_%d (operands)\n", name, insn_code_number);
|
||||
printf (" rtx *operands%s;\n", unused);
|
||||
printf ("rtx\ngen_%s_%d (rtx *operands)\n", name, insn_code_number);
|
||||
}
|
||||
printf ("{\n");
|
||||
|
||||
@ -678,8 +677,7 @@ output_add_clobbers ()
|
||||
struct clobber_ent *ent;
|
||||
int i;
|
||||
|
||||
printf ("\n\nvoid\nadd_clobbers (pattern, insn_code_number)\n");
|
||||
printf (" rtx pattern ATTRIBUTE_UNUSED;\n int insn_code_number;\n");
|
||||
printf ("\n\nvoid\nadd_clobbers (rtx pattern ATTRIBUTE_UNUSED, int insn_code_number)\n");
|
||||
printf ("{\n");
|
||||
printf (" switch (insn_code_number)\n");
|
||||
printf (" {\n");
|
||||
@ -717,8 +715,7 @@ output_added_clobbers_hard_reg_p (void)
|
||||
struct clobber_ent *ent;
|
||||
int clobber_p, used;
|
||||
|
||||
printf ("\n\nint\nadded_clobbers_hard_reg_p (insn_code_number)\n");
|
||||
printf (" int insn_code_number;\n");
|
||||
printf ("\n\nint\nadded_clobbers_hard_reg_p (int insn_code_number)\n");
|
||||
printf ("{\n");
|
||||
printf (" switch (insn_code_number)\n");
|
||||
printf (" {\n");
|
||||
|
@ -381,8 +381,7 @@ from the machine description file `md'. */\n\n");
|
||||
of any missing operand whose numbers are skipped by a given pattern. */
|
||||
printf ("static rtx junk ATTRIBUTE_UNUSED;\n");
|
||||
|
||||
printf ("void\ninsn_extract (insn)\n");
|
||||
printf (" rtx insn;\n");
|
||||
printf ("void\ninsn_extract (rtx insn)\n");
|
||||
printf ("{\n");
|
||||
printf (" rtx *ro = recog_data.operand;\n");
|
||||
printf (" rtx **ro_loc = recog_data.operand_loc;\n");
|
||||
|
@ -259,15 +259,12 @@ gendef (const char *format)
|
||||
/* Start by writing the definition of the function name and the types
|
||||
of the arguments. */
|
||||
|
||||
printf ("rtx\ngen_rtx_fmt_%s (code, mode", format);
|
||||
printf ("rtx\ngen_rtx_fmt_%s (RTX_CODE code, enum machine_mode mode", format);
|
||||
for (p = format, i = 0; *p != 0; p++)
|
||||
if (*p != '0')
|
||||
printf (", arg%d", i++);
|
||||
printf (",\n\t%sarg%d", type_from_format (*p), i++);
|
||||
|
||||
puts (")\n RTX_CODE code;\n enum machine_mode mode;");
|
||||
for (p = format, i = 0; *p != 0; p++)
|
||||
if (*p != '0')
|
||||
printf (" %sarg%d;\n", type_from_format (*p), i++);
|
||||
puts (")");
|
||||
|
||||
/* Now write out the body of the function itself, which allocates
|
||||
the memory and initializes it. */
|
||||
|
@ -1960,8 +1960,7 @@ write_func_for_structure (type_p orig_s, type_p s, type_p *param,
|
||||
oprintf (d.of, "gt_%s_", wtd->prefix);
|
||||
output_mangled_typename (d.of, orig_s);
|
||||
}
|
||||
oprintf (d.of, " (x_p)\n");
|
||||
oprintf (d.of, " void *x_p;\n");
|
||||
oprintf (d.of, " (void *x_p)\n");
|
||||
oprintf (d.of, "{\n");
|
||||
oprintf (d.of, " %s %s * %sx = (%s %s *)x_p;\n",
|
||||
s->kind == TYPE_UNION ? "union" : "struct", s->u.s.tag,
|
||||
@ -2209,11 +2208,7 @@ write_local_func_for_structure (type_p orig_s, type_p s, type_p *param)
|
||||
oprintf (d.of, "void\n");
|
||||
oprintf (d.of, "gt_pch_p_");
|
||||
output_mangled_typename (d.of, orig_s);
|
||||
oprintf (d.of, " (this_obj, x_p, op, cookie)\n");
|
||||
oprintf (d.of, " void *this_obj ATTRIBUTE_UNUSED;\n");
|
||||
oprintf (d.of, " void *x_p;\n");
|
||||
oprintf (d.of, " gt_pointer_operator op ATTRIBUTE_UNUSED;\n");
|
||||
oprintf (d.of, " void *cookie ATTRIBUTE_UNUSED;\n");
|
||||
oprintf (d.of, " (void *this_obj ATTRIBUTE_UNUSED,\n\tvoid *x_p,\n\tgt_pointer_operator op ATTRIBUTE_UNUSED,\n\tvoid *cookie ATTRIBUTE_UNUSED)\n");
|
||||
oprintf (d.of, "{\n");
|
||||
oprintf (d.of, " %s %s * const x ATTRIBUTE_UNUSED = (%s %s *)x_p;\n",
|
||||
s->kind == TYPE_UNION ? "union" : "struct", s->u.s.tag,
|
||||
|
@ -352,7 +352,7 @@ from the machine description file `md'. */\n\n");
|
||||
printf ("#include \"optabs.h\"\n");
|
||||
printf ("#include \"reload.h\"\n\n");
|
||||
|
||||
printf ("void\ninit_all_optabs ()\n{\n");
|
||||
printf ("void\ninit_all_optabs (void)\n{\n");
|
||||
|
||||
/* Read the machine description. */
|
||||
|
||||
|
@ -174,7 +174,6 @@ struct data
|
||||
static struct data *idata, **idata_end = &idata;
|
||||
|
||||
static void output_prologue (void);
|
||||
static void output_predicate_decls (void);
|
||||
static void output_operand_data (void);
|
||||
static void output_insn_data (void);
|
||||
static void output_get_insn_name (void);
|
||||
@ -243,45 +242,6 @@ output_prologue (void)
|
||||
printf ("#include \"target.h\"\n");
|
||||
}
|
||||
|
||||
|
||||
/* We need to define all predicates used. Keep a list of those we
|
||||
have defined so far. There normally aren't very many predicates
|
||||
used, so a linked list should be fast enough. */
|
||||
struct predicate { const char *name; struct predicate *next; };
|
||||
|
||||
static void
|
||||
output_predicate_decls (void)
|
||||
{
|
||||
struct predicate *predicates = 0;
|
||||
struct operand_data *d;
|
||||
struct predicate *p, *next;
|
||||
|
||||
for (d = odata; d; d = d->next)
|
||||
if (d->predicate && d->predicate[0])
|
||||
{
|
||||
for (p = predicates; p; p = p->next)
|
||||
if (strcmp (p->name, d->predicate) == 0)
|
||||
break;
|
||||
|
||||
if (p == 0)
|
||||
{
|
||||
printf ("extern int %s (rtx, enum machine_mode);\n",
|
||||
d->predicate);
|
||||
p = (struct predicate *) xmalloc (sizeof (struct predicate));
|
||||
p->name = d->predicate;
|
||||
p->next = predicates;
|
||||
predicates = p;
|
||||
}
|
||||
}
|
||||
|
||||
printf ("\n\n");
|
||||
for (p = predicates; p; p = next)
|
||||
{
|
||||
next = p->next;
|
||||
free (p);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
output_operand_data (void)
|
||||
{
|
||||
@ -415,8 +375,7 @@ static void
|
||||
output_get_insn_name (void)
|
||||
{
|
||||
printf ("const char *\n");
|
||||
printf ("get_insn_name (code)\n");
|
||||
printf (" int code;\n");
|
||||
printf ("get_insn_name (int code)\n");
|
||||
printf ("{\n");
|
||||
printf (" if (code == NOOP_MOVE_INSN_CODE)\n");
|
||||
printf (" return \"NOOP_MOVE\";\n");
|
||||
@ -678,12 +637,9 @@ process_template (struct data *d, const char *template)
|
||||
d->template = 0;
|
||||
d->output_format = INSN_OUTPUT_FORMAT_FUNCTION;
|
||||
|
||||
printf ("\nstatic const char *output_%d (rtx *, rtx);\n",
|
||||
d->code_number);
|
||||
puts ("\nstatic const char *");
|
||||
printf ("output_%d (operands, insn)\n", d->code_number);
|
||||
puts (" rtx *operands ATTRIBUTE_UNUSED;");
|
||||
puts (" rtx insn ATTRIBUTE_UNUSED;");
|
||||
printf ("output_%d (rtx *operands ATTRIBUTE_UNUSED, rtx insn ATTRIBUTE_UNUSED)\n",
|
||||
d->code_number);
|
||||
puts ("{");
|
||||
|
||||
puts (template + 1);
|
||||
@ -1023,7 +979,6 @@ main (int argc, char **argv)
|
||||
}
|
||||
|
||||
printf("\n\n");
|
||||
output_predicate_decls ();
|
||||
output_operand_data ();
|
||||
output_insn_data ();
|
||||
output_get_insn_name ();
|
||||
|
@ -386,7 +386,7 @@ from the machine description file `md'. */\n\n");
|
||||
printf ("extern rtx peep_operand[];\n\n");
|
||||
printf ("#define operands peep_operand\n\n");
|
||||
|
||||
printf ("rtx\npeephole (ins1)\n rtx ins1;\n{\n");
|
||||
printf ("rtx\npeephole (rtx ins1)\n{\n");
|
||||
printf (" rtx insn ATTRIBUTE_UNUSED, x ATTRIBUTE_UNUSED, pat ATTRIBUTE_UNUSED;\n\n");
|
||||
|
||||
/* Early out: no peepholes for insns followed by barriers. */
|
||||
|
@ -2272,28 +2272,18 @@ write_subroutine (struct decision_head *head, enum routine_type type)
|
||||
switch (type)
|
||||
{
|
||||
case RECOG:
|
||||
printf ("%sint recog%s (rtx, rtx, int *);\n", s_or_e, extension);
|
||||
printf ("%sint\n\
|
||||
recog%s (x0, insn, pnum_clobbers)\n\
|
||||
rtx x0 ATTRIBUTE_UNUSED;\n\
|
||||
rtx insn ATTRIBUTE_UNUSED;\n\
|
||||
int *pnum_clobbers ATTRIBUTE_UNUSED;\n", s_or_e, extension);
|
||||
recog%s (rtx x0 ATTRIBUTE_UNUSED,\n\trtx insn ATTRIBUTE_UNUSED,\n\tint *pnum_clobbers ATTRIBUTE_UNUSED)\n", s_or_e, extension);
|
||||
break;
|
||||
case SPLIT:
|
||||
printf ("%srtx split%s (rtx, rtx);\n", s_or_e, extension);
|
||||
printf ("%srtx\n\
|
||||
split%s (x0, insn)\n\
|
||||
rtx x0 ATTRIBUTE_UNUSED;\n\
|
||||
rtx insn ATTRIBUTE_UNUSED;\n", s_or_e, extension);
|
||||
split%s (rtx x0 ATTRIBUTE_UNUSED, rtx insn ATTRIBUTE_UNUSED)\n",
|
||||
s_or_e, extension);
|
||||
break;
|
||||
case PEEPHOLE2:
|
||||
printf ("%srtx peephole2%s (rtx, rtx, int *);\n",
|
||||
s_or_e, extension);
|
||||
printf ("%srtx\n\
|
||||
peephole2%s (x0, insn, _pmatch_len)\n\
|
||||
rtx x0 ATTRIBUTE_UNUSED;\n\
|
||||
rtx insn ATTRIBUTE_UNUSED;\n\
|
||||
int *_pmatch_len ATTRIBUTE_UNUSED;\n", s_or_e, extension);
|
||||
peephole2%s (rtx x0 ATTRIBUTE_UNUSED,\n\trtx insn ATTRIBUTE_UNUSED,\n\tint *_pmatch_len ATTRIBUTE_UNUSED)\n",
|
||||
s_or_e, extension);
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user