From: Christophe Lyon Date: Tue, 14 Feb 2023 16:47:54 +0000 (+0000) Subject: arm: [MVE intrinsics] add binary shape X-Git-Tag: basepoints/gcc-15~9698 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=45dbb66f7c7fc86d1ac0399c56ebc8002c83bf9b;p=thirdparty%2Fgcc.git arm: [MVE intrinsics] add binary shape This patch adds the binary shape description. 2022-09-08 Christophe Lyon gcc/ * config/arm/arm-mve-builtins-shapes.cc (binary): New. * config/arm/arm-mve-builtins-shapes.h (binary): New. --- diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm-mve-builtins-shapes.cc index 033b304060a3..e69faae4e2c0 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.cc +++ b/gcc/config/arm/arm-mve-builtins-shapes.cc @@ -338,6 +338,33 @@ struct overloaded_base : public function_shape } }; +/* _t vfoo[_t0](_t, _t) + + i.e. the standard shape for binary operations that operate on + uniform types. + + Example: vandq. + int8x16_t [__arm_]vandq[_s8](int8x16_t a, int8x16_t b) + int8x16_t [__arm_]vandq_m[_s8](int8x16_t inactive, int8x16_t a, int8x16_t b, mve_pred16_t p) + int8x16_t [__arm_]vandq_x[_s8](int8x16_t a, int8x16_t b, mve_pred16_t p) */ +struct binary_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, "v0,v0,v0", group, MODE_none, preserve_user_namespace); + } + + tree + resolve (function_resolver &r) const override + { + return r.resolve_uniform (2); + } +}; +SHAPE (binary) + /* _t vfoo[_t0](_t, _t) _t vfoo[_n_t0](_t, _t) diff --git a/gcc/config/arm/arm-mve-builtins-shapes.h b/gcc/config/arm/arm-mve-builtins-shapes.h index 43798fdde57c..b00ee5eb57af 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.h +++ b/gcc/config/arm/arm-mve-builtins-shapes.h @@ -34,6 +34,7 @@ namespace arm_mve namespace shapes { + extern const function_shape *const binary; extern const function_shape *const binary_opt_n; extern const function_shape *const inherent; extern const function_shape *const unary_convert;