On Thu, 12 Nov 2020, Joel Hutton wrote: > Hi all, > > This patch adds widening add and widening subtract patterns to > tree-vect-patterns.
I am missing documentation in md.texi for the new patterns. In particular I wonder why you need singed and unsigned variants for the add/subtract patterns. We're walking away from adding tree codes for new vectorizer pieces and instead want to use direct internal functions for them. Can you rework the patch to use this approach? Thanks, Richard. > All 3 patches together bootstrapped and regression tested on aarch64. > > gcc/ChangeLog: > > 2020-11-12 ?Joel Hutton ?<joel.hut...@arm.com> > > ? ? ? ? * expr.c (expand_expr_real_2): add widen_add,widen_subtract cases > ? ? ? ? * optabs-tree.c (optab_for_tree_code): optabs for widening > adds,subtracts > ? ? ? ? * optabs.def (OPTAB_D): define vectorized widen add, subtracts > ? ? ? ? * tree-cfg.c (verify_gimple_assign_binary): Add case for widening > adds, subtracts > ? ? ? ? * tree-inline.c (estimate_operator_cost): Add case for widening adds, > subtracts > ? ? ? ? * tree-vect-generic.c (expand_vector_operations_1): Add case for > widening adds, subtracts > ? ? ? ? * tree-vect-patterns.c (vect_recog_widen_add_pattern): New recog > ptatern > ? ? ? ? (vect_recog_widen_sub_pattern): New recog pattern > ? ? ? ? (vect_recog_average_pattern): Update widened add code > ? ? ? ? (vect_recog_average_pattern): Update widened add code > ? ? ? ? * tree-vect-stmts.c (vectorizable_conversion): Add case for widened > add, subtract > ? ? ? ? (supportable_widening_operation): Add case for widened add, subtract > ? ? ? ? * tree.def (WIDEN_ADD_EXPR): New tree code > ? ? ? ? (WIDEN_SUB_EXPR): New tree code > ? ? ? ? (VEC_WIDEN_ADD_HI_EXPR): New tree code > ? ? ? ? (VEC_WIDEN_ADD_LO_EXPR): New tree code > ? ? ? ? (VEC_WIDEN_SUB_HI_EXPR): New tree code > ? ? ? ? (VEC_WIDEN_SUB_LO_EXPR): New tree code > > gcc/testsuite/ChangeLog: > > 2020-11-12 ?Joel Hutton ?<joel.hut...@arm.com> > > ? ? ? ? * gcc.target/aarch64/vect-widen-add.c: New test. > ? ? ? ? * gcc.target/aarch64/vect-widen-sub.c: New test. > > > Ok for trunk? > -- Richard Biener <rguent...@suse.de> SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany; GF: Felix Imend