XEXP (XEXP (single_set, loc[0]), loc[1]). */
};
+DEF_VEC_P(rtx);
+DEF_VEC_ALLOC_P(rtx,heap);
+
/* Information about accumulators to expand. */
struct var_to_expand
{
rtx insn; /* The insn in that the variable expansion occurs. */
rtx reg; /* The accumulator which is expanded. */
- varray_type var_expansions; /* The copies of the accumulator which is expanded. */
+ VEC(rtx,heap) *var_expansions; /* The copies of the accumulator which is expanded. */
enum rtx_code op; /* The type of the accumulation - addition, subtraction
or multiplication. */
int expansion_count; /* Count the number of expansions generated so far. */
/* Record the accumulator to expand. */
ves = xmalloc (sizeof (struct var_to_expand));
ves->insn = insn;
- VARRAY_RTX_INIT (ves->var_expansions, 1, "var_expansions");
+ ves->var_expansions = VEC_alloc (rtx, heap, 1);
ves->reg = copy_rtx (dest);
ves->op = GET_CODE (src);
ves->expansion_count = 0;
if (ve->reuse_expansion == 0)
reg = ve->reg;
else
- reg = VARRAY_RTX (ve->var_expansions, ve->reuse_expansion - 1);
+ reg = VEC_index (rtx, ve->var_expansions, ve->reuse_expansion - 1);
- if (VARRAY_ACTIVE_SIZE (ve->var_expansions) == (unsigned) ve->reuse_expansion)
+ if (VEC_length (rtx, ve->var_expansions) == (unsigned) ve->reuse_expansion)
ve->reuse_expansion = 0;
else
ve->reuse_expansion++;
if (apply_change_group ())
if (really_new_expansion)
{
- VARRAY_PUSH_RTX (ve->var_expansions, new_reg);
+ VEC_safe_push (rtx, heap, ve->var_expansions, new_reg);
ve->expansion_count++;
}
}
rtx seq, var, zero_init, insn;
unsigned i;
- if (VARRAY_ACTIVE_SIZE (ve->var_expansions) == 0)
+ if (VEC_length (rtx, ve->var_expansions) == 0)
return 1;
start_sequence ();
if (ve->op == PLUS || ve->op == MINUS)
- for (i = 0; i < VARRAY_ACTIVE_SIZE (ve->var_expansions); i++)
+ for (i = 0; VEC_iterate (rtx, ve->var_expansions, i, var); i++)
{
- var = VARRAY_RTX (ve->var_expansions, i);
zero_init = CONST0_RTX (GET_MODE (var));
emit_move_insn (var, zero_init);
}
else if (ve->op == MULT)
- for (i = 0; i < VARRAY_ACTIVE_SIZE (ve->var_expansions); i++)
+ for (i = 0; VEC_iterate (rtx, ve->var_expansions, i, var); i++)
{
- var = VARRAY_RTX (ve->var_expansions, i);
zero_init = CONST1_RTX (GET_MODE (var));
emit_move_insn (var, zero_init);
}
rtx expr, seq, var, insn;
unsigned i;
- if (VARRAY_ACTIVE_SIZE (ve->var_expansions) == 0)
+ if (VEC_length (rtx, ve->var_expansions) == 0)
return 1;
start_sequence ();
if (ve->op == PLUS || ve->op == MINUS)
- for (i = 0; i < VARRAY_ACTIVE_SIZE (ve->var_expansions); i++)
+ for (i = 0; VEC_iterate (rtx, ve->var_expansions, i, var); i++)
{
- var = VARRAY_RTX (ve->var_expansions, i);
sum = simplify_gen_binary (PLUS, GET_MODE (ve->reg),
var, sum);
}
else if (ve->op == MULT)
- for (i = 0; i < VARRAY_ACTIVE_SIZE (ve->var_expansions); i++)
+ for (i = 0; VEC_iterate (rtx, ve->var_expansions, i, var); i++)
{
- var = VARRAY_RTX (ve->var_expansions, i);
sum = simplify_gen_binary (MULT, GET_MODE (ve->reg),
var, sum);
}
{
struct var_to_expand *ve = *slot;
- VARRAY_CLEAR (ve->var_expansions);
+ VEC_free (rtx, heap, ve->var_expansions);
/* Continue traversing the hash table. */
return 1;