/* Generate code from machine description to recognize rtl as insns.
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1997, 1998,
- 1999, 2000 Free Software Foundation, Inc.
+ 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
struct decision *first;
struct decision *last;
};
-
+
/* A single test. The two accept types aren't tests per-se, but
their equality (or lack thereof) does affect tree merging so
it is convenient to keep them here. */
{
DT_mode, DT_code, DT_veclen,
DT_elt_zero_int, DT_elt_one_int, DT_elt_zero_wide, DT_elt_zero_wide_safe,
- DT_veclen_ge, DT_dup, DT_pred, DT_c_test,
+ DT_veclen_ge, DT_dup, DT_pred, DT_c_test,
DT_accept_op, DT_accept_insn
} type;
PARAMS ((rtx, enum routine_type));
static void process_tree
PARAMS ((struct decision_head *, enum routine_type));
-
+
static void record_insn_name
PARAMS ((int, const char *));
&& XSTR (pattern, 2)[0] != '+')
{
message_with_line (pattern_lineno,
- "operand %d missing output reload",
+ "operand %d missing output reload",
XINT (pattern, 0));
error_count++;
}
/* A modeless MATCH_OPERAND can be handy when we can
check for multiple modes in the c_test. In most other cases,
it is a mistake. Only DEFINE_INSN is eligible, since SPLIT
- and PEEP2 can FAIL within the output pattern. Exclude
+ and PEEP2 can FAIL within the output pattern. Exclude
address_operand, since its mode is related to the mode of
the memory not the operand. Exclude the SET_DEST of a call
instruction, as that is a common idiom. */
error_count++;
}
- /* If only one of the operands is VOIDmode, and PC or CC0 is
+ /* If only one of the operands is VOIDmode, and PC or CC0 is
not involved, it's probably a mistake. */
else if (dmode != smode
&& GET_CODE (dest) != PC
}
/* True iff the two nodes are identical (on one level only). Due
- to the way these lists are constructed, we shouldn't have to
+ to the way these lists are constructed, we shouldn't have to
consider different orderings on the tests. */
static int
/* A subroutine of merge_trees; given two nodes that have been declared
identical, cope with two insn accept states. If they differ in the
number of clobbers, then the conflict was created by make_insn_sequence
- and we can drop the with-clobbers version on the floor. If both
+ and we can drop the with-clobbers version on the floor. If both
nodes have no additional clobbers, we have found an ambiguity in the
source machine description. */
that tests just the same mode.
If we have no match, place NEW after the closest match we found. */
-
+
for (old = oldh->last; old; old = old->prev)
{
if (nodes_identical (old, add))
}
}
\f
-/* Walk the tree looking for sub-nodes that perform common tests.
+/* Walk the tree looking for sub-nodes that perform common tests.
Factor out the common test into a new node. This enables us
(depending on the test type) to emit switch statements later. */
if (next->tests->type != type)
continue;
- /* Don't want all node types, just those we can turn into
+ /* Don't want all node types, just those we can turn into
switch statements. */
if (type != DT_mode
&& type != DT_code
new->tests = first->tests->next;
first->tests->next = NULL;
}
-
+
/* Crop the node tree off after our first test. */
first->next = NULL;
old_last = head->last;
{
struct decision *p, *q, *afterward;
- /* We can't propogate alternatives across subroutine boundaries.
+ /* We can't propogate alternatives across subroutine boundaries.
This is not incorrect, merely a minor optimization loss. */
p = head->first;
if (maybe_both_true (p, q, 1))
break;
- /* If we reached the end of the list without finding one,
+ /* If we reached the end of the list without finding one,
use the incoming afterward position. */
if (!q)
q = afterward;
/* We can only fail if we're moving down the tree. */
if (old_has_insn >= 0 && oldpos[old_has_insn] >= newpos[depth])
{
- printf ("%stem = peep2_next_insn (%d);\n",
+ printf ("%stem = peep2_next_insn (%d);\n",
indent, newpos[depth] - 'A');
}
else
{
- printf ("%stem = peep2_next_insn (%d);\n",
+ printf ("%stem = peep2_next_insn (%d);\n",
indent, newpos[depth] - 'A');
printf ("%sif (tem == NULL_RTX)\n", indent);
if (afterward)
}
}
-/* Emit a switch statement, if possible, for an initial sequence of
+/* Emit a switch statement, if possible, for an initial sequence of
nodes at START. Return the first node yet untested. */
static struct decision *
printf (" switch (GET_CODE (x%d))\n {\n", depth);
code = p->tests->u.code;
- do
+ do
{
if (p != start && p->need_label && needs_label == NULL)
needs_label = p;
const char *s_or_e;
char extension[32];
int i;
-
+
s_or_e = subfunction ? "static " : "";
if (subfunction)
#include \"hard-reg-set.h\"\n\
#include \"resource.h\"\n\
#include \"toplev.h\"\n\
+#include \"reload.h\"\n\
\n");
puts ("\n\
h = make_insn_sequence (desc, PEEPHOLE2);
merge_trees (&peephole2_tree, &h);
}
-
+
next_index++;
}
new_size = (insn_name_ptr_size ? insn_name_ptr_size * 2 : 512);
insn_name_ptr =
(char **) xrealloc (insn_name_ptr, sizeof(char *) * new_size);
- memset (insn_name_ptr + insn_name_ptr_size, 0,
+ memset (insn_name_ptr + insn_name_ptr_size, 0,
sizeof(char *) * (new_size - insn_name_ptr_size));
insn_name_ptr_size = new_size;
}
last_real_name = new = xstrdup (name);
last_real_code = code;
}
-
+
insn_name_ptr[code] = new;
-}
+}
\f
static void
debug_decision_2 (test)
fprintf (stderr, "A_op=%d", test->u.opno);
break;
case DT_accept_insn:
- fprintf (stderr, "A_insn=(%d,%d)",
+ fprintf (stderr, "A_insn=(%d,%d)",
test->u.insn.code_number, test->u.insn.num_clobbers_to_add);
break;