public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Christophe Lyon <christophe.lyon@arm.com>
To: <gcc-patches@gcc.gnu.org>, <kyrylo.tkachov@arm.com>,
	<richard.earnshaw@arm.com>, <richard.sandiford@arm.com>
Cc: Christophe Lyon <christophe.lyon@arm.com>
Subject: [PATCH 14/16] arm: [MVE intrinsics] add binary_maxamina shape
Date: Tue, 9 May 2023 14:19:35 +0200	[thread overview]
Message-ID: <20230509121937.206183-14-christophe.lyon@arm.com> (raw)
In-Reply-To: <20230509121937.206183-1-christophe.lyon@arm.com>

This patch adds the binary_maxamina shape description.

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

	gcc/
	* config/arm/arm-mve-builtins-shapes.cc (binary_maxamina): New.
	* config/arm/arm-mve-builtins-shapes.h (binary_maxamina): New.
---
 gcc/config/arm/arm-mve-builtins-shapes.cc | 40 +++++++++++++++++++++++
 gcc/config/arm/arm-mve-builtins-shapes.h  |  1 +
 2 files changed, 41 insertions(+)

diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm-mve-builtins-shapes.cc
index 1324abd1c12..c9eac80d1e3 100644
--- a/gcc/config/arm/arm-mve-builtins-shapes.cc
+++ b/gcc/config/arm/arm-mve-builtins-shapes.cc
@@ -401,6 +401,46 @@ struct binary_rshift_def : public overloaded_base<0>
 };
 SHAPE (binary_rshift)
 
+
+/* <uT0>_t vfoo[_t0](<uT0>_t, <T0>_t)
+
+   i.e. binary operations that take a vector of unsigned elements as first argument and a
+   vector of signed elements as second argument, and produce a vector of unsigned elements.
+
+   Example: vminaq.
+   uint8x16_t [__arm_]vminaq[_s8](uint8x16_t a, int8x16_t b)
+   uint8x16_t [__arm_]vminaq_m[_s8](uint8x16_t a, int8x16_t b, mve_pred16_t p)  */
+struct binary_maxamina_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, "vu0,vu0,vs0", 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)
+	|| (type = r.infer_vector_type (i)) == NUM_TYPE_SUFFIXES)
+      return error_mark_node;
+
+    /* Check that the first argument has the expeected unsigned
+       type.  */
+    type_suffix_index return_type
+      = find_type_suffix (TYPE_unsigned, type_suffixes[type].element_bits);
+    if (!r.require_matching_vector_type (0, return_type))
+      return error_mark_node;
+
+    return r.resolve_to (r.mode_suffix_id, type);
+  }
+};
+SHAPE (binary_maxamina)
+
 /* <uS0>_t vfoo[_<t0>](<uS0>_t, <T0>_t)
 
    Example: vmaxavq.
diff --git a/gcc/config/arm/arm-mve-builtins-shapes.h b/gcc/config/arm/arm-mve-builtins-shapes.h
index cf4c523ab1a..7f582d7375a 100644
--- a/gcc/config/arm/arm-mve-builtins-shapes.h
+++ b/gcc/config/arm/arm-mve-builtins-shapes.h
@@ -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_maxamina;
     extern const function_shape *const binary_maxavminav;
     extern const function_shape *const binary_maxvminv;
     extern const function_shape *const binary_move_narrow;
-- 
2.34.1


  parent reply	other threads:[~2023-05-09 12:20 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-09 12:19 [PATCH 01/16] arm: [MVE intrinsics] add binary_maxvminv shape Christophe Lyon
2023-05-09 12:19 ` [PATCH 02/16] arm: [MVE intrinsics] add binary_maxavminav shape Christophe Lyon
2023-05-09 12:19 ` [PATCH 03/16] arm: [MVE intrinsics add unspec_mve_function_exact_insn_pred_p Christophe Lyon
2023-05-09 12:19 ` [PATCH 04/16] arm: [MVE intrinsics] factorize vmaxvq vminvq vmaxavq vminavq Christophe Lyon
2023-05-09 12:19 ` [PATCH 05/16] arm: [MVE intrinsics] rework " Christophe Lyon
2023-05-09 12:19 ` [PATCH 06/16] arm: add smax/smin expanders for v*hf Christophe Lyon
2023-05-09 13:48   ` Kyrylo Tkachov
2023-05-09 17:18     ` Christophe Lyon
2023-05-09 17:31       ` Kyrylo Tkachov
2023-05-09 17:33         ` Christophe Lyon
2023-05-09 17:34           ` Kyrylo Tkachov
2023-05-09 18:28             ` [PATCH v2 " Christophe Lyon
2023-05-09 12:19 ` [PATCH 07/16] arm: [MVE intrinsics] factorize vmaxnmq vminnmq Christophe Lyon
2023-05-09 12:19 ` [PATCH 08/16] arm: [MVE intrinsics] rework " Christophe Lyon
2023-05-09 12:19 ` [PATCH 09/16] arm: [MVE intrinsics] factorize vmaxnmavq vmaxnmvq vminnmavq vminnmvq Christophe Lyon
2023-05-09 12:19 ` [PATCH 10/16] arm: [MVE intrinsics] add support for mve_q_p_f Christophe Lyon
2023-05-09 12:19 ` [PATCH 11/16] arm: [MVE intrinsics] rework vmaxnmavq vmaxnmvq vminnmavq vminnmvq Christophe Lyon
2023-05-09 12:19 ` [PATCH 12/16] arm: [MVE intrinsics] factorize vmaxnmaq vminnmaq Christophe Lyon
2023-05-09 12:19 ` [PATCH 13/16] arm: [MVE intrinsics] rework " Christophe Lyon
2023-05-09 12:19 ` Christophe Lyon [this message]
2023-05-09 12:19 ` [PATCH 15/16] arm: [MVE intrinsics] factorize vmaxaq vminaq Christophe Lyon
2023-05-09 12:19 ` [PATCH 16/16] arm: [MVE intrinsics] rework " Christophe Lyon
2023-05-09 13:50 ` [PATCH 01/16] arm: [MVE intrinsics] add binary_maxvminv shape Kyrylo Tkachov
2023-05-09 18:30   ` Christophe Lyon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230509121937.206183-14-christophe.lyon@arm.com \
    --to=christophe.lyon@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=kyrylo.tkachov@arm.com \
    --cc=richard.earnshaw@arm.com \
    --cc=richard.sandiford@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).