summaryrefslogtreecommitdiff
path: root/gcc/gensupport.c
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2015-06-13 09:48:35 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2015-06-13 09:48:35 +0000
commit2ff8d4ae52e8294cc4647ded1d1a85e4c3e459e5 (patch)
tree73afaadfb9d218323d01fe93da665d1a87626ac0 /gcc/gensupport.c
parent125a2cf7d2ef6e6730419425e4e587ceed2773be (diff)
downloadgcc-2ff8d4ae52e8294cc4647ded1d1a85e4c3e459e5.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@224454 138bc75d-0d04-0410-961f-82ee72b054a4
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 2f26f3a87ae..dc73cf9ae17 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++)
{