aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorAlan Lawrence <alan.lawrence@arm.com>2014-11-13 16:35:06 +0000
committerAlan Lawrence <alalaw01@gcc.gnu.org>2014-11-13 16:35:06 +0000
commit1c4188463c7e81c3345a7d4e87eccb5b5a168c44 (patch)
tree7ade3a50e40a210abad179d58eabb4cb20bd0176 /gcc/fold-const.c
parentcf7aa6a3b79ac25df266aa4fcfe6c059243602aa (diff)
downloadgcc-1c4188463c7e81c3345a7d4e87eccb5b5a168c44.zip
gcc-1c4188463c7e81c3345a7d4e87eccb5b5a168c44.tar.gz
gcc-1c4188463c7e81c3345a7d4e87eccb5b5a168c44.tar.bz2
Remove VEC_RSHIFT_EXPR tree code, now unused
* fold-const.c (const_binop): Remove code handling VEC_RSHIFT_EXPR. * tree-cfg.c (verify_gimple_assign_binary): Likewise. * tree-inline.c (estimate_operator_cost): Likewise. * tree-pretty-print.c (dump_generic_node, op_code_prio, op_symbol_code): Likewise. * tree-vect-generic.c (expand_vector_operations_1): Remove assertion against VEC_RSHIFT_EXPR. * optabs.h (expand_vec_shift_expr): Remove. * optabs.c (optab_for_tree_code): Remove case VEC_RSHIFT_EXPR. (expand_vec_shift_expr): Remove. * tree.def (VEC_RSHIFT_EXPR): Remove From-SVN: r217510
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c41
1 files changed, 7 insertions, 34 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index e51abee..ee9ed7b 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -1418,44 +1418,17 @@ const_binop (enum tree_code code, tree arg1, tree arg2)
int count = TYPE_VECTOR_SUBPARTS (type), i;
tree *elts = XALLOCAVEC (tree, count);
- if (code == VEC_RSHIFT_EXPR)
+ for (i = 0; i < count; i++)
{
- if (!tree_fits_uhwi_p (arg2))
- return NULL_TREE;
+ tree elem1 = VECTOR_CST_ELT (arg1, i);
- unsigned HOST_WIDE_INT shiftc = tree_to_uhwi (arg2);
- unsigned HOST_WIDE_INT outerc = tree_to_uhwi (TYPE_SIZE (type));
- unsigned HOST_WIDE_INT innerc
- = tree_to_uhwi (TYPE_SIZE (TREE_TYPE (type)));
- if (shiftc >= outerc || (shiftc % innerc) != 0)
+ elts[i] = const_binop (code, elem1, arg2);
+
+ /* It is possible that const_binop cannot handle the given
+ code and return NULL_TREE. */
+ if (elts[i] == NULL_TREE)
return NULL_TREE;
- int offset = shiftc / innerc;
- /* The direction of VEC_RSHIFT_EXPR is endian dependent.
- For reductions, if !BYTES_BIG_ENDIAN then compiler picks first
- vector element, but last element if BYTES_BIG_ENDIAN. */
- if (BYTES_BIG_ENDIAN)
- offset = -offset;
- tree zero = build_zero_cst (TREE_TYPE (type));
- for (i = 0; i < count; i++)
- {
- if (i + offset < 0 || i + offset >= count)
- elts[i] = zero;
- else
- elts[i] = VECTOR_CST_ELT (arg1, i + offset);
- }
}
- else
- for (i = 0; i < count; i++)
- {
- tree elem1 = VECTOR_CST_ELT (arg1, i);
-
- elts[i] = const_binop (code, elem1, arg2);
-
- /* It is possible that const_binop cannot handle the given
- code and return NULL_TREE */
- if (elts[i] == NULL_TREE)
- return NULL_TREE;
- }
return build_vector (type, elts);
}