]> gcc.gnu.org Git - gcc.git/commitdiff
arm: [MVE intrinsics] add binary_rshift shape
authorChristophe Lyon <christophe.lyon@arm.com>
Thu, 9 Feb 2023 18:00:16 +0000 (18:00 +0000)
committerChristophe Lyon <christophe.lyon@arm.com>
Fri, 5 May 2023 14:12:01 +0000 (16:12 +0200)
This patch adds the binary_rshift shape description.

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

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

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

index e3bf586565c80ee39d78858dc7cd4db605d33486..7078f7d72205d4eb5444d349c2ec9050b8ad7cec 100644 (file)
@@ -365,6 +365,42 @@ struct binary_def : public overloaded_base<0>
 };
 SHAPE (binary)
 
+/* <T0>_t vfoo[_n_t0](<T0>_t, const int)
+
+   Shape for vector shift right operations that take a vector first
+   argument and an integer, and produce a vector.
+
+   Check that 'imm' is in the [1..#bits] range.
+
+   Example: vrshrq.
+   int8x16_t [__arm_]vrshrq[_n_s8](int8x16_t a, const int imm)
+   int8x16_t [__arm_]vrshrq_m[_n_s8](int8x16_t inactive, int8x16_t a, const int imm, mve_pred16_t p)
+   int8x16_t [__arm_]vrshrq_x[_n_s8](int8x16_t a, const int imm, mve_pred16_t p)  */
+struct binary_rshift_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,ss32", group, MODE_n, preserve_user_namespace);
+  }
+
+  tree
+  resolve (function_resolver &r) const override
+  {
+    return r.resolve_uniform (1, 1);
+  }
+
+  bool
+  check (function_checker &c) const override
+  {
+    unsigned int bits = c.type_suffix (0).element_bits;
+    return c.require_immediate_range (1, 1, bits);
+  }
+};
+SHAPE (binary_rshift)
+
 /* <T0>_t vfoo[_t0](<T0>_t, <T0>_t)
    <T0>_t vfoo[_n_t0](<T0>_t, <S0>_t)
 
index ca1c1017e8e6594d201bd2b175a013bed155473f..09e00b69e63d2ab436c2ccd7eb85f0c2412e6728 100644 (file)
@@ -40,6 +40,7 @@ namespace arm_mve
     extern const function_shape *const binary_opt_n;
     extern const function_shape *const binary_orrq;
     extern const function_shape *const binary_round_lshift;
+    extern const function_shape *const binary_rshift;
     extern const function_shape *const binary_rshift_narrow;
     extern const function_shape *const binary_rshift_narrow_unsigned;
     extern const function_shape *const create;
This page took 0.069901 seconds and 5 git commands to generate.