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] |
This patch detects the sum-of-absolute-differences idiom and the multiply-highpart idiom, for targets that have specialized vector support for these idioms. On targets that don't directly support the multiply-highpart, it can be vectorized using widening-multiplication (or data-unpacking and regular multiplication), followed by shift and data-packing (for the final truncate). On targets that don't directly support the sum-of-absolute-differences (sad) idiom, it can be vectorized using subtract, abs, and widening-summation. The expansion of sad was not tested because I don't have it modelled on any target yet. Bootstrapped with vectorization enabled and tested on the vectorizer testcases on powerpc-linux. dorit Changelog: + * expr.c (expand_expr_real_1): Implement MULT_HI_EXPR case. + * genopinit.c (sad_optab): Initialize new optab. + * optabs.c (optab_for_tree_code): Add case for SAD_EXPR. + (sad_optab): Initialize new optab. + * optabs.h (OTI_sad): New optan index. + (sad_optan): New optab. + * tree-inline.c (estimate_num_insns_1): Add case for SAD_EXPR. + * tree-pretty-print.c (dump_generic_node): Add case for SAD_EXPR. + (op_prio): Add case for SAD_EXPR. + * tree-vect-analyze.c (vect_recog_sad_pattern): New function. + (vect_recog_mult_hi_pattern): Implement. + (vect_recog_dot_prod_pattern, vect_recog_widen_mult_pattern): + (vect_recog_widen_sum_pattern, vect_recog_unsigned_subsat_pattern): + (vect_pattern_recog_1): Replace build with appropriate buildN. + * tree-vect-transform.c (get_initial_def_for_reduction): Add case for + SAD_EXPR. + * tree-vectorizer.h (NUM_PATTERNS): Set to 6. + (vect_recog_sad_pattern): New function declaration. + * tree.def (SAD_EXPR): New tree-code. + (See attached file: patch.oct23.txt)
Attachment:
patch.oct23.txt
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |