diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-10-25 18:26:12 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-10-25 18:26:12 +0200 |
commit | 96592eeda1f5cb381d91ef78dea3e2666bbdb7b5 (patch) | |
tree | 9f9b788664b48c4b29fde366326af8ab3961d90f /gcc/tree-vect-patterns.c | |
parent | 8c78afcec88be17030623a4290f214928c143b29 (diff) | |
download | gcc-96592eeda1f5cb381d91ef78dea3e2666bbdb7b5.zip gcc-96592eeda1f5cb381d91ef78dea3e2666bbdb7b5.tar.gz gcc-96592eeda1f5cb381d91ef78dea3e2666bbdb7b5.tar.bz2 |
re PR target/78102 (GCC refuses to generate PCMPEQQ instruction for SSE4.1)
PR target/78102
* optabs.def (vcondeq_optab, vec_cmpeq_optab): New optabs.
* optabs.c (expand_vec_cond_expr): For comparison codes
EQ_EXPR and NE_EXPR, attempt vcondeq_optab as fallback.
(expand_vec_cmp_expr): For comparison codes
EQ_EXPR and NE_EXPR, attempt vec_cmpeq_optab as fallback.
* optabs-tree.h (expand_vec_cmp_expr_p, expand_vec_cond_expr_p):
Add enum tree_code argument.
* optabs-query.h (get_vec_cmp_eq_icode, get_vcond_eq_icode): New
inline functions.
* optabs-tree.c (expand_vec_cmp_expr_p): Add CODE argument. For
CODE EQ_EXPR or NE_EXPR, attempt to use vec_cmpeq_optab as
fallback.
(expand_vec_cond_expr_p): Add CODE argument. For CODE EQ_EXPR or
NE_EXPR, attempt to use vcondeq_optab as fallback.
* tree-vect-generic.c (expand_vector_comparison,
expand_vector_divmod, expand_vector_condition): Adjust
expand_vec_cmp_expr_p and expand_vec_cond_expr_p callers.
* tree-vect-stmts.c (vectorizable_condition,
vectorizable_comparison): Likewise.
* tree-vect-patterns.c (vect_recog_mixed_size_cond_pattern,
check_bool_pattern, search_type_for_mask_1): Likewise.
* expr.c (do_store_flag): Likewise.
* doc/md.texi (@code{vec_cmpeq@var{m}@var{n}},
@code{vcondeq@var{m}@var{n}}): Document.
* config/i386/sse.md (vec_cmpeqv2div2di, vcondeq<VI8F_128:mode>v2di):
New expanders.
testsuite/
* gcc.target/i386/pr78102.c: New test.
From-SVN: r241525
Diffstat (limited to 'gcc/tree-vect-patterns.c')
-rw-r--r-- | gcc/tree-vect-patterns.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c index 3dfbc7b..835d9b5 100644 --- a/gcc/tree-vect-patterns.c +++ b/gcc/tree-vect-patterns.c @@ -3073,7 +3073,7 @@ vect_recog_mixed_size_cond_pattern (vec<gimple *> *stmts, tree *type_in, if (vectype == NULL_TREE) return NULL; - if (expand_vec_cond_expr_p (vectype, comp_vectype)) + if (expand_vec_cond_expr_p (vectype, comp_vectype, TREE_CODE (cond_expr))) return NULL; if (itype == NULL_TREE) @@ -3088,7 +3088,7 @@ vect_recog_mixed_size_cond_pattern (vec<gimple *> *stmts, tree *type_in, if (vecitype == NULL_TREE) return NULL; - if (!expand_vec_cond_expr_p (vecitype, comp_vectype)) + if (!expand_vec_cond_expr_p (vecitype, comp_vectype, TREE_CODE (cond_expr))) return NULL; if (GET_MODE_BITSIZE (TYPE_MODE (type)) > cmp_mode_size) @@ -3195,7 +3195,7 @@ check_bool_pattern (tree var, vec_info *vinfo, hash_set<gimple *> &stmts) tree mask_type = get_mask_type_for_scalar_type (TREE_TYPE (rhs1)); if (mask_type - && expand_vec_cmp_expr_p (comp_vectype, mask_type)) + && expand_vec_cmp_expr_p (comp_vectype, mask_type, rhs_code)) return false; if (TREE_CODE (TREE_TYPE (rhs1)) != INTEGER_TYPE) @@ -3209,7 +3209,7 @@ check_bool_pattern (tree var, vec_info *vinfo, hash_set<gimple *> &stmts) } else vecitype = comp_vectype; - if (! expand_vec_cond_expr_p (vecitype, comp_vectype)) + if (! expand_vec_cond_expr_p (vecitype, comp_vectype, rhs_code)) return false; } else @@ -3537,7 +3537,7 @@ search_type_for_mask_1 (tree var, vec_info *vinfo, mask_type = get_mask_type_for_scalar_type (TREE_TYPE (rhs1)); if (!mask_type - || !expand_vec_cmp_expr_p (comp_vectype, mask_type)) + || !expand_vec_cmp_expr_p (comp_vectype, mask_type, rhs_code)) { res = NULL_TREE; break; |