Commit fdae5092 by Richard Sandiford Committed by Richard Sandiford

genrecog.c (test): Rename to rtx_test.

gcc/
	* genrecog.c (test): Rename to rtx_test.  Update rest of file
	accordingly.

From-SVN: r222683
parent ab528787
2015-05-01 Richard Sandiford <richard.sandiford@arm.com>
* genrecog.c (test): Rename to rtx_test. Update rest of file
accordingly.
2015-05-01 Andreas Schwab <schwab@linux-m68k.org> 2015-05-01 Andreas Schwab <schwab@linux-m68k.org>
PR translation/65959 PR translation/65959
......
...@@ -1047,9 +1047,9 @@ struct pattern_use ...@@ -1047,9 +1047,9 @@ struct pattern_use
}; };
/* Represents a test performed by a decision. */ /* Represents a test performed by a decision. */
struct test struct rtx_test
{ {
test (); rtx_test ();
/* The types of test that can be performed. Most of them take as input /* The types of test that can be performed. Most of them take as input
an rtx X. Some also take as input a transition label LABEL; the others an rtx X. Some also take as input a transition label LABEL; the others
...@@ -1140,136 +1140,136 @@ struct test ...@@ -1140,136 +1140,136 @@ struct test
acceptance_type acceptance; acceptance_type acceptance;
} u; } u;
static test code (position *); static rtx_test code (position *);
static test mode (position *); static rtx_test mode (position *);
static test int_field (position *, int); static rtx_test int_field (position *, int);
static test wide_int_field (position *, int); static rtx_test wide_int_field (position *, int);
static test veclen (position *); static rtx_test veclen (position *);
static test peep2_count (int); static rtx_test peep2_count (int);
static test veclen_ge (position *, int); static rtx_test veclen_ge (position *, int);
static test predicate (position *, const pred_data *, machine_mode); static rtx_test predicate (position *, const pred_data *, machine_mode);
static test duplicate (position *, int); static rtx_test duplicate (position *, int);
static test pattern (position *, pattern_use *); static rtx_test pattern (position *, pattern_use *);
static test have_num_clobbers (); static rtx_test have_num_clobbers ();
static test c_test (const char *); static rtx_test c_test (const char *);
static test set_op (position *, int); static rtx_test set_op (position *, int);
static test accept (const acceptance_type &); static rtx_test accept (const acceptance_type &);
bool terminal_p () const; bool terminal_p () const;
bool single_outcome_p () const; bool single_outcome_p () const;
private: private:
test (position *, kind_enum); rtx_test (position *, kind_enum);
}; };
test::test () {} rtx_test::rtx_test () {}
test::test (position *pos_in, kind_enum kind_in) rtx_test::rtx_test (position *pos_in, kind_enum kind_in)
: pos (pos_in), pos_operand (-1), kind (kind_in) {} : pos (pos_in), pos_operand (-1), kind (kind_in) {}
test rtx_test
test::code (position *pos) rtx_test::code (position *pos)
{ {
return test (pos, test::CODE); return rtx_test (pos, rtx_test::CODE);
} }
test rtx_test
test::mode (position *pos) rtx_test::mode (position *pos)
{ {
return test (pos, test::MODE); return rtx_test (pos, rtx_test::MODE);
} }
test rtx_test
test::int_field (position *pos, int opno) rtx_test::int_field (position *pos, int opno)
{ {
test res (pos, test::INT_FIELD); rtx_test res (pos, rtx_test::INT_FIELD);
res.u.opno = opno; res.u.opno = opno;
return res; return res;
} }
test rtx_test
test::wide_int_field (position *pos, int opno) rtx_test::wide_int_field (position *pos, int opno)
{ {
test res (pos, test::WIDE_INT_FIELD); rtx_test res (pos, rtx_test::WIDE_INT_FIELD);
res.u.opno = opno; res.u.opno = opno;
return res; return res;
} }
test rtx_test
test::veclen (position *pos) rtx_test::veclen (position *pos)
{ {
return test (pos, test::VECLEN); return rtx_test (pos, rtx_test::VECLEN);
} }
test rtx_test
test::peep2_count (int min_len) rtx_test::peep2_count (int min_len)
{ {
test res (0, test::PEEP2_COUNT); rtx_test res (0, rtx_test::PEEP2_COUNT);
res.u.min_len = min_len; res.u.min_len = min_len;
return res; return res;
} }
test rtx_test
test::veclen_ge (position *pos, int min_len) rtx_test::veclen_ge (position *pos, int min_len)
{ {
test res (pos, test::VECLEN_GE); rtx_test res (pos, rtx_test::VECLEN_GE);
res.u.min_len = min_len; res.u.min_len = min_len;
return res; return res;
} }
test rtx_test
test::predicate (position *pos, const struct pred_data *data, rtx_test::predicate (position *pos, const struct pred_data *data,
machine_mode mode) machine_mode mode)
{ {
test res (pos, test::PREDICATE); rtx_test res (pos, rtx_test::PREDICATE);
res.u.predicate.data = data; res.u.predicate.data = data;
res.u.predicate.mode_is_param = false; res.u.predicate.mode_is_param = false;
res.u.predicate.mode = mode; res.u.predicate.mode = mode;
return res; return res;
} }
test rtx_test
test::duplicate (position *pos, int opno) rtx_test::duplicate (position *pos, int opno)
{ {
test res (pos, test::DUPLICATE); rtx_test res (pos, rtx_test::DUPLICATE);
res.u.opno = opno; res.u.opno = opno;
return res; return res;
} }
test rtx_test
test::pattern (position *pos, pattern_use *pattern) rtx_test::pattern (position *pos, pattern_use *pattern)
{ {
test res (pos, test::PATTERN); rtx_test res (pos, rtx_test::PATTERN);
res.u.pattern = pattern; res.u.pattern = pattern;
return res; return res;
} }
test rtx_test
test::have_num_clobbers () rtx_test::have_num_clobbers ()
{ {
return test (0, test::HAVE_NUM_CLOBBERS); return rtx_test (0, rtx_test::HAVE_NUM_CLOBBERS);
} }
test rtx_test
test::c_test (const char *string) rtx_test::c_test (const char *string)
{ {
test res (0, test::C_TEST); rtx_test res (0, rtx_test::C_TEST);
res.u.string = string; res.u.string = string;
return res; return res;
} }
test rtx_test
test::set_op (position *pos, int opno) rtx_test::set_op (position *pos, int opno)
{ {
test res (pos, test::SET_OP); rtx_test res (pos, rtx_test::SET_OP);
res.u.opno = opno; res.u.opno = opno;
return res; return res;
} }
test rtx_test
test::accept (const acceptance_type &acceptance) rtx_test::accept (const acceptance_type &acceptance)
{ {
test res (0, test::ACCEPT); rtx_test res (0, rtx_test::ACCEPT);
res.u.acceptance = acceptance; res.u.acceptance = acceptance;
return res; return res;
} }
...@@ -1277,66 +1277,66 @@ test::accept (const acceptance_type &acceptance) ...@@ -1277,66 +1277,66 @@ test::accept (const acceptance_type &acceptance)
/* Return true if the test represents an unconditionally successful match. */ /* Return true if the test represents an unconditionally successful match. */
bool bool
test::terminal_p () const rtx_test::terminal_p () const
{ {
return kind == test::ACCEPT && u.acceptance.type != PEEPHOLE2; return kind == rtx_test::ACCEPT && u.acceptance.type != PEEPHOLE2;
} }
/* Return true if the test is a boolean that is always true. */ /* Return true if the test is a boolean that is always true. */
bool bool
test::single_outcome_p () const rtx_test::single_outcome_p () const
{ {
return terminal_p () || kind == test::SET_OP; return terminal_p () || kind == rtx_test::SET_OP;
} }
bool bool
operator == (const test &a, const test &b) operator == (const rtx_test &a, const rtx_test &b)
{ {
if (a.pos != b.pos || a.kind != b.kind) if (a.pos != b.pos || a.kind != b.kind)
return false; return false;
switch (a.kind) switch (a.kind)
{ {
case test::CODE: case rtx_test::CODE:
case test::MODE: case rtx_test::MODE:
case test::VECLEN: case rtx_test::VECLEN:
case test::HAVE_NUM_CLOBBERS: case rtx_test::HAVE_NUM_CLOBBERS:
return true; return true;
case test::PEEP2_COUNT: case rtx_test::PEEP2_COUNT:
case test::VECLEN_GE: case rtx_test::VECLEN_GE:
return a.u.min_len == b.u.min_len; return a.u.min_len == b.u.min_len;
case test::INT_FIELD: case rtx_test::INT_FIELD:
case test::WIDE_INT_FIELD: case rtx_test::WIDE_INT_FIELD:
case test::DUPLICATE: case rtx_test::DUPLICATE:
case test::SET_OP: case rtx_test::SET_OP:
return a.u.opno == b.u.opno; return a.u.opno == b.u.opno;
case test::SAVED_CONST_INT: case rtx_test::SAVED_CONST_INT:
return (a.u.integer.is_param == b.u.integer.is_param return (a.u.integer.is_param == b.u.integer.is_param
&& a.u.integer.value == b.u.integer.value); && a.u.integer.value == b.u.integer.value);
case test::PREDICATE: case rtx_test::PREDICATE:
return (a.u.predicate.data == b.u.predicate.data return (a.u.predicate.data == b.u.predicate.data
&& a.u.predicate.mode_is_param == b.u.predicate.mode_is_param && a.u.predicate.mode_is_param == b.u.predicate.mode_is_param
&& a.u.predicate.mode == b.u.predicate.mode); && a.u.predicate.mode == b.u.predicate.mode);
case test::PATTERN: case rtx_test::PATTERN:
return (a.u.pattern->routine == b.u.pattern->routine return (a.u.pattern->routine == b.u.pattern->routine
&& a.u.pattern->params == b.u.pattern->params); && a.u.pattern->params == b.u.pattern->params);
case test::C_TEST: case rtx_test::C_TEST:
return strcmp (a.u.string, b.u.string) == 0; return strcmp (a.u.string, b.u.string) == 0;
case test::ACCEPT: case rtx_test::ACCEPT:
return a.u.acceptance == b.u.acceptance; return a.u.acceptance == b.u.acceptance;
} }
gcc_unreachable (); gcc_unreachable ();
} }
bool bool
operator != (const test &a, const test &b) operator != (const rtx_test &a, const rtx_test &b)
{ {
return !operator == (a, b); return !operator == (a, b);
} }
...@@ -1420,8 +1420,8 @@ struct transition ...@@ -1420,8 +1420,8 @@ struct transition
transition *prev, *next; transition *prev, *next;
/* The transition should be taken when T has one of these values. /* The transition should be taken when T has one of these values.
E.g. for test::CODE this is a set of codes, while for booleans like E.g. for rtx_test::CODE this is a set of codes, while for booleans like
test::PREDICATE it is always a singleton "true". The labels are rtx_test::PREDICATE it is always a singleton "true". The labels are
sorted in ascending order. */ sorted in ascending order. */
int_set labels; int_set labels;
...@@ -1439,7 +1439,7 @@ struct transition ...@@ -1439,7 +1439,7 @@ struct transition
bool optional; bool optional;
/* True if LABELS contains parameter numbers rather than constants. /* True if LABELS contains parameter numbers rather than constants.
E.g. if this is true for a test::CODE, the label is the number E.g. if this is true for a rtx_test::CODE, the label is the number
of an rtx_code parameter rather than an rtx_code itself. of an rtx_code parameter rather than an rtx_code itself.
LABELS is always a singleton when this variable is true. */ LABELS is always a singleton when this variable is true. */
bool is_param; bool is_param;
...@@ -1452,7 +1452,7 @@ struct transition ...@@ -1452,7 +1452,7 @@ struct transition
more decisions to try, fails the match. */ more decisions to try, fails the match. */
struct decision : list_head <transition> struct decision : list_head <transition>
{ {
decision (const test &); decision (const rtx_test &);
void set_parent (list_head <decision> *s); void set_parent (list_head <decision> *s);
bool if_statement_p (uint64_t * = 0) const; bool if_statement_p (uint64_t * = 0) const;
...@@ -1464,7 +1464,7 @@ struct decision : list_head <transition> ...@@ -1464,7 +1464,7 @@ struct decision : list_head <transition>
decision *prev, *next; decision *prev, *next;
/* The test to perform. */ /* The test to perform. */
struct test test; rtx_test test;
}; };
/* Represents one machine state. For each state the machine tries a list /* Represents one machine state. For each state the machine tries a list
...@@ -1488,7 +1488,7 @@ transition::set_parent (list_head <transition> *from_in) ...@@ -1488,7 +1488,7 @@ transition::set_parent (list_head <transition> *from_in)
from = static_cast <decision *> (from_in); from = static_cast <decision *> (from_in);
} }
decision::decision (const struct test &test_in) decision::decision (const rtx_test &test_in)
: prev (0), next (0), test (test_in) {} : prev (0), next (0), test (test_in) {}
/* Set the state to which this decision belongs. */ /* Set the state to which this decision belongs. */
...@@ -1518,7 +1518,7 @@ decision::if_statement_p (uint64_t *label) const ...@@ -1518,7 +1518,7 @@ decision::if_statement_p (uint64_t *label) const
TRANS. */ TRANS. */
static void static void
add_decision (state *from, const test &test, transition *trans) add_decision (state *from, const rtx_test &test, transition *trans)
{ {
decision *d = new decision (test); decision *d = new decision (test);
from->push_back (d); from->push_back (d);
...@@ -1530,7 +1530,7 @@ add_decision (state *from, const test &test, transition *trans) ...@@ -1530,7 +1530,7 @@ add_decision (state *from, const test &test, transition *trans)
should be optional. Return the new state. */ should be optional. Return the new state. */
static state * static state *
add_decision (state *from, const test &test, int_set labels, bool optional) add_decision (state *from, const rtx_test &test, int_set labels, bool optional)
{ {
state *to = new state; state *to = new state;
add_decision (from, test, new transition (labels, to, optional)); add_decision (from, test, new transition (labels, to, optional));
...@@ -1542,7 +1542,7 @@ add_decision (state *from, const test &test, int_set labels, bool optional) ...@@ -1542,7 +1542,7 @@ add_decision (state *from, const test &test, int_set labels, bool optional)
optional. */ optional. */
static decision * static decision *
insert_decision_before (state::range r, const test &test, insert_decision_before (state::range r, const rtx_test &test,
const int_set &labels, bool optional) const int_set &labels, bool optional)
{ {
decision *newd = new decision (test); decision *newd = new decision (test);
...@@ -1593,18 +1593,18 @@ simplify_tests (state *s) ...@@ -1593,18 +1593,18 @@ simplify_tests (state *s)
uint64_t label; uint64_t label;
/* Convert checks for GET_CODE (x) == CONST_INT and XWINT (x, 0) == N /* Convert checks for GET_CODE (x) == CONST_INT and XWINT (x, 0) == N
into checks for const_int_rtx[N'], if N is suitably small. */ into checks for const_int_rtx[N'], if N is suitably small. */
if (d->test.kind == test::CODE if (d->test.kind == rtx_test::CODE
&& d->if_statement_p (&label) && d->if_statement_p (&label)
&& label == CONST_INT) && label == CONST_INT)
if (decision *second = d->first->to->singleton ()) if (decision *second = d->first->to->singleton ())
if (d->test.pos == second->test.pos if (d->test.pos == second->test.pos
&& second->test.kind == test::WIDE_INT_FIELD && second->test.kind == rtx_test::WIDE_INT_FIELD
&& second->test.u.opno == 0 && second->test.u.opno == 0
&& second->if_statement_p (&label) && second->if_statement_p (&label)
&& IN_RANGE (int64_t (label), && IN_RANGE (int64_t (label),
-MAX_SAVED_CONST_INT, MAX_SAVED_CONST_INT)) -MAX_SAVED_CONST_INT, MAX_SAVED_CONST_INT))
{ {
d->test.kind = test::SAVED_CONST_INT; d->test.kind = rtx_test::SAVED_CONST_INT;
d->test.u.integer.is_param = false; d->test.u.integer.is_param = false;
d->test.u.integer.value = label; d->test.u.integer.value = label;
d->replace (d->first, second->release ()); d->replace (d->first, second->release ());
...@@ -1619,7 +1619,7 @@ simplify_tests (state *s) ...@@ -1619,7 +1619,7 @@ simplify_tests (state *s)
paths that reach that code test require the same predicate paths that reach that code test require the same predicate
to be true. cse_tests will then put the predicate test in to be true. cse_tests will then put the predicate test in
series with the code test. */ series with the code test. */
if (d->test.kind == test::CODE) if (d->test.kind == rtx_test::CODE)
if (transition *trans = d->singleton ()) if (transition *trans = d->singleton ())
{ {
state *s = trans->to; state *s = trans->to;
...@@ -1630,7 +1630,7 @@ simplify_tests (state *s) ...@@ -1630,7 +1630,7 @@ simplify_tests (state *s)
transition *trans2 = d2->singleton (); transition *trans2 = d2->singleton ();
if (!trans2) if (!trans2)
break; break;
if (d2->test.kind == test::PREDICATE) if (d2->test.kind == rtx_test::PREDICATE)
{ {
d->test = d2->test; d->test = d2->test;
trans->labels = int_set (true); trans->labels = int_set (true);
...@@ -1654,7 +1654,7 @@ simplify_tests (state *s) ...@@ -1654,7 +1654,7 @@ simplify_tests (state *s)
static bool static bool
common_test_p (decision *d, transition *common, vec <transition *> *where) common_test_p (decision *d, transition *common, vec <transition *> *where)
{ {
if (d->test.kind == test::ACCEPT) if (d->test.kind == rtx_test::ACCEPT)
/* We found a successful return that didn't require COMMON. */ /* We found a successful return that didn't require COMMON. */
return false; return false;
if (d->test == common->from->test) if (d->test == common->from->test)
...@@ -1702,20 +1702,20 @@ struct known_conditions ...@@ -1702,20 +1702,20 @@ struct known_conditions
as positive proof. */ as positive proof. */
static bool static bool
safe_to_hoist_p (decision *d, const test &test, known_conditions *kc) safe_to_hoist_p (decision *d, const rtx_test &test, known_conditions *kc)
{ {
switch (test.kind) switch (test.kind)
{ {
case test::C_TEST: case rtx_test::C_TEST:
/* In general, C tests require everything else to have been /* In general, C tests require everything else to have been
verified and all operands to have been set up. */ verified and all operands to have been set up. */
return false; return false;
case test::ACCEPT: case rtx_test::ACCEPT:
/* Don't accept something before all conditions have been tested. */ /* Don't accept something before all conditions have been tested. */
return false; return false;
case test::PREDICATE: case rtx_test::PREDICATE:
/* Don't move a predicate over a test for VECLEN_GE, since the /* Don't move a predicate over a test for VECLEN_GE, since the
predicate used in a match_parallel can legitimately expect the predicate used in a match_parallel can legitimately expect the
length to be checked first. */ length to be checked first. */
...@@ -1723,21 +1723,21 @@ safe_to_hoist_p (decision *d, const test &test, known_conditions *kc) ...@@ -1723,21 +1723,21 @@ safe_to_hoist_p (decision *d, const test &test, known_conditions *kc)
subd->test != test; subd->test != test;
subd = subd->first->to->first) subd = subd->first->to->first)
if (subd->test.pos == test.pos if (subd->test.pos == test.pos
&& subd->test.kind == test::VECLEN_GE) && subd->test.kind == rtx_test::VECLEN_GE)
return false; return false;
goto any_rtx; goto any_rtx;
case test::DUPLICATE: case rtx_test::DUPLICATE:
/* Don't test for a match_dup until the associated operand has /* Don't test for a match_dup until the associated operand has
been set. */ been set. */
if (!kc->set_operands[test.u.opno]) if (!kc->set_operands[test.u.opno])
return false; return false;
goto any_rtx; goto any_rtx;
case test::CODE: case rtx_test::CODE:
case test::MODE: case rtx_test::MODE:
case test::SAVED_CONST_INT: case rtx_test::SAVED_CONST_INT:
case test::SET_OP: case rtx_test::SET_OP:
any_rtx: any_rtx:
/* Check whether it is safe to access the rtx under test. */ /* Check whether it is safe to access the rtx under test. */
switch (test.pos->type) switch (test.pos->type)
...@@ -1753,20 +1753,20 @@ safe_to_hoist_p (decision *d, const test &test, known_conditions *kc) ...@@ -1753,20 +1753,20 @@ safe_to_hoist_p (decision *d, const test &test, known_conditions *kc)
} }
gcc_unreachable (); gcc_unreachable ();
case test::INT_FIELD: case rtx_test::INT_FIELD:
case test::WIDE_INT_FIELD: case rtx_test::WIDE_INT_FIELD:
case test::VECLEN: case rtx_test::VECLEN:
case test::VECLEN_GE: case rtx_test::VECLEN_GE:
/* These tests access a specific part of an rtx, so are only safe /* These tests access a specific part of an rtx, so are only safe
once we know what the rtx is. */ once we know what the rtx is. */
return kc->position_tests[test.pos->id] & TESTED_CODE; return kc->position_tests[test.pos->id] & TESTED_CODE;
case test::PEEP2_COUNT: case rtx_test::PEEP2_COUNT:
case test::HAVE_NUM_CLOBBERS: case rtx_test::HAVE_NUM_CLOBBERS:
/* These tests can be performed anywhere. */ /* These tests can be performed anywhere. */
return true; return true;
case test::PATTERN: case rtx_test::PATTERN:
gcc_unreachable (); gcc_unreachable ();
} }
gcc_unreachable (); gcc_unreachable ();
...@@ -1887,8 +1887,8 @@ cse_tests (position *pos, state *s, known_conditions *kc) ...@@ -1887,8 +1887,8 @@ cse_tests (position *pos, state *s, known_conditions *kc)
/* Make sure that safe_to_hoist_p isn't being overly conservative. /* Make sure that safe_to_hoist_p isn't being overly conservative.
It should realize that D's test is safe in the current It should realize that D's test is safe in the current
environment. */ environment. */
gcc_assert (d->test.kind == test::C_TEST gcc_assert (d->test.kind == rtx_test::C_TEST
|| d->test.kind == test::ACCEPT || d->test.kind == rtx_test::ACCEPT
|| safe_to_hoist_p (d, d->test, kc)); || safe_to_hoist_p (d, d->test, kc));
/* D won't be changed any further by the current optimization. /* D won't be changed any further by the current optimization.
...@@ -1896,24 +1896,24 @@ cse_tests (position *pos, state *s, known_conditions *kc) ...@@ -1896,24 +1896,24 @@ cse_tests (position *pos, state *s, known_conditions *kc)
int prev = 0; int prev = 0;
switch (d->test.kind) switch (d->test.kind)
{ {
case test::CODE: case rtx_test::CODE:
prev = kc->position_tests[d->test.pos->id]; prev = kc->position_tests[d->test.pos->id];
kc->position_tests[d->test.pos->id] |= TESTED_CODE; kc->position_tests[d->test.pos->id] |= TESTED_CODE;
break; break;
case test::VECLEN: case rtx_test::VECLEN:
case test::VECLEN_GE: case rtx_test::VECLEN_GE:
prev = kc->position_tests[d->test.pos->id]; prev = kc->position_tests[d->test.pos->id];
kc->position_tests[d->test.pos->id] |= TESTED_VECLEN; kc->position_tests[d->test.pos->id] |= TESTED_VECLEN;
break; break;
case test::SET_OP: case rtx_test::SET_OP:
prev = kc->set_operands[d->test.u.opno]; prev = kc->set_operands[d->test.u.opno];
gcc_assert (!prev); gcc_assert (!prev);
kc->set_operands[d->test.u.opno] = true; kc->set_operands[d->test.u.opno] = true;
break; break;
case test::PEEP2_COUNT: case rtx_test::PEEP2_COUNT:
prev = kc->peep2_count; prev = kc->peep2_count;
kc->peep2_count = MAX (prev, d->test.u.min_len); kc->peep2_count = MAX (prev, d->test.u.min_len);
break; break;
...@@ -1925,17 +1925,17 @@ cse_tests (position *pos, state *s, known_conditions *kc) ...@@ -1925,17 +1925,17 @@ cse_tests (position *pos, state *s, known_conditions *kc)
cse_tests (d->test.pos ? d->test.pos : pos, trans->to, kc); cse_tests (d->test.pos ? d->test.pos : pos, trans->to, kc);
switch (d->test.kind) switch (d->test.kind)
{ {
case test::CODE: case rtx_test::CODE:
case test::VECLEN: case rtx_test::VECLEN:
case test::VECLEN_GE: case rtx_test::VECLEN_GE:
kc->position_tests[d->test.pos->id] = prev; kc->position_tests[d->test.pos->id] = prev;
break; break;
case test::SET_OP: case rtx_test::SET_OP:
kc->set_operands[d->test.u.opno] = prev; kc->set_operands[d->test.u.opno] = prev;
break; break;
case test::PEEP2_COUNT: case rtx_test::PEEP2_COUNT:
kc->peep2_count = prev; kc->peep2_count = prev;
break; break;
...@@ -1949,33 +1949,33 @@ cse_tests (position *pos, state *s, known_conditions *kc) ...@@ -1949,33 +1949,33 @@ cse_tests (position *pos, state *s, known_conditions *kc)
or parameter::UNSET if none. */ or parameter::UNSET if none. */
parameter::type_enum parameter::type_enum
transition_parameter_type (test::kind_enum kind) transition_parameter_type (rtx_test::kind_enum kind)
{ {
switch (kind) switch (kind)
{ {
case test::CODE: case rtx_test::CODE:
return parameter::CODE; return parameter::CODE;
case test::MODE: case rtx_test::MODE:
return parameter::MODE; return parameter::MODE;
case test::INT_FIELD: case rtx_test::INT_FIELD:
case test::VECLEN: case rtx_test::VECLEN:
case test::PATTERN: case rtx_test::PATTERN:
return parameter::INT; return parameter::INT;
case test::WIDE_INT_FIELD: case rtx_test::WIDE_INT_FIELD:
return parameter::WIDE_INT; return parameter::WIDE_INT;
case test::PEEP2_COUNT: case rtx_test::PEEP2_COUNT:
case test::VECLEN_GE: case rtx_test::VECLEN_GE:
case test::SAVED_CONST_INT: case rtx_test::SAVED_CONST_INT:
case test::PREDICATE: case rtx_test::PREDICATE:
case test::DUPLICATE: case rtx_test::DUPLICATE:
case test::HAVE_NUM_CLOBBERS: case rtx_test::HAVE_NUM_CLOBBERS:
case test::C_TEST: case rtx_test::C_TEST:
case test::SET_OP: case rtx_test::SET_OP:
case test::ACCEPT: case rtx_test::ACCEPT:
return parameter::UNSET; return parameter::UNSET;
} }
gcc_unreachable (); gcc_unreachable ();
...@@ -1993,11 +1993,11 @@ find_operand_positions (state *s, vec <int> &operand_pos) ...@@ -1993,11 +1993,11 @@ find_operand_positions (state *s, vec <int> &operand_pos)
int this_operand = (d->test.pos ? operand_pos[d->test.pos->id] : -1); int this_operand = (d->test.pos ? operand_pos[d->test.pos->id] : -1);
if (this_operand >= 0) if (this_operand >= 0)
d->test.pos_operand = this_operand; d->test.pos_operand = this_operand;
if (d->test.kind == test::SET_OP) if (d->test.kind == rtx_test::SET_OP)
operand_pos[d->test.pos->id] = d->test.u.opno; operand_pos[d->test.pos->id] = d->test.u.opno;
for (transition *trans = d->first; trans; trans = trans->next) for (transition *trans = d->first; trans; trans = trans->next)
find_operand_positions (trans->to, operand_pos); find_operand_positions (trans->to, operand_pos);
if (d->test.kind == test::SET_OP) if (d->test.kind == rtx_test::SET_OP)
operand_pos[d->test.pos->id] = this_operand; operand_pos[d->test.pos->id] = this_operand;
} }
} }
...@@ -2065,7 +2065,7 @@ get_stats (state *s) ...@@ -2065,7 +2065,7 @@ get_stats (state *s)
for_d.num_decisions += 1; for_d.num_decisions += 1;
for_d.longest_path += 1; for_d.longest_path += 1;
} }
if (d->test.kind == test::ACCEPT) if (d->test.kind == rtx_test::ACCEPT)
{ {
for_d.longest_path_code = d->test.u.acceptance.u.full.code; for_d.longest_path_code = d->test.u.acceptance.u.full.code;
for_d.longest_backtrack_code = d->test.u.acceptance.u.full.code; for_d.longest_backtrack_code = d->test.u.acceptance.u.full.code;
...@@ -2379,21 +2379,21 @@ update_parameters (vec <parameter> &to, const vec <parameter> &from) ...@@ -2379,21 +2379,21 @@ update_parameters (vec <parameter> &to, const vec <parameter> &from)
PARAMB alone. */ PARAMB alone. */
static bool static bool
compatible_tests_p (const test &a, const test &b, compatible_tests_p (const rtx_test &a, const rtx_test &b,
parameter *parama, parameter *paramb) parameter *parama, parameter *paramb)
{ {
if (a.kind != b.kind) if (a.kind != b.kind)
return false; return false;
switch (a.kind) switch (a.kind)
{ {
case test::PREDICATE: case rtx_test::PREDICATE:
if (a.u.predicate.data != b.u.predicate.data) if (a.u.predicate.data != b.u.predicate.data)
return false; return false;
*parama = parameter (parameter::MODE, false, a.u.predicate.mode); *parama = parameter (parameter::MODE, false, a.u.predicate.mode);
*paramb = parameter (parameter::MODE, false, b.u.predicate.mode); *paramb = parameter (parameter::MODE, false, b.u.predicate.mode);
return true; return true;
case test::SAVED_CONST_INT: case rtx_test::SAVED_CONST_INT:
*parama = parameter (parameter::INT, false, a.u.integer.value); *parama = parameter (parameter::INT, false, a.u.integer.value);
*paramb = parameter (parameter::INT, false, b.u.integer.value); *paramb = parameter (parameter::INT, false, b.u.integer.value);
return true; return true;
...@@ -2667,7 +2667,7 @@ merge_patterns (merge_state_info *sinfo1, merge_state_info *sinfo2) ...@@ -2667,7 +2667,7 @@ merge_patterns (merge_state_info *sinfo1, merge_state_info *sinfo2)
parameterizing the first N const_ints of the vector parameterizing the first N const_ints of the vector
and then (once we reach the maximum number of parameters) and then (once we reach the maximum number of parameters)
we go on to match the other elements exactly. */ we go on to match the other elements exactly. */
if (d1->test.kind == test::WIDE_INT_FIELD) if (d1->test.kind == rtx_test::WIDE_INT_FIELD)
return false; return false;
/* See whether the label has a generalizable type. */ /* See whether the label has a generalizable type. */
...@@ -2803,7 +2803,7 @@ init_pattern_use (create_pattern_info *cpi, merge_state_info *sinfo, ...@@ -2803,7 +2803,7 @@ init_pattern_use (create_pattern_info *cpi, merge_state_info *sinfo,
pattern_use *use = new pattern_use; pattern_use *use = new pattern_use;
use->routine = pat->routine; use->routine = pat->routine;
use->params.splice (params); use->params.splice (params);
decision *d = new decision (test::pattern (res->root, use)); decision *d = new decision (rtx_test::pattern (res->root, use));
/* If the original decision could use an element of operands[] instead /* If the original decision could use an element of operands[] instead
of an rtx variable, try to transfer it to the new decision. */ of an rtx variable, try to transfer it to the new decision. */
...@@ -2823,7 +2823,7 @@ add_pattern_acceptance (create_pattern_info *cpi, state *s) ...@@ -2823,7 +2823,7 @@ add_pattern_acceptance (create_pattern_info *cpi, state *s)
acceptance.type = SUBPATTERN; acceptance.type = SUBPATTERN;
acceptance.partial_p = false; acceptance.partial_p = false;
acceptance.u.full.code = cpi->next_result; acceptance.u.full.code = cpi->next_result;
add_decision (s, test::accept (acceptance), true, false); add_decision (s, rtx_test::accept (acceptance), true, false);
cpi->next_result += 1; cpi->next_result += 1;
} }
...@@ -2860,12 +2860,12 @@ populate_pattern_routine (create_pattern_info *cpi, merge_state_info *sinfo, ...@@ -2860,12 +2860,12 @@ populate_pattern_routine (create_pattern_info *cpi, merge_state_info *sinfo,
const parameter &param = params[pat->param_test]; const parameter &param = params[pat->param_test];
switch (newd->test.kind) switch (newd->test.kind)
{ {
case test::PREDICATE: case rtx_test::PREDICATE:
newd->test.u.predicate.mode_is_param = param.is_param; newd->test.u.predicate.mode_is_param = param.is_param;
newd->test.u.predicate.mode = param.value; newd->test.u.predicate.mode = param.value;
break; break;
case test::SAVED_CONST_INT: case rtx_test::SAVED_CONST_INT:
newd->test.u.integer.is_param = param.is_param; newd->test.u.integer.is_param = param.is_param;
newd->test.u.integer.value = param.value; newd->test.u.integer.value = param.value;
break; break;
...@@ -2875,9 +2875,9 @@ populate_pattern_routine (create_pattern_info *cpi, merge_state_info *sinfo, ...@@ -2875,9 +2875,9 @@ populate_pattern_routine (create_pattern_info *cpi, merge_state_info *sinfo,
break; break;
} }
} }
if (d->test.kind == test::C_TEST) if (d->test.kind == rtx_test::C_TEST)
routine->insn_p = true; routine->insn_p = true;
else if (d->test.kind == test::HAVE_NUM_CLOBBERS) else if (d->test.kind == rtx_test::HAVE_NUM_CLOBBERS)
routine->pnum_clobbers_p = true; routine->pnum_clobbers_p = true;
news->push_back (newd); news->push_back (newd);
...@@ -3038,11 +3038,11 @@ split_out_patterns (vec <merge_state_info> &states) ...@@ -3038,11 +3038,11 @@ split_out_patterns (vec <merge_state_info> &states)
and so couldn't be shared between states). */ and so couldn't be shared between states). */
if (decision *d = sinfo->s->singleton ()) if (decision *d = sinfo->s->singleton ())
/* ACCEPT states are unique, so don't even try to merge them. */ /* ACCEPT states are unique, so don't even try to merge them. */
if (d->test.kind != test::ACCEPT if (d->test.kind != rtx_test::ACCEPT
&& (pattern_have_num_clobbers_p && (pattern_have_num_clobbers_p
|| d->test.kind != test::HAVE_NUM_CLOBBERS) || d->test.kind != rtx_test::HAVE_NUM_CLOBBERS)
&& (pattern_c_test_p && (pattern_c_test_p
|| d->test.kind != test::C_TEST)) || d->test.kind != rtx_test::C_TEST))
{ {
merge_state_info **slot = hashtab.find_slot (sinfo, INSERT); merge_state_info **slot = hashtab.find_slot (sinfo, INSERT);
sinfo->prev_same_test = *slot; sinfo->prev_same_test = *slot;
...@@ -3290,7 +3290,7 @@ create_subroutine (routine_type type, state *s, vec <state *> &procs) ...@@ -3290,7 +3290,7 @@ create_subroutine (routine_type type, state *s, vec <state *> &procs)
acceptance.partial_p = true; acceptance.partial_p = true;
acceptance.u.subroutine_id = procs.length (); acceptance.u.subroutine_id = procs.length ();
state *news = new state; state *news = new state;
add_decision (news, test::accept (acceptance), true, false); add_decision (news, rtx_test::accept (acceptance), true, false);
return news; return news;
} }
...@@ -3327,8 +3327,8 @@ find_subroutines (routine_type type, state *s, vec <state *> &procs) ...@@ -3327,8 +3327,8 @@ find_subroutines (routine_type type, state *s, vec <state *> &procs)
if (!newd->test.single_outcome_p ()) if (!newd->test.single_outcome_p ())
size.num_statements += 1; size.num_statements += 1;
trans = newd->singleton (); trans = newd->singleton ();
if (newd->test.kind == test::SET_OP if (newd->test.kind == rtx_test::SET_OP
|| newd->test.kind == test::ACCEPT) || newd->test.kind == rtx_test::ACCEPT)
break; break;
} }
/* The target of TRANS is a subroutine candidate. First recurse /* The target of TRANS is a subroutine candidate. First recurse
...@@ -3866,9 +3866,9 @@ match_pattern_2 (state *s, rtx top_pattern, position *pos, rtx pattern) ...@@ -3866,9 +3866,9 @@ match_pattern_2 (state *s, rtx top_pattern, position *pos, rtx pattern)
if (code == MATCH_PARALLEL || code == MATCH_PAR_DUP) if (code == MATCH_PARALLEL || code == MATCH_PAR_DUP)
{ {
/* Check that we have a parallel with enough elements. */ /* Check that we have a parallel with enough elements. */
s = add_decision (s, test::code (pos), PARALLEL, false); s = add_decision (s, rtx_test::code (pos), PARALLEL, false);
int min_len = XVECLEN (pattern, 2); int min_len = XVECLEN (pattern, 2);
s = add_decision (s, test::veclen_ge (pos, min_len), s = add_decision (s, rtx_test::veclen_ge (pos, min_len),
true, false); true, false);
} }
else else
...@@ -3883,7 +3883,7 @@ match_pattern_2 (state *s, rtx top_pattern, position *pos, rtx pattern) ...@@ -3883,7 +3883,7 @@ match_pattern_2 (state *s, rtx top_pattern, position *pos, rtx pattern)
bool need_codes = (pred bool need_codes = (pred
&& (code == MATCH_OPERATOR && (code == MATCH_OPERATOR
|| code == MATCH_OP_DUP)); || code == MATCH_OP_DUP));
s = add_decision (s, test::code (pos), codes, !need_codes); s = add_decision (s, rtx_test::code (pos), codes, !need_codes);
} }
/* Postpone the predicate check until we've checked the rest /* Postpone the predicate check until we've checked the rest
...@@ -3924,7 +3924,7 @@ match_pattern_2 (state *s, rtx top_pattern, position *pos, rtx pattern) ...@@ -3924,7 +3924,7 @@ match_pattern_2 (state *s, rtx top_pattern, position *pos, rtx pattern)
default: default:
{ {
/* Check that the rtx has the right code. */ /* Check that the rtx has the right code. */
s = add_decision (s, test::code (pos), code, false); s = add_decision (s, rtx_test::code (pos), code, false);
/* Queue a test for the mode if one is specified. */ /* Queue a test for the mode if one is specified. */
if (GET_MODE (pattern) != VOIDmode) if (GET_MODE (pattern) != VOIDmode)
...@@ -3949,7 +3949,8 @@ match_pattern_2 (state *s, rtx top_pattern, position *pos, rtx pattern) ...@@ -3949,7 +3949,8 @@ match_pattern_2 (state *s, rtx top_pattern, position *pos, rtx pattern)
/* Make sure the vector has the right number of /* Make sure the vector has the right number of
elements. */ elements. */
int length = XVECLEN (pattern, i); int length = XVECLEN (pattern, i);
s = add_decision (s, test::veclen (pos), length, false); s = add_decision (s, rtx_test::veclen (pos),
length, false);
position **subpos2_ptr = &pos->xvecexp0s; position **subpos2_ptr = &pos->xvecexp0s;
for (int j = 0; j < length; j++) for (int j = 0; j < length; j++)
...@@ -3965,13 +3966,13 @@ match_pattern_2 (state *s, rtx top_pattern, position *pos, rtx pattern) ...@@ -3965,13 +3966,13 @@ match_pattern_2 (state *s, rtx top_pattern, position *pos, rtx pattern)
case 'i': case 'i':
/* Make sure that XINT (X, I) has the right value. */ /* Make sure that XINT (X, I) has the right value. */
s = add_decision (s, test::int_field (pos, i), s = add_decision (s, rtx_test::int_field (pos, i),
XINT (pattern, i), false); XINT (pattern, i), false);
break; break;
case 'w': case 'w':
/* Make sure that XWINT (X, I) has the right value. */ /* Make sure that XWINT (X, I) has the right value. */
s = add_decision (s, test::wide_int_field (pos, i), s = add_decision (s, rtx_test::wide_int_field (pos, i),
XWINT (pattern, 0), false); XWINT (pattern, 0), false);
break; break;
...@@ -4037,7 +4038,7 @@ match_pattern_2 (state *s, rtx top_pattern, position *pos, rtx pattern) ...@@ -4037,7 +4038,7 @@ match_pattern_2 (state *s, rtx top_pattern, position *pos, rtx pattern)
and DImode register_operands, as described above. */ and DImode register_operands, as described above. */
machine_mode mode = GET_MODE (e->pattern); machine_mode mode = GET_MODE (e->pattern);
if (safe_predicate_mode (pred, mode)) if (safe_predicate_mode (pred, mode))
s = add_decision (s, test::mode (e->pos), mode, true); s = add_decision (s, rtx_test::mode (e->pos), mode, true);
/* Assign to operands[] first, so that the rtx usually doesn't /* Assign to operands[] first, so that the rtx usually doesn't
need to be live across the call to the predicate. need to be live across the call to the predicate.
...@@ -4046,19 +4047,21 @@ match_pattern_2 (state *s, rtx top_pattern, position *pos, rtx pattern) ...@@ -4046,19 +4047,21 @@ match_pattern_2 (state *s, rtx top_pattern, position *pos, rtx pattern)
since we fully expect to assign to operands[] at some point, since we fully expect to assign to operands[] at some point,
and since the caller usually writes to other parts of and since the caller usually writes to other parts of
recog_data anyway. */ recog_data anyway. */
s = add_decision (s, test::set_op (e->pos, opno), true, false); s = add_decision (s, rtx_test::set_op (e->pos, opno),
s = add_decision (s, test::predicate (e->pos, pred, mode), true, false);
s = add_decision (s, rtx_test::predicate (e->pos, pred, mode),
true, false); true, false);
} }
else else
/* Historically we've ignored the mode when there's no /* Historically we've ignored the mode when there's no
predicate. Just set up operands[] unconditionally. */ predicate. Just set up operands[] unconditionally. */
s = add_decision (s, test::set_op (e->pos, opno), true, false); s = add_decision (s, rtx_test::set_op (e->pos, opno),
true, false);
break; break;
} }
default: default:
s = add_decision (s, test::mode (e->pos), s = add_decision (s, rtx_test::mode (e->pos),
GET_MODE (e->pattern), false); GET_MODE (e->pattern), false);
break; break;
} }
...@@ -4066,7 +4069,7 @@ match_pattern_2 (state *s, rtx top_pattern, position *pos, rtx pattern) ...@@ -4066,7 +4069,7 @@ match_pattern_2 (state *s, rtx top_pattern, position *pos, rtx pattern)
/* Finally add rtx_equal_p checks for duplicated operands. */ /* Finally add rtx_equal_p checks for duplicated operands. */
FOR_EACH_VEC_ELT (dup_tests, i, e) FOR_EACH_VEC_ELT (dup_tests, i, e)
s = add_decision (s, test::duplicate (e->pos, XINT (e->pattern, 0)), s = add_decision (s, rtx_test::duplicate (e->pos, XINT (e->pattern, 0)),
true, false); true, false);
return s; return s;
} }
...@@ -4098,7 +4101,7 @@ match_pattern_1 (state *s, rtx top_pattern, const char *c_test, ...@@ -4098,7 +4101,7 @@ match_pattern_1 (state *s, rtx top_pattern, const char *c_test,
position *subpos = next_position (subpos_ptr, &root_pos, position *subpos = next_position (subpos_ptr, &root_pos,
POS_PEEP2_INSN, count); POS_PEEP2_INSN, count);
if (count > 0) if (count > 0)
s = add_decision (s, test::peep2_count (count + 1), s = add_decision (s, rtx_test::peep2_count (count + 1),
true, false); true, false);
s = match_pattern_2 (s, top_pattern, subpos, x); s = match_pattern_2 (s, top_pattern, subpos, x);
subpos_ptr = &subpos->next; subpos_ptr = &subpos->next;
...@@ -4115,15 +4118,15 @@ match_pattern_1 (state *s, rtx top_pattern, const char *c_test, ...@@ -4115,15 +4118,15 @@ match_pattern_1 (state *s, rtx top_pattern, const char *c_test,
/* If the match is only valid when extra clobbers are added, /* If the match is only valid when extra clobbers are added,
make sure we're able to pass that information to the caller. */ make sure we're able to pass that information to the caller. */
if (acceptance.type == RECOG && acceptance.u.full.u.num_clobbers) if (acceptance.type == RECOG && acceptance.u.full.u.num_clobbers)
s = add_decision (s, test::have_num_clobbers (), true, false); s = add_decision (s, rtx_test::have_num_clobbers (), true, false);
} }
/* Make sure that the C test is true. */ /* Make sure that the C test is true. */
if (maybe_eval_c_test (c_test) != 1) if (maybe_eval_c_test (c_test) != 1)
s = add_decision (s, test::c_test (c_test), true, false); s = add_decision (s, rtx_test::c_test (c_test), true, false);
/* Accept the pattern. */ /* Accept the pattern. */
add_decision (s, test::accept (acceptance), true, false); add_decision (s, rtx_test::accept (acceptance), true, false);
} }
/* Like match_pattern_1, but (if merge_states_p) try to merge the /* Like match_pattern_1, but (if merge_states_p) try to merge the
...@@ -4321,7 +4324,7 @@ static bool ...@@ -4321,7 +4324,7 @@ static bool
terminal_pattern_p (decision *d, unsigned int *base_out, terminal_pattern_p (decision *d, unsigned int *base_out,
unsigned int *count_out) unsigned int *count_out)
{ {
if (d->test.kind != test::PATTERN) if (d->test.kind != rtx_test::PATTERN)
return false; return false;
unsigned int base = 0; unsigned int base = 0;
unsigned int count = 0; unsigned int count = 0;
...@@ -4330,7 +4333,7 @@ terminal_pattern_p (decision *d, unsigned int *base_out, ...@@ -4330,7 +4333,7 @@ terminal_pattern_p (decision *d, unsigned int *base_out,
if (trans->is_param || trans->labels.length () != 1) if (trans->is_param || trans->labels.length () != 1)
return false; return false;
decision *subd = trans->to->singleton (); decision *subd = trans->to->singleton ();
if (!subd || subd->test.kind != test::ACCEPT) if (!subd || subd->test.kind != rtx_test::ACCEPT)
return false; return false;
unsigned int this_base = (subd->test.u.acceptance.u.full.code unsigned int this_base = (subd->test.u.acceptance.u.full.code
- trans->labels[0]); - trans->labels[0]);
...@@ -4349,7 +4352,7 @@ terminal_pattern_p (decision *d, unsigned int *base_out, ...@@ -4349,7 +4352,7 @@ terminal_pattern_p (decision *d, unsigned int *base_out,
already available in state OS. */ already available in state OS. */
static bool static bool
test_position_available_p (output_state *os, const test &test) test_position_available_p (output_state *os, const rtx_test &test)
{ {
return (!test.pos return (!test.pos
|| test.pos_operand >= 0 || test.pos_operand >= 0
...@@ -4461,7 +4464,7 @@ print_parameter_value (const parameter &param) ...@@ -4461,7 +4464,7 @@ print_parameter_value (const parameter &param)
/* Print the C expression for the rtx tested by TEST. */ /* Print the C expression for the rtx tested by TEST. */
static void static void
print_test_rtx (output_state *os, const test &test) print_test_rtx (output_state *os, const rtx_test &test)
{ {
if (test.pos_operand >= 0) if (test.pos_operand >= 0)
printf ("operands[%d]", test.pos_operand); printf ("operands[%d]", test.pos_operand);
...@@ -4472,41 +4475,41 @@ print_test_rtx (output_state *os, const test &test) ...@@ -4472,41 +4475,41 @@ print_test_rtx (output_state *os, const test &test)
/* Print the C expression for non-boolean test TEST. */ /* Print the C expression for non-boolean test TEST. */
static void static void
print_nonbool_test (output_state *os, const test &test) print_nonbool_test (output_state *os, const rtx_test &test)
{ {
switch (test.kind) switch (test.kind)
{ {
case test::CODE: case rtx_test::CODE:
printf ("GET_CODE ("); printf ("GET_CODE (");
print_test_rtx (os, test); print_test_rtx (os, test);
printf (")"); printf (")");
break; break;
case test::MODE: case rtx_test::MODE:
printf ("GET_MODE ("); printf ("GET_MODE (");
print_test_rtx (os, test); print_test_rtx (os, test);
printf (")"); printf (")");
break; break;
case test::VECLEN: case rtx_test::VECLEN:
printf ("XVECLEN ("); printf ("XVECLEN (");
print_test_rtx (os, test); print_test_rtx (os, test);
printf (", 0)"); printf (", 0)");
break; break;
case test::INT_FIELD: case rtx_test::INT_FIELD:
printf ("XINT ("); printf ("XINT (");
print_test_rtx (os, test); print_test_rtx (os, test);
printf (", %d)", test.u.opno); printf (", %d)", test.u.opno);
break; break;
case test::WIDE_INT_FIELD: case rtx_test::WIDE_INT_FIELD:
printf ("XWINT ("); printf ("XWINT (");
print_test_rtx (os, test); print_test_rtx (os, test);
printf (", %d)", test.u.opno); printf (", %d)", test.u.opno);
break; break;
case test::PATTERN: case rtx_test::PATTERN:
{ {
pattern_routine *routine = test.u.pattern->routine; pattern_routine *routine = test.u.pattern->routine;
printf ("pattern%d (", routine->pattern_id); printf ("pattern%d (", routine->pattern_id);
...@@ -4536,15 +4539,15 @@ print_nonbool_test (output_state *os, const test &test) ...@@ -4536,15 +4539,15 @@ print_nonbool_test (output_state *os, const test &test)
break; break;
} }
case test::PEEP2_COUNT: case rtx_test::PEEP2_COUNT:
case test::VECLEN_GE: case rtx_test::VECLEN_GE:
case test::SAVED_CONST_INT: case rtx_test::SAVED_CONST_INT:
case test::DUPLICATE: case rtx_test::DUPLICATE:
case test::PREDICATE: case rtx_test::PREDICATE:
case test::SET_OP: case rtx_test::SET_OP:
case test::HAVE_NUM_CLOBBERS: case rtx_test::HAVE_NUM_CLOBBERS:
case test::C_TEST: case rtx_test::C_TEST:
case test::ACCEPT: case rtx_test::ACCEPT:
gcc_unreachable (); gcc_unreachable ();
} }
} }
...@@ -4553,7 +4556,7 @@ print_nonbool_test (output_state *os, const test &test) ...@@ -4553,7 +4556,7 @@ print_nonbool_test (output_state *os, const test &test)
decision performs TEST. Print the C code for the label. */ decision performs TEST. Print the C code for the label. */
static void static void
print_label_value (const test &test, bool is_param, uint64_t value) print_label_value (const rtx_test &test, bool is_param, uint64_t value)
{ {
print_parameter_value (parameter (transition_parameter_type (test.kind), print_parameter_value (parameter (transition_parameter_type (test.kind),
is_param, value)); is_param, value));
...@@ -4564,24 +4567,24 @@ print_label_value (const test &test, bool is_param, uint64_t value) ...@@ -4564,24 +4567,24 @@ print_label_value (const test &test, bool is_param, uint64_t value)
Test for inequality if INVERT_P, otherwise test for equality. */ Test for inequality if INVERT_P, otherwise test for equality. */
static void static void
print_test (output_state *os, const test &test, bool is_param, uint64_t value, print_test (output_state *os, const rtx_test &test, bool is_param,
bool invert_p) uint64_t value, bool invert_p)
{ {
switch (test.kind) switch (test.kind)
{ {
/* Handle the non-boolean TESTs. */ /* Handle the non-boolean TESTs. */
case test::CODE: case rtx_test::CODE:
case test::MODE: case rtx_test::MODE:
case test::VECLEN: case rtx_test::VECLEN:
case test::INT_FIELD: case rtx_test::INT_FIELD:
case test::WIDE_INT_FIELD: case rtx_test::WIDE_INT_FIELD:
case test::PATTERN: case rtx_test::PATTERN:
print_nonbool_test (os, test); print_nonbool_test (os, test);
printf (" %s ", invert_p ? "!=" : "=="); printf (" %s ", invert_p ? "!=" : "==");
print_label_value (test, is_param, value); print_label_value (test, is_param, value);
break; break;
case test::SAVED_CONST_INT: case rtx_test::SAVED_CONST_INT:
gcc_assert (!is_param && value == 1); gcc_assert (!is_param && value == 1);
print_test_rtx (os, test); print_test_rtx (os, test);
printf (" %s const_int_rtx[MAX_SAVED_CONST_INT + ", printf (" %s const_int_rtx[MAX_SAVED_CONST_INT + ",
...@@ -4592,20 +4595,20 @@ print_test (output_state *os, const test &test, bool is_param, uint64_t value, ...@@ -4592,20 +4595,20 @@ print_test (output_state *os, const test &test, bool is_param, uint64_t value,
printf ("]"); printf ("]");
break; break;
case test::PEEP2_COUNT: case rtx_test::PEEP2_COUNT:
gcc_assert (!is_param && value == 1); gcc_assert (!is_param && value == 1);
printf ("peep2_current_count %s %d", invert_p ? "<" : ">=", printf ("peep2_current_count %s %d", invert_p ? "<" : ">=",
test.u.min_len); test.u.min_len);
break; break;
case test::VECLEN_GE: case rtx_test::VECLEN_GE:
gcc_assert (!is_param && value == 1); gcc_assert (!is_param && value == 1);
printf ("XVECLEN ("); printf ("XVECLEN (");
print_test_rtx (os, test); print_test_rtx (os, test);
printf (", 0) %s %d", invert_p ? "<" : ">=", test.u.min_len); printf (", 0) %s %d", invert_p ? "<" : ">=", test.u.min_len);
break; break;
case test::PREDICATE: case rtx_test::PREDICATE:
gcc_assert (!is_param && value == 1); gcc_assert (!is_param && value == 1);
printf ("%s%s (", invert_p ? "!" : "", test.u.predicate.data->name); printf ("%s%s (", invert_p ? "!" : "", test.u.predicate.data->name);
print_test_rtx (os, test); print_test_rtx (os, test);
...@@ -4616,27 +4619,27 @@ print_test (output_state *os, const test &test, bool is_param, uint64_t value, ...@@ -4616,27 +4619,27 @@ print_test (output_state *os, const test &test, bool is_param, uint64_t value,
printf (")"); printf (")");
break; break;
case test::DUPLICATE: case rtx_test::DUPLICATE:
gcc_assert (!is_param && value == 1); gcc_assert (!is_param && value == 1);
printf ("%srtx_equal_p (", invert_p ? "!" : ""); printf ("%srtx_equal_p (", invert_p ? "!" : "");
print_test_rtx (os, test); print_test_rtx (os, test);
printf (", operands[%d])", test.u.opno); printf (", operands[%d])", test.u.opno);
break; break;
case test::HAVE_NUM_CLOBBERS: case rtx_test::HAVE_NUM_CLOBBERS:
gcc_assert (!is_param && value == 1); gcc_assert (!is_param && value == 1);
printf ("pnum_clobbers %s NULL", invert_p ? "==" : "!="); printf ("pnum_clobbers %s NULL", invert_p ? "==" : "!=");
break; break;
case test::C_TEST: case rtx_test::C_TEST:
gcc_assert (!is_param && value == 1); gcc_assert (!is_param && value == 1);
if (invert_p) if (invert_p)
printf ("!"); printf ("!");
print_c_condition (test.u.string); print_c_condition (test.u.string);
break; break;
case test::ACCEPT: case rtx_test::ACCEPT:
case test::SET_OP: case rtx_test::SET_OP:
gcc_unreachable (); gcc_unreachable ();
} }
} }
...@@ -4812,9 +4815,9 @@ print_decision (output_state *os, decision *d, unsigned int indent, ...@@ -4812,9 +4815,9 @@ print_decision (output_state *os, decision *d, unsigned int indent,
return ES_FALLTHROUGH; return ES_FALLTHROUGH;
} }
} }
else if (d->test.kind == test::ACCEPT) else if (d->test.kind == rtx_test::ACCEPT)
return print_acceptance (d->test.u.acceptance, indent, is_final); return print_acceptance (d->test.u.acceptance, indent, is_final);
else if (d->test.kind == test::SET_OP) else if (d->test.kind == rtx_test::SET_OP)
{ {
printf_indent (indent, "operands[%d] = ", d->test.u.opno); printf_indent (indent, "operands[%d] = ", d->test.u.opno);
print_test_rtx (os, d->test); print_test_rtx (os, d->test);
...@@ -4843,8 +4846,8 @@ print_decision (output_state *os, decision *d, unsigned int indent, ...@@ -4843,8 +4846,8 @@ print_decision (output_state *os, decision *d, unsigned int indent,
{ {
d = trans->to->singleton (); d = trans->to->singleton ();
if (!d if (!d
|| d->test.kind == test::ACCEPT || d->test.kind == rtx_test::ACCEPT
|| d->test.kind == test::SET_OP || d->test.kind == rtx_test::SET_OP
|| !d->if_statement_p (&label) || !d->if_statement_p (&label)
|| !test_position_available_p (os, d->test)) || !test_position_available_p (os, d->test))
break; break;
...@@ -4869,7 +4872,7 @@ print_decision (output_state *os, decision *d, unsigned int indent, ...@@ -4869,7 +4872,7 @@ print_decision (output_state *os, decision *d, unsigned int indent,
return print_state (os, to, indent, is_final); return print_state (os, to, indent, is_final);
} }
else if (to->singleton () else if (to->singleton ()
&& to->first->test.kind == test::ACCEPT && to->first->test.kind == rtx_test::ACCEPT
&& single_statement_p (to->first->test.u.acceptance)) && single_statement_p (to->first->test.u.acceptance))
{ {
/* The target of the transition is a simple "return" statement. /* The target of the transition is a simple "return" statement.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment