This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: vectorizer patches 1/2 : WIDEN_MULT_PLUS support


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]