]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
arm: [MVE intrinsics] add binary_maxavminav shape
authorChristophe Lyon <christophe.lyon@arm.com>
Mon, 13 Feb 2023 22:06:46 +0000 (22:06 +0000)
committerChristophe Lyon <christophe.lyon@arm.com>
Tue, 9 May 2023 18:31:15 +0000 (20:31 +0200)
This patch adds the binary_maxavminav shape description.

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

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

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

index 19c3c47a20e63f4ae99491dfdb926eecfae2143b..1324abd1c12e32881deae697707380e188b30895 100644 (file)
@@ -401,6 +401,36 @@ struct binary_rshift_def : public overloaded_base<0>
 };
 SHAPE (binary_rshift)
 
+/* <uS0>_t vfoo[_<t0>](<uS0>_t, <T0>_t)
+
+   Example: vmaxavq.
+   uint8_t [__arm_]vmaxavq[_s8](uint8_t a, int8x16_t b)
+   uint8_t [__arm_]vmaxavq_p[_s8](uint8_t a, int8x16_t b, mve_pred16_t p)  */
+struct binary_maxavminav_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, "su0,su0,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 (2, i, nargs)
+       || !r.require_derived_scalar_type (0, TYPE_unsigned)
+       || (type = r.infer_vector_type (1)) == NUM_TYPE_SUFFIXES)
+      return error_mark_node;
+
+    return r.resolve_to (r.mode_suffix_id, type);
+  }
+};
+SHAPE (binary_maxavminav)
+
 /* <S0>_t vfoo[_<t0>](<S0>_t, <T0>_t)
 
    Example: vmaxvq.
index 9debf1d873317f68197c3fe19200f003d0364887..cf4c523ab1a204b07e961d99a145b4270bf9cc73 100644 (file)
@@ -37,6 +37,7 @@ namespace arm_mve
     extern const function_shape *const binary;
     extern const function_shape *const binary_lshift;
     extern const function_shape *const binary_lshift_r;
+    extern const function_shape *const binary_maxavminav;
     extern const function_shape *const binary_maxvminv;
     extern const function_shape *const binary_move_narrow;
     extern const function_shape *const binary_move_narrow_unsigned;