aboutsummaryrefslogtreecommitdiff
path: root/gcc/optabs.h
diff options
context:
space:
mode:
authorRobin Dapp <rdapp@ventanamicro.com>2023-06-28 15:48:55 +0200
committerRobin Dapp <rdapp@ventanamicro.com>2023-07-05 16:57:05 +0200
commitc30efd8cd634f8a59bc1bf52e71d8866bf52d56c (patch)
tree626cf8ee88df61e6b4ee4106d725e0e716799ff2 /gcc/optabs.h
parent573bb719bb82d1d61ca54eb4fddf82eccfd56470 (diff)
downloadgcc-c30efd8cd634f8a59bc1bf52e71d8866bf52d56c.zip
gcc-c30efd8cd634f8a59bc1bf52e71d8866bf52d56c.tar.gz
gcc-c30efd8cd634f8a59bc1bf52e71d8866bf52d56c.tar.bz2
gimple-isel: Recognize vec_extract pattern.
In gimple-isel we already deduce a vec_set pattern from an ARRAY_REF(VIEW_CONVERT_EXPR). This patch does the same for a vec_extract. The code is largely similar to the vec_set one including the addition of a can_vec_extract_var_idx_p function in optabs.cc to check if the backend can handle a register operand as index. We already have can_vec_extract in optabs-query but that one checks whether we can extract specific modes. With the introduction of an internal function for vec_extract the expander must not FAIL. For vec_set this has already been the case so adjust the documentation accordingly. Additionally, clarify the wording of the vector-vector case for vec_extract. gcc/ChangeLog: * doc/md.texi: Document that vec_set and vec_extract must not fail. * gimple-isel.cc (gimple_expand_vec_set_expr): Rename this... (gimple_expand_vec_set_extract_expr): ...to this. (gimple_expand_vec_exprs): Call renamed function. * internal-fn.cc (vec_extract_direct): Add. (expand_vec_extract_optab_fn): New function to expand vec_extract optab. (direct_vec_extract_optab_supported_p): Add. * internal-fn.def (VEC_EXTRACT): Add. * optabs.cc (can_vec_extract_var_idx_p): New function. * optabs.h (can_vec_extract_var_idx_p): Declare.
Diffstat (limited to 'gcc/optabs.h')
-rw-r--r--gcc/optabs.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/optabs.h b/gcc/optabs.h
index 781d554..c80b7f4 100644
--- a/gcc/optabs.h
+++ b/gcc/optabs.h
@@ -259,6 +259,7 @@ extern bool can_vcond_compare_p (enum rtx_code, machine_mode, machine_mode);
/* Return whether the backend can emit vector set instructions for inserting
element into vector at variable index position. */
extern bool can_vec_set_var_idx_p (machine_mode);
+extern bool can_vec_extract_var_idx_p (machine_mode, machine_mode);
extern rtx prepare_operand (enum insn_code, rtx, int, machine_mode,
machine_mode, int);