Commit 313d38e3 by Richard Sandiford Committed by Richard Sandiford

gensupport.h (add_implicit_parallel): Declare.

gcc/
	* gensupport.h (add_implicit_parallel): Declare.
	* genrecog.c (add_implicit_parallel): Move to...
	* gensupport.c (add_implicit_parallel): ...here.
	(process_one_cond_exec): Use it.
	* genemit.c (gen_insn): Likewise.

From-SVN: r224454
parent a6860be9
2015-06-13 Richard Sandiford <richard.sandiford@arm.com>
* gensupport.h (add_implicit_parallel): Declare.
* genrecog.c (add_implicit_parallel): Move to...
* gensupport.c (add_implicit_parallel): ...here.
(process_one_cond_exec): Use it.
* genemit.c (gen_insn): Likewise.
2015-06-13 Iain Sandoe <iain@codesourcery.com>
PR bootstrap/66448
......
......@@ -378,27 +378,15 @@ gen_insn (rtx insn, int lineno)
/* Output code to construct and return the rtl for the instruction body. */
if (XVECLEN (insn, 1) == 1)
{
rtx pattern = add_implicit_parallel (XVEC (insn, 1));
/* ??? This is the traditional behavior, but seems suspect. */
char *used = (XVECLEN (insn, 1) == 1
? NULL
: XCNEWVEC (char, stats.num_generator_args));
printf (" return ");
gen_exp (XVECEXP (insn, 1, 0), DEFINE_INSN, NULL);
gen_exp (pattern, DEFINE_INSN, used);
printf (";\n}\n\n");
}
else
{
char *used = XCNEWVEC (char, stats.num_generator_args);
printf (" return gen_rtx_PARALLEL (VOIDmode, gen_rtvec (%d",
XVECLEN (insn, 1));
for (i = 0; i < XVECLEN (insn, 1); i++)
{
printf (",\n\t\t");
gen_exp (XVECEXP (insn, 1, i), DEFINE_INSN, used);
}
printf ("));\n}\n\n");
XDELETEVEC (used);
}
}
/* Generate the `gen_...' function for a DEFINE_EXPAND. */
......
......@@ -5185,22 +5185,6 @@ print_subroutine_group (output_state *os, routine_type type, state *root)
print_subroutine (os, root, 0);
}
/* Return the rtx pattern specified by the list of rtxes in a
define_insn or define_split. */
static rtx
add_implicit_parallel (rtvec vec)
{
if (GET_NUM_ELEM (vec) == 1)
return RTVEC_ELT (vec, 0);
else
{
rtx pattern = rtx_alloc (PARALLEL);
XVEC (pattern, 0) = vec;
return pattern;
}
}
/* Return the rtx pattern for the list of rtxes in a define_peephole2. */
static rtx
......
......@@ -143,6 +143,22 @@ gen_rtx_CONST_INT (machine_mode ARG_UNUSED (mode),
return rt;
}
/* Return the rtx pattern specified by the list of rtxes in a
define_insn or define_split. */
rtx
add_implicit_parallel (rtvec vec)
{
if (GET_NUM_ELEM (vec) == 1)
return RTVEC_ELT (vec, 0);
else
{
rtx pattern = rtx_alloc (PARALLEL);
XVEC (pattern, 0) = vec;
return pattern;
}
}
/* Predicate handling.
We construct from the machine description a table mapping each
......@@ -1702,19 +1718,9 @@ process_one_cond_exec (struct queue_elem *ce_elem)
XSTR (insn, 0) = new_name;
pattern = rtx_alloc (COND_EXEC);
XEXP (pattern, 0) = pred;
if (XVECLEN (insn, 1) == 1)
{
XEXP (pattern, 1) = XVECEXP (insn, 1, 0);
XVECEXP (insn, 1, 0) = pattern;
PUT_NUM_ELEM (XVEC (insn, 1), 1);
}
else
{
XEXP (pattern, 1) = rtx_alloc (PARALLEL);
XVEC (XEXP (pattern, 1), 0) = XVEC (insn, 1);
XEXP (pattern, 1) = add_implicit_parallel (XVEC (insn, 1));
XVEC (insn, 1) = rtvec_alloc (1);
XVECEXP (insn, 1, 0) = pattern;
}
if (XVEC (ce_elem->data, 3) != NULL)
{
......@@ -1759,19 +1765,10 @@ process_one_cond_exec (struct queue_elem *ce_elem)
/* Predicate the pattern matched by the split. */
pattern = rtx_alloc (COND_EXEC);
XEXP (pattern, 0) = pred;
if (XVECLEN (split, 0) == 1)
{
XEXP (pattern, 1) = XVECEXP (split, 0, 0);
XVECEXP (split, 0, 0) = pattern;
PUT_NUM_ELEM (XVEC (split, 0), 1);
}
else
{
XEXP (pattern, 1) = rtx_alloc (PARALLEL);
XVEC (XEXP (pattern, 1), 0) = XVEC (split, 0);
XEXP (pattern, 1) = add_implicit_parallel (XVEC (split, 0));
XVEC (split, 0) = rtvec_alloc (1);
XVECEXP (split, 0, 0) = pattern;
}
/* Predicate all of the insns generated by the split. */
for (i = 0; i < XVECLEN (split, 2); i++)
{
......
......@@ -23,6 +23,7 @@ along with GCC; see the file COPYING3. If not see
struct obstack;
extern struct obstack *rtl_obstack;
extern rtx add_implicit_parallel (rtvec);
extern bool init_rtx_reader_args_cb (int, char **, bool (*)(const char *));
extern bool init_rtx_reader_args (int, char **);
extern rtx read_md_rtx (int *, int *);
......
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