2015-09-17 14:28:59 +00:00
|
|
|
/* Tree-based target query functions relating to optabs
|
2019-01-01 13:31:55 +01:00
|
|
|
Copyright (C) 2001-2019 Free Software Foundation, Inc.
|
2015-09-17 14:28:59 +00:00
|
|
|
|
|
|
|
This file is part of GCC.
|
|
|
|
|
|
|
|
GCC is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 3, or (at your option)
|
|
|
|
any later version.
|
|
|
|
|
|
|
|
GCC is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with GCC; see the file COPYING3. If not see
|
|
|
|
<http://www.gnu.org/licenses/>. */
|
|
|
|
|
|
|
|
#ifndef GCC_OPTABS_TREE_H
|
|
|
|
#define GCC_OPTABS_TREE_H
|
|
|
|
|
|
|
|
#include "optabs-query.h"
|
|
|
|
|
|
|
|
/* An extra flag to control optab_for_tree_code's behavior. This is needed to
|
|
|
|
distinguish between machines with a vector shift that takes a scalar for the
|
|
|
|
shift amount vs. machines that take a vector for the shift amount. */
|
|
|
|
enum optab_subtype
|
|
|
|
{
|
|
|
|
optab_default,
|
|
|
|
optab_scalar,
|
|
|
|
optab_vector
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Return the optab used for computing the given operation on the type given by
|
|
|
|
the second argument. The third argument distinguishes between the types of
|
|
|
|
vector shifts and rotates. */
|
|
|
|
optab optab_for_tree_code (enum tree_code, const_tree, enum optab_subtype);
|
2019-11-27 12:22:02 +00:00
|
|
|
bool supportable_convert_operation (enum tree_code, tree, tree,
|
2015-09-17 14:28:59 +00:00
|
|
|
enum tree_code *);
|
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
2016-10-25 18:26:12 +02:00
|
|
|
bool expand_vec_cmp_expr_p (tree, tree, enum tree_code);
|
|
|
|
bool expand_vec_cond_expr_p (tree, tree, enum tree_code);
|
2015-09-17 14:28:59 +00:00
|
|
|
void init_tree_optimization_optabs (tree);
|
2017-06-22 08:39:04 +00:00
|
|
|
bool target_supports_op_p (tree, enum tree_code,
|
|
|
|
enum optab_subtype = optab_default);
|
2015-09-17 14:28:59 +00:00
|
|
|
|
|
|
|
#endif
|