/* Output code to construct and return the rtl for the instruction body. */
- if (XVECLEN (insn, 1) == 1)
- {
- printf (" return ");
- gen_exp (XVECEXP (insn, 1, 0), DEFINE_INSN, NULL);
- 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);
- }
+ 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 (pattern, DEFINE_INSN, used);
+ printf (";\n}\n\n");
+ XDELETEVEC (used);
}
\f
/* Generate the `gen_...' function for a DEFINE_EXPAND. */
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
XWINT (rt, 0) = arg;
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;
+ }
+}
\f
/* Predicate handling.
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);
- XVEC (insn, 1) = rtvec_alloc (1);
- XVECEXP (insn, 1, 0) = pattern;
- }
+ 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)
{
/* 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);
- XVEC (split, 0) = rtvec_alloc (1);
- XVECEXP (split, 0, 0) = pattern;
- }
+ 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++)
{