aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorAlan Lawrence <alan.lawrence@arm.com>2014-10-28 11:17:47 +0000
committerAlan Lawrence <alalaw01@gcc.gnu.org>2014-10-28 11:17:47 +0000
commite29dfbf07d93e89e92d8b95bef247fc95a8024ef (patch)
tree815114050f368a772cb5c71599a28a3a4b7ef2ec /gcc/fold-const.c
parentfed4de37b870faad50374a63aa1cf68a97963da6 (diff)
downloadgcc-e29dfbf07d93e89e92d8b95bef247fc95a8024ef.zip
gcc-e29dfbf07d93e89e92d8b95bef247fc95a8024ef.tar.gz
gcc-e29dfbf07d93e89e92d8b95bef247fc95a8024ef.tar.bz2
Remove VEC_LSHIFT_EXPR and vec_shl_optab
* expr.c (expand_expr_real_2): Remove code handling VEC_LSHIFT_EXPR. * fold-const.c (const_binop): Likewise. * cfgexpand.c (expand_debug_expr): Likewise. * tree-inline.c (estimate_operator_cost): Likewise. * tree-vect-generic.c (expand_vector_operations_1): Likewise. * optabs.c (optab_for_tree_code): Likewise. (expand_vec_shift_expr): Likewise, update comment. * tree.def: Delete VEC_LSHIFT_EXPR, remove comment. * optabs.h (expand_vec_shift_expr): Remove comment re. VEC_LSHIFT_EXPR. * optabs.def: Remove vec_shl_optab. * doc/md.texi: Remove references to vec_shr_m. From-SVN: r216779
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index ba9b013..8166070 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -1415,8 +1415,7 @@ 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_LSHIFT_EXPR
- || code == VEC_RSHIFT_EXPR)
+ if (code == VEC_RSHIFT_EXPR)
{
if (!tree_fits_uhwi_p (arg2))
return NULL_TREE;
@@ -1428,11 +1427,10 @@ const_binop (enum tree_code code, tree arg1, tree arg2)
if (shiftc >= outerc || (shiftc % innerc) != 0)
return NULL_TREE;
int offset = shiftc / innerc;
- /* The direction of VEC_[LR]SHIFT_EXPR is endian dependent.
- For reductions, compiler emits VEC_RSHIFT_EXPR always,
- for !BYTES_BIG_ENDIAN picks first vector element, but
- for BYTES_BIG_ENDIAN last element from the vector. */
- if ((code == VEC_RSHIFT_EXPR) ^ (!BYTES_BIG_ENDIAN))
+ /* 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++)