]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
arm: [MVE intrinsics] add ternary_n shape
authorChristophe Lyon <christophe.lyon@arm.com>
Fri, 24 Feb 2023 14:38:03 +0000 (14:38 +0000)
committerChristophe Lyon <christophe.lyon@arm.com>
Thu, 11 May 2023 19:04:11 +0000 (21:04 +0200)
This patch adds the ternary_n shape description.

2022-12-12  Christophe Lyon  <christophe.lyon@arm.com>

gcc/
* config/arm/arm-mve-builtins-shapes.cc (ternary_n): New.
* config/arm/arm-mve-builtins-shapes.h (ternary_n): New.

gcc/config/arm/arm-mve-builtins-shapes.cc
gcc/config/arm/arm-mve-builtins-shapes.h

index 4455a2535794eba3cfaff595ee26e04a6f786252..5a299a272f57b32319e1000dfa4fa497de1f39c1 100644 (file)
@@ -1189,6 +1189,33 @@ struct ternary_def : public overloaded_base<0>
 };
 SHAPE (ternary)
 
+/* <T0>_t vfoo[_n_t0](<T0>_t, <T0>_t, <S0>_t)
+
+   i.e. the standard shape for ternary operations that operate on a
+   pair of vectors of the same type as the destination, and take a
+   third scalar argument of the same type as the vector elements.
+
+   Example: vmlaq.
+   int8x16_t [__arm_]vmlaq[_n_s8](int8x16_t add, int8x16_t m1, int8_t m2)
+   int8x16_t [__arm_]vmlaq_m[_n_s8](int8x16_t add, int8x16_t m1, int8_t m2, mve_pred16_t p)  */
+struct ternary_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_n, 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 (2, 1);
+  }
+};
+SHAPE (ternary_n)
+
 /* <T0>_t vfoo[_t0](<T0>_t)
 
    i.e. the standard shape for unary operations that operate on
index b3ddd0a9e8d59a06548b5da7475124bc7bff2cb6..a28cd6a1547bf69c110eddd9f2c389a8c2a5a86c 100644 (file)
@@ -57,6 +57,7 @@ namespace arm_mve
     extern const function_shape *const create;
     extern const function_shape *const inherent;
     extern const function_shape *const ternary;
+    extern const function_shape *const ternary_n;
     extern const function_shape *const unary;
     extern const function_shape *const unary_acc;
     extern const function_shape *const unary_convert;