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]

[patch] [4.2 projects] vectorize reduction patterns - patch 4/n


Add support for a specific reduction-pattern: dot-product.

The patch includes:
- New tree-code, optabs and pattern-detection function for dot-product.
- Also new tree-codes for widen-sum and widen-mult, that are not yet
generated, but will be used for the detection of dot-product once available
(widen-sum detection will be submitted next. widen-mult detection will be
submitted as part of the support for type-conversions).
- New testcases and new keywords to identify which dot-product forms are
supported by targets.
- Support for altivec

Also attached support for sse as present in autovcet-branch, contributed by
Richard Henderson.

This patch was bootstrapped with vectorization enabled and tested on the
vectorizer testcases on powerpc-linux and i686-pc-linux-gnu.

Some of the changes to testsuite/lib/target-supports.exp depend on ia64
dot-product support which is available on autovect-branch, also contributed
by Richard (these bits can be removed until ia64 updates are also brought
over to mainline).

dorit

        * expr.c (expand_expr_real_1): Added case for DOT_PROD_EXPR.
        * genopinit.c (udot_prod_optab, sdot_prod_optab): Initialize.
        * optabs.c (optab_for_tree_code): Added case for DOT_PROD_EXPR.
        (expand_widen_pattern_expr): New function.
        (init_optabs): Initialize new optabs udot_prod_optab,
sdot_prod_optab.
        * optabs.h (OTI_sdot_prod, OTI_udot_prod): New.
        (sdot_prod_optab, udot_prod_optab): Define new optabs.
        (expand_widen_pattern_expr): New function declaration.
        * tree.def (DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR): New
        tree-codes.
        * tree-inline.c (estimate_num_insns_1): Added cases for new
tree-codes
        DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR.
        * tree-pretty-print.c (dump_generic_node): Likewise.
        (op_prio): Likewise.
        (op_symbol): Added cases for WIDEN_SUM_EXPR, WIDEN_MULT_EXPR.
        * tree-ssa-operands.c (get_expr_operands): Added case for
DOT_PROD_EXPR.
        * tree-vect-patterns.c (widened_name_p): New function.
        (vect_recog_dot_prod_pattern): Added function implementation.
        * tree-vect-transform.c (get_initial_def_for_reduction): Added
cases
        for DOT_PROD_EXPR, WIDEN_SUM_EXPR.
        * config/rs6000/altivec.md (udot_prod<mode>, sdot_prodv8hi): New.
        * config/i386/sse.md (sdot_prodv8hi, udot_prodv4si): New.

Testsuite Changelog:

        * lib/target-suports.exp (check_effective_target_vect_sdot_qi):
New.
        (check_effective_target_vect_udot_qi): New.
        (check_effective_target_vect_sdot_hi): New.
        (check_effective_target_vect_udot_hi): New.
        * gcc.dg/vect/vect.exp: Use sump-details, and compile testcases
prefixed
        with "wrapv-" with -fwrapv.
        * gcc.dg/vect/wrapv-vect-reduc-dot-s8.c: New.
        * gcc.dg/vect/vect-reduc-dot-u8.c: New.
        * gcc.dg/vect/vect-reduc-dot-u16.c: New.
        * gcc.dg/vect/vect-reduc-dot-s8.c: New.
        * gcc.dg/vect/vect-reduc-dot-s16.c: New.


(See attached file: mainline.reduc_patterns4.txt) (See attached file:
sse_dot.txt)

Attachment: mainline.reduc_patterns4.txt
Description: Text document

Attachment: sse_dot.txt
Description: Text document


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