Commit 16610927 by Andreas Jaeger

genattrtab.c (copy_rtx_unchanging): Remove #if 0'ed code.

        * genattrtab.c (copy_rtx_unchanging): Remove #if 0'ed code.
        Remove #if 0'ed function simplify_by_alternatives.
        (optimize_attrs): Remove #if 0'ed code.
        Remove ^L.
        Use ISO C90 prototypes.
        (make_canonical): Remove #if 0'ed code.
        (convert_const_symbol_ref): Remove #if 0'ed function.

From-SVN: r67298
parent 3d7aafde
/* Generate code from machine description to compute values of attributes. /* Generate code from machine description to compute values of attributes.
Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2002 Free Software Foundation, Inc. 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu) Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
This file is part of GCC. This file is part of GCC.
...@@ -370,103 +370,97 @@ int optimize = 0; ...@@ -370,103 +370,97 @@ int optimize = 0;
rtx global_rtl[GR_MAX]; rtx global_rtl[GR_MAX];
rtx pic_offset_table_rtx; rtx pic_offset_table_rtx;
static void attr_hash_add_rtx PARAMS ((int, rtx)); static void attr_hash_add_rtx (int, rtx);
static void attr_hash_add_string PARAMS ((int, char *)); static void attr_hash_add_string (int, char *);
static rtx attr_rtx PARAMS ((enum rtx_code, ...)); static rtx attr_rtx (enum rtx_code, ...);
static rtx attr_rtx_1 PARAMS ((enum rtx_code, va_list)); static rtx attr_rtx_1 (enum rtx_code, va_list);
static char *attr_string PARAMS ((const char *, int)); static char *attr_string (const char *, int);
static rtx check_attr_value PARAMS ((rtx, struct attr_desc *)); static rtx check_attr_value (rtx, struct attr_desc *);
static rtx convert_set_attr_alternative PARAMS ((rtx, struct insn_def *)); static rtx convert_set_attr_alternative (rtx, struct insn_def *);
static rtx convert_set_attr PARAMS ((rtx, struct insn_def *)); static rtx convert_set_attr (rtx, struct insn_def *);
static void check_defs PARAMS ((void)); static void check_defs (void);
#if 0 static rtx make_canonical (struct attr_desc *, rtx);
static rtx convert_const_symbol_ref PARAMS ((rtx, struct attr_desc *)); static struct attr_value *get_attr_value (rtx, struct attr_desc *, int);
#endif static rtx copy_rtx_unchanging (rtx);
static rtx make_canonical PARAMS ((struct attr_desc *, rtx)); static rtx copy_boolean (rtx);
static struct attr_value *get_attr_value PARAMS ((rtx, struct attr_desc *, int)); static void expand_delays (void);
static rtx copy_rtx_unchanging PARAMS ((rtx)); static rtx operate_exp (enum operator, rtx, rtx);
static rtx copy_boolean PARAMS ((rtx)); static void expand_units (void);
static void expand_delays PARAMS ((void)); static rtx simplify_knowing (rtx, rtx);
static rtx operate_exp PARAMS ((enum operator, rtx, rtx)); static rtx encode_units_mask (rtx);
static void expand_units PARAMS ((void)); static void fill_attr (struct attr_desc *);
static rtx simplify_knowing PARAMS ((rtx, rtx)); static rtx substitute_address (rtx, rtx (*) (rtx), rtx (*) (rtx));
static rtx encode_units_mask PARAMS ((rtx)); static void make_length_attrs (void);
static void fill_attr PARAMS ((struct attr_desc *)); static rtx identity_fn (rtx);
static rtx substitute_address PARAMS ((rtx, rtx (*) (rtx), rtx (*) (rtx))); static rtx zero_fn (rtx);
static void make_length_attrs PARAMS ((void)); static rtx one_fn (rtx);
static rtx identity_fn PARAMS ((rtx)); static rtx max_fn (rtx);
static rtx zero_fn PARAMS ((rtx)); static void write_length_unit_log (void);
static rtx one_fn PARAMS ((rtx)); static rtx simplify_cond (rtx, int, int);
static rtx max_fn PARAMS ((rtx)); static rtx simplify_by_exploding (rtx);
static void write_length_unit_log PARAMS ((void)); static int find_and_mark_used_attributes (rtx, rtx *, int *);
static rtx simplify_cond PARAMS ((rtx, int, int)); static void unmark_used_attributes (rtx, struct dimension *, int);
#if 0 static int add_values_to_cover (struct dimension *);
static rtx simplify_by_alternatives PARAMS ((rtx, int, int)); static int increment_current_value (struct dimension *, int);
#endif static rtx test_for_current_value (struct dimension *, int);
static rtx simplify_by_exploding PARAMS ((rtx)); static rtx simplify_with_current_value (rtx, struct dimension *, int);
static int find_and_mark_used_attributes PARAMS ((rtx, rtx *, int *)); static rtx simplify_with_current_value_aux (rtx);
static void unmark_used_attributes PARAMS ((rtx, struct dimension *, int)); static void clear_struct_flag (rtx);
static int add_values_to_cover PARAMS ((struct dimension *)); static int count_sub_rtxs (rtx, int);
static int increment_current_value PARAMS ((struct dimension *, int)); static void remove_insn_ent (struct attr_value *, struct insn_ent *);
static rtx test_for_current_value PARAMS ((struct dimension *, int)); static void insert_insn_ent (struct attr_value *, struct insn_ent *);
static rtx simplify_with_current_value PARAMS ((rtx, struct dimension *, int)); static rtx insert_right_side (enum rtx_code, rtx, rtx, int, int);
static rtx simplify_with_current_value_aux PARAMS ((rtx)); static rtx make_alternative_compare (int);
static void clear_struct_flag PARAMS ((rtx)); static int compute_alternative_mask (rtx, enum rtx_code);
static int count_sub_rtxs PARAMS ((rtx, int)); static rtx evaluate_eq_attr (rtx, rtx, int, int);
static void remove_insn_ent PARAMS ((struct attr_value *, struct insn_ent *)); static rtx simplify_and_tree (rtx, rtx *, int, int);
static void insert_insn_ent PARAMS ((struct attr_value *, struct insn_ent *)); static rtx simplify_or_tree (rtx, rtx *, int, int);
static rtx insert_right_side PARAMS ((enum rtx_code, rtx, rtx, int, int)); static rtx simplify_test_exp (rtx, int, int);
static rtx make_alternative_compare PARAMS ((int)); static rtx simplify_test_exp_in_temp (rtx, int, int);
static int compute_alternative_mask PARAMS ((rtx, enum rtx_code)); static void optimize_attrs (void);
static rtx evaluate_eq_attr PARAMS ((rtx, rtx, int, int)); static void gen_attr (rtx, int);
static rtx simplify_and_tree PARAMS ((rtx, rtx *, int, int)); static int count_alternatives (rtx);
static rtx simplify_or_tree PARAMS ((rtx, rtx *, int, int)); static int compares_alternatives_p (rtx);
static rtx simplify_test_exp PARAMS ((rtx, int, int)); static int contained_in_p (rtx, rtx);
static rtx simplify_test_exp_in_temp PARAMS ((rtx, int, int)); static void gen_insn (rtx, int);
static void optimize_attrs PARAMS ((void)); static void gen_delay (rtx, int);
static void gen_attr PARAMS ((rtx, int)); static void gen_unit (rtx, int);
static int count_alternatives PARAMS ((rtx)); static void write_test_expr (rtx, int);
static int compares_alternatives_p PARAMS ((rtx)); static int max_attr_value (rtx, int*);
static int contained_in_p PARAMS ((rtx, rtx)); static int or_attr_value (rtx, int*);
static void gen_insn PARAMS ((rtx, int)); static void walk_attr_value (rtx);
static void gen_delay PARAMS ((rtx, int)); static void write_attr_get (struct attr_desc *);
static void gen_unit PARAMS ((rtx, int)); static rtx eliminate_known_true (rtx, rtx, int, int);
static void write_test_expr PARAMS ((rtx, int)); static void write_attr_set (struct attr_desc *, int, rtx,
static int max_attr_value PARAMS ((rtx, int*)); const char *, const char *, rtx,
static int or_attr_value PARAMS ((rtx, int*)); int, int);
static void walk_attr_value PARAMS ((rtx)); static void write_attr_case (struct attr_desc *, struct attr_value *,
static void write_attr_get PARAMS ((struct attr_desc *)); int, const char *, const char *, int, rtx);
static rtx eliminate_known_true PARAMS ((rtx, rtx, int, int)); static void write_unit_name (const char *, int, const char *);
static void write_attr_set PARAMS ((struct attr_desc *, int, rtx, static void write_attr_valueq (struct attr_desc *, const char *);
const char *, const char *, rtx, static void write_attr_value (struct attr_desc *, rtx);
int, int)); static void write_upcase (const char *);
static void write_attr_case PARAMS ((struct attr_desc *, struct attr_value *, static void write_indent (int);
int, const char *, const char *, int, rtx)); static void write_eligible_delay (const char *);
static void write_unit_name PARAMS ((const char *, int, const char *)); static void write_function_unit_info (void);
static void write_attr_valueq PARAMS ((struct attr_desc *, const char *)); static void write_complex_function (struct function_unit *, const char *,
static void write_attr_value PARAMS ((struct attr_desc *, rtx)); const char *);
static void write_upcase PARAMS ((const char *)); static int write_expr_attr_cache (rtx, struct attr_desc *);
static void write_indent PARAMS ((int)); static void write_toplevel_expr (rtx);
static void write_eligible_delay PARAMS ((const char *)); static void write_const_num_delay_slots (void);
static void write_function_unit_info PARAMS ((void)); static char *next_comma_elt (const char **);
static void write_complex_function PARAMS ((struct function_unit *, const char *, static struct attr_desc *find_attr (const char *, int);
const char *)); static struct attr_value *find_most_used (struct attr_desc *);
static int write_expr_attr_cache PARAMS ((rtx, struct attr_desc *)); static rtx find_single_value (struct attr_desc *);
static void write_toplevel_expr PARAMS ((rtx)); static void extend_range (struct range *, int, int);
static void write_const_num_delay_slots PARAMS ((void)); static rtx attr_eq (const char *, const char *);
static char *next_comma_elt PARAMS ((const char **)); static const char *attr_numeral (int);
static struct attr_desc *find_attr PARAMS ((const char *, int)); static int attr_equal_p (rtx, rtx);
static struct attr_value *find_most_used PARAMS ((struct attr_desc *)); static rtx attr_copy_rtx (rtx);
static rtx find_single_value PARAMS ((struct attr_desc *)); static int attr_rtx_cost (rtx);
static void extend_range PARAMS ((struct range *, int, int));
static rtx attr_eq PARAMS ((const char *, const char *));
static const char *attr_numeral PARAMS ((int));
static int attr_equal_p PARAMS ((rtx, rtx));
static rtx attr_copy_rtx PARAMS ((rtx));
static int attr_rtx_cost PARAMS ((rtx));
#define oballoc(size) obstack_alloc (hash_obstack, size) #define oballoc(size) obstack_alloc (hash_obstack, size)
/* Hash table for sharing RTL and strings. */ /* Hash table for sharing RTL and strings. */
/* Each hash table slot is a bucket containing a chain of these structures. /* Each hash table slot is a bucket containing a chain of these structures.
...@@ -501,9 +495,7 @@ struct attr_hash *attr_hash_table[RTL_HASH_SIZE]; ...@@ -501,9 +495,7 @@ struct attr_hash *attr_hash_table[RTL_HASH_SIZE];
/* Add an entry to the hash table for RTL with hash code HASHCODE. */ /* Add an entry to the hash table for RTL with hash code HASHCODE. */
static void static void
attr_hash_add_rtx (hashcode, rtl) attr_hash_add_rtx (int hashcode, rtx rtl)
int hashcode;
rtx rtl;
{ {
struct attr_hash *h; struct attr_hash *h;
...@@ -518,9 +510,7 @@ attr_hash_add_rtx (hashcode, rtl) ...@@ -518,9 +510,7 @@ attr_hash_add_rtx (hashcode, rtl)
/* Add an entry to the hash table for STRING with hash code HASHCODE. */ /* Add an entry to the hash table for STRING with hash code HASHCODE. */
static void static void
attr_hash_add_string (hashcode, str) attr_hash_add_string (int hashcode, char *str)
int hashcode;
char *str;
{ {
struct attr_hash *h; struct attr_hash *h;
...@@ -543,9 +533,7 @@ attr_hash_add_string (hashcode, str) ...@@ -543,9 +533,7 @@ attr_hash_add_string (hashcode, str)
rtx attr_rtx (code, [element1, ..., elementn]) */ rtx attr_rtx (code, [element1, ..., elementn]) */
static rtx static rtx
attr_rtx_1 (code, p) attr_rtx_1 (enum rtx_code code, va_list p)
enum rtx_code code;
va_list p;
{ {
rtx rt_val = NULL_RTX;/* RTX to return to caller... */ rtx rt_val = NULL_RTX;/* RTX to return to caller... */
int hashcode; int hashcode;
...@@ -723,7 +711,7 @@ attr_rtx (enum rtx_code code, ...) ...@@ -723,7 +711,7 @@ attr_rtx (enum rtx_code code, ...)
{ {
rtx result; rtx result;
va_list p; va_list p;
va_start (p, code); va_start (p, code);
result = attr_rtx_1 (code, p); result = attr_rtx_1 (code, p);
va_end (p); va_end (p);
...@@ -740,9 +728,9 @@ attr_printf (unsigned int len, const char *fmt, ...) ...@@ -740,9 +728,9 @@ attr_printf (unsigned int len, const char *fmt, ...)
{ {
char str[256]; char str[256];
va_list p; va_list p;
va_start (p, fmt); va_start (p, fmt);
if (len > sizeof str - 1) /* Leave room for \0. */ if (len > sizeof str - 1) /* Leave room for \0. */
abort (); abort ();
...@@ -753,16 +741,14 @@ attr_printf (unsigned int len, const char *fmt, ...) ...@@ -753,16 +741,14 @@ attr_printf (unsigned int len, const char *fmt, ...)
} }
static rtx static rtx
attr_eq (name, value) attr_eq (const char *name, const char *value)
const char *name, *value;
{ {
return attr_rtx (EQ_ATTR, attr_string (name, strlen (name)), return attr_rtx (EQ_ATTR, attr_string (name, strlen (name)),
attr_string (value, strlen (value))); attr_string (value, strlen (value)));
} }
static const char * static const char *
attr_numeral (n) attr_numeral (int n)
int n;
{ {
return XSTR (make_numeric_value (n), 0); return XSTR (make_numeric_value (n), 0);
} }
...@@ -771,9 +757,7 @@ attr_numeral (n) ...@@ -771,9 +757,7 @@ attr_numeral (n)
to be null terminated) with LEN bytes. */ to be null terminated) with LEN bytes. */
static char * static char *
attr_string (str, len) attr_string (const char *str, int len)
const char *str;
int len;
{ {
struct attr_hash *h; struct attr_hash *h;
int hashcode; int hashcode;
...@@ -807,20 +791,18 @@ attr_string (str, len) ...@@ -807,20 +791,18 @@ attr_string (str, len)
then they can't be equal unless they are the same object. */ then they can't be equal unless they are the same object. */
static int static int
attr_equal_p (x, y) attr_equal_p (rtx x, rtx y)
rtx x, y;
{ {
return (x == y || (! (ATTR_PERMANENT_P (x) && ATTR_PERMANENT_P (y)) return (x == y || (! (ATTR_PERMANENT_P (x) && ATTR_PERMANENT_P (y))
&& rtx_equal_p (x, y))); && rtx_equal_p (x, y)));
} }
/* Copy an attribute value expression, /* Copy an attribute value expression,
descending to all depths, but not copying any descending to all depths, but not copying any
permanent hashed subexpressions. */ permanent hashed subexpressions. */
static rtx static rtx
attr_copy_rtx (orig) attr_copy_rtx (rtx orig)
rtx orig;
{ {
rtx copy; rtx copy;
int i, j; int i, j;
...@@ -900,7 +882,7 @@ attr_copy_rtx (orig) ...@@ -900,7 +882,7 @@ attr_copy_rtx (orig)
} }
return copy; return copy;
} }
/* Given a test expression for an attribute, ensure it is validly formed. /* Given a test expression for an attribute, ensure it is validly formed.
IS_CONST indicates whether the expression is constant for each compiler IS_CONST indicates whether the expression is constant for each compiler
run (a constant expression may not test any particular insn). run (a constant expression may not test any particular insn).
...@@ -916,10 +898,7 @@ attr_copy_rtx (orig) ...@@ -916,10 +898,7 @@ attr_copy_rtx (orig)
Return the new expression, if any. */ Return the new expression, if any. */
rtx rtx
check_attr_test (exp, is_const, lineno) check_attr_test (rtx exp, int is_const, int lineno)
rtx exp;
int is_const;
int lineno;
{ {
struct attr_desc *attr; struct attr_desc *attr;
struct attr_value *av; struct attr_value *av;
...@@ -1057,7 +1036,7 @@ check_attr_test (exp, is_const, lineno) ...@@ -1057,7 +1036,7 @@ check_attr_test (exp, is_const, lineno)
return exp; return exp;
} }
/* Given an expression, ensure that it is validly formed and that all named /* Given an expression, ensure that it is validly formed and that all named
attribute values are valid for the given attribute. Issue a fatal error attribute values are valid for the given attribute. Issue a fatal error
if not. If no attribute is specified, assume a numeric attribute. if not. If no attribute is specified, assume a numeric attribute.
...@@ -1065,9 +1044,7 @@ check_attr_test (exp, is_const, lineno) ...@@ -1065,9 +1044,7 @@ check_attr_test (exp, is_const, lineno)
Return a perhaps modified replacement expression for the value. */ Return a perhaps modified replacement expression for the value. */
static rtx static rtx
check_attr_value (exp, attr) check_attr_value (rtx exp, struct attr_desc *attr)
rtx exp;
struct attr_desc *attr;
{ {
struct attr_value *av; struct attr_value *av;
const char *p; const char *p;
...@@ -1233,14 +1210,12 @@ check_attr_value (exp, attr) ...@@ -1233,14 +1210,12 @@ check_attr_value (exp, attr)
return exp; return exp;
} }
/* Given an SET_ATTR_ALTERNATIVE expression, convert to the canonical SET. /* Given an SET_ATTR_ALTERNATIVE expression, convert to the canonical SET.
It becomes a COND with each test being (eq_attr "alternative "n") */ It becomes a COND with each test being (eq_attr "alternative "n") */
static rtx static rtx
convert_set_attr_alternative (exp, id) convert_set_attr_alternative (rtx exp, struct insn_def *id)
rtx exp;
struct insn_def *id;
{ {
int num_alt = id->num_alternatives; int num_alt = id->num_alternatives;
rtx condexp; rtx condexp;
...@@ -1272,14 +1247,12 @@ convert_set_attr_alternative (exp, id) ...@@ -1272,14 +1247,12 @@ convert_set_attr_alternative (exp, id)
return attr_rtx (SET, attr_rtx (ATTR, XSTR (exp, 0)), condexp); return attr_rtx (SET, attr_rtx (ATTR, XSTR (exp, 0)), condexp);
} }
/* Given a SET_ATTR, convert to the appropriate SET. If a comma-separated /* Given a SET_ATTR, convert to the appropriate SET. If a comma-separated
list of values is given, convert to SET_ATTR_ALTERNATIVE first. */ list of values is given, convert to SET_ATTR_ALTERNATIVE first. */
static rtx static rtx
convert_set_attr (exp, id) convert_set_attr (rtx exp, struct insn_def *id)
rtx exp;
struct insn_def *id;
{ {
rtx newexp; rtx newexp;
const char *name_ptr; const char *name_ptr;
...@@ -1305,13 +1278,13 @@ convert_set_attr (exp, id) ...@@ -1305,13 +1278,13 @@ convert_set_attr (exp, id)
return convert_set_attr_alternative (newexp, id); return convert_set_attr_alternative (newexp, id);
} }
/* Scan all definitions, checking for validity. Also, convert any SET_ATTR /* Scan all definitions, checking for validity. Also, convert any SET_ATTR
and SET_ATTR_ALTERNATIVE expressions to the corresponding SET and SET_ATTR_ALTERNATIVE expressions to the corresponding SET
expressions. */ expressions. */
static void static void
check_defs () check_defs (void)
{ {
struct insn_def *id; struct insn_def *id;
struct attr_desc *attr; struct attr_desc *attr;
...@@ -1367,68 +1340,14 @@ check_defs () ...@@ -1367,68 +1340,14 @@ check_defs ()
} }
} }
} }
#if 0
/* Given a constant SYMBOL_REF expression, convert to a COND that
explicitly tests each enumerated value. */
static rtx
convert_const_symbol_ref (exp, attr)
rtx exp;
struct attr_desc *attr;
{
rtx condexp;
struct attr_value *av;
int i;
int num_alt = 0;
for (av = attr->first_value; av; av = av->next)
num_alt++;
/* Make a COND with all tests but the last, and in the original order.
Select the last value via the default. Note that the attr values
are constructed in reverse order. */
condexp = rtx_alloc (COND);
XVEC (condexp, 0) = rtvec_alloc ((num_alt - 1) * 2);
av = attr->first_value;
XEXP (condexp, 1) = av->value;
for (i = num_alt - 2; av = av->next, i >= 0; i--)
{
char *p, *string;
rtx value;
string = p = (char *) oballoc (2
+ strlen (attr->name)
+ strlen (XSTR (av->value, 0)));
strcpy (p, attr->name);
strcat (p, "_");
strcat (p, XSTR (av->value, 0));
for (; *p != '\0'; p++)
*p = TOUPPER (*p);
value = attr_rtx (SYMBOL_REF, string);
ATTR_IND_SIMPLIFIED_P (value) = 1;
XVECEXP (condexp, 0, 2 * i) = attr_rtx (EQ, exp, value);
XVECEXP (condexp, 0, 2 * i + 1) = av->value;
}
return condexp;
}
#endif
/* Given a valid expression for an attribute value, remove any IF_THEN_ELSE /* Given a valid expression for an attribute value, remove any IF_THEN_ELSE
expressions by converting them into a COND. This removes cases from this expressions by converting them into a COND. This removes cases from this
program. Also, replace an attribute value of "*" with the default attribute program. Also, replace an attribute value of "*" with the default attribute
value. */ value. */
static rtx static rtx
make_canonical (attr, exp) make_canonical (struct attr_desc *attr, rtx exp)
struct attr_desc *attr;
rtx exp;
{ {
int i; int i;
rtx newexp; rtx newexp;
...@@ -1456,21 +1375,8 @@ make_canonical (attr, exp) ...@@ -1456,21 +1375,8 @@ make_canonical (attr, exp)
This makes the COND something that won't be considered an arbitrary This makes the COND something that won't be considered an arbitrary
expression by walk_attr_value. */ expression by walk_attr_value. */
ATTR_IND_SIMPLIFIED_P (exp) = 1; ATTR_IND_SIMPLIFIED_P (exp) = 1;
#if 0
/* ??? Why do we do this? With attribute values { A B C D E }, this
tends to generate (!(x==A) && !(x==B) && !(x==C) && !(x==D)) rather
than (x==E). */
exp = convert_const_symbol_ref (exp, attr);
ATTR_IND_SIMPLIFIED_P (exp) = 1;
exp = check_attr_value (exp, attr);
/* Goto COND case since this is now a COND. Note that while the
new expression is rescanned, all symbol_ref notes are marked as
unchanging. */
goto cond;
#else
exp = check_attr_value (exp, attr); exp = check_attr_value (exp, attr);
break; break;
#endif
case IF_THEN_ELSE: case IF_THEN_ELSE:
newexp = rtx_alloc (COND); newexp = rtx_alloc (COND);
...@@ -1514,15 +1420,14 @@ make_canonical (attr, exp) ...@@ -1514,15 +1420,14 @@ make_canonical (attr, exp)
} }
static rtx static rtx
copy_boolean (exp) copy_boolean (rtx exp)
rtx exp;
{ {
if (GET_CODE (exp) == AND || GET_CODE (exp) == IOR) if (GET_CODE (exp) == AND || GET_CODE (exp) == IOR)
return attr_rtx (GET_CODE (exp), copy_boolean (XEXP (exp, 0)), return attr_rtx (GET_CODE (exp), copy_boolean (XEXP (exp, 0)),
copy_boolean (XEXP (exp, 1))); copy_boolean (XEXP (exp, 1)));
return exp; return exp;
} }
/* Given a value and an attribute description, return a `struct attr_value *' /* Given a value and an attribute description, return a `struct attr_value *'
that represents that value. This is either an existing structure, if the that represents that value. This is either an existing structure, if the
value has been previously encountered, or a newly-created structure. value has been previously encountered, or a newly-created structure.
...@@ -1533,10 +1438,7 @@ copy_boolean (exp) ...@@ -1533,10 +1438,7 @@ copy_boolean (exp)
alternatives. */ alternatives. */
static struct attr_value * static struct attr_value *
get_attr_value (value, attr, insn_code) get_attr_value (rtx value, struct attr_desc *attr, int insn_code)
rtx value;
struct attr_desc *attr;
int insn_code;
{ {
struct attr_value *av; struct attr_value *av;
int num_alt = 0; int num_alt = 0;
...@@ -1566,7 +1468,7 @@ get_attr_value (value, attr, insn_code) ...@@ -1566,7 +1468,7 @@ get_attr_value (value, attr, insn_code)
return av; return av;
} }
/* After all DEFINE_DELAYs have been read in, create internal attributes /* After all DEFINE_DELAYs have been read in, create internal attributes
to generate the required routines. to generate the required routines.
...@@ -1582,7 +1484,7 @@ get_attr_value (value, attr, insn_code) ...@@ -1582,7 +1484,7 @@ get_attr_value (value, attr, insn_code)
information needed to handle delay slots. */ information needed to handle delay slots. */
static void static void
expand_delays () expand_delays (void)
{ {
struct delay_desc *delay; struct delay_desc *delay;
rtx condexp; rtx condexp;
...@@ -1664,7 +1566,7 @@ expand_delays () ...@@ -1664,7 +1566,7 @@ expand_delays ()
} }
} }
} }
/* This function is given a left and right side expression and an operator. /* This function is given a left and right side expression and an operator.
Each side is a conditional expression, each alternative of which has a Each side is a conditional expression, each alternative of which has a
numerical value. The function returns another conditional expression numerical value. The function returns another conditional expression
...@@ -1674,9 +1576,7 @@ expand_delays () ...@@ -1674,9 +1576,7 @@ expand_delays ()
Since this is called early, it must also support IF_THEN_ELSE. */ Since this is called early, it must also support IF_THEN_ELSE. */
static rtx static rtx
operate_exp (op, left, right) operate_exp (enum operator op, rtx left, rtx right)
enum operator op;
rtx left, right;
{ {
int left_value, right_value; int left_value, right_value;
rtx newexp; rtx newexp;
...@@ -1836,7 +1736,7 @@ operate_exp (op, left, right) ...@@ -1836,7 +1736,7 @@ operate_exp (op, left, right)
/* NOTREACHED */ /* NOTREACHED */
return NULL; return NULL;
} }
/* Once all attributes and DEFINE_FUNCTION_UNITs have been read, we /* Once all attributes and DEFINE_FUNCTION_UNITs have been read, we
construct a number of attributes. construct a number of attributes.
...@@ -1870,7 +1770,7 @@ operate_exp (op, left, right) ...@@ -1870,7 +1770,7 @@ operate_exp (op, left, right)
half gives the maximum value. */ half gives the maximum value. */
static void static void
expand_units () expand_units (void)
{ {
struct function_unit *unit, **unit_num; struct function_unit *unit, **unit_num;
struct function_unit_op *op, **op_array, ***unit_ops; struct function_unit_op *op, **op_array, ***unit_ops;
...@@ -2231,8 +2131,7 @@ expand_units () ...@@ -2231,8 +2131,7 @@ expand_units ()
/* Simplify EXP given KNOWN_TRUE. */ /* Simplify EXP given KNOWN_TRUE. */
static rtx static rtx
simplify_knowing (exp, known_true) simplify_knowing (rtx exp, rtx known_true)
rtx exp, known_true;
{ {
if (GET_CODE (exp) != CONST_STRING) if (GET_CODE (exp) != CONST_STRING)
{ {
...@@ -2254,8 +2153,7 @@ simplify_knowing (exp, known_true) ...@@ -2254,8 +2153,7 @@ simplify_knowing (exp, known_true)
and only one unit is used or the one's complement of the bitmask. */ and only one unit is used or the one's complement of the bitmask. */
static rtx static rtx
encode_units_mask (x) encode_units_mask (rtx x)
rtx x;
{ {
int i; int i;
int j; int j;
...@@ -2316,14 +2214,13 @@ encode_units_mask (x) ...@@ -2316,14 +2214,13 @@ encode_units_mask (x)
} }
return x; return x;
} }
/* Once all attributes and insns have been read and checked, we construct for /* Once all attributes and insns have been read and checked, we construct for
each attribute value a list of all the insns that have that value for each attribute value a list of all the insns that have that value for
the attribute. */ the attribute. */
static void static void
fill_attr (attr) fill_attr (struct attr_desc *attr)
struct attr_desc *attr;
{ {
struct attr_value *av; struct attr_value *av;
struct insn_ent *ie; struct insn_ent *ie;
...@@ -2358,7 +2255,7 @@ fill_attr (attr) ...@@ -2358,7 +2255,7 @@ fill_attr (attr)
insert_insn_ent (av, ie); insert_insn_ent (av, ie);
} }
} }
/* Given an expression EXP, see if it is a COND or IF_THEN_ELSE that has a /* Given an expression EXP, see if it is a COND or IF_THEN_ELSE that has a
test that checks relative positions of insns (uses MATCH_DUP or PC). test that checks relative positions of insns (uses MATCH_DUP or PC).
If so, replace it with what is obtained by passing the expression to If so, replace it with what is obtained by passing the expression to
...@@ -2367,10 +2264,8 @@ fill_attr (attr) ...@@ -2367,10 +2264,8 @@ fill_attr (attr)
return the value returned by NO_ADDRESS_FN applied to EXP. */ return the value returned by NO_ADDRESS_FN applied to EXP. */
static rtx static rtx
substitute_address (exp, no_address_fn, address_fn) substitute_address (rtx exp, rtx (*no_address_fn) (rtx),
rtx exp; rtx (*address_fn) (rtx))
rtx (*no_address_fn) PARAMS ((rtx));
rtx (*address_fn) PARAMS ((rtx));
{ {
int i; int i;
rtx newexp; rtx newexp;
...@@ -2420,7 +2315,7 @@ substitute_address (exp, no_address_fn, address_fn) ...@@ -2420,7 +2315,7 @@ substitute_address (exp, no_address_fn, address_fn)
return (*no_address_fn) (exp); return (*no_address_fn) (exp);
} }
/* Make new attributes from the `length' attribute. The following are made, /* Make new attributes from the `length' attribute. The following are made,
each corresponding to a function called from `shorten_branches' or each corresponding to a function called from `shorten_branches' or
`get_attr_length': `get_attr_length':
...@@ -2441,13 +2336,13 @@ substitute_address (exp, no_address_fn, address_fn) ...@@ -2441,13 +2336,13 @@ substitute_address (exp, no_address_fn, address_fn)
*/ */
static void static void
make_length_attrs () make_length_attrs (void)
{ {
static const char *const new_names[] = {"*insn_default_length", static const char *const new_names[] = {"*insn_default_length",
"*insn_variable_length_p", "*insn_variable_length_p",
"*insn_current_length"}; "*insn_current_length"};
static rtx (*const no_address_fn[]) PARAMS ((rtx)) = {identity_fn, zero_fn, zero_fn}; static rtx (*const no_address_fn[]) (rtx) = {identity_fn, zero_fn, zero_fn};
static rtx (*const address_fn[]) PARAMS ((rtx)) = {max_fn, one_fn, identity_fn}; static rtx (*const address_fn[]) (rtx) = {max_fn, one_fn, identity_fn};
size_t i; size_t i;
struct attr_desc *length_attr, *new_attr; struct attr_desc *length_attr, *new_attr;
struct attr_value *av, *new_av; struct attr_value *av, *new_av;
...@@ -2491,36 +2386,32 @@ make_length_attrs () ...@@ -2491,36 +2386,32 @@ make_length_attrs ()
/* Utility functions called from above routine. */ /* Utility functions called from above routine. */
static rtx static rtx
identity_fn (exp) identity_fn (rtx exp)
rtx exp;
{ {
return exp; return exp;
} }
static rtx static rtx
zero_fn (exp) zero_fn (rtx exp ATTRIBUTE_UNUSED)
rtx exp ATTRIBUTE_UNUSED;
{ {
return make_numeric_value (0); return make_numeric_value (0);
} }
static rtx static rtx
one_fn (exp) one_fn (rtx exp ATTRIBUTE_UNUSED)
rtx exp ATTRIBUTE_UNUSED;
{ {
return make_numeric_value (1); return make_numeric_value (1);
} }
static rtx static rtx
max_fn (exp) max_fn (rtx exp)
rtx exp;
{ {
int unknown; int unknown;
return make_numeric_value (max_attr_value (exp, &unknown)); return make_numeric_value (max_attr_value (exp, &unknown));
} }
static void static void
write_length_unit_log () write_length_unit_log (void)
{ {
struct attr_desc *length_attr = find_attr ("length", 0); struct attr_desc *length_attr = find_attr ("length", 0);
struct attr_value *av; struct attr_value *av;
...@@ -2545,7 +2436,7 @@ write_length_unit_log () ...@@ -2545,7 +2436,7 @@ write_length_unit_log ()
} }
printf ("int length_unit_log = %u;\n", length_unit_log); printf ("int length_unit_log = %u;\n", length_unit_log);
} }
/* Take a COND expression and see if any of the conditions in it can be /* Take a COND expression and see if any of the conditions in it can be
simplified. If any are known true or known false for the particular insn simplified. If any are known true or known false for the particular insn
code, the COND can be further simplified. code, the COND can be further simplified.
...@@ -2555,9 +2446,7 @@ write_length_unit_log () ...@@ -2555,9 +2446,7 @@ write_length_unit_log ()
We do not modify EXP; rather, we make and return a new rtx. */ We do not modify EXP; rather, we make and return a new rtx. */
static rtx static rtx
simplify_cond (exp, insn_code, insn_index) simplify_cond (rtx exp, int insn_code, int insn_index)
rtx exp;
int insn_code, insn_index;
{ {
int i, j; int i, j;
/* We store the desired contents here, /* We store the desired contents here,
...@@ -2668,13 +2557,11 @@ simplify_cond (exp, insn_code, insn_index) ...@@ -2668,13 +2557,11 @@ simplify_cond (exp, insn_code, insn_index)
free (tests); free (tests);
return ret; return ret;
} }
/* Remove an insn entry from an attribute value. */ /* Remove an insn entry from an attribute value. */
static void static void
remove_insn_ent (av, ie) remove_insn_ent (struct attr_value *av, struct insn_ent *ie)
struct attr_value *av;
struct insn_ent *ie;
{ {
struct insn_ent *previe; struct insn_ent *previe;
...@@ -2697,9 +2584,7 @@ remove_insn_ent (av, ie) ...@@ -2697,9 +2584,7 @@ remove_insn_ent (av, ie)
/* Insert an insn entry in an attribute value list. */ /* Insert an insn entry in an attribute value list. */
static void static void
insert_insn_ent (av, ie) insert_insn_ent (struct attr_value *av, struct insn_ent *ie)
struct attr_value *av;
struct insn_ent *ie;
{ {
ie->next = av->first_insn; ie->next = av->first_insn;
av->first_insn = ie; av->first_insn = ie;
...@@ -2709,7 +2594,7 @@ insert_insn_ent (av, ie) ...@@ -2709,7 +2594,7 @@ insert_insn_ent (av, ie)
num_insn_ents++; num_insn_ents++;
} }
/* This is a utility routine to take an expression that is a tree of either /* This is a utility routine to take an expression that is a tree of either
AND or IOR expressions and insert a new term. The new term will be AND or IOR expressions and insert a new term. The new term will be
inserted at the right side of the first node whose code does not match inserted at the right side of the first node whose code does not match
...@@ -2720,11 +2605,7 @@ insert_insn_ent (av, ie) ...@@ -2720,11 +2605,7 @@ insert_insn_ent (av, ie)
If the `term' is itself a tree, all its leaves will be inserted. */ If the `term' is itself a tree, all its leaves will be inserted. */
static rtx static rtx
insert_right_side (code, exp, term, insn_code, insn_index) insert_right_side (enum rtx_code code, rtx exp, rtx term, int insn_code, int insn_index)
enum rtx_code code;
rtx exp;
rtx term;
int insn_code, insn_index;
{ {
rtx newexp; rtx newexp;
...@@ -2776,7 +2657,7 @@ insert_right_side (code, exp, term, insn_code, insn_index) ...@@ -2776,7 +2657,7 @@ insert_right_side (code, exp, term, insn_code, insn_index)
return simplify_test_exp_in_temp (newexp, insn_code, insn_index); return simplify_test_exp_in_temp (newexp, insn_code, insn_index);
} }
/* If we have an expression which AND's a bunch of /* If we have an expression which AND's a bunch of
(not (eq_attrq "alternative" "n")) (not (eq_attrq "alternative" "n"))
terms, we may have covered all or all but one of the possible alternatives. terms, we may have covered all or all but one of the possible alternatives.
...@@ -2786,9 +2667,7 @@ insert_right_side (code, exp, term, insn_code, insn_index) ...@@ -2786,9 +2667,7 @@ insert_right_side (code, exp, term, insn_code, insn_index)
bitmask indicating which alternatives are mentioned within EXP. */ bitmask indicating which alternatives are mentioned within EXP. */
static int static int
compute_alternative_mask (exp, code) compute_alternative_mask (rtx exp, enum rtx_code code)
rtx exp;
enum rtx_code code;
{ {
const char *string; const char *string;
if (GET_CODE (exp) == code) if (GET_CODE (exp) == code)
...@@ -2816,8 +2695,7 @@ compute_alternative_mask (exp, code) ...@@ -2816,8 +2695,7 @@ compute_alternative_mask (exp, code)
attribute with the value represented by that bit. */ attribute with the value represented by that bit. */
static rtx static rtx
make_alternative_compare (mask) make_alternative_compare (int mask)
int mask;
{ {
rtx newexp; rtx newexp;
int i; int i;
...@@ -2831,7 +2709,7 @@ make_alternative_compare (mask) ...@@ -2831,7 +2709,7 @@ make_alternative_compare (mask)
return newexp; return newexp;
} }
/* If we are processing an (eq_attr "attr" "value") test, we find the value /* If we are processing an (eq_attr "attr" "value") test, we find the value
of "attr" for this insn code. From that value, we can compute a test of "attr" for this insn code. From that value, we can compute a test
showing when the EQ_ATTR will be true. This routine performs that showing when the EQ_ATTR will be true. This routine performs that
...@@ -2842,10 +2720,7 @@ make_alternative_compare (mask) ...@@ -2842,10 +2720,7 @@ make_alternative_compare (mask)
for the insn corresponding to INSN_CODE and INSN_INDEX. */ for the insn corresponding to INSN_CODE and INSN_INDEX. */
static rtx static rtx
evaluate_eq_attr (exp, value, insn_code, insn_index) evaluate_eq_attr (rtx exp, rtx value, int insn_code, int insn_index)
rtx exp;
rtx value;
int insn_code, insn_index;
{ {
rtx orexp, andexp; rtx orexp, andexp;
rtx right; rtx right;
...@@ -2950,7 +2825,7 @@ evaluate_eq_attr (exp, value, insn_code, insn_index) ...@@ -2950,7 +2825,7 @@ evaluate_eq_attr (exp, value, insn_code, insn_index)
else else
return newexp; return newexp;
} }
/* This routine is called when an AND of a term with a tree of AND's is /* This routine is called when an AND of a term with a tree of AND's is
encountered. If the term or its complement is present in the tree, it encountered. If the term or its complement is present in the tree, it
can be replaced with TRUE or FALSE, respectively. can be replaced with TRUE or FALSE, respectively.
...@@ -2966,10 +2841,7 @@ evaluate_eq_attr (exp, value, insn_code, insn_index) ...@@ -2966,10 +2841,7 @@ evaluate_eq_attr (exp, value, insn_code, insn_index)
the term. */ the term. */
static rtx static rtx
simplify_and_tree (exp, pterm, insn_code, insn_index) simplify_and_tree (rtx exp, rtx *pterm, int insn_code, int insn_index)
rtx exp;
rtx *pterm;
int insn_code, insn_index;
{ {
rtx left, right; rtx left, right;
rtx newexp; rtx newexp;
...@@ -3081,14 +2953,11 @@ simplify_and_tree (exp, pterm, insn_code, insn_index) ...@@ -3081,14 +2953,11 @@ simplify_and_tree (exp, pterm, insn_code, insn_index)
return exp; return exp;
} }
/* Similar to `simplify_and_tree', but for IOR trees. */ /* Similar to `simplify_and_tree', but for IOR trees. */
static rtx static rtx
simplify_or_tree (exp, pterm, insn_code, insn_index) simplify_or_tree (rtx exp, rtx *pterm, int insn_code, int insn_index)
rtx exp;
rtx *pterm;
int insn_code, insn_index;
{ {
rtx left, right; rtx left, right;
rtx newexp; rtx newexp;
...@@ -3151,11 +3020,11 @@ simplify_or_tree (exp, pterm, insn_code, insn_index) ...@@ -3151,11 +3020,11 @@ simplify_or_tree (exp, pterm, insn_code, insn_index)
return exp; return exp;
} }
/* Compute approximate cost of the expression. Used to decide whether /* Compute approximate cost of the expression. Used to decide whether
expression is cheap enough for inline. */ expression is cheap enough for inline. */
static int static int
attr_rtx_cost (x) attr_rtx_cost (rtx x)
rtx x;
{ {
int cost = 0; int cost = 0;
enum rtx_code code; enum rtx_code code;
...@@ -3198,16 +3067,13 @@ attr_rtx_cost (x) ...@@ -3198,16 +3067,13 @@ attr_rtx_cost (x)
} }
return cost; return cost;
} }
/* Simplify test expression and use temporary obstack in order to avoid /* Simplify test expression and use temporary obstack in order to avoid
memory bloat. Use ATTR_IND_SIMPLIFIED to avoid unnecessary simplifications memory bloat. Use ATTR_IND_SIMPLIFIED to avoid unnecessary simplifications
and avoid unnecessary copying if possible. */ and avoid unnecessary copying if possible. */
static rtx static rtx
simplify_test_exp_in_temp (exp, insn_code, insn_index) simplify_test_exp_in_temp (rtx exp, int insn_code, int insn_index)
rtx exp;
int insn_code, insn_index;
{ {
rtx x; rtx x;
struct obstack *old; struct obstack *old;
...@@ -3232,9 +3098,7 @@ simplify_test_exp_in_temp (exp, insn_code, insn_index) ...@@ -3232,9 +3098,7 @@ simplify_test_exp_in_temp (exp, insn_code, insn_index)
it occurs here! */ it occurs here! */
static rtx static rtx
simplify_test_exp (exp, insn_code, insn_index) simplify_test_exp (rtx exp, int insn_code, int insn_index)
rtx exp;
int insn_code, insn_index;
{ {
rtx left, right; rtx left, right;
struct attr_desc *attr; struct attr_desc *attr;
...@@ -3499,13 +3363,13 @@ simplify_test_exp (exp, insn_code, insn_index) ...@@ -3499,13 +3363,13 @@ simplify_test_exp (exp, insn_code, insn_index)
return newexp; return newexp;
} }
/* Optimize the attribute lists by seeing if we can determine conditional /* Optimize the attribute lists by seeing if we can determine conditional
values from the known values of other attributes. This will save subroutine values from the known values of other attributes. This will save subroutine
calls during the compilation. */ calls during the compilation. */
static void static void
optimize_attrs () optimize_attrs (void)
{ {
struct attr_desc *attr; struct attr_desc *attr;
struct attr_value *av; struct attr_value *av;
...@@ -3578,13 +3442,6 @@ optimize_attrs () ...@@ -3578,13 +3442,6 @@ optimize_attrs ()
continue; continue;
rtl_obstack = temp_obstack; rtl_obstack = temp_obstack;
#if 0 /* This was intended as a speed up, but it was slower. */
if (insn_n_alternatives[ie->insn_code] > 6
&& count_sub_rtxs (av->value, 200) >= 200)
newexp = simplify_by_alternatives (av->value, ie->insn_code,
ie->insn_index);
else
#endif
newexp = av->value; newexp = av->value;
while (GET_CODE (newexp) == COND) while (GET_CODE (newexp) == COND)
{ {
...@@ -3611,46 +3468,12 @@ optimize_attrs () ...@@ -3611,46 +3468,12 @@ optimize_attrs ()
free (insn_code_values - 2); free (insn_code_values - 2);
} }
#if 0
static rtx
simplify_by_alternatives (exp, insn_code, insn_index)
rtx exp;
int insn_code, insn_index;
{
int i;
int len = insn_n_alternatives[insn_code];
rtx newexp = rtx_alloc (COND);
rtx ultimate;
XVEC (newexp, 0) = rtvec_alloc (len * 2);
/* It will not matter what value we use as the default value
of the new COND, since that default will never be used.
Choose something of the right type. */
for (ultimate = exp; GET_CODE (ultimate) == COND;)
ultimate = XEXP (ultimate, 1);
XEXP (newexp, 1) = ultimate;
for (i = 0; i < insn_n_alternatives[insn_code]; i++)
{
current_alternative_string = attr_numeral (i);
XVECEXP (newexp, 0, i * 2) = make_alternative_compare (1 << i);
XVECEXP (newexp, 0, i * 2 + 1)
= simplify_cond (exp, insn_code, insn_index);
}
current_alternative_string = 0;
return simplify_cond (newexp, insn_code, insn_index);
}
#endif
/* If EXP is a suitable expression, reorganize it by constructing an /* If EXP is a suitable expression, reorganize it by constructing an
equivalent expression that is a COND with the tests being all combinations equivalent expression that is a COND with the tests being all combinations
of attribute values and the values being simple constants. */ of attribute values and the values being simple constants. */
static rtx static rtx
simplify_by_exploding (exp) simplify_by_exploding (rtx exp)
rtx exp;
{ {
rtx list = 0, link, condexp, defval = NULL_RTX; rtx list = 0, link, condexp, defval = NULL_RTX;
struct dimension *space; struct dimension *space;
...@@ -3772,7 +3595,7 @@ simplify_by_exploding (exp) ...@@ -3772,7 +3595,7 @@ simplify_by_exploding (exp)
/* Give up if nothing is constant. */ /* Give up if nothing is constant. */
if (num_marks == 0) if (num_marks == 0)
ret = exp; ret = exp;
/* If all values are the default, use that. */ /* If all values are the default, use that. */
else if (total == most_tests) else if (total == most_tests)
ret = defval; ret = defval;
...@@ -3804,9 +3627,7 @@ simplify_by_exploding (exp) ...@@ -3804,9 +3627,7 @@ simplify_by_exploding (exp)
tests have known value. */ tests have known value. */
static int static int
find_and_mark_used_attributes (exp, terms, nterms) find_and_mark_used_attributes (rtx exp, rtx *terms, int *nterms)
rtx exp, *terms;
int *nterms;
{ {
int i; int i;
...@@ -3857,10 +3678,7 @@ find_and_mark_used_attributes (exp, terms, nterms) ...@@ -3857,10 +3678,7 @@ find_and_mark_used_attributes (exp, terms, nterms)
in the values of the NDIM-dimensional attribute space SPACE. */ in the values of the NDIM-dimensional attribute space SPACE. */
static void static void
unmark_used_attributes (list, space, ndim) unmark_used_attributes (rtx list, struct dimension *space, int ndim)
rtx list;
struct dimension *space;
int ndim;
{ {
rtx link, exp; rtx link, exp;
int i; int i;
...@@ -3880,8 +3698,7 @@ unmark_used_attributes (list, space, ndim) ...@@ -3880,8 +3698,7 @@ unmark_used_attributes (list, space, ndim)
are tested. Return the updated number of values. */ are tested. Return the updated number of values. */
static int static int
add_values_to_cover (dim) add_values_to_cover (struct dimension *dim)
struct dimension *dim;
{ {
struct attr_value *av; struct attr_value *av;
rtx exp, link, *prev; rtx exp, link, *prev;
...@@ -3945,9 +3762,7 @@ add_values_to_cover (dim) ...@@ -3945,9 +3762,7 @@ add_values_to_cover (dim)
and return FALSE if the increment overflowed. */ and return FALSE if the increment overflowed. */
static int static int
increment_current_value (space, ndim) increment_current_value (struct dimension *space, int ndim)
struct dimension *space;
int ndim;
{ {
int i; int i;
...@@ -3965,9 +3780,7 @@ increment_current_value (space, ndim) ...@@ -3965,9 +3780,7 @@ increment_current_value (space, ndim)
NDIM-dimensional attribute space SPACE. */ NDIM-dimensional attribute space SPACE. */
static rtx static rtx
test_for_current_value (space, ndim) test_for_current_value (struct dimension *space, int ndim)
struct dimension *space;
int ndim;
{ {
int i; int i;
rtx exp = true_rtx; rtx exp = true_rtx;
...@@ -3985,10 +3798,7 @@ test_for_current_value (space, ndim) ...@@ -3985,10 +3798,7 @@ test_for_current_value (space, ndim)
known EQ_ATTR expressions are set to FALSE. */ known EQ_ATTR expressions are set to FALSE. */
static rtx static rtx
simplify_with_current_value (exp, space, ndim) simplify_with_current_value (rtx exp, struct dimension *space, int ndim)
rtx exp;
struct dimension *space;
int ndim;
{ {
int i; int i;
rtx x; rtx x;
...@@ -4018,8 +3828,7 @@ simplify_with_current_value (exp, space, ndim) ...@@ -4018,8 +3828,7 @@ simplify_with_current_value (exp, space, ndim)
all EQ_ATTR expressions. */ all EQ_ATTR expressions. */
static rtx static rtx
simplify_with_current_value_aux (exp) simplify_with_current_value_aux (rtx exp)
rtx exp;
{ {
int i; int i;
rtx cond; rtx cond;
...@@ -4093,12 +3902,11 @@ simplify_with_current_value_aux (exp) ...@@ -4093,12 +3902,11 @@ simplify_with_current_value_aux (exp)
abort (); abort ();
} }
} }
/* Clear the ATTR_CURR_SIMPLIFIED_P flag in EXP and its subexpressions. */ /* Clear the ATTR_CURR_SIMPLIFIED_P flag in EXP and its subexpressions. */
static void static void
clear_struct_flag (x) clear_struct_flag (rtx x)
rtx x;
{ {
int i; int i;
int j; int j;
...@@ -4155,9 +3963,7 @@ clear_struct_flag (x) ...@@ -4155,9 +3963,7 @@ clear_struct_flag (x)
But if we count more than MAX objects, stop counting. */ But if we count more than MAX objects, stop counting. */
static int static int
count_sub_rtxs (x, max) count_sub_rtxs (rtx x, int max)
rtx x;
int max;
{ {
int i; int i;
int j; int j;
...@@ -4211,13 +4017,11 @@ count_sub_rtxs (x, max) ...@@ -4211,13 +4017,11 @@ count_sub_rtxs (x, max)
return total; return total;
} }
/* Create table entries for DEFINE_ATTR. */ /* Create table entries for DEFINE_ATTR. */
static void static void
gen_attr (exp, lineno) gen_attr (rtx exp, int lineno)
rtx exp;
int lineno;
{ {
struct attr_desc *attr; struct attr_desc *attr;
struct attr_value *av; struct attr_value *av;
...@@ -4279,14 +4083,13 @@ gen_attr (exp, lineno) ...@@ -4279,14 +4083,13 @@ gen_attr (exp, lineno)
XEXP (exp, 2) = check_attr_value (XEXP (exp, 2), attr); XEXP (exp, 2) = check_attr_value (XEXP (exp, 2), attr);
attr->default_val = get_attr_value (XEXP (exp, 2), attr, -2); attr->default_val = get_attr_value (XEXP (exp, 2), attr, -2);
} }
/* Given a pattern for DEFINE_PEEPHOLE or DEFINE_INSN, return the number of /* Given a pattern for DEFINE_PEEPHOLE or DEFINE_INSN, return the number of
alternatives in the constraints. Assume all MATCH_OPERANDs have the same alternatives in the constraints. Assume all MATCH_OPERANDs have the same
number of alternatives as this should be checked elsewhere. */ number of alternatives as this should be checked elsewhere. */
static int static int
count_alternatives (exp) count_alternatives (rtx exp)
rtx exp;
{ {
int i, j, n; int i, j, n;
const char *fmt; const char *fmt;
...@@ -4318,13 +4121,12 @@ count_alternatives (exp) ...@@ -4318,13 +4121,12 @@ count_alternatives (exp)
return 0; return 0;
} }
/* Returns nonzero if the given expression contains an EQ_ATTR with the /* Returns nonzero if the given expression contains an EQ_ATTR with the
`alternative' attribute. */ `alternative' attribute. */
static int static int
compares_alternatives_p (exp) compares_alternatives_p (rtx exp)
rtx exp;
{ {
int i, j; int i, j;
const char *fmt; const char *fmt;
...@@ -4351,13 +4153,11 @@ compares_alternatives_p (exp) ...@@ -4351,13 +4153,11 @@ compares_alternatives_p (exp)
return 0; return 0;
} }
/* Returns nonzero is INNER is contained in EXP. */ /* Returns nonzero is INNER is contained in EXP. */
static int static int
contained_in_p (inner, exp) contained_in_p (rtx inner, rtx exp)
rtx inner;
rtx exp;
{ {
int i, j; int i, j;
const char *fmt; const char *fmt;
...@@ -4384,13 +4184,11 @@ contained_in_p (inner, exp) ...@@ -4384,13 +4184,11 @@ contained_in_p (inner, exp)
return 0; return 0;
} }
/* Process DEFINE_PEEPHOLE, DEFINE_INSN, and DEFINE_ASM_ATTRIBUTES. */ /* Process DEFINE_PEEPHOLE, DEFINE_INSN, and DEFINE_ASM_ATTRIBUTES. */
static void static void
gen_insn (exp, lineno) gen_insn (rtx exp, int lineno)
rtx exp;
int lineno;
{ {
struct insn_def *id; struct insn_def *id;
...@@ -4432,14 +4230,12 @@ gen_insn (exp, lineno) ...@@ -4432,14 +4230,12 @@ gen_insn (exp, lineno)
abort (); abort ();
} }
} }
/* Process a DEFINE_DELAY. Validate the vector length, check if annul /* Process a DEFINE_DELAY. Validate the vector length, check if annul
true or annul false is specified, and make a `struct delay_desc'. */ true or annul false is specified, and make a `struct delay_desc'. */
static void static void
gen_delay (def, lineno) gen_delay (rtx def, int lineno)
rtx def;
int lineno;
{ {
struct delay_desc *delay; struct delay_desc *delay;
int i; int i;
...@@ -4467,7 +4263,7 @@ gen_delay (def, lineno) ...@@ -4467,7 +4263,7 @@ gen_delay (def, lineno)
delay->lineno = lineno; delay->lineno = lineno;
delays = delay; delays = delay;
} }
/* Process a DEFINE_FUNCTION_UNIT. /* Process a DEFINE_FUNCTION_UNIT.
This gives information about a function unit contained in the CPU. This gives information about a function unit contained in the CPU.
...@@ -4475,9 +4271,7 @@ gen_delay (def, lineno) ...@@ -4475,9 +4271,7 @@ gen_delay (def, lineno)
with information used later by `expand_unit'. */ with information used later by `expand_unit'. */
static void static void
gen_unit (def, lineno) gen_unit (rtx def, int lineno)
rtx def;
int lineno;
{ {
struct function_unit *unit; struct function_unit *unit;
struct function_unit_op *op; struct function_unit_op *op;
...@@ -4558,7 +4352,7 @@ gen_unit (def, lineno) ...@@ -4558,7 +4352,7 @@ gen_unit (def, lineno)
which insns are used by the function unit. */ which insns are used by the function unit. */
unit->condexp = insert_right_side (IOR, unit->condexp, op->condexp, -2, -2); unit->condexp = insert_right_side (IOR, unit->condexp, op->condexp, -2, -2);
} }
/* Given a piece of RTX, print a C expression to test its truth value. /* Given a piece of RTX, print a C expression to test its truth value.
We use AND and IOR both for logical and bit-wise operations, so We use AND and IOR both for logical and bit-wise operations, so
interpret them as logical unless they are inside a comparison expression. interpret them as logical unless they are inside a comparison expression.
...@@ -4568,9 +4362,7 @@ gen_unit (def, lineno) ...@@ -4568,9 +4362,7 @@ gen_unit (def, lineno)
a cached local variable instead of calling a function. */ a cached local variable instead of calling a function. */
static void static void
write_test_expr (exp, flags) write_test_expr (rtx exp, int flags)
rtx exp;
int flags;
{ {
int comparison_operator = 0; int comparison_operator = 0;
RTX_CODE code; RTX_CODE code;
...@@ -4810,14 +4602,12 @@ write_test_expr (exp, flags) ...@@ -4810,14 +4602,12 @@ write_test_expr (exp, flags)
printf (")"); printf (")");
} }
/* Given an attribute value, return the maximum CONST_STRING argument /* Given an attribute value, return the maximum CONST_STRING argument
encountered. Set *UNKNOWNP and return INT_MAX if the value is unknown. */ encountered. Set *UNKNOWNP and return INT_MAX if the value is unknown. */
static int static int
max_attr_value (exp, unknownp) max_attr_value (rtx exp, int *unknownp)
rtx exp;
int *unknownp;
{ {
int current_max; int current_max;
int i, n; int i, n;
...@@ -4859,9 +4649,7 @@ max_attr_value (exp, unknownp) ...@@ -4859,9 +4649,7 @@ max_attr_value (exp, unknownp)
if the numeric value is not known. */ if the numeric value is not known. */
static int static int
or_attr_value (exp, unknownp) or_attr_value (rtx exp, int *unknownp)
rtx exp;
int *unknownp;
{ {
int current_or; int current_or;
int i; int i;
...@@ -4891,7 +4679,7 @@ or_attr_value (exp, unknownp) ...@@ -4891,7 +4679,7 @@ or_attr_value (exp, unknownp)
return current_or; return current_or;
} }
/* Scan an attribute value, possibly a conditional, and record what actions /* Scan an attribute value, possibly a conditional, and record what actions
will be required to do any conditional tests in it. will be required to do any conditional tests in it.
...@@ -4903,8 +4691,7 @@ or_attr_value (exp, unknownp) ...@@ -4903,8 +4691,7 @@ or_attr_value (exp, unknownp)
*/ */
static void static void
walk_attr_value (exp) walk_attr_value (rtx exp)
rtx exp;
{ {
int i, j; int i, j;
const char *fmt; const char *fmt;
...@@ -4966,12 +4753,11 @@ walk_attr_value (exp) ...@@ -4966,12 +4753,11 @@ walk_attr_value (exp)
break; break;
} }
} }
/* Write out a function to obtain the attribute for a given INSN. */ /* Write out a function to obtain the attribute for a given INSN. */
static void static void
write_attr_get (attr) write_attr_get (struct attr_desc *attr)
struct attr_desc *attr;
{ {
struct attr_value *av, *common_av; struct attr_value *av, *common_av;
...@@ -4989,9 +4775,9 @@ write_attr_get (attr) ...@@ -4989,9 +4775,9 @@ write_attr_get (attr)
/* If the attribute name starts with a star, the remainder is the name of /* If the attribute name starts with a star, the remainder is the name of
the subroutine to use, instead of `get_attr_...'. */ the subroutine to use, instead of `get_attr_...'. */
if (attr->name[0] == '*') if (attr->name[0] == '*')
printf ("%s PARAMS ((rtx));\n", &attr->name[1]); printf ("%s (rtx);\n", &attr->name[1]);
else else
printf ("get_attr_%s PARAMS ((%s));\n", attr->name, printf ("get_attr_%s (%s);\n", attr->name,
(attr->is_const ? "void" : "rtx")); (attr->is_const ? "void" : "rtx"));
/* Write out start of function, then all values with explicit `case' lines, /* Write out start of function, then all values with explicit `case' lines,
...@@ -5058,17 +4844,14 @@ write_attr_get (attr) ...@@ -5058,17 +4844,14 @@ write_attr_get (attr)
printf (" }\n}\n\n"); printf (" }\n}\n\n");
} }
} }
/* Given an AND tree of known true terms (because we are inside an `if' with /* Given an AND tree of known true terms (because we are inside an `if' with
that as the condition or are in an `else' clause) and an expression, that as the condition or are in an `else' clause) and an expression,
replace any known true terms with TRUE. Use `simplify_and_tree' to do replace any known true terms with TRUE. Use `simplify_and_tree' to do
the bulk of the work. */ the bulk of the work. */
static rtx static rtx
eliminate_known_true (known_true, exp, insn_code, insn_index) eliminate_known_true (rtx known_true, rtx exp, int insn_code, int insn_index)
rtx known_true;
rtx exp;
int insn_code, insn_index;
{ {
rtx term; rtx term;
...@@ -5089,22 +4872,16 @@ eliminate_known_true (known_true, exp, insn_code, insn_index) ...@@ -5089,22 +4872,16 @@ eliminate_known_true (known_true, exp, insn_code, insn_index)
return exp; return exp;
} }
/* Write out a series of tests and assignment statements to perform tests and /* Write out a series of tests and assignment statements to perform tests and
sets of an attribute value. We are passed an indentation amount and prefix sets of an attribute value. We are passed an indentation amount and prefix
and suffix strings to write around each attribute value (e.g., "return" and suffix strings to write around each attribute value (e.g., "return"
and ";"). */ and ";"). */
static void static void
write_attr_set (attr, indent, value, prefix, suffix, known_true, write_attr_set (struct attr_desc *attr, int indent, rtx value,
insn_code, insn_index) const char *prefix, const char *suffix, rtx known_true,
struct attr_desc *attr; int insn_code, int insn_index)
int indent;
rtx value;
const char *prefix;
const char *suffix;
rtx known_true;
int insn_code, insn_index;
{ {
if (GET_CODE (value) == COND) if (GET_CODE (value) == COND)
{ {
...@@ -5187,18 +4964,13 @@ write_attr_set (attr, indent, value, prefix, suffix, known_true, ...@@ -5187,18 +4964,13 @@ write_attr_set (attr, indent, value, prefix, suffix, known_true,
printf ("%s\n", suffix); printf ("%s\n", suffix);
} }
} }
/* Write out the computation for one attribute value. */ /* Write out the computation for one attribute value. */
static void static void
write_attr_case (attr, av, write_case_lines, prefix, suffix, indent, write_attr_case (struct attr_desc *attr, struct attr_value *av,
known_true) int write_case_lines, const char *prefix, const char *suffix,
struct attr_desc *attr; int indent, rtx known_true)
struct attr_value *av;
int write_case_lines;
const char *prefix, *suffix;
int indent;
rtx known_true;
{ {
struct insn_ent *ie; struct insn_ent *ie;
...@@ -5258,13 +5030,11 @@ write_attr_case (attr, av, write_case_lines, prefix, suffix, indent, ...@@ -5258,13 +5030,11 @@ write_attr_case (attr, av, write_case_lines, prefix, suffix, indent,
} }
printf ("\n"); printf ("\n");
} }
/* Search for uses of non-const attributes and write code to cache them. */ /* Search for uses of non-const attributes and write code to cache them. */
static int static int
write_expr_attr_cache (p, attr) write_expr_attr_cache (rtx p, struct attr_desc *attr)
rtx p;
struct attr_desc *attr;
{ {
const char *fmt; const char *fmt;
int i, ie, j, je; int i, ie, j, je;
...@@ -5313,8 +5083,7 @@ write_expr_attr_cache (p, attr) ...@@ -5313,8 +5083,7 @@ write_expr_attr_cache (p, attr)
expressions to cater to older compilers. */ expressions to cater to older compilers. */
static void static void
write_toplevel_expr (p) write_toplevel_expr (rtx p)
rtx p;
{ {
struct attr_desc *attr; struct attr_desc *attr;
int i; int i;
...@@ -5342,14 +5111,11 @@ write_toplevel_expr (p) ...@@ -5342,14 +5111,11 @@ write_toplevel_expr (p)
write_test_expr (p, 3); write_test_expr (p, 3);
printf (";\n"); printf (";\n");
} }
/* Utilities to write names in various forms. */ /* Utilities to write names in various forms. */
static void static void
write_unit_name (prefix, num, suffix) write_unit_name (const char *prefix, int num, const char *suffix)
const char *prefix;
int num;
const char *suffix;
{ {
struct function_unit *unit; struct function_unit *unit;
...@@ -5364,9 +5130,7 @@ write_unit_name (prefix, num, suffix) ...@@ -5364,9 +5130,7 @@ write_unit_name (prefix, num, suffix)
} }
static void static void
write_attr_valueq (attr, s) write_attr_valueq (struct attr_desc *attr, const char *s)
struct attr_desc *attr;
const char *s;
{ {
if (attr->is_numeric) if (attr->is_numeric)
{ {
...@@ -5411,9 +5175,7 @@ write_attr_valueq (attr, s) ...@@ -5411,9 +5175,7 @@ write_attr_valueq (attr, s)
} }
static void static void
write_attr_value (attr, value) write_attr_value (struct attr_desc *attr, rtx value)
struct attr_desc *attr;
rtx value;
{ {
int op; int op;
...@@ -5469,8 +5231,7 @@ write_attr_value (attr, value) ...@@ -5469,8 +5231,7 @@ write_attr_value (attr, value)
} }
static void static void
write_upcase (str) write_upcase (const char *str)
const char *str;
{ {
while (*str) while (*str)
{ {
...@@ -5481,8 +5242,7 @@ write_upcase (str) ...@@ -5481,8 +5242,7 @@ write_upcase (str)
} }
static void static void
write_indent (indent) write_indent (int indent)
int indent;
{ {
for (; indent > 8; indent -= 8) for (; indent > 8; indent -= 8)
printf ("\t"); printf ("\t");
...@@ -5490,7 +5250,7 @@ write_indent (indent) ...@@ -5490,7 +5250,7 @@ write_indent (indent)
for (; indent; indent--) for (; indent; indent--)
printf (" "); printf (" ");
} }
/* Write a subroutine that is given an insn that requires a delay slot, a /* Write a subroutine that is given an insn that requires a delay slot, a
delay slot ordinal, and a candidate insn. It returns nonzero if the delay slot ordinal, and a candidate insn. It returns nonzero if the
candidate can be placed in the specified delay slot of the insn. candidate can be placed in the specified delay slot of the insn.
...@@ -5504,8 +5264,7 @@ write_indent (indent) ...@@ -5504,8 +5264,7 @@ write_indent (indent)
or "annul_false"). */ or "annul_false"). */
static void static void
write_eligible_delay (kind) write_eligible_delay (const char *kind)
const char *kind;
{ {
struct delay_desc *delay; struct delay_desc *delay;
int max_slots; int max_slots;
...@@ -5621,12 +5380,12 @@ write_eligible_delay (kind) ...@@ -5621,12 +5380,12 @@ write_eligible_delay (kind)
printf ("}\n\n"); printf ("}\n\n");
} }
/* Write routines to compute conflict cost for function units. Then write a /* Write routines to compute conflict cost for function units. Then write a
table describing the available function units. */ table describing the available function units. */
static void static void
write_function_unit_info () write_function_unit_info (void)
{ {
struct function_unit *unit; struct function_unit *unit;
int i; int i;
...@@ -5697,9 +5456,9 @@ write_function_unit_info () ...@@ -5697,9 +5456,9 @@ write_function_unit_info ()
} }
static void static void
write_complex_function (unit, name, connection) write_complex_function (struct function_unit *unit,
struct function_unit *unit; const char *name,
const char *name, *connection; const char *connection)
{ {
struct attr_desc *case_attr, *attr; struct attr_desc *case_attr, *attr;
struct attr_value *av, *common_av; struct attr_value *av, *common_av;
...@@ -5708,7 +5467,7 @@ write_complex_function (unit, name, connection) ...@@ -5708,7 +5467,7 @@ write_complex_function (unit, name, connection)
int using_case; int using_case;
int i; int i;
printf ("static int %s_unit_%s PARAMS ((rtx, rtx));\n", unit->name, name); printf ("static int %s_unit_%s (rtx, rtx);\n", unit->name, name);
printf ("static int\n"); printf ("static int\n");
printf ("%s_unit_%s (executing_insn, candidate_insn)\n", unit->name, name); printf ("%s_unit_%s (executing_insn, candidate_insn)\n", unit->name, name);
printf (" rtx executing_insn;\n"); printf (" rtx executing_insn;\n");
...@@ -5789,7 +5548,7 @@ write_complex_function (unit, name, connection) ...@@ -5789,7 +5548,7 @@ write_complex_function (unit, name, connection)
printf (" default:\n abort ();\n"); printf (" default:\n abort ();\n");
printf (" }\n}\n\n"); printf (" }\n}\n\n");
} }
/* This page contains miscellaneous utility routines. */ /* This page contains miscellaneous utility routines. */
/* Given a pointer to a (char *), return a malloc'ed string containing the /* Given a pointer to a (char *), return a malloc'ed string containing the
...@@ -5797,8 +5556,7 @@ write_complex_function (unit, name, connection) ...@@ -5797,8 +5556,7 @@ write_complex_function (unit, name, connection)
scanned, or the end-of-string. Return NULL if at end of string. */ scanned, or the end-of-string. Return NULL if at end of string. */
static char * static char *
next_comma_elt (pstr) next_comma_elt (const char **pstr)
const char **pstr;
{ {
const char *start; const char *start;
...@@ -5814,9 +5572,7 @@ next_comma_elt (pstr) ...@@ -5814,9 +5572,7 @@ next_comma_elt (pstr)
is nonzero, build a new attribute, if one does not exist. */ is nonzero, build a new attribute, if one does not exist. */
static struct attr_desc * static struct attr_desc *
find_attr (name, create) find_attr (const char *name, int create)
const char *name;
int create;
{ {
struct attr_desc *attr; struct attr_desc *attr;
int index; int index;
...@@ -5853,10 +5609,7 @@ find_attr (name, create) ...@@ -5853,10 +5609,7 @@ find_attr (name, create)
/* Create internal attribute with the given default value. */ /* Create internal attribute with the given default value. */
void void
make_internal_attr (name, value, special) make_internal_attr (const char *name, rtx value, int special)
const char *name;
rtx value;
int special;
{ {
struct attr_desc *attr; struct attr_desc *attr;
...@@ -5877,8 +5630,7 @@ make_internal_attr (name, value, special) ...@@ -5877,8 +5630,7 @@ make_internal_attr (name, value, special)
/* Find the most used value of an attribute. */ /* Find the most used value of an attribute. */
static struct attr_value * static struct attr_value *
find_most_used (attr) find_most_used (struct attr_desc *attr)
struct attr_desc *attr;
{ {
struct attr_value *av; struct attr_value *av;
struct attr_value *most_used; struct attr_value *most_used;
...@@ -5898,8 +5650,7 @@ find_most_used (attr) ...@@ -5898,8 +5650,7 @@ find_most_used (attr)
return NULL. */ return NULL. */
static rtx static rtx
find_single_value (attr) find_single_value (struct attr_desc *attr)
struct attr_desc *attr;
{ {
struct attr_value *av; struct attr_value *av;
rtx unique_value; rtx unique_value;
...@@ -5920,8 +5671,7 @@ find_single_value (attr) ...@@ -5920,8 +5671,7 @@ find_single_value (attr)
/* Return (attr_value "n") */ /* Return (attr_value "n") */
rtx rtx
make_numeric_value (n) make_numeric_value (int n)
int n;
{ {
static rtx int_values[20]; static rtx int_values[20];
rtx exp; rtx exp;
...@@ -5941,12 +5691,9 @@ make_numeric_value (n) ...@@ -5941,12 +5691,9 @@ make_numeric_value (n)
return exp; return exp;
} }
static void static void
extend_range (range, min, max) extend_range (struct range *range, int min, int max)
struct range *range;
int min;
int max;
{ {
if (range->min > min) if (range->min > min)
range->min = min; range->min = min;
...@@ -5955,49 +5702,20 @@ extend_range (range, min, max) ...@@ -5955,49 +5702,20 @@ extend_range (range, min, max)
} }
static rtx static rtx
copy_rtx_unchanging (orig) copy_rtx_unchanging (rtx orig)
rtx orig;
{ {
#if 0
rtx copy;
RTX_CODE code;
#endif
if (ATTR_IND_SIMPLIFIED_P (orig) || ATTR_CURR_SIMPLIFIED_P (orig)) if (ATTR_IND_SIMPLIFIED_P (orig) || ATTR_CURR_SIMPLIFIED_P (orig))
return orig; return orig;
ATTR_CURR_SIMPLIFIED_P (orig) = 1; ATTR_CURR_SIMPLIFIED_P (orig) = 1;
return orig; return orig;
#if 0
code = GET_CODE (orig);
switch (code)
{
case CONST_INT:
case CONST_DOUBLE:
case SYMBOL_REF:
case CODE_LABEL:
return orig;
default:
break;
}
copy = rtx_alloc (code);
PUT_MODE (copy, GET_MODE (orig));
ATTR_IND_SIMPLIFIED_P (copy) = 1;
memcpy (&XEXP (copy, 0), &XEXP (orig, 0),
GET_RTX_LENGTH (GET_CODE (copy)) * sizeof (rtx));
return copy;
#endif
} }
/* Determine if an insn has a constant number of delay slots, i.e., the /* Determine if an insn has a constant number of delay slots, i.e., the
number of delay slots is not a function of the length of the insn. */ number of delay slots is not a function of the length of the insn. */
static void static void
write_const_num_delay_slots () write_const_num_delay_slots (void)
{ {
struct attr_desc *attr = find_attr ("*num_delay_slots", 0); struct attr_desc *attr = find_attr ("*num_delay_slots", 0);
struct attr_value *av; struct attr_value *av;
...@@ -6029,13 +5747,9 @@ write_const_num_delay_slots () ...@@ -6029,13 +5747,9 @@ write_const_num_delay_slots ()
printf (" }\n}\n\n"); printf (" }\n}\n\n");
} }
} }
extern int main PARAMS ((int, char **));
int int
main (argc, argv) main (int argc, char **argv)
int argc;
char **argv;
{ {
rtx desc; rtx desc;
struct attr_desc *attr; struct attr_desc *attr;
...@@ -6101,47 +5815,47 @@ from the machine description file `md'. */\n\n"); ...@@ -6101,47 +5815,47 @@ from the machine description file `md'. */\n\n");
case DEFINE_CPU_UNIT: case DEFINE_CPU_UNIT:
gen_cpu_unit (desc); gen_cpu_unit (desc);
break; break;
case DEFINE_QUERY_CPU_UNIT: case DEFINE_QUERY_CPU_UNIT:
gen_query_cpu_unit (desc); gen_query_cpu_unit (desc);
break; break;
case DEFINE_BYPASS: case DEFINE_BYPASS:
gen_bypass (desc); gen_bypass (desc);
break; break;
case EXCLUSION_SET: case EXCLUSION_SET:
gen_excl_set (desc); gen_excl_set (desc);
break; break;
case PRESENCE_SET: case PRESENCE_SET:
gen_presence_set (desc); gen_presence_set (desc);
break; break;
case FINAL_PRESENCE_SET: case FINAL_PRESENCE_SET:
gen_final_presence_set (desc); gen_final_presence_set (desc);
break; break;
case ABSENCE_SET: case ABSENCE_SET:
gen_absence_set (desc); gen_absence_set (desc);
break; break;
case FINAL_ABSENCE_SET: case FINAL_ABSENCE_SET:
gen_final_absence_set (desc); gen_final_absence_set (desc);
break; break;
case DEFINE_AUTOMATON: case DEFINE_AUTOMATON:
gen_automaton (desc); gen_automaton (desc);
break; break;
case AUTOMATA_OPTION: case AUTOMATA_OPTION:
gen_automata_option (desc); gen_automata_option (desc);
break; break;
case DEFINE_RESERVATION: case DEFINE_RESERVATION:
gen_reserv (desc); gen_reserv (desc);
break; break;
case DEFINE_INSN_RESERVATION: case DEFINE_INSN_RESERVATION:
gen_insn_reserv (desc); gen_insn_reserv (desc);
break; break;
...@@ -6286,8 +6000,7 @@ from the machine description file `md'. */\n\n"); ...@@ -6286,8 +6000,7 @@ from the machine description file `md'. */\n\n");
/* Define this so we can link with print-rtl.o to get debug_rtx function. */ /* Define this so we can link with print-rtl.o to get debug_rtx function. */
const char * const char *
get_insn_name (code) get_insn_name (int code ATTRIBUTE_UNUSED)
int code ATTRIBUTE_UNUSED;
{ {
return NULL; return NULL;
} }
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