This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: vectorizer patches 1/2 : WIDEN_MULT_PLUS support
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: joern dot rennecke at riscy-ip dot com
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 12 Nov 2018 15:30:02 +0100
- Subject: Re: RFA: vectorizer patches 1/2 : WIDEN_MULT_PLUS support
- References: <5BE7D7FC.8060805@riscy-ip.com>
On Sun, Nov 11, 2018 at 8:21 AM Joern Wolfgang Rennecke
<joern.rennecke@riscy-ip.com> wrote:
>
> Our target (eSi-RISC) doesn't have DOT_PROD_EXPR or WIDEN_SUM_EXPR
> operations in
> the standard vector modes; however, it has a vectorized WIDEN_MULT_PLUS_EXPR
> implementation with a double-vector output, which works just as well,
> with a little
> help from the compiler - as implemented in these patches.
I guess I already asked this question when WIDEN_MULT_PLUS_EXPR was
introduced - but isn't that fully contained within a DOT_PROD_EXPR?
Some comments on the patch.
+ tree vecotype
+ = build_vector_type (otype, GET_MODE_NUNITS (TYPE_MODE (vecitype)));
TYPE_VECTOR_SUBPARTS (vecitype)
You want to pass in the half/full types and use get_vectype_for_scalar_type
which also makes sure the target supports the vector type.
I think you want to extend and re-use supportable_widening_operation
here anyways.
Index: gcc/tree-vect-stmts.c
===================================================================
--- gcc/tree-vect-stmts.c (revision 266008)
+++ gcc/tree-vect-stmts.c (working copy)
@@ -10638,7 +10638,11 @@ vect_get_vector_types_for_stmt (stmt_vec
scalar_type);
if (maybe_ne (GET_MODE_SIZE (TYPE_MODE (vectype)),
- GET_MODE_SIZE (TYPE_MODE (nunits_vectype))))
+ GET_MODE_SIZE (TYPE_MODE (nunits_vectype)))
+ /* Reductions that use a widening reduction would show
+ a mismatch but that's already been checked to be OK. */
+ && STMT_VINFO_DEF_TYPE (stmt_info) != vect_reduction_def)
+
return opt_result::failure_at (stmt,
"not vectorized: different sized vector "
"types in statement, %T and %T\n",
that change doesn't look good.
> Bootstrapped and regtested on i686-pc-linux-gnu.