]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
arm: [MVE intrinsics] add load_gather_base shape
authorChristophe Lyon <christophe.lyon@linaro.org>
Wed, 30 Oct 2024 09:02:15 +0000 (09:02 +0000)
committerChristophe Lyon <christophe.lyon@linaro.org>
Fri, 13 Dec 2024 14:23:32 +0000 (14:23 +0000)
This patch adds the load_gather_base shape description.

Unlike other load_gather shapes, this one does not support overloaded
forms.

gcc/ChangeLog:

* config/arm/arm-mve-builtins-shapes.cc (struct
load_gather_base_def): New.
* config/arm/arm-mve-builtins-shapes.h: (load_gather_base): New.

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

index 28b90454417d2cab86ca8845419a3356a7a85588..fa4fee072e6d5d506c389ac42ffe31b6e0ea7fcc 100644 (file)
@@ -1552,6 +1552,44 @@ struct load_ext_gather : public overloaded_base<0>
   }
 };
 
+/* <T0>_t vfoo[_t0](<X>_t, const int)
+
+   where <X> has the same width as <T0> but is of unsigned type.
+
+   Example: vldrwq_gather_base
+   int32x4_t [__arm_]vldrwq_gather_base_s32(uint32x4_t addr, const int offset)
+   float32x4_t [__arm_]vldrwq_gather_base_z_f32(uint32x4_t addr, const int offset, mve_pred16_t p)  */
+struct load_gather_base_def : public nonoverloaded_base
+{
+  bool
+  explicit_mode_suffix_p (enum predication_index, enum mode_suffix_index) const override
+  {
+    return true;
+  }
+
+  bool
+  mode_after_pred () const override
+  {
+    return false;
+  }
+
+  void
+  build (function_builder &b, const function_group_info &group,
+        bool preserve_user_namespace) const override
+  {
+    build_all (b, "v0,vu0,ss64", group, MODE_none, preserve_user_namespace);
+  }
+
+  bool
+  check (function_checker &c) const override
+  {
+    unsigned int multiple = c.type_suffix (0).element_bits / 8;
+    int bound = 127 * multiple;
+    return c.require_immediate_range_multiple (1, -bound, bound, multiple);
+  }
+};
+SHAPE (load_gather_base)
+
 /* <T0>_t vfoo[_t0](<X>_t const *, <Y>_t)
 
    where <X> might be tied to <t0> (for non-extending loads) or might
index 9113d55dab43e6dfa29f7c25a96c0c71195a795f..2db323b56286f8a38296d38f62797db8c197f19c 100644 (file)
@@ -64,6 +64,7 @@ namespace arm_mve
     extern const function_shape *const load;
     extern const function_shape *const load_ext;
     extern const function_shape *const load_ext_gather_offset;
+    extern const function_shape *const load_gather_base;
     extern const function_shape *const mvn;
     extern const function_shape *const store;
     extern const function_shape *const store_scatter_base;