aboutsummaryrefslogtreecommitdiff
path: root/gcc/optabs-query.c
diff options
context:
space:
mode:
authorIlya Enkovich <enkovich.gnu@gmail.com>2015-11-10 12:06:05 +0000
committerIlya Enkovich <ienkovich@gcc.gnu.org>2015-11-10 12:06:05 +0000
commit045c12782cc8ccea5dda8e5b703bb794fc759aac (patch)
tree58e89245d538b87c44e1cedf05f978bb107e276d /gcc/optabs-query.c
parent42fd8198b4adabe3aa74e9bb98518a1d137c3aff (diff)
downloadgcc-045c12782cc8ccea5dda8e5b703bb794fc759aac.zip
gcc-045c12782cc8ccea5dda8e5b703bb794fc759aac.tar.gz
gcc-045c12782cc8ccea5dda8e5b703bb794fc759aac.tar.bz2
internal-fn.c (expand_MASK_LOAD): Adjust to maskload optab changes.
gcc/ * internal-fn.c (expand_MASK_LOAD): Adjust to maskload optab changes. (expand_MASK_STORE): Adjust to maskstore optab changes. * optabs-query.c (can_vec_mask_load_store_p): Add MASK_MODE arg. Adjust to maskload, maskstore optab changes. * optabs-query.h (can_vec_mask_load_store_p): Add MASK_MODE arg. * optabs.def (maskload_optab): Transform into convert optab. (maskstore_optab): Likewise. * tree-if-conv.c (ifcvt_can_use_mask_load_store): Adjust to can_vec_mask_load_store_p signature change. (predicate_mem_writes): Use boolean mask. * tree-vect-stmts.c (vectorizable_mask_load_store): Adjust to can_vec_mask_load_store_p signature change. Allow invariant masks. (vectorizable_operation): Ignore type precision for boolean vectors. gcc/testsuite/ * gcc.target/i386/avx2-vec-mask-bit-not.c: New test. From-SVN: r230099
Diffstat (limited to 'gcc/optabs-query.c')
-rw-r--r--gcc/optabs-query.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/gcc/optabs-query.c b/gcc/optabs-query.c
index 254089f..c20597c 100644
--- a/gcc/optabs-query.c
+++ b/gcc/optabs-query.c
@@ -466,7 +466,9 @@ can_mult_highpart_p (machine_mode mode, bool uns_p)
/* Return true if target supports vector masked load/store for mode. */
bool
-can_vec_mask_load_store_p (machine_mode mode, bool is_load)
+can_vec_mask_load_store_p (machine_mode mode,
+ machine_mode mask_mode,
+ bool is_load)
{
optab op = is_load ? maskload_optab : maskstore_optab;
machine_mode vmode;
@@ -474,7 +476,7 @@ can_vec_mask_load_store_p (machine_mode mode, bool is_load)
/* If mode is vector mode, check it directly. */
if (VECTOR_MODE_P (mode))
- return optab_handler (op, mode) != CODE_FOR_nothing;
+ return convert_optab_handler (op, mode, mask_mode) != CODE_FOR_nothing;
/* Otherwise, return true if there is some vector mode with
the mask load/store supported. */
@@ -485,7 +487,12 @@ can_vec_mask_load_store_p (machine_mode mode, bool is_load)
if (!VECTOR_MODE_P (vmode))
return false;
- if (optab_handler (op, vmode) != CODE_FOR_nothing)
+ mask_mode = targetm.vectorize.get_mask_mode (GET_MODE_NUNITS (vmode),
+ GET_MODE_SIZE (vmode));
+ if (mask_mode == VOIDmode)
+ return false;
+
+ if (convert_optab_handler (op, vmode, mask_mode) != CODE_FOR_nothing)
return true;
vector_sizes = targetm.vectorize.autovectorize_vector_sizes ();
@@ -496,8 +503,10 @@ can_vec_mask_load_store_p (machine_mode mode, bool is_load)
if (cur <= GET_MODE_SIZE (mode))
continue;
vmode = mode_for_vector (mode, cur / GET_MODE_SIZE (mode));
+ mask_mode = targetm.vectorize.get_mask_mode (GET_MODE_NUNITS (vmode),
+ cur);
if (VECTOR_MODE_P (vmode)
- && optab_handler (op, vmode) != CODE_FOR_nothing)
+ && convert_optab_handler (op, vmode, mask_mode) != CODE_FOR_nothing)
return true;
}
return false;