aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@arm.com>2023-02-20 14:04:29 +0000
committerChristophe Lyon <christophe.lyon@arm.com>2023-05-03 16:58:27 +0200
commit566094741d98ba746f37a651e30d60595f57c11e (patch)
treef69b71b87a63fb17b6fb7f21112e227a0a52cff5 /gcc
parent632f70d8652b806d0390e37d1a6f1bc0a25ce238 (diff)
downloadgcc-566094741d98ba746f37a651e30d60595f57c11e.zip
gcc-566094741d98ba746f37a651e30d60595f57c11e.tar.gz
gcc-566094741d98ba746f37a651e30d60595f57c11e.tar.bz2
arm: [MVE intrinsics] add binary_orrq shape
patch adds the binary_orrq shape description. MODE_n intrinsics use a set of predicates (preds_m_or_none) different the MODE_none ones, so we explicitly reference preds_m_or_none from the shape, thus we need to make it a global array. 2022-09-08 Christophe Lyon <christophe.lyon@arm.com> gcc/ * config/arm/arm-mve-builtins-shapes.cc (binary_orrq): New. * config/arm/arm-mve-builtins-shapes.h (binary_orrq): New. * config/arm/arm-mve-builtins.cc (preds_m_or_none): Remove static. * config/arm/arm-mve-builtins.h (preds_m_or_none): Declare.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/arm/arm-mve-builtins-shapes.cc61
-rw-r--r--gcc/config/arm/arm-mve-builtins-shapes.h1
-rw-r--r--gcc/config/arm/arm-mve-builtins.cc2
-rw-r--r--gcc/config/arm/arm-mve-builtins.h3
4 files changed, 66 insertions, 1 deletions
diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm-mve-builtins-shapes.cc
index e69faae..e2f0984 100644
--- a/gcc/config/arm/arm-mve-builtins-shapes.cc
+++ b/gcc/config/arm/arm-mve-builtins-shapes.cc
@@ -397,6 +397,67 @@ struct binary_opt_n_def : public overloaded_base<0>
};
SHAPE (binary_opt_n)
+/* <T0>_t vfoo[t0](<T0>_t, <T0>_t)
+ <T0>_t vfoo[_n_t0](<T0>_t, <S0>_t)
+
+ Where the _n form only supports s16/s32/u16/u32 types as for vorrq.
+
+ Example: vorrq.
+ int16x8_t [__arm_]vorrq[_s16](int16x8_t a, int16x8_t b)
+ int16x8_t [__arm_]vorrq_m[_s16](int16x8_t inactive, int16x8_t a, int16x8_t b, mve_pred16_t p)
+ int16x8_t [__arm_]vorrq_x[_s16](int16x8_t a, int16x8_t b, mve_pred16_t p)
+ int16x8_t [__arm_]vorrq[_n_s16](int16x8_t a, const int16_t imm)
+ int16x8_t [__arm_]vorrq_m_n[_s16](int16x8_t a, const int16_t imm, mve_pred16_t p) */
+struct binary_orrq_def : public overloaded_base<0>
+{
+ bool
+ explicit_mode_suffix_p (enum predication_index pred, enum mode_suffix_index mode) const override
+ {
+ return (mode == MODE_n
+ && pred == PRED_m);
+ }
+
+ bool
+ skip_overload_p (enum predication_index pred, enum mode_suffix_index mode) const override
+ {
+ switch (mode)
+ {
+ case MODE_none:
+ return false;
+
+ /* For MODE_n, share the overloaded instance with MODE_none, except for PRED_m. */
+ case MODE_n:
+ return pred != PRED_m;
+
+ default:
+ gcc_unreachable ();
+ }
+ }
+
+ void
+ build (function_builder &b, const function_group_info &group,
+ bool preserve_user_namespace) const override
+ {
+ b.add_overloaded_functions (group, MODE_none, preserve_user_namespace);
+ b.add_overloaded_functions (group, MODE_n, preserve_user_namespace);
+ build_all (b, "v0,v0,v0", group, MODE_none, preserve_user_namespace);
+ build_16_32 (b, "v0,v0,s0", group, MODE_n, preserve_user_namespace, false, preds_m_or_none);
+ }
+
+ tree
+ resolve (function_resolver &r) const override
+ {
+ unsigned int i, nargs;
+ type_suffix_index type;
+ if (!r.check_gp_argument (2, i, nargs)
+ || (type = r.infer_vector_type (0)) == NUM_TYPE_SUFFIXES)
+ return error_mark_node;
+
+ return r.finish_opt_n_resolution (i, 0, type);
+ }
+};
+SHAPE (binary_orrq)
+
/* <T0>[xN]_t vfoo_t0().
Example: vuninitializedq.
diff --git a/gcc/config/arm/arm-mve-builtins-shapes.h b/gcc/config/arm/arm-mve-builtins-shapes.h
index b00ee5e..618b322 100644
--- a/gcc/config/arm/arm-mve-builtins-shapes.h
+++ b/gcc/config/arm/arm-mve-builtins-shapes.h
@@ -36,6 +36,7 @@ namespace arm_mve
extern const function_shape *const binary;
extern const function_shape *const binary_opt_n;
+ extern const function_shape *const binary_orrq;
extern const function_shape *const inherent;
extern const function_shape *const unary_convert;
diff --git a/gcc/config/arm/arm-mve-builtins.cc b/gcc/config/arm/arm-mve-builtins.cc
index e409a02..c74e890 100644
--- a/gcc/config/arm/arm-mve-builtins.cc
+++ b/gcc/config/arm/arm-mve-builtins.cc
@@ -285,7 +285,7 @@ static const predication_index preds_none[] = { PRED_none, NUM_PREDS };
/* Used by functions that have the m (merging) predicated form, and in
addition have an unpredicated form. */
-static const predication_index preds_m_or_none[] = {
+const predication_index preds_m_or_none[] = {
PRED_m, PRED_none, NUM_PREDS
};
diff --git a/gcc/config/arm/arm-mve-builtins.h b/gcc/config/arm/arm-mve-builtins.h
index a20d2fb..c9b51a0 100644
--- a/gcc/config/arm/arm-mve-builtins.h
+++ b/gcc/config/arm/arm-mve-builtins.h
@@ -135,6 +135,9 @@ enum predication_index
NUM_PREDS
};
+/* Some shapes need access to some predicate sets. */
+extern const predication_index preds_m_or_none[];
+
/* Classifies element types, based on type suffixes with the bit count
removed. */
enum type_class_index