[Vectorizer] Use a VEC_PERM_EXPR instead of VEC_RSHIFT_EXPR; expand appropriate VEC_P...
authorAlan Lawrence <alan.lawrence@arm.com>
Thu, 13 Nov 2014 16:27:37 +0000 (16:27 +0000)
committerAlan Lawrence <alalaw01@gcc.gnu.org>
Thu, 13 Nov 2014 16:27:37 +0000 (16:27 +0000)
commitcf7aa6a3b79ac25df266aa4fcfe6c059243602aa
tree6780c5d8c1b45da220db82c4a0f897afcd467d9a
parent557be5a8767902f204e8afa04551a387eac33a26
[Vectorizer] Use a VEC_PERM_EXPR instead of VEC_RSHIFT_EXPR; expand appropriate VEC_PERM_EXPRs using vec_shr_optab

* optabs.c (can_vec_perm_p): Update comment, does not consider vec_shr.
(shift_amt_for_vec_perm_mask): New.
(expand_vec_perm_1): Use vec_shr_optab if second vector is const0_rtx
and mask appropriate.

* tree-vect-loop.c (calc_vec_perm_mask_for_shift): New.
(have_whole_vector_shift): New.
(vect_model_reduction_cost): Call have_whole_vector_shift instead of
looking for vec_shr_optab.
(vect_create_epilog_for_reduction): Likewise; also rename local variable
have_whole_vector_shift to reduce_with_shift; output VEC_PERM_EXPRs
instead of VEC_RSHIFT_EXPRs.

* tree-vect-stmts.c (vect_gen_perm_mask_checked): Extend comment.

From-SVN: r217509
gcc/ChangeLog
gcc/optabs.c
gcc/tree-vect-loop.c
gcc/tree-vect-stmts.c