Re: [PATCH] Tidy: remove reduc_xxx_optab migration code

2016-01-14 Thread Alan Lawrence

On 14/01/16 12:22, Richard Biener wrote:

On Thu, Jan 14, 2016 at 11:26 AM, Alan Lawrence  wrote:

If/when mips-ps-3d.md is moved from reduc_* to reduc_*_scal optabs (patch here:
https://gcc.gnu.org/ml/gcc-patches/2016-01/msg00311.html ), there will be no
uses of the old reduc_* optabs remaining. This patch removes those optabs and
the migration path.

Bootstrapped + check-gcc + check-g++ on x86_64 and AArch64.

I'm not sure whether such a code tidy is acceptable for stage 3, please advise?


Yes, this is still very much welcome.

Thanks,
Richard.



I took that as an approval, and committed r232373.

Thanks, Alan



Re: [PATCH] Tidy: remove reduc_xxx_optab migration code

2016-01-14 Thread Richard Biener
On Thu, Jan 14, 2016 at 11:26 AM, Alan Lawrence  wrote:
> If/when mips-ps-3d.md is moved from reduc_* to reduc_*_scal optabs (patch 
> here:
> https://gcc.gnu.org/ml/gcc-patches/2016-01/msg00311.html ), there will be no
> uses of the old reduc_* optabs remaining. This patch removes those optabs and
> the migration path.
>
> Bootstrapped + check-gcc + check-g++ on x86_64 and AArch64.
>
> I'm not sure whether such a code tidy is acceptable for stage 3, please 
> advise?

Yes, this is still very much welcome.

Thanks,
Richard.

> Thanks, Alan
>
> gcc/ChangeLog:
>
> * 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.
> ---
>  gcc/doc/md.texi  | 27 ---
>  gcc/expr.c   | 39 ++-
>  gcc/optabs-tree.c| 20 
>  gcc/optabs-tree.h|  1 -
>  gcc/optabs.def   |  7 ---
>  gcc/tree-vect-loop.c | 12 
>  6 files changed, 14 insertions(+), 92 deletions(-)
>
> diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi
> index faf3910..68321dc 100644
> --- a/gcc/doc/md.texi
> +++ b/gcc/doc/md.texi
> @@ -5007,33 +5007,6 @@ raised and a quiet @code{NaN} is returned.
>  All operands have mode @var{m}, which is a scalar or vector
>  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_smax_scal_@var{m}} instruction pattern
>  @item @samp{reduc_smin_scal_@var{m}}, @samp{reduc_smax_scal_@var{m}}
> diff --git a/gcc/expr.c b/gcc/expr.c
> index 8973893..e1ed44d 100644
> --- a/gcc/expr.c
> +++ b/gcc/expr.c
> @@ -9164,35 +9164,16 @@ expand_expr_real_2 (sepops ops, rtx target, 
> machine_mode tmode,
>  this_optab = optab_for_tree_code (code, type, optab_default);
>  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);
> -
> -   create_output_operand (&ops[0], target, mode);
> -   create_input_operand (&ops[1], op0, vec_mode);
> -   if (maybe_expand_insn (icode, 2, ops))
> - {
> -   target = ops[0].value;
> -   if (GET_MODE (target) != mode)
> - return gen_lowpart (tmode, 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