aboutsummaryrefslogtreecommitdiff
path: root/gcc/optabs.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2011-10-15 12:36:50 -0700
committerRichard Henderson <rth@gcc.gnu.org>2011-10-15 12:36:50 -0700
commit2635892a1c64fc7e5b8c1c13d53dd0468ffc757d (patch)
tree648ae2160b09141f65b345023049f5969eb8fc42 /gcc/optabs.c
parentf3b3dc6a7e46c011a2b29e2baff19fcb55f16b79 (diff)
downloadgcc-2635892a1c64fc7e5b8c1c13d53dd0468ffc757d.zip
gcc-2635892a1c64fc7e5b8c1c13d53dd0468ffc757d.tar.gz
gcc-2635892a1c64fc7e5b8c1c13d53dd0468ffc757d.tar.bz2
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. From-SVN: r180047
Diffstat (limited to 'gcc/optabs.c')
-rw-r--r--gcc/optabs.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/optabs.c b/gcc/optabs.c
index e9a23f4..a373d7a 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