diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-10-15 19:36:50 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-10-15 19:36:50 +0000 |
commit | 964ec9cd8bd2896d0fd242db33bc7eeba8e4e62f (patch) | |
tree | 648ae2160b09141f65b345023049f5969eb8fc42 /gcc/optabs.c | |
parent | 7359fe3f0fb6418c2a03a44908a4baa466c027f6 (diff) | |
download | gcc-964ec9cd8bd2896d0fd242db33bc7eeba8e4e62f.tar.gz |
Use VEC_PERM_EXPR in the vectorizer.
* tree-vect-slp.c: Include langhooks.h.
(vect_create_mask_and_perm): Emit VEC_PERM_EXPR, not a builtin.
(vect_transform_slp_perm_load): Use can_vec_perm_expr_p. Simplify
mask creation for VEC_PERM_EXPR.
* tree-vect-stmts.c (perm_mask_for_reverse): Return the mask,
not the builtin.
(reverse_vec_elements): Emit VEC_PERM_EXPR not a builtin.
* Makefile.in (tree-vect-slp.o): Update dependency.
* optabs.c (can_vec_perm_expr_p): Allow NULL as unknown constant.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180047 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/optabs.c')
-rw-r--r-- | gcc/optabs.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/optabs.c b/gcc/optabs.c index e9a23f4b093..a373d7aeff4 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -6686,7 +6686,7 @@ vector_compare_rtx (tree cond, bool unsignedp, enum insn_code icode) } /* Return true if VEC_PERM_EXPR can be expanded using SIMD extensions - of the CPU. */ + of the CPU. SEL may be NULL, which stands for an unknown constant. */ bool can_vec_perm_expr_p (tree type, tree sel) @@ -6699,10 +6699,10 @@ can_vec_perm_expr_p (tree type, tree sel) if (!VECTOR_MODE_P (mode)) return false; - if (TREE_CODE (sel) == VECTOR_CST) + if (sel == NULL || TREE_CODE (sel) == VECTOR_CST) { if (direct_optab_handler (vec_perm_const_optab, mode) != CODE_FOR_nothing - && targetm.vectorize.builtin_vec_perm_ok (type, sel)) + && (sel == NULL || targetm.vectorize.builtin_vec_perm_ok (type, sel))) return true; } @@ -6722,7 +6722,7 @@ can_vec_perm_expr_p (tree type, tree sel) /* In order to support the lowering of non-constant permutations, we need to support shifts and adds. */ - if (TREE_CODE (sel) != VECTOR_CST) + if (sel != NULL && TREE_CODE (sel) != VECTOR_CST) { if (GET_MODE_UNIT_SIZE (mode) > 2 && optab_handler (ashl_optab, mode) == CODE_FOR_nothing |