* 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
+2014-10-28 Alan Lawrence <alan.lawrence@arm.com>
+
+ * 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.
+
2014-10-28 Yury Gribov <y.gribov@samsung.com>
* asan.c (report_error_func): Add noabort path.
case REDUC_MIN_EXPR:
case REDUC_PLUS_EXPR:
case VEC_COND_EXPR:
- case VEC_LSHIFT_EXPR:
case VEC_PACK_FIX_TRUNC_EXPR:
case VEC_PACK_SAT_EXPR:
case VEC_PACK_TRUNC_EXPR:
operand 0. (This is used express accumulation of elements into an accumulator
of a wider mode.)
-@cindex @code{vec_shl_@var{m}} instruction pattern
@cindex @code{vec_shr_@var{m}} instruction pattern
-@item @samp{vec_shl_@var{m}}, @samp{vec_shr_@var{m}}
-Whole vector left/right shift in bits.
+@item @samp{vec_shr_@var{m}}
+Whole vector right shift in bits.
Operand 1 is a vector to be shifted.
Operand 2 is an integer shift amount in bits.
Operand 0 is where the resulting shifted vector is stored.
return temp;
}
- case VEC_LSHIFT_EXPR:
case VEC_RSHIFT_EXPR:
{
target = expand_vec_shift_expr (ops, target);
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;
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++)
case REDUC_PLUS_EXPR:
return reduc_plus_scal_optab;
- case VEC_LSHIFT_EXPR:
- return vec_shl_optab;
-
case VEC_RSHIFT_EXPR:
return vec_shr_optab;
return true;
}
-/* Generate insns for VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR. */
+/* Generate insns for VEC_RSHIFT_EXPR. */
rtx
expand_vec_shift_expr (sepops ops, rtx target)
enum machine_mode mode = TYPE_MODE (ops->type);
tree vec_oprnd = ops->op0;
tree shift_oprnd = ops->op1;
- optab shift_optab;
- switch (ops->code)
- {
- case VEC_RSHIFT_EXPR:
- shift_optab = vec_shr_optab;
- break;
- case VEC_LSHIFT_EXPR:
- shift_optab = vec_shl_optab;
- break;
- default:
- gcc_unreachable ();
- }
+ gcc_assert (ops->code == VEC_RSHIFT_EXPR);
- icode = optab_handler (shift_optab, mode);
+ icode = optab_handler (vec_shr_optab, mode);
gcc_assert (icode != CODE_FOR_nothing);
rtx_op1 = expand_normal (vec_oprnd);
OPTAB_D (vec_perm_optab, "vec_perm$a")
OPTAB_D (vec_realign_load_optab, "vec_realign_load_$a")
OPTAB_D (vec_set_optab, "vec_set$a")
-OPTAB_D (vec_shl_optab, "vec_shl_$a")
OPTAB_D (vec_shr_optab, "vec_shr_$a")
OPTAB_D (vec_unpacks_float_hi_optab, "vec_unpacks_float_hi_$a")
OPTAB_D (vec_unpacks_float_lo_optab, "vec_unpacks_float_lo_$a")
/* Generate code for VEC_COND_EXPR. */
extern rtx expand_vec_cond_expr (tree, tree, tree, tree, rtx);
-/* Generate code for VEC_LSHIFT_EXPR and VEC_RSHIFT_EXPR. */
+/* Generate code for VEC_RSHIFT_EXPR. */
extern rtx expand_vec_shift_expr (sepops, rtx);
/* Return true if target supports vector operations for VEC_PERM_EXPR. */
return false;
}
- case VEC_LSHIFT_EXPR:
case VEC_RSHIFT_EXPR:
{
if (TREE_CODE (rhs1_type) != VECTOR_TYPE
case RSHIFT_EXPR:
case LROTATE_EXPR:
case RROTATE_EXPR:
- case VEC_LSHIFT_EXPR:
case VEC_RSHIFT_EXPR:
case BIT_IOR_EXPR:
case RSHIFT_EXPR:
case LROTATE_EXPR:
case RROTATE_EXPR:
- case VEC_LSHIFT_EXPR:
case VEC_RSHIFT_EXPR:
case WIDEN_LSHIFT_EXPR:
case BIT_IOR_EXPR:
case REDUC_MAX_EXPR:
case REDUC_MIN_EXPR:
case REDUC_PLUS_EXPR:
- case VEC_LSHIFT_EXPR:
case VEC_RSHIFT_EXPR:
case VEC_UNPACK_HI_EXPR:
case VEC_UNPACK_LO_EXPR:
case RROTATE_EXPR:
return "r>>";
- case VEC_LSHIFT_EXPR:
- return "v<<";
-
case VEC_RSHIFT_EXPR:
return "v>>";
if (compute_type == type)
return;
- gcc_assert (code != VEC_LSHIFT_EXPR && code != VEC_RSHIFT_EXPR);
+ gcc_assert (code != VEC_RSHIFT_EXPR);
new_rhs = expand_vector_operation (gsi, type, compute_type, stmt, code);
/* Leave expression untouched for later expansion. */
before adding operand three. */
DEFTREECODE (FMA_EXPR, "fma_expr", tcc_expression, 3)
-/* Whole vector left/right shift in bits.
+/* Whole vector right shift in bits.
Operand 0 is a vector to be shifted.
Operand 1 is an integer shift amount in bits. */
-DEFTREECODE (VEC_LSHIFT_EXPR, "vec_lshift_expr", tcc_binary, 2)
DEFTREECODE (VEC_RSHIFT_EXPR, "vec_rshift_expr", tcc_binary, 2)
\f
/* Widening vector multiplication.