aboutsummaryrefslogtreecommitdiff
path: root/gcc/gensupport.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2015-06-13 09:48:35 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2015-06-13 09:48:35 +0000
commit313d38e359bfcd8b56c946233294061c66ae21dc (patch)
tree73afaadfb9d218323d01fe93da665d1a87626ac0 /gcc/gensupport.c
parenta6860be9c89b7025c938f7a53c209478d3d84ca9 (diff)
downloadgcc-313d38e359bfcd8b56c946233294061c66ae21dc.zip
gcc-313d38e359bfcd8b56c946233294061c66ae21dc.tar.gz
gcc-313d38e359bfcd8b56c946233294061c66ae21dc.tar.bz2
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
Diffstat (limited to 'gcc/gensupport.c')
-rw-r--r--gcc/gensupport.c49
1 files changed, 23 insertions, 26 deletions
diff --git a/gcc/gensupport.c b/gcc/gensupport.c
index 2f26f3a..dc73cf9 100644
--- a/gcc/gensupport.c
+++ b/gcc/gensupport.c
@@ -142,6 +142,22 @@ gen_rtx_CONST_INT (machine_mode ARG_UNUSED (mode),
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;
+ }
+}
/* Predicate handling.
@@ -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);
- 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)
{
@@ -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);
- 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++)
{