Commit c9541287 by Kazu Hirata Committed by Jeff Law

* genattrtab.c: Fix formatting.

From-SVN: r36364
parent 3ff5f682
...@@ -18,6 +18,8 @@ Tue Sep 12 08:53:57 2000 Jeffrey A Law (law@cygnus.com) ...@@ -18,6 +18,8 @@ Tue Sep 12 08:53:57 2000 Jeffrey A Law (law@cygnus.com)
2000-09-12 Kazu Hirata <kazu@hxi.com> 2000-09-12 Kazu Hirata <kazu@hxi.com>
* genattrtab.c: Fix formatting.
* unroll.c: Fix formatting. * unroll.c: Fix formatting.
2000-09-12 Bruce Korb <bkorb@gnu.org> 2000-09-12 Bruce Korb <bkorb@gnu.org>
......
...@@ -37,7 +37,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -37,7 +37,7 @@ Boston, MA 02111-1307, USA. */
`constrain_operands' is called. If either of these cases of a reference to `constrain_operands' is called. If either of these cases of a reference to
an operand is found, `extract_insn' is called. an operand is found, `extract_insn' is called.
The special attribute `length' is also recognized. For this operand, The special attribute `length' is also recognized. For this operand,
expressions involving the address of an operand or the current insn, expressions involving the address of an operand or the current insn,
(address (pc)), are valid. In this case, an initial pass is made to (address (pc)), are valid. In this case, an initial pass is made to
set all lengths that do not depend on address. Those that do are set to set all lengths that do not depend on address. Those that do are set to
...@@ -52,7 +52,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -52,7 +52,7 @@ Boston, MA 02111-1307, USA. */
parameters as it does not depend on any particular insn. Constant parameters as it does not depend on any particular insn. Constant
attributes are typically used to specify which variety of processor is attributes are typically used to specify which variety of processor is
used. used.
Internal attributes are defined to handle DEFINE_DELAY and Internal attributes are defined to handle DEFINE_DELAY and
DEFINE_FUNCTION_UNIT. Special routines are output for these cases. DEFINE_FUNCTION_UNIT. Special routines are output for these cases.
...@@ -95,7 +95,6 @@ Boston, MA 02111-1307, USA. */ ...@@ -95,7 +95,6 @@ Boston, MA 02111-1307, USA. */
`volatil' (MEM_VOLATILE_P): During simplify_by_exploding the value of an `volatil' (MEM_VOLATILE_P): During simplify_by_exploding the value of an
EQ_ATTR rtx is true if !volatil and false if volatil. */ EQ_ATTR rtx is true if !volatil and false if volatil. */
#include "hconfig.h" #include "hconfig.h"
#include "system.h" #include "system.h"
#include "rtl.h" #include "rtl.h"
...@@ -255,7 +254,7 @@ static struct function_unit *units; ...@@ -255,7 +254,7 @@ static struct function_unit *units;
computed and becomes the corresponding value. To do this, we must be computed and becomes the corresponding value. To do this, we must be
able to enumerate all values for each attribute used in the expression able to enumerate all values for each attribute used in the expression
(currently, we give up if we find a numeric attribute). (currently, we give up if we find a numeric attribute).
If the set of EQ_ATTR tests used in an expression tests the value of N If the set of EQ_ATTR tests used in an expression tests the value of N
different attributes, the list of all possible combinations can be made different attributes, the list of all possible combinations can be made
by walking the N-dimensional attribute space defined by those by walking the N-dimensional attribute space defined by those
...@@ -283,7 +282,7 @@ static struct function_unit *units; ...@@ -283,7 +282,7 @@ static struct function_unit *units;
Once the dimensions are created, the algorithm enumerates all possible Once the dimensions are created, the algorithm enumerates all possible
values and computes the current value of the given expression. */ values and computes the current value of the given expression. */
struct dimension struct dimension
{ {
struct attr_desc *attr; /* Attribute for this dimension. */ struct attr_desc *attr; /* Attribute for this dimension. */
rtx values; /* List of attribute values used. */ rtx values; /* List of attribute values used. */
...@@ -347,7 +346,7 @@ int optimize = 0; ...@@ -347,7 +346,7 @@ int optimize = 0;
#define SIMPLIFY_TEST_EXP(EXP,INSN_CODE,INSN_INDEX) \ #define SIMPLIFY_TEST_EXP(EXP,INSN_CODE,INSN_INDEX) \
(RTX_UNCHANGING_P (EXP) || MEM_IN_STRUCT_P (EXP) ? (EXP) \ (RTX_UNCHANGING_P (EXP) || MEM_IN_STRUCT_P (EXP) ? (EXP) \
: simplify_test_exp (EXP, INSN_CODE, INSN_INDEX)) : simplify_test_exp (EXP, INSN_CODE, INSN_INDEX))
/* Simplify (eq_attr ("alternative") ...) /* Simplify (eq_attr ("alternative") ...)
when we are working with a particular alternative. */ when we are working with a particular alternative. */
#define SIMPLIFY_ALTERNATIVE(EXP) \ #define SIMPLIFY_ALTERNATIVE(EXP) \
...@@ -463,7 +462,6 @@ static int attr_equal_p PARAMS ((rtx, rtx)); ...@@ -463,7 +462,6 @@ static int attr_equal_p PARAMS ((rtx, rtx));
static rtx attr_copy_rtx PARAMS ((rtx)); static rtx attr_copy_rtx 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. */
...@@ -540,7 +538,6 @@ attr_hash_add_string (hashcode, str) ...@@ -540,7 +538,6 @@ attr_hash_add_string (hashcode, str)
rtx attr_rtx (code, [element1, ..., elementn]) */ rtx attr_rtx (code, [element1, ..., elementn]) */
/*VARARGS1*/
static rtx static rtx
attr_rtx VPARAMS ((enum rtx_code code, ...)) attr_rtx VPARAMS ((enum rtx_code code, ...))
{ {
...@@ -689,7 +686,7 @@ attr_rtx VPARAMS ((enum rtx_code code, ...)) ...@@ -689,7 +686,7 @@ attr_rtx VPARAMS ((enum rtx_code code, ...))
{ {
nohash: nohash:
rt_val = rtx_alloc (code); /* Allocate the storage space. */ rt_val = rtx_alloc (code); /* Allocate the storage space. */
fmt = GET_RTX_FORMAT (code); /* Find the right format... */ fmt = GET_RTX_FORMAT (code); /* Find the right format... */
for (i = 0; i < GET_RTX_LENGTH (code); i++) for (i = 0; i < GET_RTX_LENGTH (code); i++)
{ {
...@@ -720,7 +717,7 @@ attr_rtx VPARAMS ((enum rtx_code code, ...)) ...@@ -720,7 +717,7 @@ attr_rtx VPARAMS ((enum rtx_code code, ...))
break; break;
default: default:
abort(); abort ();
} }
} }
va_end (p); va_end (p);
...@@ -743,7 +740,6 @@ attr_rtx VPARAMS ((enum rtx_code code, ...)) ...@@ -743,7 +740,6 @@ attr_rtx VPARAMS ((enum rtx_code code, ...))
rtx attr_printf (len, format, [arg1, ..., argn]) */ rtx attr_printf (len, format, [arg1, ..., argn]) */
/*VARARGS2*/
static char * static char *
attr_printf VPARAMS ((register int len, const char *fmt, ...)) attr_printf VPARAMS ((register int len, const char *fmt, ...))
{ {
...@@ -798,9 +794,9 @@ attr_string (str, len) ...@@ -798,9 +794,9 @@ attr_string (str, len)
register char *new_str; register char *new_str;
/* Compute the hash code. */ /* Compute the hash code. */
hashcode = (len + 1) * 613 + (unsigned)str[0]; hashcode = (len + 1) * 613 + (unsigned) str[0];
for (i = 1; i <= len; i += 2) for (i = 1; i <= len; i += 2)
hashcode = ((hashcode * 613) + (unsigned)str[i]); hashcode = ((hashcode * 613) + (unsigned) str[i]);
if (hashcode < 0) if (hashcode < 0)
hashcode = -hashcode; hashcode = -hashcode;
...@@ -872,7 +868,7 @@ attr_copy_rtx (orig) ...@@ -872,7 +868,7 @@ attr_copy_rtx (orig)
copy->volatil = orig->volatil; copy->volatil = orig->volatil;
copy->unchanging = orig->unchanging; copy->unchanging = orig->unchanging;
copy->integrated = orig->integrated; copy->integrated = orig->integrated;
format_ptr = GET_RTX_FORMAT (GET_CODE (copy)); format_ptr = GET_RTX_FORMAT (GET_CODE (copy));
for (i = 0; i < GET_RTX_LENGTH (GET_CODE (copy)); i++) for (i = 0; i < GET_RTX_LENGTH (GET_CODE (copy)); i++)
...@@ -978,7 +974,7 @@ check_attr_test (exp, is_const, lineno) ...@@ -978,7 +974,7 @@ check_attr_test (exp, is_const, lineno)
/* It shouldn't be possible to simplify the value given to a /* It shouldn't be possible to simplify the value given to a
constant attribute, so don't expand this until it's time to constant attribute, so don't expand this until it's time to
write the test expression. */ write the test expression. */
if (attr->is_const) if (attr->is_const)
RTX_UNCHANGING_P (exp) = 1; RTX_UNCHANGING_P (exp) = 1;
...@@ -986,8 +982,8 @@ check_attr_test (exp, is_const, lineno) ...@@ -986,8 +982,8 @@ check_attr_test (exp, is_const, lineno)
{ {
for (p = XSTR (exp, 1); *p; p++) for (p = XSTR (exp, 1); *p; p++)
if (*p < '0' || *p > '9') if (*p < '0' || *p > '9')
fatal ("Attribute `%s' takes only numeric values", fatal ("Attribute `%s' takes only numeric values",
XSTR (exp, 0)); XSTR (exp, 0));
} }
else else
{ {
...@@ -1044,7 +1040,7 @@ check_attr_test (exp, is_const, lineno) ...@@ -1044,7 +1040,7 @@ check_attr_test (exp, is_const, lineno)
/* These cases can't be simplified. */ /* These cases can't be simplified. */
RTX_UNCHANGING_P (exp) = 1; RTX_UNCHANGING_P (exp) = 1;
break; break;
case LE: case LT: case GT: case GE: case LE: case LT: case GT: case GE:
case LEU: case LTU: case GTU: case GEU: case LEU: case LTU: case GTU: case GEU:
case NE: case EQ: case NE: case EQ:
...@@ -1104,8 +1100,8 @@ check_attr_value (exp, attr) ...@@ -1104,8 +1100,8 @@ check_attr_value (exp, attr)
if (INTVAL (exp) < 0 && ! attr->negative_ok) if (INTVAL (exp) < 0 && ! attr->negative_ok)
{ {
message_with_line (attr->lineno, message_with_line (attr->lineno,
"negative numeric value specified for attribute %s", "negative numeric value specified for attribute %s",
attr->name); attr->name);
have_error = 1; have_error = 1;
break; break;
} }
...@@ -1162,8 +1158,8 @@ check_attr_value (exp, attr) ...@@ -1162,8 +1158,8 @@ check_attr_value (exp, attr)
if (attr && !attr->is_numeric) if (attr && !attr->is_numeric)
{ {
message_with_line (attr->lineno, message_with_line (attr->lineno,
"invalid operation `%s' for non-numeric attribute value", "invalid operation `%s' for non-numeric attribute value",
GET_RTX_NAME (GET_CODE (exp))); GET_RTX_NAME (GET_CODE (exp)));
have_error = 1; have_error = 1;
break; break;
} }
...@@ -1217,7 +1213,7 @@ check_attr_value (exp, attr) ...@@ -1217,7 +1213,7 @@ check_attr_value (exp, attr)
XSTR (exp, 0), attr->name); XSTR (exp, 0), attr->name);
have_error = 1; have_error = 1;
} }
else if (attr else if (attr
&& (attr->is_numeric != attr2->is_numeric && (attr->is_numeric != attr2->is_numeric
|| (! attr->negative_ok && attr2->negative_ok))) || (! attr->negative_ok && attr2->negative_ok)))
{ {
...@@ -1261,7 +1257,7 @@ convert_set_attr_alternative (exp, id) ...@@ -1261,7 +1257,7 @@ convert_set_attr_alternative (exp, id)
if (XVECLEN (exp, 1) != num_alt) if (XVECLEN (exp, 1) != num_alt)
{ {
message_with_line (id->lineno, message_with_line (id->lineno,
"bad number of entries in SET_ATTR_ALTERNATIVE"); "bad number of entries in SET_ATTR_ALTERNATIVE");
have_error = 1; have_error = 1;
return NULL_RTX; return NULL_RTX;
} }
...@@ -1422,7 +1418,7 @@ convert_const_symbol_ref (exp, attr) ...@@ -1422,7 +1418,7 @@ convert_const_symbol_ref (exp, attr)
value = attr_rtx (SYMBOL_REF, string); value = attr_rtx (SYMBOL_REF, string);
RTX_UNCHANGING_P (value) = 1; RTX_UNCHANGING_P (value) = 1;
XVECEXP (condexp, 0, 2 * i) = attr_rtx (EQ, exp, value); XVECEXP (condexp, 0, 2 * i) = attr_rtx (EQ, exp, value);
XVECEXP (condexp, 0, 2 * i + 1) = av->value; XVECEXP (condexp, 0, 2 * i + 1) = av->value;
...@@ -1471,7 +1467,7 @@ make_canonical (attr, exp) ...@@ -1471,7 +1467,7 @@ make_canonical (attr, exp)
#if 0 #if 0
/* ??? Why do we do this? With attribute values { A B C D E }, this /* ??? 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 tends to generate (!(x==A) && !(x==B) && !(x==C) && !(x==D)) rather
than (x==E). */ than (x==E). */
exp = convert_const_symbol_ref (exp, attr); exp = convert_const_symbol_ref (exp, attr);
RTX_UNCHANGING_P (exp) = 1; RTX_UNCHANGING_P (exp) = 1;
exp = check_attr_value (exp, attr); exp = check_attr_value (exp, attr);
...@@ -1636,44 +1632,46 @@ expand_delays () ...@@ -1636,44 +1632,46 @@ expand_delays ()
/* For each delay possibility and delay slot, compute an eligibility /* For each delay possibility and delay slot, compute an eligibility
attribute for non-annulled insns and for each type of annulled (annul attribute for non-annulled insns and for each type of annulled (annul
if true and annul if false). */ if true and annul if false). */
for (delay = delays; delay; delay = delay->next) for (delay = delays; delay; delay = delay->next)
{ {
for (i = 0; i < XVECLEN (delay->def, 1); i += 3) for (i = 0; i < XVECLEN (delay->def, 1); i += 3)
{ {
condexp = XVECEXP (delay->def, 1, i); condexp = XVECEXP (delay->def, 1, i);
if (condexp == 0) condexp = false_rtx; if (condexp == 0)
newexp = attr_rtx (IF_THEN_ELSE, condexp, condexp = false_rtx;
make_numeric_value (1), make_numeric_value (0)); newexp = attr_rtx (IF_THEN_ELSE, condexp,
make_numeric_value (1), make_numeric_value (0));
p = attr_printf (sizeof ("*delay__") + MAX_DIGITS*2, "*delay_%d_%d",
delay->num, i / 3); p = attr_printf (sizeof ("*delay__") + MAX_DIGITS * 2,
make_internal_attr (p, newexp, 1); "*delay_%d_%d",
delay->num, i / 3);
if (have_annul_true) make_internal_attr (p, newexp, 1);
{
condexp = XVECEXP (delay->def, 1, i + 1); if (have_annul_true)
if (condexp == 0) condexp = false_rtx; {
newexp = attr_rtx (IF_THEN_ELSE, condexp, condexp = XVECEXP (delay->def, 1, i + 1);
make_numeric_value (1), if (condexp == 0) condexp = false_rtx;
make_numeric_value (0)); newexp = attr_rtx (IF_THEN_ELSE, condexp,
p = attr_printf (sizeof ("*annul_true__") + MAX_DIGITS*2, make_numeric_value (1),
"*annul_true_%d_%d", delay->num, i / 3); make_numeric_value (0));
make_internal_attr (p, newexp, 1); p = attr_printf (sizeof ("*annul_true__") + MAX_DIGITS * 2,
} "*annul_true_%d_%d", delay->num, i / 3);
make_internal_attr (p, newexp, 1);
if (have_annul_false) }
{
condexp = XVECEXP (delay->def, 1, i + 2); if (have_annul_false)
if (condexp == 0) condexp = false_rtx; {
newexp = attr_rtx (IF_THEN_ELSE, condexp, condexp = XVECEXP (delay->def, 1, i + 2);
make_numeric_value (1), if (condexp == 0) condexp = false_rtx;
make_numeric_value (0)); newexp = attr_rtx (IF_THEN_ELSE, condexp,
p = attr_printf (sizeof ("*annul_false__") + MAX_DIGITS*2, make_numeric_value (1),
"*annul_false_%d_%d", delay->num, i / 3); make_numeric_value (0));
make_internal_attr (p, newexp, 1); p = attr_printf (sizeof ("*annul_false__") + MAX_DIGITS * 2,
} "*annul_false_%d_%d", delay->num, i / 3);
} make_internal_attr (p, newexp, 1);
} }
}
}
} }
/* 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.
...@@ -1779,7 +1777,7 @@ operate_exp (op, left, right) ...@@ -1779,7 +1777,7 @@ operate_exp (op, left, right)
XVECEXP (newexp, 0, i + 1) XVECEXP (newexp, 0, i + 1)
= operate_exp (op, left, XVECEXP (right, 0, i + 1)); = operate_exp (op, left, XVECEXP (right, 0, i + 1));
if (! rtx_equal_p (XVECEXP (newexp, 0, i + 1), if (! rtx_equal_p (XVECEXP (newexp, 0, i + 1),
defval)) defval))
allsame = 0; allsame = 0;
} }
...@@ -1838,7 +1836,7 @@ operate_exp (op, left, right) ...@@ -1838,7 +1836,7 @@ operate_exp (op, left, right)
XVECEXP (newexp, 0, i + 1) XVECEXP (newexp, 0, i + 1)
= operate_exp (op, XVECEXP (left, 0, i + 1), right); = operate_exp (op, XVECEXP (left, 0, i + 1), right);
if (! rtx_equal_p (XVECEXP (newexp, 0, i + 1), if (! rtx_equal_p (XVECEXP (newexp, 0, i + 1),
defval)) defval))
allsame = 0; allsame = 0;
} }
...@@ -1969,21 +1967,21 @@ expand_units () ...@@ -1969,21 +1967,21 @@ expand_units ()
{ {
/* Merge each function unit into the unit mask attributes. */ /* Merge each function unit into the unit mask attributes. */
for (unit = units; unit; unit = unit->next) for (unit = units; unit; unit = unit->next)
{ {
XEXP (newexp, 0) = unit->condexp; XEXP (newexp, 0) = unit->condexp;
XEXP (newexp, 1) = make_numeric_value (1 << unit->num); XEXP (newexp, 1) = make_numeric_value (1 << unit->num);
unitsmask = operate_exp (OR_OP, unitsmask, newexp); unitsmask = operate_exp (OR_OP, unitsmask, newexp);
} }
} }
else else
{ {
/* Merge each function unit into the unit mask attributes. */ /* Merge each function unit into the unit mask attributes. */
for (unit = units; unit; unit = unit->next) for (unit = units; unit; unit = unit->next)
{ {
XEXP (newexp, 0) = unit->condexp; XEXP (newexp, 0) = unit->condexp;
XEXP (newexp, 1) = make_numeric_value (1 << unit->num); XEXP (newexp, 1) = make_numeric_value (1 << unit->num);
unitsmask = operate_exp (ORX_OP, unitsmask, attr_copy_rtx (newexp)); unitsmask = operate_exp (ORX_OP, unitsmask, attr_copy_rtx (newexp));
} }
} }
/* Simplify the unit mask expression, encode it, and make an attribute /* Simplify the unit mask expression, encode it, and make an attribute
...@@ -2048,11 +2046,11 @@ expand_units () ...@@ -2048,11 +2046,11 @@ expand_units ()
/* Sort the array of ops into increasing ready cost order. */ /* Sort the array of ops into increasing ready cost order. */
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
for (j = num - 1; j > i; j--) for (j = num - 1; j > i; j--)
if (op_array[j-1]->ready < op_array[j]->ready) if (op_array[j - 1]->ready < op_array[j]->ready)
{ {
op = op_array[j]; op = op_array[j];
op_array[j] = op_array[j-1]; op_array[j] = op_array[j - 1];
op_array[j-1] = op; op_array[j - 1] = op;
} }
/* Determine how many distinct non-default ready cost values there /* Determine how many distinct non-default ready cost values there
...@@ -2075,7 +2073,9 @@ expand_units () ...@@ -2075,7 +2073,9 @@ expand_units ()
XVEC (readycost, 0) = rtvec_alloc (nvalues * 2); XVEC (readycost, 0) = rtvec_alloc (nvalues * 2);
XEXP (readycost, 1) = make_numeric_value (1); XEXP (readycost, 1) = make_numeric_value (1);
nvalues = 0; orexp = false_rtx; value = op_array[0]->ready; nvalues = 0;
orexp = false_rtx;
value = op_array[0]->ready;
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
{ {
op = op_array[i]; op = op_array[i];
...@@ -2190,7 +2190,7 @@ expand_units () ...@@ -2190,7 +2190,7 @@ expand_units ()
|| atoi (XSTR (newexp, 0)) != 1); || atoi (XSTR (newexp, 0)) != 1);
/* If the all values of BLOCKAGE (E,C) have the same value, /* If the all values of BLOCKAGE (E,C) have the same value,
neither blockage function is written. */ neither blockage function is written. */
unit->needs_range_function unit->needs_range_function
= (unit->needs_blockage_function = (unit->needs_blockage_function
|| GET_CODE (max_blockage) != CONST_STRING); || GET_CODE (max_blockage) != CONST_STRING);
...@@ -2268,8 +2268,8 @@ simplify_knowing (exp, known_true) ...@@ -2268,8 +2268,8 @@ simplify_knowing (exp, known_true)
if (! unknown) if (! unknown)
{ {
exp = attr_rtx (IF_THEN_ELSE, known_true, exp, exp = attr_rtx (IF_THEN_ELSE, known_true, exp,
make_numeric_value (max)); make_numeric_value (max));
exp = simplify_by_exploding (exp); exp = simplify_by_exploding (exp);
} }
} }
return exp; return exp;
...@@ -2296,7 +2296,8 @@ encode_units_mask (x) ...@@ -2296,7 +2296,8 @@ encode_units_mask (x)
case CONST_STRING: case CONST_STRING:
i = atoi (XSTR (x, 0)); i = atoi (XSTR (x, 0));
if (i < 0) if (i < 0)
abort (); /* The sign bit encodes a one's compliment mask. */ /* The sign bit encodes a one's compliment mask. */
abort ();
else if (i != 0 && i == (i & -i)) else if (i != 0 && i == (i & -i))
/* Only one bit is set, so yield that unit number. */ /* Only one bit is set, so yield that unit number. */
for (j = 0; (i >>= 1) != 0; j++) for (j = 0; (i >>= 1) != 0; j++)
...@@ -2315,7 +2316,7 @@ encode_units_mask (x) ...@@ -2315,7 +2316,7 @@ encode_units_mask (x)
case CC0: case CC0:
case EQ_ATTR: case EQ_ATTR:
return x; return x;
default: default:
break; break;
} }
...@@ -2368,7 +2369,7 @@ fill_attr (attr) ...@@ -2368,7 +2369,7 @@ fill_attr (attr)
value = NULL; value = NULL;
if (XVEC (id->def, id->vec_idx)) if (XVEC (id->def, id->vec_idx))
for (i = 0; i < XVECLEN (id->def, id->vec_idx); i++) for (i = 0; i < XVECLEN (id->def, id->vec_idx); i++)
if (! strcmp (XSTR (XEXP (XVECEXP (id->def, id->vec_idx, i), 0), 0), if (! strcmp (XSTR (XEXP (XVECEXP (id->def, id->vec_idx, i), 0), 0),
attr->name)) attr->name))
value = XEXP (XVECEXP (id->def, id->vec_idx, i), 1); value = XEXP (XVECEXP (id->def, id->vec_idx, i), 1);
...@@ -2566,7 +2567,7 @@ write_length_unit_log () ...@@ -2566,7 +2567,7 @@ write_length_unit_log ()
{ {
length_or = ~length_or; length_or = ~length_or;
for (length_unit_log = 0; length_or & 1; length_or >>= 1) for (length_unit_log = 0; length_or & 1; length_or >>= 1)
length_unit_log++; length_unit_log++;
} }
printf ("int length_unit_log = %u;\n", length_unit_log); printf ("int length_unit_log = %u;\n", length_unit_log);
} }
...@@ -2865,7 +2866,7 @@ make_alternative_compare (mask) ...@@ -2865,7 +2866,7 @@ make_alternative_compare (mask)
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
computation. If a test condition involves an address, we leave the EQ_ATTR computation. If a test condition involves an address, we leave the EQ_ATTR
intact because addresses are only valid for the `length' attribute. intact because addresses are only valid for the `length' attribute.
EXP is the EQ_ATTR expression and VALUE is the value of that attribute EXP is the EQ_ATTR expression and VALUE is the value of that attribute
for the insn corresponding to INSN_CODE and INSN_INDEX. */ for the insn corresponding to INSN_CODE and INSN_INDEX. */
...@@ -2893,19 +2894,19 @@ evaluate_eq_attr (exp, value, insn_code, insn_index) ...@@ -2893,19 +2894,19 @@ evaluate_eq_attr (exp, value, insn_code, insn_index)
char *p, *string; char *p, *string;
if (GET_CODE (exp) != EQ_ATTR) if (GET_CODE (exp) != EQ_ATTR)
abort(); abort ();
string = (char *) alloca (2 + strlen (XSTR (exp, 0)) string = (char *) alloca (2 + strlen (XSTR (exp, 0))
+ strlen (XSTR (exp, 1))); + strlen (XSTR (exp, 1)));
strcpy (string, XSTR (exp, 0)); strcpy (string, XSTR (exp, 0));
strcat (string, "_"); strcat (string, "_");
strcat (string, XSTR (exp, 1)); strcat (string, XSTR (exp, 1));
for (p = string; *p ; p++) for (p = string; *p; p++)
*p = TOUPPER (*p); *p = TOUPPER (*p);
newexp = attr_rtx (EQ, value, newexp = attr_rtx (EQ, value,
attr_rtx (SYMBOL_REF, attr_rtx (SYMBOL_REF,
attr_string(string, strlen(string)))); attr_string (string, strlen (string))));
} }
else if (GET_CODE (value) == COND) else if (GET_CODE (value) == COND)
{ {
...@@ -2914,7 +2915,7 @@ evaluate_eq_attr (exp, value, insn_code, insn_index) ...@@ -2914,7 +2915,7 @@ evaluate_eq_attr (exp, value, insn_code, insn_index)
FALSE will be returned. FALSE will be returned.
Each case is the AND of the NOT's of the previous conditions with the Each case is the AND of the NOT's of the previous conditions with the
current condition; in the default case the current condition is TRUE. current condition; in the default case the current condition is TRUE.
For each possible COND value, call ourselves recursively. For each possible COND value, call ourselves recursively.
...@@ -2983,7 +2984,7 @@ evaluate_eq_attr (exp, value, insn_code, insn_index) ...@@ -2983,7 +2984,7 @@ evaluate_eq_attr (exp, value, insn_code, insn_index)
can be replaced with TRUE or FALSE, respectively. can be replaced with TRUE or FALSE, respectively.
Note that (eq_attr "att" "v1") and (eq_attr "att" "v2") cannot both Note that (eq_attr "att" "v1") and (eq_attr "att" "v2") cannot both
be true and hence are complementary. be true and hence are complementary.
There is one special case: If we see There is one special case: If we see
(and (not (eq_attr "att" "v1")) (and (not (eq_attr "att" "v1"))
...@@ -3005,7 +3006,7 @@ simplify_and_tree (exp, pterm, insn_code, insn_index) ...@@ -3005,7 +3006,7 @@ simplify_and_tree (exp, pterm, insn_code, insn_index)
if (GET_CODE (exp) == AND) if (GET_CODE (exp) == AND)
{ {
left = simplify_and_tree (XEXP (exp, 0), pterm, insn_code, insn_index); left = simplify_and_tree (XEXP (exp, 0), pterm, insn_code, insn_index);
right = simplify_and_tree (XEXP (exp, 1), pterm, insn_code, insn_index); right = simplify_and_tree (XEXP (exp, 1), pterm, insn_code, insn_index);
if (left != XEXP (exp, 0) || right != XEXP (exp, 1)) if (left != XEXP (exp, 0) || right != XEXP (exp, 1))
{ {
...@@ -3020,7 +3021,7 @@ simplify_and_tree (exp, pterm, insn_code, insn_index) ...@@ -3020,7 +3021,7 @@ simplify_and_tree (exp, pterm, insn_code, insn_index)
/* For the IOR case, we do the same as above, except that we can /* For the IOR case, we do the same as above, except that we can
only eliminate `term' if both sides of the IOR would do so. */ only eliminate `term' if both sides of the IOR would do so. */
temp = *pterm; temp = *pterm;
left = simplify_and_tree (XEXP (exp, 0), &temp, insn_code, insn_index); left = simplify_and_tree (XEXP (exp, 0), &temp, insn_code, insn_index);
left_eliminates_term = (temp == true_rtx); left_eliminates_term = (temp == true_rtx);
temp = *pterm; temp = *pterm;
...@@ -3124,7 +3125,7 @@ simplify_or_tree (exp, pterm, insn_code, insn_index) ...@@ -3124,7 +3125,7 @@ simplify_or_tree (exp, pterm, insn_code, insn_index)
if (GET_CODE (exp) == IOR) if (GET_CODE (exp) == IOR)
{ {
left = simplify_or_tree (XEXP (exp, 0), pterm, insn_code, insn_index); left = simplify_or_tree (XEXP (exp, 0), pterm, insn_code, insn_index);
right = simplify_or_tree (XEXP (exp, 1), pterm, insn_code, insn_index); right = simplify_or_tree (XEXP (exp, 1), pterm, insn_code, insn_index);
if (left != XEXP (exp, 0) || right != XEXP (exp, 1)) if (left != XEXP (exp, 0) || right != XEXP (exp, 1))
{ {
...@@ -3139,7 +3140,7 @@ simplify_or_tree (exp, pterm, insn_code, insn_index) ...@@ -3139,7 +3140,7 @@ simplify_or_tree (exp, pterm, insn_code, insn_index)
/* For the AND case, we do the same as above, except that we can /* For the AND case, we do the same as above, except that we can
only eliminate `term' if both sides of the AND would do so. */ only eliminate `term' if both sides of the AND would do so. */
temp = *pterm; temp = *pterm;
left = simplify_or_tree (XEXP (exp, 0), &temp, insn_code, insn_index); left = simplify_or_tree (XEXP (exp, 0), &temp, insn_code, insn_index);
left_eliminates_term = (temp == false_rtx); left_eliminates_term = (temp == false_rtx);
temp = *pterm; temp = *pterm;
...@@ -3183,7 +3184,7 @@ simplify_or_tree (exp, pterm, insn_code, insn_index) ...@@ -3183,7 +3184,7 @@ simplify_or_tree (exp, pterm, insn_code, insn_index)
code based on the values of other attributes being tested. This can code based on the values of other attributes being tested. This can
eliminate nested get_attr_... calls. eliminate nested get_attr_... calls.
Note that if an endless recursion is specified in the patterns, the Note that if an endless recursion is specified in the patterns, the
optimization will loop. However, it will do so in precisely the cases where optimization will loop. However, it will do so in precisely the cases where
an infinite recursion loop could occur during compilation. It's better that an infinite recursion loop could occur during compilation. It's better that
it occurs here! */ it occurs here! */
...@@ -3353,7 +3354,7 @@ simplify_test_exp (exp, insn_code, insn_index) ...@@ -3353,7 +3354,7 @@ simplify_test_exp (exp, insn_code, insn_index)
*/ */
else if (GET_CODE (left) == AND && GET_CODE (right) == AND else if (GET_CODE (left) == AND && GET_CODE (right) == AND
&& attr_equal_p (XEXP (left, 0), XEXP (right, 0))) && attr_equal_p (XEXP (left, 0), XEXP (right, 0)))
{ {
newexp = attr_rtx (IOR, XEXP (left, 1), XEXP (right, 1)); newexp = attr_rtx (IOR, XEXP (left, 1), XEXP (right, 1));
...@@ -3367,12 +3368,12 @@ simplify_test_exp (exp, insn_code, insn_index) ...@@ -3367,12 +3368,12 @@ simplify_test_exp (exp, insn_code, insn_index)
in this tree. Optimize if so. */ in this tree. Optimize if so. */
else if (insn_code >= 0 else if (insn_code >= 0
&& (GET_CODE (left) == IOR && (GET_CODE (left) == IOR
|| (GET_CODE (left) == EQ_ATTR || (GET_CODE (left) == EQ_ATTR
&& XSTR (left, 0) == alternative_name) && XSTR (left, 0) == alternative_name)
|| GET_CODE (right) == IOR || GET_CODE (right) == IOR
|| (GET_CODE (right) == EQ_ATTR || (GET_CODE (right) == EQ_ATTR
&& XSTR (right, 0) == alternative_name))) && XSTR (right, 0) == alternative_name)))
{ {
i = compute_alternative_mask (exp, IOR); i = compute_alternative_mask (exp, IOR);
if (i & ~insn_alternatives[insn_code]) if (i & ~insn_alternatives[insn_code])
...@@ -3458,7 +3459,7 @@ simplify_test_exp (exp, insn_code, insn_index) ...@@ -3458,7 +3459,7 @@ simplify_test_exp (exp, insn_code, insn_index)
if (current_alternative_string && XSTR (exp, 0) == alternative_name) if (current_alternative_string && XSTR (exp, 0) == alternative_name)
return (XSTR (exp, 1) == current_alternative_string return (XSTR (exp, 1) == current_alternative_string
? true_rtx : false_rtx); ? true_rtx : false_rtx);
/* Look at the value for this insn code in the specified attribute. /* Look at the value for this insn code in the specified attribute.
We normally can replace this comparison with the condition that We normally can replace this comparison with the condition that
would give this insn the values being tested for. */ would give this insn the values being tested for. */
...@@ -3469,7 +3470,7 @@ simplify_test_exp (exp, insn_code, insn_index) ...@@ -3469,7 +3470,7 @@ simplify_test_exp (exp, insn_code, insn_index)
if (ie->insn_code == insn_code) if (ie->insn_code == insn_code)
return evaluate_eq_attr (exp, av->value, insn_code, insn_index); return evaluate_eq_attr (exp, av->value, insn_code, insn_index);
break; break;
default: default:
break; break;
} }
...@@ -3497,10 +3498,13 @@ optimize_attrs () ...@@ -3497,10 +3498,13 @@ optimize_attrs ()
rtx newexp; rtx newexp;
int something_changed = 1; int something_changed = 1;
int i; int i;
struct attr_value_list { struct attr_value *av; struct attr_value_list
struct insn_ent *ie; {
struct attr_desc * attr; struct attr_value *av;
struct attr_value_list *next; }; struct insn_ent *ie;
struct attr_desc *attr;
struct attr_value_list *next;
};
struct attr_value_list **insn_code_values; struct attr_value_list **insn_code_values;
struct attr_value_list *ivbuf; struct attr_value_list *ivbuf;
struct attr_value_list *iv; struct attr_value_list *iv;
...@@ -3609,7 +3613,6 @@ simplify_by_alternatives (exp, insn_code, insn_index) ...@@ -3609,7 +3613,6 @@ simplify_by_alternatives (exp, insn_code, insn_index)
rtx newexp = rtx_alloc (COND); rtx newexp = rtx_alloc (COND);
rtx ultimate; rtx ultimate;
XVEC (newexp, 0) = rtvec_alloc (len * 2); XVEC (newexp, 0) = rtvec_alloc (len * 2);
/* It will not matter what value we use as the default value /* It will not matter what value we use as the default value
...@@ -3706,8 +3709,8 @@ simplify_by_exploding (exp) ...@@ -3706,8 +3709,8 @@ simplify_by_exploding (exp)
{ {
struct dimension tmp; struct dimension tmp;
tmp = space[j]; tmp = space[j];
space[j] = space[j-1]; space[j] = space[j - 1];
space[j-1] = tmp; space[j - 1] = tmp;
} }
/* Establish the initial current value. */ /* Establish the initial current value. */
...@@ -3875,7 +3878,8 @@ add_values_to_cover (dim) ...@@ -3875,7 +3878,8 @@ add_values_to_cover (dim)
if (nalt < dim->num_values) if (nalt < dim->num_values)
abort (); abort ();
else if (nalt == dim->num_values) else if (nalt == dim->num_values)
; /* Ok. */ /* OK. */
;
else if (nalt * 2 < dim->num_values * 3) else if (nalt * 2 < dim->num_values * 3)
{ {
/* Most all the values of the attribute are used, so add all the unused /* Most all the values of the attribute are used, so add all the unused
...@@ -4104,7 +4108,7 @@ clear_struct_flag (x) ...@@ -4104,7 +4108,7 @@ clear_struct_flag (x)
case EQ_ATTR: case EQ_ATTR:
case ATTR_FLAG: case ATTR_FLAG:
return; return;
default: default:
break; break;
} }
...@@ -4159,7 +4163,7 @@ count_sub_rtxs (x, max) ...@@ -4159,7 +4163,7 @@ count_sub_rtxs (x, max)
case EQ_ATTR: case EQ_ATTR:
case ATTR_FLAG: case ATTR_FLAG:
return 1; return 1;
default: default:
break; break;
} }
...@@ -4248,7 +4252,8 @@ gen_attr (exp, lineno) ...@@ -4248,7 +4252,8 @@ gen_attr (exp, lineno)
if (! strcmp (attr->name, "length") && ! attr->is_numeric) if (! strcmp (attr->name, "length") && ! attr->is_numeric)
{ {
message_with_line (lineno, "`length' attribute must take numeric values"); message_with_line (lineno,
"`length' attribute must take numeric values");
have_error = 1; have_error = 1;
} }
...@@ -4267,7 +4272,7 @@ count_alternatives (exp) ...@@ -4267,7 +4272,7 @@ count_alternatives (exp)
{ {
int i, j, n; int i, j, n;
const char *fmt; const char *fmt;
if (GET_CODE (exp) == MATCH_OPERAND) if (GET_CODE (exp) == MATCH_OPERAND)
return n_comma_elts (XSTR (exp, 2)); return n_comma_elts (XSTR (exp, 2));
...@@ -4361,7 +4366,7 @@ contained_in_p (inner, exp) ...@@ -4361,7 +4366,7 @@ 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
...@@ -4404,7 +4409,7 @@ gen_insn (exp, lineno) ...@@ -4404,7 +4409,7 @@ gen_insn (exp, lineno)
id->vec_idx = 0; id->vec_idx = 0;
got_define_asm_attributes = 1; got_define_asm_attributes = 1;
break; break;
default: default:
abort (); abort ();
} }
...@@ -4424,7 +4429,7 @@ gen_delay (def, lineno) ...@@ -4424,7 +4429,7 @@ gen_delay (def, lineno)
if (XVECLEN (def, 1) % 3 != 0) if (XVECLEN (def, 1) % 3 != 0)
{ {
message_with_line (lineno, message_with_line (lineno,
"number of elements in DEFINE_DELAY must be multiple of three"); "number of elements in DEFINE_DELAY must be multiple of three");
have_error = 1; have_error = 1;
return; return;
} }
...@@ -4436,7 +4441,7 @@ gen_delay (def, lineno) ...@@ -4436,7 +4441,7 @@ gen_delay (def, lineno)
if (XVECEXP (def, 1, i + 2)) if (XVECEXP (def, 1, i + 2))
have_annul_false = 1; have_annul_false = 1;
} }
delay = (struct delay_desc *) oballoc (sizeof (struct delay_desc)); delay = (struct delay_desc *) oballoc (sizeof (struct delay_desc));
delay->def = def; delay->def = def;
delay->num = ++num_delays; delay->num = ++num_delays;
...@@ -4445,7 +4450,7 @@ gen_delay (def, lineno) ...@@ -4445,7 +4450,7 @@ gen_delay (def, 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.
We fill in a `struct function_unit_op' and a `struct function_unit' We fill in a `struct function_unit_op' and a `struct function_unit'
...@@ -4475,8 +4480,8 @@ gen_unit (def, lineno) ...@@ -4475,8 +4480,8 @@ gen_unit (def, lineno)
|| unit->simultaneity != simultaneity) || unit->simultaneity != simultaneity)
{ {
message_with_line (lineno, message_with_line (lineno,
"differing specifications given for function unit %s", "differing specifications given for function unit %s",
unit->name); unit->name);
message_with_line (unit->first_lineno, "previous definition"); message_with_line (unit->first_lineno, "previous definition");
have_error = 1; have_error = 1;
return; return;
...@@ -4537,7 +4542,7 @@ gen_unit (def, lineno) ...@@ -4537,7 +4542,7 @@ gen_unit (def, lineno)
} }
/* 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.
The first bit of FLAGS will be non-zero in that case. The first bit of FLAGS will be non-zero in that case.
...@@ -4571,7 +4576,7 @@ write_test_expr (exp, flags) ...@@ -4571,7 +4576,7 @@ write_test_expr (exp, flags)
case ASHIFT: case LSHIFTRT: case ASHIFTRT: case ASHIFT: case LSHIFTRT: case ASHIFTRT:
write_test_expr (XEXP (exp, 0), flags | comparison_operator); write_test_expr (XEXP (exp, 0), flags | comparison_operator);
switch (code) switch (code)
{ {
case EQ: case EQ:
printf (" == "); printf (" == ");
break; break;
...@@ -4641,7 +4646,7 @@ write_test_expr (exp, flags) ...@@ -4641,7 +4646,7 @@ write_test_expr (exp, flags)
break; break;
default: default:
abort (); abort ();
} }
write_test_expr (XEXP (exp, 1), flags | comparison_operator); write_test_expr (XEXP (exp, 1), flags | comparison_operator);
break; break;
...@@ -4657,7 +4662,7 @@ write_test_expr (exp, flags) ...@@ -4657,7 +4662,7 @@ write_test_expr (exp, flags)
/* Otherwise, fall through to normal unary operator. */ /* Otherwise, fall through to normal unary operator. */
/* Unary operators. */ /* Unary operators. */
case ABS: case NEG: case ABS: case NEG:
switch (code) switch (code)
{ {
...@@ -4694,7 +4699,8 @@ write_test_expr (exp, flags) ...@@ -4694,7 +4699,8 @@ write_test_expr (exp, flags)
} }
attr = find_attr (XSTR (exp, 0), 0); attr = find_attr (XSTR (exp, 0), 0);
if (! attr) abort (); if (! attr)
abort ();
/* Now is the time to expand the value of a constant attribute. */ /* Now is the time to expand the value of a constant attribute. */
if (attr->is_const) if (attr->is_const)
...@@ -4725,7 +4731,7 @@ write_test_expr (exp, flags) ...@@ -4725,7 +4731,7 @@ write_test_expr (exp, flags)
case MATCH_OPERAND: case MATCH_OPERAND:
/* If only a mode is given, just ensure the mode matches the operand. /* If only a mode is given, just ensure the mode matches the operand.
If neither a mode nor predicate is given, error. */ If neither a mode nor predicate is given, error. */
if (XSTR (exp, 1) == NULL || *XSTR (exp, 1) == '\0') if (XSTR (exp, 1) == NULL || *XSTR (exp, 1) == '\0')
{ {
if (GET_MODE (exp) == VOIDmode) if (GET_MODE (exp) == VOIDmode)
fatal ("Null MATCH_OPERAND specified as test"); fatal ("Null MATCH_OPERAND specified as test");
...@@ -4764,7 +4770,7 @@ write_test_expr (exp, flags) ...@@ -4764,7 +4770,7 @@ write_test_expr (exp, flags)
address of the next insn for forward branches, and both with address of the next insn for forward branches, and both with
adjustments that account for the worst-case possible stretching of adjustments that account for the worst-case possible stretching of
intervening alignments between this insn and its destination. */ intervening alignments between this insn and its destination. */
printf("insn_current_reference_address (insn)"); printf ("insn_current_reference_address (insn)");
break; break;
case CONST_STRING: case CONST_STRING:
...@@ -4955,7 +4961,7 @@ write_attr_get (attr) ...@@ -4955,7 +4961,7 @@ write_attr_get (attr)
switch we will generate. */ switch we will generate. */
common_av = find_most_used (attr); common_av = find_most_used (attr);
/* Write out prototype of function. */ /* Write out prototype of function. */
if (!attr->is_numeric) if (!attr->is_numeric)
printf ("extern enum attr_%s ", attr->name); printf ("extern enum attr_%s ", attr->name);
else if (attr->unsigned_p) else if (attr->unsigned_p)
...@@ -5007,7 +5013,7 @@ write_attr_get (attr) ...@@ -5007,7 +5013,7 @@ write_attr_get (attr)
{ {
rtx p = XEXP (common_av->value, 0); rtx p = XEXP (common_av->value, 0);
/* No need to emit code to abort if the insn is unrecognized; the /* No need to emit code to abort if the insn is unrecognized; the
other get_attr_foo functions will do that when we call them. */ other get_attr_foo functions will do that when we call them. */
write_toplevel_expr (p); write_toplevel_expr (p);
...@@ -5101,8 +5107,8 @@ write_attr_set (attr, indent, value, prefix, suffix, known_true, ...@@ -5101,8 +5107,8 @@ write_attr_set (attr, indent, value, prefix, suffix, known_true,
XVECEXP (value, 0, i), XVECEXP (value, 0, i),
insn_code, insn_index); insn_code, insn_index);
newexp = attr_rtx (NOT, testexp); newexp = attr_rtx (NOT, testexp);
newexp = insert_right_side (AND, our_known_true, newexp, newexp = insert_right_side (AND, our_known_true, newexp,
insn_code, insn_index); insn_code, insn_index);
/* If the test expression is always true or if the next `known_true' /* If the test expression is always true or if the next `known_true'
expression is always false, this is the last case, so break expression is always false, this is the last case, so break
...@@ -5130,7 +5136,7 @@ write_attr_set (attr, indent, value, prefix, suffix, known_true, ...@@ -5130,7 +5136,7 @@ write_attr_set (attr, indent, value, prefix, suffix, known_true,
write_indent (indent + 2); write_indent (indent + 2);
printf ("{\n"); printf ("{\n");
write_attr_set (attr, indent + 4, write_attr_set (attr, indent + 4,
XVECEXP (value, 0, i + 1), prefix, suffix, XVECEXP (value, 0, i + 1), prefix, suffix,
inner_true, insn_code, insn_index); inner_true, insn_code, insn_index);
write_indent (indent + 2); write_indent (indent + 2);
...@@ -5296,11 +5302,11 @@ write_toplevel_expr (p) ...@@ -5296,11 +5302,11 @@ write_toplevel_expr (p)
int i; int i;
for (i = 0; i < MAX_ATTRS_INDEX; ++i) for (i = 0; i < MAX_ATTRS_INDEX; ++i)
for (attr = attrs[i]; attr ; attr = attr->next) for (attr = attrs[i]; attr; attr = attr->next)
if (!attr->is_const) if (!attr->is_const)
write_expr_attr_cache (p, attr); write_expr_attr_cache (p, attr);
printf(" register unsigned long accum = 0;\n\n"); printf (" register unsigned long accum = 0;\n\n");
while (GET_CODE (p) == IOR) while (GET_CODE (p) == IOR)
{ {
...@@ -5410,7 +5416,7 @@ write_attr_value (attr, value) ...@@ -5410,7 +5416,7 @@ write_attr_value (attr, value)
case ATTR: case ATTR:
{ {
struct attr_desc *attr2 = find_attr (XSTR (value, 0), 0); struct attr_desc *attr2 = find_attr (XSTR (value, 0), 0);
printf ("get_attr_%s (%s)", attr2->name, printf ("get_attr_%s (%s)", attr2->name,
(attr2->is_const ? "" : "insn")); (attr2->is_const ? "" : "insn"));
} }
break; break;
...@@ -5449,11 +5455,11 @@ write_upcase (str) ...@@ -5449,11 +5455,11 @@ write_upcase (str)
const char *str; const char *str;
{ {
while (*str) while (*str)
{ {
/* The argument of TOUPPER should not have side effects. */ /* The argument of TOUPPER should not have side effects. */
putchar (TOUPPER(*str)); putchar (TOUPPER(*str));
str++; str++;
} }
} }
static void static void
...@@ -5481,7 +5487,7 @@ write_indent (indent) ...@@ -5481,7 +5487,7 @@ write_indent (indent)
static void static void
write_eligible_delay (kind) write_eligible_delay (kind)
const char *kind; const char *kind;
{ {
struct delay_desc *delay; struct delay_desc *delay;
int max_slots; int max_slots;
...@@ -5501,8 +5507,8 @@ write_eligible_delay (kind) ...@@ -5501,8 +5507,8 @@ write_eligible_delay (kind)
/* Write function prelude. */ /* Write function prelude. */
printf ("int\n"); printf ("int\n");
printf ("eligible_for_%s (delay_insn, slot, candidate_insn, flags)\n", printf ("eligible_for_%s (delay_insn, slot, candidate_insn, flags)\n",
kind); kind);
printf (" rtx delay_insn;\n"); printf (" rtx delay_insn;\n");
printf (" int slot;\n"); printf (" int slot;\n");
printf (" rtx candidate_insn;\n"); printf (" rtx candidate_insn;\n");
...@@ -5519,7 +5525,8 @@ write_eligible_delay (kind) ...@@ -5519,7 +5525,8 @@ write_eligible_delay (kind)
if (num_delays > 1) if (num_delays > 1)
{ {
attr = find_attr ("*delay_type", 0); attr = find_attr ("*delay_type", 0);
if (! attr) abort (); if (! attr)
abort ();
common_av = find_most_used (attr); common_av = find_most_used (attr);
printf (" insn = delay_insn;\n"); printf (" insn = delay_insn;\n");
...@@ -5547,7 +5554,8 @@ write_eligible_delay (kind) ...@@ -5547,7 +5554,8 @@ write_eligible_delay (kind)
printf (" {\n"); printf (" {\n");
attr = find_attr ("*delay_1_0", 0); attr = find_attr ("*delay_1_0", 0);
if (! attr) abort (); if (! attr)
abort ();
common_av = find_most_used (attr); common_av = find_most_used (attr);
for (av = attr->first_value; av; av = av->next) for (av = attr->first_value; av; av = av->next)
...@@ -5576,7 +5584,8 @@ write_eligible_delay (kind) ...@@ -5576,7 +5584,8 @@ write_eligible_delay (kind)
sprintf (str, "*%s_%d_%d", kind, delay->num, i / 3); sprintf (str, "*%s_%d_%d", kind, delay->num, i / 3);
attr = find_attr (str, 0); attr = find_attr (str, 0);
if (! attr) abort (); if (! attr)
abort ();
common_av = find_most_used (attr); common_av = find_most_used (attr);
for (av = attr->first_value; av; av = av->next) for (av = attr->first_value; av; av = av->next)
...@@ -5588,7 +5597,7 @@ write_eligible_delay (kind) ...@@ -5588,7 +5597,7 @@ write_eligible_delay (kind)
} }
printf (" default:\n"); printf (" default:\n");
printf (" abort ();\n"); printf (" abort ();\n");
printf (" }\n"); printf (" }\n");
} }
...@@ -5681,8 +5690,7 @@ write_complex_function (unit, name, connection) ...@@ -5681,8 +5690,7 @@ write_complex_function (unit, name, connection)
printf ("static int %s_unit_%s PARAMS ((rtx, rtx));\n", unit->name, name); printf ("static int %s_unit_%s PARAMS ((rtx, rtx));\n", unit->name, name);
printf ("static int\n"); printf ("static int\n");
printf ("%s_unit_%s (executing_insn, candidate_insn)\n", printf ("%s_unit_%s (executing_insn, candidate_insn)\n", unit->name, name);
unit->name, name);
printf (" rtx executing_insn;\n"); printf (" rtx executing_insn;\n");
printf (" rtx candidate_insn;\n"); printf (" rtx candidate_insn;\n");
printf ("{\n"); printf ("{\n");
...@@ -5696,7 +5704,8 @@ write_complex_function (unit, name, connection) ...@@ -5696,7 +5704,8 @@ write_complex_function (unit, name, connection)
str = (char *) alloca (strlen (unit->name) + strlen (name) + strlen (connection) + 10); str = (char *) alloca (strlen (unit->name) + strlen (name) + strlen (connection) + 10);
sprintf (str, "*%s_cases", unit->name); sprintf (str, "*%s_cases", unit->name);
case_attr = find_attr (str, 0); case_attr = find_attr (str, 0);
if (! case_attr) abort (); if (! case_attr)
abort ();
common_av = find_most_used (case_attr); common_av = find_most_used (case_attr);
for (av = case_attr->first_value; av; av = av->next) for (av = case_attr->first_value; av; av = av->next)
...@@ -5729,7 +5738,8 @@ write_complex_function (unit, name, connection) ...@@ -5729,7 +5738,8 @@ write_complex_function (unit, name, connection)
printf (" case %d:\n", i); printf (" case %d:\n", i);
sprintf (str, "*%s_%s_%d", unit->name, connection, i); sprintf (str, "*%s_%s_%d", unit->name, connection, i);
attr = find_attr (str, 0); attr = find_attr (str, 0);
if (! attr) abort (); if (! attr)
abort ();
/* If single value, just write it. */ /* If single value, just write it. */
value = find_single_value (attr); value = find_single_value (attr);
...@@ -5945,8 +5955,10 @@ extend_range (range, min, max) ...@@ -5945,8 +5955,10 @@ extend_range (range, min, max)
int min; int min;
int max; int max;
{ {
if (range->min > min) range->min = min; if (range->min > min)
if (range->max < max) range->max = max; range->min = min;
if (range->max < max)
range->max = max;
} }
static rtx static rtx
...@@ -5973,7 +5985,7 @@ copy_rtx_unchanging (orig) ...@@ -5973,7 +5985,7 @@ copy_rtx_unchanging (orig)
case SYMBOL_REF: case SYMBOL_REF:
case CODE_LABEL: case CODE_LABEL:
return orig; return orig;
default: default:
break; break;
} }
...@@ -5981,7 +5993,7 @@ copy_rtx_unchanging (orig) ...@@ -5981,7 +5993,7 @@ copy_rtx_unchanging (orig)
copy = rtx_alloc (code); copy = rtx_alloc (code);
PUT_MODE (copy, GET_MODE (orig)); PUT_MODE (copy, GET_MODE (orig));
RTX_UNCHANGING_P (copy) = 1; RTX_UNCHANGING_P (copy) = 1;
bcopy ((char *) &XEXP (orig, 0), (char *) &XEXP (copy, 0), bcopy ((char *) &XEXP (orig, 0), (char *) &XEXP (copy, 0),
GET_RTX_LENGTH (GET_CODE (copy)) * sizeof (rtx)); GET_RTX_LENGTH (GET_CODE (copy)) * sizeof (rtx));
return copy; return copy;
...@@ -6013,8 +6025,8 @@ write_const_num_delay_slots () ...@@ -6013,8 +6025,8 @@ write_const_num_delay_slots ()
if (length_used) if (length_used)
{ {
for (ie = av->first_insn; ie; ie = ie->next) for (ie = av->first_insn; ie; ie = ie->next)
if (ie->insn_code != -1) if (ie->insn_code != -1)
printf (" case %d:\n", ie->insn_code); printf (" case %d:\n", ie->insn_code);
printf (" return 0;\n"); printf (" return 0;\n");
} }
} }
...@@ -6024,7 +6036,6 @@ write_const_num_delay_slots () ...@@ -6024,7 +6036,6 @@ write_const_num_delay_slots ()
printf (" }\n}\n\n"); printf (" }\n}\n\n");
} }
} }
extern int main PARAMS ((int, char **)); extern int main PARAMS ((int, char **));
...@@ -6087,29 +6098,29 @@ from the machine description file `md'. */\n\n"); ...@@ -6087,29 +6098,29 @@ from the machine description file `md'. */\n\n");
switch (GET_CODE (desc)) switch (GET_CODE (desc))
{ {
case DEFINE_INSN: case DEFINE_INSN:
case DEFINE_PEEPHOLE: case DEFINE_PEEPHOLE:
case DEFINE_ASM_ATTRIBUTES: case DEFINE_ASM_ATTRIBUTES:
gen_insn(desc, lineno); gen_insn (desc, lineno);
break; break;
case DEFINE_ATTR:
gen_attr (desc, lineno);
break;
case DEFINE_DELAY: case DEFINE_ATTR:
gen_delay (desc, lineno); gen_attr (desc, lineno);
break; break;
case DEFINE_FUNCTION_UNIT: case DEFINE_DELAY:
gen_unit (desc, lineno); gen_delay (desc, lineno);
break; break;
default: case DEFINE_FUNCTION_UNIT:
break; gen_unit (desc, lineno);
break;
default:
break;
} }
if (GET_CODE (desc) != DEFINE_ASM_ATTRIBUTES) if (GET_CODE (desc) != DEFINE_ASM_ATTRIBUTES)
insn_index_number++; insn_index_number++;
} }
if (have_error) if (have_error)
...@@ -6144,7 +6155,7 @@ from the machine description file `md'. */\n\n"); ...@@ -6144,7 +6155,7 @@ from the machine description file `md'. */\n\n");
printf ("#include \"output.h\"\n"); printf ("#include \"output.h\"\n");
printf ("#include \"insn-attr.h\"\n"); printf ("#include \"insn-attr.h\"\n");
printf ("#include \"toplev.h\"\n"); printf ("#include \"toplev.h\"\n");
printf ("\n"); printf ("\n");
printf ("#define operands recog_data.operand\n\n"); printf ("#define operands recog_data.operand\n\n");
/* Make `insn_alternatives'. */ /* Make `insn_alternatives'. */
......
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