/* Generate code from machine description to recognize rtl as insns.
- Copyright (C) 1987-2019 Free Software Foundation, Inc.
+ Copyright (C) 1987-2020 Free Software Foundation, Inc.
This file is part of GCC.
}
case CLOBBER:
- case CLOBBER_HIGH:
validate_pattern (SET_DEST (pattern), info, pattern, '=');
return;
to "T *prev, *next;" and a function "void set_parent (list_head <T> *)"
to set the parent list. */
template <typename T>
-struct list_head
+class list_head
{
+public:
/* A range of linked items. */
- struct range
+ class range
{
+ public:
range (T *);
range (T *, T *);
return first == last ? first : 0;
}
\f
-struct state;
+class state;
/* Describes a possible successful return from a routine. */
struct acceptance_type
}
/* Represents a parameter to a pattern routine. */
-struct parameter
+class parameter
{
+public:
/* The C type of parameter. */
enum type_enum {
/* Represents an invalid parameter. */
an ad-hoc enum value on success and -1 on failure. The routine can
be used by any subroutine type. The match can be parameterized by
things like mode, code and UNSPEC number. */
-struct pattern_routine
+class pattern_routine
{
+public:
/* The state that implements the pattern. */
state *s;
static vec <pattern_routine *> patterns;
/* Represents one use of a pattern routine. */
-struct pattern_use
+class pattern_use
{
+public:
/* The pattern routine to use. */
pattern_routine *routine;
};
/* Represents a test performed by a decision. */
-struct rtx_test
+class rtx_test
{
+public:
rtx_test ();
/* The types of test that can be performed. Most of them take as input
/* A simple set of transition labels. Most transitions have a singleton
label, so try to make that case as efficient as possible. */
-struct int_set : public auto_vec <uint64_t, 1>
+class int_set : public auto_vec <uint64_t, 1>
{
+public:
typedef uint64_t *iterator;
int_set ();
return !operator == (a, b);
}
-struct decision;
+class decision;
/* Represents a transition between states, dependent on the result of
a test T. */
-struct transition
+class transition
{
+public:
transition (const int_set &, state *, bool);
void set_parent (list_head <transition> *);
to the transition's target state. If no suitable transition exists,
the machine either falls through to the next decision or, if there are no
more decisions to try, fails the match. */
-struct decision : list_head <transition>
+class decision : public list_head <transition>
{
+public:
decision (const rtx_test &);
void set_parent (list_head <decision> *s);
/* Represents one machine state. For each state the machine tries a list
of decisions, in order, and acts on the first match. It fails without
further backtracking if no decisions match. */
-struct state : list_head <decision>
+class state : public list_head <decision>
{
+public:
void set_parent (list_head <state> *) {}
};
const unsigned char TESTED_VECLEN = 2;
/* Represents a set of conditions that are known to hold. */
-struct known_conditions
+class known_conditions
{
+public:
/* A mask of TESTED_ values for each position, indexed by the position's
id field. */
auto_vec <unsigned char> position_tests;
}
/* Statistics about a matching routine. */
-struct stats
+class stats
{
+public:
stats ();
/* The total number of decisions in the routine, excluding trivial
st.longest_backtrack, st.longest_backtrack_code);
}
-struct merge_pattern_info;
+class merge_pattern_info;
/* Represents a transition from one pattern to another. */
-struct merge_pattern_transition
+class merge_pattern_transition
{
+public:
merge_pattern_transition (merge_pattern_info *);
/* The target pattern. */
/* Represents a pattern that can might match several states. The pattern
may replace parts of the test with a parameter value. It may also
replace transition labels with parameters. */
-struct merge_pattern_info
+class merge_pattern_info
{
+public:
merge_pattern_info (unsigned int);
/* If PARAM_TEST_P, the state's singleton test should be generalized
/* Describes one way of matching a particular state to a particular
pattern. */
-struct merge_state_result
+class merge_state_result
{
+public:
merge_state_result (merge_pattern_info *, position *, merge_state_result *);
/* A pattern that matches the state. */
/* Information about a state, used while trying to match it against
a pattern. */
-struct merge_state_info
+class merge_state_info
{
+public:
merge_state_info (state *);
/* The state itself. */
/* Pairs a pattern that needs to be matched with the rtx position at
which the pattern should occur. */
-struct pattern_pos {
+class pattern_pos {
+public:
pattern_pos () {}
pattern_pos (rtx, position *);
/* Information used while writing out code. */
-struct output_state
+class output_state
{
+public:
/* The type of routine that we're generating. */
routine_type type;
for (i = XVECLEN (pattern, 0); i > 0; i--)
{
rtx x = XVECEXP (pattern, 0, i - 1);
- if ((GET_CODE (x) != CLOBBER && GET_CODE (x) != CLOBBER_HIGH)
+ if (GET_CODE (x) != CLOBBER
|| (!REG_P (XEXP (x, 0))
&& GET_CODE (XEXP (x, 0)) != MATCH_SCRATCH))
break;