]> gcc.gnu.org Git - gcc.git/commitdiff
arm: [MVE intrinsics] add support for MODE_r
authorChristophe Lyon <christophe.lyon@arm.com>
Wed, 8 Feb 2023 21:18:28 +0000 (21:18 +0000)
committerChristophe Lyon <christophe.lyon@arm.com>
Fri, 5 May 2023 14:12:00 +0000 (16:12 +0200)
A few intrinsics have an additional mode (MODE_r), which does not
always support the same set of predicates as MODE_none and MODE_n.
For vqshlq they are the same, but for vshlq they are not.

Indeed we have:
vqshlq
vqshlq_m
vqshlq_n
vqshlq_m_n
vqshlq_r
vqshlq_m_r

vshlq
vshlq_m
vshlq_x
vshlq_n
vshlq_m_n
vshlq_x_n
vshlq_r
vshlq_m_r

This patch adds support for it.

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

gcc/
* config/arm/arm-mve-builtins.cc (has_inactive_argument)
(finish_opt_n_resolution): Handle MODE_r.
* config/arm/arm-mve-builtins.def (r): New mode.

gcc/config/arm/arm-mve-builtins.cc
gcc/config/arm/arm-mve-builtins.def

index 91b3ae71f9448b9124e70a07b668c5d4be79e1f2..c25b1be990325d801c90f478b68b29c669e2ce18 100644 (file)
@@ -669,7 +669,8 @@ function_instance::has_inactive_argument () const
   if (pred != PRED_m)
     return false;
 
-  if ((base == functions::vorrq && mode_suffix_id == MODE_n)
+  if (mode_suffix_id == MODE_r
+      || (base == functions::vorrq && mode_suffix_id == MODE_n)
       || (base == functions::vqrshlq && mode_suffix_id == MODE_n)
       || (base == functions::vrshlq && mode_suffix_id == MODE_n))
     return false;
@@ -1522,7 +1523,10 @@ finish_opt_n_resolution (unsigned int argno, unsigned int first_argno,
 {
   if (inferred_type == NUM_TYPE_SUFFIXES)
     inferred_type = first_type;
-  tree scalar_form = lookup_form (MODE_n, inferred_type);
+  mode_suffix_index scalar_mode = MODE_n;
+  if (mode_suffix_id == MODE_r)
+    scalar_mode = MODE_r;
+  tree scalar_form = lookup_form (scalar_mode, inferred_type);
 
   /* Allow the final argument to be scalar, if an _n form exists.  */
   if (scalar_argument_p (argno))
index 49d07364fa2572d6a305e977b854f3500387e597..e3f378762104edd1737a6765b04bce5c00e8a08b 100644 (file)
@@ -35,6 +35,7 @@
 
 DEF_MVE_MODE (n, none, none, none)
 DEF_MVE_MODE (offset, none, none, bytes)
+DEF_MVE_MODE (r, none, none, none)
 
 #define REQUIRES_FLOAT false
 DEF_MVE_TYPE (mve_pred16_t, boolean_type_node)
This page took 0.069491 seconds and 5 git commands to generate.