aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@arm.com>2023-02-21 13:33:10 +0000
committerChristophe Lyon <christophe.lyon@arm.com>2023-05-11 10:25:11 +0200
commit7e3c2d23cfdc479d5022fa4de56841bd032e915b (patch)
tree9040afb15ba44b50b98f17f199cddb6dc6b7746a /gcc
parentcf24e531874312fc56797d348aea4037685dfffd (diff)
downloadgcc-7e3c2d23cfdc479d5022fa4de56841bd032e915b.zip
gcc-7e3c2d23cfdc479d5022fa4de56841bd032e915b.tar.gz
gcc-7e3c2d23cfdc479d5022fa4de56841bd032e915b.tar.bz2
arm: [MVE intrinsics] add unary_acc shape
This patch adds the unary_acc shape description. 2022-10-25 Christophe Lyon <christophe.lyon@arm.com> gcc/ * config/arm/arm-mve-builtins-shapes.cc (unary_acc): New. * config/arm/arm-mve-builtins-shapes.h (unary_acc): New.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/arm/arm-mve-builtins-shapes.cc28
-rw-r--r--gcc/config/arm/arm-mve-builtins-shapes.h1
2 files changed, 29 insertions, 0 deletions
diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm-mve-builtins-shapes.cc
index bff1c3e..e77a0cc 100644
--- a/gcc/config/arm/arm-mve-builtins-shapes.cc
+++ b/gcc/config/arm/arm-mve-builtins-shapes.cc
@@ -1066,6 +1066,34 @@ struct unary_def : public overloaded_base<0>
};
SHAPE (unary)
+/* <S0:twice>_t vfoo[_<t0>](<T0>_t)
+
+ i.e. a version of "unary" in which the source elements are half the
+ size of the destination scalar, but have the same type class.
+
+ Example: vaddlvq.
+ int64_t [__arm_]vaddlvq[_s32](int32x4_t a)
+ int64_t [__arm_]vaddlvq_p[_s32](int32x4_t a, mve_pred16_t p) */
+struct unary_acc_def : public overloaded_base<0>
+{
+ 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);
+ build_all (b, "sw0,v0", group, MODE_none, preserve_user_namespace);
+ }
+
+ tree
+ resolve (function_resolver &r) const override
+ {
+ /* FIXME: check that the return value is actually
+ twice as wide as arg 0. */
+ return r.resolve_unary ();
+ }
+};
+SHAPE (unary_acc)
+
/* <T0>_t foo_t0[_t1](<T1>_t)
where the target type <t0> must be specified explicitly but the source
diff --git a/gcc/config/arm/arm-mve-builtins-shapes.h b/gcc/config/arm/arm-mve-builtins-shapes.h
index fc1bacb..c062fe6 100644
--- a/gcc/config/arm/arm-mve-builtins-shapes.h
+++ b/gcc/config/arm/arm-mve-builtins-shapes.h
@@ -53,6 +53,7 @@ namespace arm_mve
extern const function_shape *const create;
extern const function_shape *const inherent;
extern const function_shape *const unary;
+ extern const function_shape *const unary_acc;
extern const function_shape *const unary_convert;
extern const function_shape *const unary_int32;
extern const function_shape *const unary_int32_acc;