summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@arm.com>2023-02-21 21:36:44 +0000
committerChristophe Lyon <christophe.lyon@arm.com>2023-05-11 21:04:09 +0200
commit2b46dbc0480e060096ce22b9f943fd0d6329bc35 (patch)
tree152f6eea99784973be60473b95217306c10b697e
parent42c94ccef896b63cf22509b5d2eb488cdc3ec73c (diff)
downloadgcc-2b46dbc0480e060096ce22b9f943fd0d6329bc35.tar.gz
arm: [MVE intrinsics] add unary_widen_acc shape
This patch adds the unary_widen_acc shape description. 2022-10-25 Christophe Lyon <christophe.lyon@arm.com> gcc/ * config/arm/arm-mve-builtins-shapes.cc (unary_widen_acc): New. * config/arm/arm-mve-builtins-shapes.h (unary_widen_acc): New.
-rw-r--r--gcc/config/arm/arm-mve-builtins-shapes.cc34
-rw-r--r--gcc/config/arm/arm-mve-builtins-shapes.h1
2 files changed, 35 insertions, 0 deletions
diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm-mve-builtins-shapes.cc
index ae73fc6b1b7..a7faf8299cb 100644
--- a/gcc/config/arm/arm-mve-builtins-shapes.cc
+++ b/gcc/config/arm/arm-mve-builtins-shapes.cc
@@ -1282,6 +1282,40 @@ struct unary_widen_def : public overloaded_base<0>
};
SHAPE (unary_widen)
+/* <S0:twice>_t vfoo[_<t0>](<S0:twice>_t, <T0>_t)
+
+ i.e. a version of "unary" in which the source elements are half the
+ size of the destination scalar and accumulator, but have the same
+ type class.
+
+ Example: vaddlvaq.
+ int64_t [__arm_]vaddlvaq[_s32](int64_t a, int32x4_t b)
+ int64_t [__arm_]vaddlvaq_p[_s32](int64_t a, int32x4_t b, mve_pred16_t p) */
+struct unary_widen_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,sw0,v0", group, MODE_none, preserve_user_namespace);
+ }
+
+ tree
+ resolve (function_resolver &r) const override
+ {
+ unsigned int i, nargs;
+ type_suffix_index type;
+ if (!r.check_gp_argument (2, i, nargs)
+ || !r.require_derived_scalar_type (0, r.SAME_TYPE_CLASS)
+ || (type = r.infer_vector_type (i)) == NUM_TYPE_SUFFIXES)
+ return error_mark_node;
+
+ return r.resolve_to (r.mode_suffix_id, type);
+ }
+};
+SHAPE (unary_widen_acc)
+
} /* end namespace arm_mve */
#undef SHAPE
diff --git a/gcc/config/arm/arm-mve-builtins-shapes.h b/gcc/config/arm/arm-mve-builtins-shapes.h
index 5a8d9fe2b2d..46cc26ef918 100644
--- a/gcc/config/arm/arm-mve-builtins-shapes.h
+++ b/gcc/config/arm/arm-mve-builtins-shapes.h
@@ -59,6 +59,7 @@ namespace arm_mve
extern const function_shape *const unary_int32_acc;
extern const function_shape *const unary_n;
extern const function_shape *const unary_widen;
+ extern const function_shape *const unary_widen_acc;
} /* end namespace arm_mve::shapes */
} /* end namespace arm_mve */