Tidy: remove reduc_xxx_optab migration code.
* doc/md.texi (reduc_smin_@var{m}, reduc_smax_@var{m}, reduc_umin_@var{m}, reduc_umax_@var{m}, reduc_splus_@var{m}, reduc_uplus_@var{m}): Remove. * expr.c (expand_expr_real_2): Remove expansion path for reduc_[us](min|max|plus) optabs. * optabs-tree.c (scalar_reduc_to_vector): Remove. * optabs-tree.h (scalar_reduc_to_vector): Remove. * optabs.def (reduc_smax_optab, reduc_smin_optab, reduc_splus_optab, reduc_umax_optab, reduc_umin_optab, reduc_uplus_optab): Remove. * tree-vect-loop.c (vectorizable_reduction): Remove test for reduc_[us](min|max|plus) optabs. From-SVN: r232373
This commit is contained in:
parent
59a2f0fa2a
commit
b56ed680d4
|
@ -1,3 +1,17 @@
|
||||||
|
2016-01-14 Alan Lawrence <alan.lawrence@arm.com>
|
||||||
|
|
||||||
|
* doc/md.texi (reduc_smin_@var{m}, reduc_smax_@var{m},
|
||||||
|
reduc_umin_@var{m}, reduc_umax_@var{m}, reduc_splus_@var{m},
|
||||||
|
reduc_uplus_@var{m}): Remove.
|
||||||
|
* expr.c (expand_expr_real_2): Remove expansion path for
|
||||||
|
reduc_[us](min|max|plus) optabs.
|
||||||
|
* optabs-tree.c (scalar_reduc_to_vector): Remove.
|
||||||
|
* optabs-tree.h (scalar_reduc_to_vector): Remove.
|
||||||
|
* optabs.def (reduc_smax_optab, reduc_smin_optab, reduc_splus_optab,
|
||||||
|
reduc_umax_optab, reduc_umin_optab, reduc_uplus_optab): Remove.
|
||||||
|
* tree-vect-loop.c (vectorizable_reduction): Remove test for
|
||||||
|
reduc_[us](min|max|plus) optabs.
|
||||||
|
|
||||||
2016-01-14 Alan Lawrence <alan.lawrence@arm.com>
|
2016-01-14 Alan Lawrence <alan.lawrence@arm.com>
|
||||||
|
|
||||||
* config/mips/mips-ps-3d.md (reduc_splus_v2sf): Remove.
|
* config/mips/mips-ps-3d.md (reduc_splus_v2sf): Remove.
|
||||||
|
|
|
@ -5007,33 +5007,6 @@ raised and a quiet @code{NaN} is returned.
|
||||||
All operands have mode @var{m}, which is a scalar or vector
|
All operands have mode @var{m}, which is a scalar or vector
|
||||||
floating-point mode. These patterns are not allowed to @code{FAIL}.
|
floating-point mode. These patterns are not allowed to @code{FAIL}.
|
||||||
|
|
||||||
@cindex @code{reduc_smin_@var{m}} instruction pattern
|
|
||||||
@cindex @code{reduc_smax_@var{m}} instruction pattern
|
|
||||||
@item @samp{reduc_smin_@var{m}}, @samp{reduc_smax_@var{m}}
|
|
||||||
Find the signed minimum/maximum of the elements of a vector. The vector is
|
|
||||||
operand 1, and the result is stored in the least significant bits of
|
|
||||||
operand 0 (also a vector). The output and input vector should have the same
|
|
||||||
modes. These are legacy optabs, and platforms should prefer to implement
|
|
||||||
@samp{reduc_smin_scal_@var{m}} and @samp{reduc_smax_scal_@var{m}}.
|
|
||||||
|
|
||||||
@cindex @code{reduc_umin_@var{m}} instruction pattern
|
|
||||||
@cindex @code{reduc_umax_@var{m}} instruction pattern
|
|
||||||
@item @samp{reduc_umin_@var{m}}, @samp{reduc_umax_@var{m}}
|
|
||||||
Find the unsigned minimum/maximum of the elements of a vector. The vector is
|
|
||||||
operand 1, and the result is stored in the least significant bits of
|
|
||||||
operand 0 (also a vector). The output and input vector should have the same
|
|
||||||
modes. These are legacy optabs, and platforms should prefer to implement
|
|
||||||
@samp{reduc_umin_scal_@var{m}} and @samp{reduc_umax_scal_@var{m}}.
|
|
||||||
|
|
||||||
@cindex @code{reduc_splus_@var{m}} instruction pattern
|
|
||||||
@cindex @code{reduc_uplus_@var{m}} instruction pattern
|
|
||||||
@item @samp{reduc_splus_@var{m}}, @samp{reduc_uplus_@var{m}}
|
|
||||||
Compute the sum of the signed/unsigned elements of a vector. The vector is
|
|
||||||
operand 1, and the result is stored in the least significant bits of operand 0
|
|
||||||
(also a vector). The output and input vector should have the same modes.
|
|
||||||
These are legacy optabs, and platforms should prefer to implement
|
|
||||||
@samp{reduc_plus_scal_@var{m}}.
|
|
||||||
|
|
||||||
@cindex @code{reduc_smin_scal_@var{m}} instruction pattern
|
@cindex @code{reduc_smin_scal_@var{m}} instruction pattern
|
||||||
@cindex @code{reduc_smax_scal_@var{m}} instruction pattern
|
@cindex @code{reduc_smax_scal_@var{m}} instruction pattern
|
||||||
@item @samp{reduc_smin_scal_@var{m}}, @samp{reduc_smax_scal_@var{m}}
|
@item @samp{reduc_smin_scal_@var{m}}, @samp{reduc_smax_scal_@var{m}}
|
||||||
|
|
37
gcc/expr.c
37
gcc/expr.c
|
@ -9162,35 +9162,16 @@ expand_expr_real_2 (sepops ops, rtx target, machine_mode tmode,
|
||||||
this_optab = optab_for_tree_code (code, type, optab_default);
|
this_optab = optab_for_tree_code (code, type, optab_default);
|
||||||
machine_mode vec_mode = TYPE_MODE (TREE_TYPE (treeop0));
|
machine_mode vec_mode = TYPE_MODE (TREE_TYPE (treeop0));
|
||||||
|
|
||||||
if (optab_handler (this_optab, vec_mode) != CODE_FOR_nothing)
|
struct expand_operand ops[2];
|
||||||
{
|
enum insn_code icode = optab_handler (this_optab, vec_mode);
|
||||||
struct expand_operand ops[2];
|
|
||||||
enum insn_code icode = optab_handler (this_optab, vec_mode);
|
|
||||||
|
|
||||||
create_output_operand (&ops[0], target, mode);
|
create_output_operand (&ops[0], target, mode);
|
||||||
create_input_operand (&ops[1], op0, vec_mode);
|
create_input_operand (&ops[1], op0, vec_mode);
|
||||||
if (maybe_expand_insn (icode, 2, ops))
|
expand_insn (icode, 2, ops);
|
||||||
{
|
target = ops[0].value;
|
||||||
target = ops[0].value;
|
if (GET_MODE (target) != mode)
|
||||||
if (GET_MODE (target) != mode)
|
return gen_lowpart (tmode, target);
|
||||||
return gen_lowpart (tmode, target);
|
return target;
|
||||||
return target;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* Fall back to optab with vector result, and then extract scalar. */
|
|
||||||
this_optab = scalar_reduc_to_vector (this_optab, type);
|
|
||||||
temp = expand_unop (vec_mode, this_optab, op0, NULL_RTX, unsignedp);
|
|
||||||
gcc_assert (temp);
|
|
||||||
/* The tree code produces a scalar result, but (somewhat by convention)
|
|
||||||
the optab produces a vector with the result in element 0 if
|
|
||||||
little-endian, or element N-1 if big-endian. So pull the scalar
|
|
||||||
result out of that element. */
|
|
||||||
int index = BYTES_BIG_ENDIAN ? GET_MODE_NUNITS (vec_mode) - 1 : 0;
|
|
||||||
int bitsize = GET_MODE_UNIT_BITSIZE (vec_mode);
|
|
||||||
temp = extract_bit_field (temp, bitsize, bitsize * index, unsignedp,
|
|
||||||
target, mode, mode, false);
|
|
||||||
gcc_assert (temp);
|
|
||||||
return temp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
case VEC_UNPACK_HI_EXPR:
|
case VEC_UNPACK_HI_EXPR:
|
||||||
|
|
|
@ -246,26 +246,6 @@ optab_for_tree_code (enum tree_code code, const_tree type,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Given optab UNOPTAB that reduces a vector to a scalar, find instead the old
|
|
||||||
optab that produces a vector with the reduction result in one element,
|
|
||||||
for a tree with type TYPE. */
|
|
||||||
|
|
||||||
optab
|
|
||||||
scalar_reduc_to_vector (optab unoptab, const_tree type)
|
|
||||||
{
|
|
||||||
switch (unoptab)
|
|
||||||
{
|
|
||||||
case reduc_plus_scal_optab:
|
|
||||||
return TYPE_UNSIGNED (type) ? reduc_uplus_optab : reduc_splus_optab;
|
|
||||||
|
|
||||||
case reduc_smin_scal_optab: return reduc_smin_optab;
|
|
||||||
case reduc_umin_scal_optab: return reduc_umin_optab;
|
|
||||||
case reduc_smax_scal_optab: return reduc_smax_optab;
|
|
||||||
case reduc_umax_scal_optab: return reduc_umax_optab;
|
|
||||||
default: return unknown_optab;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Function supportable_convert_operation
|
/* Function supportable_convert_operation
|
||||||
|
|
||||||
Check whether an operation represented by the code CODE is a
|
Check whether an operation represented by the code CODE is a
|
||||||
|
|
|
@ -36,7 +36,6 @@ enum optab_subtype
|
||||||
the second argument. The third argument distinguishes between the types of
|
the second argument. The third argument distinguishes between the types of
|
||||||
vector shifts and rotates. */
|
vector shifts and rotates. */
|
||||||
optab optab_for_tree_code (enum tree_code, const_tree, enum optab_subtype);
|
optab optab_for_tree_code (enum tree_code, const_tree, enum optab_subtype);
|
||||||
optab scalar_reduc_to_vector (optab, const_tree);
|
|
||||||
bool supportable_convert_operation (enum tree_code, tree, tree, tree *,
|
bool supportable_convert_operation (enum tree_code, tree, tree, tree *,
|
||||||
enum tree_code *);
|
enum tree_code *);
|
||||||
bool expand_vec_cmp_expr_p (tree, tree);
|
bool expand_vec_cmp_expr_p (tree, tree);
|
||||||
|
|
|
@ -285,13 +285,6 @@ OPTAB_D (reduc_smin_scal_optab, "reduc_smin_scal_$a")
|
||||||
OPTAB_D (reduc_plus_scal_optab, "reduc_plus_scal_$a")
|
OPTAB_D (reduc_plus_scal_optab, "reduc_plus_scal_$a")
|
||||||
OPTAB_D (reduc_umax_scal_optab, "reduc_umax_scal_$a")
|
OPTAB_D (reduc_umax_scal_optab, "reduc_umax_scal_$a")
|
||||||
OPTAB_D (reduc_umin_scal_optab, "reduc_umin_scal_$a")
|
OPTAB_D (reduc_umin_scal_optab, "reduc_umin_scal_$a")
|
||||||
/* (Old) Vector reduction, returning a vector with the result in one lane. */
|
|
||||||
OPTAB_D (reduc_smax_optab, "reduc_smax_$a")
|
|
||||||
OPTAB_D (reduc_smin_optab, "reduc_smin_$a")
|
|
||||||
OPTAB_D (reduc_splus_optab, "reduc_splus_$a")
|
|
||||||
OPTAB_D (reduc_umax_optab, "reduc_umax_$a")
|
|
||||||
OPTAB_D (reduc_umin_optab, "reduc_umin_$a")
|
|
||||||
OPTAB_D (reduc_uplus_optab, "reduc_uplus_$a")
|
|
||||||
|
|
||||||
OPTAB_D (sdot_prod_optab, "sdot_prod$I$a")
|
OPTAB_D (sdot_prod_optab, "sdot_prod$I$a")
|
||||||
OPTAB_D (ssum_widen_optab, "widen_ssum$I$a3")
|
OPTAB_D (ssum_widen_optab, "widen_ssum$I$a3")
|
||||||
|
|
|
@ -5751,15 +5751,11 @@ vectorizable_reduction (gimple *stmt, gimple_stmt_iterator *gsi,
|
||||||
}
|
}
|
||||||
else if (optab_handler (reduc_optab, vec_mode) == CODE_FOR_nothing)
|
else if (optab_handler (reduc_optab, vec_mode) == CODE_FOR_nothing)
|
||||||
{
|
{
|
||||||
optab = scalar_reduc_to_vector (reduc_optab, vectype_out);
|
if (dump_enabled_p ())
|
||||||
if (optab_handler (optab, vec_mode) == CODE_FOR_nothing)
|
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
||||||
{
|
"reduc op not supported by target.\n");
|
||||||
if (dump_enabled_p ())
|
|
||||||
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
|
|
||||||
"reduc op not supported by target.\n");
|
|
||||||
|
|
||||||
epilog_reduc_code = ERROR_MARK;
|
epilog_reduc_code = ERROR_MARK;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* When epilog_reduc_code is ERROR_MARK then a reduction will be
|
/* When epilog_reduc_code is ERROR_MARK then a reduction will be
|
||||||
|
|
Loading…
Reference in New Issue