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
This commit is contained in:
Alan Lawrence 2014-10-28 11:17:47 +00:00 committed by Alan Lawrence
parent fed4de37b8
commit e29dfbf07d
13 changed files with 27 additions and 41 deletions

View File

@ -1,3 +1,17 @@
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.

View File

@ -4598,7 +4598,6 @@ expand_debug_expr (tree exp)
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:

View File

@ -4796,10 +4796,9 @@ operand 1. Add operand 1 to operand 2 and place the widened result in
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.

View File

@ -9084,7 +9084,6 @@ expand_expr_real_2 (sepops ops, rtx target, enum machine_mode tmode,
return temp;
}
case VEC_LSHIFT_EXPR:
case VEC_RSHIFT_EXPR:
{
target = expand_vec_shift_expr (ops, target);

View File

@ -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++)

View File

@ -519,9 +519,6 @@ optab_for_tree_code (enum tree_code code, const_tree type,
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;
@ -773,7 +770,7 @@ force_expand_binop (enum machine_mode mode, optab binoptab,
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)
@ -784,21 +781,10 @@ 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);

View File

@ -276,7 +276,6 @@ OPTAB_D (vec_perm_const_optab, "vec_perm_const$a")
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")

View File

@ -240,7 +240,7 @@ bool expand_vec_cond_expr_p (tree, tree);
/* 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. */

View File

@ -3673,7 +3673,6 @@ verify_gimple_assign_binary (gimple stmt)
return false;
}
case VEC_LSHIFT_EXPR:
case VEC_RSHIFT_EXPR:
{
if (TREE_CODE (rhs1_type) != VECTOR_TYPE

View File

@ -3696,7 +3696,6 @@ estimate_operator_cost (enum tree_code code, eni_weights *weights,
case RSHIFT_EXPR:
case LROTATE_EXPR:
case RROTATE_EXPR:
case VEC_LSHIFT_EXPR:
case VEC_RSHIFT_EXPR:
case BIT_IOR_EXPR:

View File

@ -1848,7 +1848,6 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
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:
@ -3029,7 +3028,6 @@ op_code_prio (enum tree_code code)
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:
@ -3140,9 +3138,6 @@ op_symbol_code (enum tree_code code)
case RROTATE_EXPR:
return "r>>";
case VEC_LSHIFT_EXPR:
return "v<<";
case VEC_RSHIFT_EXPR:
return "v>>";

View File

@ -1605,7 +1605,7 @@ expand_vector_operations_1 (gimple_stmt_iterator *gsi)
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. */

View File

@ -1242,10 +1242,9 @@ DEFTREECODE (WIDEN_LSHIFT_EXPR, "widen_lshift_expr", tcc_binary, 2)
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)
/* Widening vector multiplication.