This patch adds the ternary_opt_n shape description.
2022-12-12 Christophe Lyon <[email protected]>
gcc/
* config/arm/arm-mve-builtins-shapes.cc (ternary_opt_n): New.
* config/arm/arm-mve-builtins-shapes.h (ternary_opt_n): New.
---
gcc/config/arm/arm-mve-builtins-shapes.cc | 30 +++++++++++++++++++++++
gcc/config/arm/arm-mve-builtins-shapes.h | 1 +
2 files changed, 31 insertions(+)
diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc
b/gcc/config/arm/arm-mve-builtins-shapes.cc
index 6401a79c570..43532601fbe 100644
--- a/gcc/config/arm/arm-mve-builtins-shapes.cc
+++ b/gcc/config/arm/arm-mve-builtins-shapes.cc
@@ -1399,6 +1399,36 @@ struct ternary_n_def : public overloaded_base<0>
};
SHAPE (ternary_n)
+/* <T0>_t vfoo[_t0](<T0>_t, <T0>_t, <T0>_t)
+ <T0>_t vfoo[_n_t0](<T0>_t, <T0>_t, <S0>_t)
+
+ i.e. the standard shape for ternary operations that operate on
+ uniform types.
+
+ Example: vfmaq.
+ float16x8_t [__arm_]vfmaq[_n_f16](float16x8_t add, float16x8_t m1,
float16_t m2)
+ float16x8_t [__arm_]vfmaq_m[_n_f16](float16x8_t add, float16x8_t m1,
float16_t m2, mve_pred16_t p)
+ float16x8_t [__arm_]vfmaq[_f16](float16x8_t add, float16x8_t m1,
float16x8_t m2)
+ float16x8_t [__arm_]vfmaq_m[_f16](float16x8_t add, float16x8_t m1,
float16x8_t m2, mve_pred16_t p) */
+struct ternary_opt_n_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,v0", group, MODE_none, preserve_user_namespace);
+ build_all (b, "v0,v0,v0,s0", group, MODE_n, preserve_user_namespace);
+ }
+
+ tree
+ resolve (function_resolver &r) const override
+ {
+ return r.resolve_uniform_opt_n (3);
+ }
+};
+SHAPE (ternary_opt_n)
+
/* <T0>_t vfoo[_t0](<T0>_t)
i.e. the standard shape for unary operations that operate on
diff --git a/gcc/config/arm/arm-mve-builtins-shapes.h
b/gcc/config/arm/arm-mve-builtins-shapes.h
index ba53e8cc52e..f67a484c146 100644
--- a/gcc/config/arm/arm-mve-builtins-shapes.h
+++ b/gcc/config/arm/arm-mve-builtins-shapes.h
@@ -62,6 +62,7 @@ namespace arm_mve
extern const function_shape *const mvn;
extern const function_shape *const ternary;
extern const function_shape *const ternary_n;
+ extern const function_shape *const ternary_opt_n;
extern const function_shape *const unary;
extern const function_shape *const unary_acc;
extern const function_shape *const unary_convert;
--
2.34.1