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

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

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

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

index f1c3844953aa9aebfaef3dcfb6d4429e194a3c82..af770fd3e39bb1f8b6d05f7b994a84b570421b75 100644 (file)
@@ -452,6 +452,43 @@ struct binary_acca_int32_def : public overloaded_base<0>
 };
 SHAPE (binary_acca_int32)
 
+/* [u]int64_t vfoo[_<t0>]([u]int64_t, <T0>_t, <T0>_t)
+
+   Example: vmlaldavaq.
+   int64_t [__arm_]vmlaldavaq[_s16](int64_t add, int16x8_t m1, int16x8_t m2)
+   int64_t [__arm_]vmlaldavaq_p[_s16](int64_t add, int16x8_t m1, int16x8_t m2, mve_pred16_t p)  */
+struct binary_acca_int64_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, "sx64,sx64,v0,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 (3, i, nargs)
+       || (type = r.infer_vector_type (1)) == NUM_TYPE_SUFFIXES)
+      return error_mark_node;
+
+    unsigned int last_arg = i;
+    for (i = 1; i < last_arg; i++)
+      if (!r.require_matching_vector_type (i, type))
+       return error_mark_node;
+
+    if (!r.require_integer_immediate (0))
+      return error_mark_node;
+
+    return r.resolve_to (r.mode_suffix_id, type);
+  }
+};
+SHAPE (binary_acca_int64)
+
 /* <T0>_t vfoo[_n_t0](<T0>_t, const int)
 
    Shape for vector shift right operations that take a vector first
index 73e82d2fd7a42118f8853db66e596a1a90b389a9..1c4254122bcc14c09392486a11c69630146a123c 100644 (file)
@@ -40,6 +40,7 @@ namespace arm_mve
     extern const function_shape *const binary_acc_int32;
     extern const function_shape *const binary_acc_int64;
     extern const function_shape *const binary_acca_int32;
+    extern const function_shape *const binary_acca_int64;
     extern const function_shape *const binary_maxamina;
     extern const function_shape *const binary_maxavminav;
     extern const function_shape *const binary_maxvminv;