diff mbox series

[12/15] arm: [MVE intrinsics] add load_gather_base shape

Message ID 20241107091820.2010568-13-christophe.lyon@linaro.org
State New
Headers show
Series arm: [MVE intrinsics] Rework store_scatter and load_gather intrinsics | expand

Commit Message

Christophe Lyon Nov. 7, 2024, 9:18 a.m. UTC
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 | 38 +++++++++++++++++++++++
 gcc/config/arm/arm-mve-builtins-shapes.h  |  1 +
 2 files changed, 39 insertions(+)
diff mbox series

Patch

diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm-mve-builtins-shapes.cc
index 28b90454417..fa4fee072e6 100644
--- a/gcc/config/arm/arm-mve-builtins-shapes.cc
+++ b/gcc/config/arm/arm-mve-builtins-shapes.cc
@@ -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
diff --git a/gcc/config/arm/arm-mve-builtins-shapes.h b/gcc/config/arm/arm-mve-builtins-shapes.h
index 9113d55dab4..2db323b5628 100644
--- a/gcc/config/arm/arm-mve-builtins-shapes.h
+++ b/gcc/config/arm/arm-mve-builtins-shapes.h
@@ -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;