From: Christophe Lyon Date: Tue, 21 Feb 2023 13:33:10 +0000 (+0000) Subject: arm: [MVE intrinsics] add unary_acc shape X-Git-Tag: basepoints/gcc-15~9447 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e3c2d23cfdc479d5022fa4de56841bd032e915b;p=thirdparty%2Fgcc.git arm: [MVE intrinsics] add unary_acc shape This patch adds the unary_acc shape description. 2022-10-25 Christophe Lyon gcc/ * config/arm/arm-mve-builtins-shapes.cc (unary_acc): New. * config/arm/arm-mve-builtins-shapes.h (unary_acc): New. --- diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm-mve-builtins-shapes.cc index bff1c3e843b3..e77a0cc20ace 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) +/* _t vfoo[_](_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) + /* _t foo_t0[_t1](_t) where the target type 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 fc1bacbd4dab..c062fe624c4c 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;