aboutsummaryrefslogtreecommitdiff
path: root/gcc/optabs-query.c
diff options
context:
space:
mode:
authorGiuliano Belinassi <giuliano.belinassi@usp.br>2020-08-22 17:43:43 -0300
committerGiuliano Belinassi <giuliano.belinassi@usp.br>2020-08-22 17:43:43 -0300
commita926878ddbd5a98b272c22171ce58663fc04c3e0 (patch)
tree86af256e5d9a9c06263c00adc90e5fe348008c43 /gcc/optabs-query.c
parent542730f087133690b47e036dfd43eb0db8a650ce (diff)
parent07cbaed8ba7d1b6e4ab3a9f44175502a4e1ecdb1 (diff)
downloadgcc-devel/autopar_devel.zip
gcc-devel/autopar_devel.tar.gz
gcc-devel/autopar_devel.tar.bz2
Merge branch 'autopar_rebase2' into autopar_develdevel/autopar_devel
Quickly commit changes in the rebase branch.
Diffstat (limited to 'gcc/optabs-query.c')
-rw-r--r--gcc/optabs-query.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/optabs-query.c b/gcc/optabs-query.c
index 215d68e..be24105 100644
--- a/gcc/optabs-query.c
+++ b/gcc/optabs-query.c
@@ -606,6 +606,33 @@ can_vec_mask_load_store_p (machine_mode mode,
return false;
}
+/* If target supports vector load/store with length for vector mode MODE,
+ return the corresponding vector mode, otherwise return opt_machine_mode ().
+ There are two flavors for vector load/store with length, one is to measure
+ length with bytes, the other is to measure length with lanes.
+ As len_{load,store} optabs point out, for the flavor with bytes, we use
+ VnQI to wrap the other supportable same size vector modes. */
+
+opt_machine_mode
+get_len_load_store_mode (machine_mode mode, bool is_load)
+{
+ optab op = is_load ? len_load_optab : len_store_optab;
+ gcc_assert (VECTOR_MODE_P (mode));
+
+ /* Check if length in lanes supported for this mode directly. */
+ if (direct_optab_handler (op, mode))
+ return mode;
+
+ /* Check if length in bytes supported for same vector size VnQI. */
+ machine_mode vmode;
+ poly_uint64 nunits = GET_MODE_SIZE (mode);
+ if (related_vector_mode (mode, QImode, nunits).exists (&vmode)
+ && direct_optab_handler (op, vmode))
+ return vmode;
+
+ return opt_machine_mode ();
+}
+
/* Return true if there is a compare_and_swap pattern. */
bool