aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@arm.com>2023-02-08 21:11:11 +0000
committerChristophe Lyon <christophe.lyon@arm.com>2023-05-05 16:12:00 +0200
commit55b0c42e3da65b97855d3cf2d4008a9fe6769a0f (patch)
treec1d954ccf16f94438eef18fce910e93dbf622e83 /gcc
parent2c9a25a82ead1379b3a1f4f4a77a23104ea238b8 (diff)
downloadgcc-55b0c42e3da65b97855d3cf2d4008a9fe6769a0f.zip
gcc-55b0c42e3da65b97855d3cf2d4008a9fe6769a0f.tar.gz
gcc-55b0c42e3da65b97855d3cf2d4008a9fe6769a0f.tar.bz2
arm: [MVE intrinsics] add binary_lshift_r shape
This patch adds the binary_lshift_r shape description. 2022-09-08 Christophe Lyon <christophe.lyon@arm.com> gcc/ * config/arm/arm-mve-builtins-shapes.cc (binary_lshift_r): New. * config/arm/arm-mve-builtins-shapes.h (binary_lshift_r): New.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/arm/arm-mve-builtins-shapes.cc41
-rw-r--r--gcc/config/arm/arm-mve-builtins-shapes.h1
2 files changed, 42 insertions, 0 deletions
diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm-mve-builtins-shapes.cc
index e5093c3..4ecb612 100644
--- a/gcc/config/arm/arm-mve-builtins-shapes.cc
+++ b/gcc/config/arm/arm-mve-builtins-shapes.cc
@@ -576,6 +576,47 @@ struct binary_lshift_def : public overloaded_base<0>
};
SHAPE (binary_lshift)
+/* Used with the above form, but only for the MODE_r case which does
+ not always support the same set of predicates as MODE_none and
+ MODE_n. For vqshlq they are the same, but for vshlq they are not.
+
+ <T0>_t vfoo_r[_t0](<T0>_t, int32_t)
+
+ i.e. the standard shape for shift operations that operate on
+ vector types.
+ Example: vshlq.
+ int8x16_t [__arm_]vshlq_r[_s8](int8x16_t a, int32_t b)
+ int8x16_t [__arm_]vshlq_m_r[_s8](int8x16_t a, int32_t b, mve_pred16_t p) */
+struct binary_lshift_r_def : public overloaded_base<0>
+{
+ bool
+ explicit_mode_suffix_p (enum predication_index, enum mode_suffix_index) const override
+ {
+ return true;
+ }
+
+ void
+ build (function_builder &b, const function_group_info &group,
+ bool preserve_user_namespace) const override
+ {
+ b.add_overloaded_functions (group, MODE_r, preserve_user_namespace);
+ build_all (b, "v0,v0,ss32", group, MODE_r, 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, TYPE_signed);
+ }
+};
+SHAPE (binary_lshift_r)
+
/* <T0>xN_t vfoo[_t0](uint64_t, uint64_t)
where there are N arguments in total.
diff --git a/gcc/config/arm/arm-mve-builtins-shapes.h b/gcc/config/arm/arm-mve-builtins-shapes.h
index e472862..25d9b60 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_lshift;
+ extern const function_shape *const binary_lshift_r;
extern const function_shape *const binary_opt_n;
extern const function_shape *const binary_orrq;
extern const function_shape *const binary_round_lshift;