diff mbox series

[2/5] arm: [MVE intrinsics] Add load_ext intrinsic shape

Message ID 20240916093819.12740-3-christophe.lyon@arm.com
State New
Headers show
Series arm, MVE: Refactor the vst and vld intrinsics | expand

Commit Message

Christophe Lyon Sept. 16, 2024, 9:38 a.m. UTC
From: Alfie Richards <Alfie.Richards@arm.com>

This patch adds the extending load shape.
It also adds/fixes comments for the load and store shapes.

2024-09-11  Alfie Richards <Alfie.Richards@arm.com>
	    Christophe Lyon  <christophe.lyon@arm.com>

	gcc/
	* config/arm/arm-mve-builtins-shapes.cc:
	(load_ext): New.
	* config/arm/arm-mve-builtins-shapes.h:
	(load_ext): New.
---
 gcc/config/arm/arm-mve-builtins-shapes.cc | 30 ++++++++++++++++++++---
 gcc/config/arm/arm-mve-builtins-shapes.h  |  1 +
 2 files changed, 28 insertions(+), 3 deletions(-)

Comments

Richard Earnshaw (lists) Oct. 15, 2024, 9:32 a.m. UTC | #1
On 16/09/2024 10:38, Christophe Lyon wrote:
> From: Alfie Richards <Alfie.Richards@arm.com>
> 
> This patch adds the extending load shape.
> It also adds/fixes comments for the load and store shapes.
> 
> 2024-09-11  Alfie Richards <Alfie.Richards@arm.com>
> 	    Christophe Lyon  <christophe.lyon@arm.com>
> 
> 	gcc/
> 	* config/arm/arm-mve-builtins-shapes.cc:
> 	(load_ext): New.
> 	* config/arm/arm-mve-builtins-shapes.h:
> 	(load_ext): New.

OK.

R.

> ---
>  gcc/config/arm/arm-mve-builtins-shapes.cc | 30 ++++++++++++++++++++---
>  gcc/config/arm/arm-mve-builtins-shapes.h  |  1 +
>  2 files changed, 28 insertions(+), 3 deletions(-)
> 
> diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm-mve-builtins-shapes.cc
> index ba20c6a8f73..1783fcf4c31 100644
> --- a/gcc/config/arm/arm-mve-builtins-shapes.cc
> +++ b/gcc/config/arm/arm-mve-builtins-shapes.cc
> @@ -1428,7 +1428,9 @@ struct inherent_def : public nonoverloaded_base
>  };
>  SHAPE (inherent)
>  
> -/* sv<t0>_t svfoo[_t0](const <t0>_t *)
> +/* <T0>_t vfoo[_t0](const <s0>_t *)
> +
> +   where <s0> is the scalar name of <T0>.
>  
>     Example: vld1q.
>     int8x16_t [__arm_]vld1q[_s8](int8_t const *base)
> @@ -1460,6 +1462,24 @@ struct load_def : public overloaded_base<0>
>  };
>  SHAPE (load)
>  
> +/* <T0>_t foo_t0 (const <X>_t *)
> +
> +   where <X> is determined by the function base name.
> +
> +   Example: vldrq.
> +   int32x4_t [__arm_]vldrwq_s32 (int32_t const *base)
> +   uint32x4_t [__arm_]vldrhq_z_u32 (uint16_t const *base, mve_pred16_t p)  */
> +struct load_ext_def : public nonoverloaded_base
> +{
> +  void
> +  build (function_builder &b, const function_group_info &group,
> +	 bool preserve_user_namespace) const override
> +  {
> +    build_all (b, "t0,al", group, MODE_none, preserve_user_namespace);
> +  }
> +};
> +SHAPE (load_ext)
> +
>  /* <T0>_t vfoo[_t0](<T0>_t)
>     <T0>_t vfoo_n_t0(<sT0>_t)
>  
> @@ -1509,14 +1529,18 @@ struct mvn_def : public overloaded_base<0>
>  };
>  SHAPE (mvn)
>  
> -/* void vfoo[_t0](<X>_t *, v<t0>[xN]_t)
> +/* void vfoo[_t0](<X>_t *, <T0>[xN]_t)
>  
>     where <X> might be tied to <t0> (for non-truncating stores) or might
>     depend on the function base name (for truncating stores).
>  
>     Example: vst1q.
>     void [__arm_]vst1q[_s8](int8_t *base, int8x16_t value)
> -   void [__arm_]vst1q_p[_s8](int8_t *base, int8x16_t value, mve_pred16_t p)  */
> +   void [__arm_]vst1q_p[_s8](int8_t *base, int8x16_t value, mve_pred16_t p)
> +
> +   Example: vstrb.
> +   void [__arm_]vstrbq[_s16](int8_t *base, int16x8_t value)
> +   void [__arm_]vstrbq_p[_s16](int8_t *base, int16x8_t value, mve_pred16_t p)  */
>  struct store_def : public overloaded_base<0>
>  {
>    void
> diff --git a/gcc/config/arm/arm-mve-builtins-shapes.h b/gcc/config/arm/arm-mve-builtins-shapes.h
> index 61aa4fa73b3..45ed27ec920 100644
> --- a/gcc/config/arm/arm-mve-builtins-shapes.h
> +++ b/gcc/config/arm/arm-mve-builtins-shapes.h
> @@ -62,6 +62,7 @@ namespace arm_mve
>      extern const function_shape *const create;
>      extern const function_shape *const inherent;
>      extern const function_shape *const load;
> +    extern const function_shape *const load_ext;
>      extern const function_shape *const mvn;
>      extern const function_shape *const store;
>      extern const function_shape *const ternary;
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 ba20c6a8f73..1783fcf4c31 100644
--- a/gcc/config/arm/arm-mve-builtins-shapes.cc
+++ b/gcc/config/arm/arm-mve-builtins-shapes.cc
@@ -1428,7 +1428,9 @@  struct inherent_def : public nonoverloaded_base
 };
 SHAPE (inherent)
 
-/* sv<t0>_t svfoo[_t0](const <t0>_t *)
+/* <T0>_t vfoo[_t0](const <s0>_t *)
+
+   where <s0> is the scalar name of <T0>.
 
    Example: vld1q.
    int8x16_t [__arm_]vld1q[_s8](int8_t const *base)
@@ -1460,6 +1462,24 @@  struct load_def : public overloaded_base<0>
 };
 SHAPE (load)
 
+/* <T0>_t foo_t0 (const <X>_t *)
+
+   where <X> is determined by the function base name.
+
+   Example: vldrq.
+   int32x4_t [__arm_]vldrwq_s32 (int32_t const *base)
+   uint32x4_t [__arm_]vldrhq_z_u32 (uint16_t const *base, mve_pred16_t p)  */
+struct load_ext_def : public nonoverloaded_base
+{
+  void
+  build (function_builder &b, const function_group_info &group,
+	 bool preserve_user_namespace) const override
+  {
+    build_all (b, "t0,al", group, MODE_none, preserve_user_namespace);
+  }
+};
+SHAPE (load_ext)
+
 /* <T0>_t vfoo[_t0](<T0>_t)
    <T0>_t vfoo_n_t0(<sT0>_t)
 
@@ -1509,14 +1529,18 @@  struct mvn_def : public overloaded_base<0>
 };
 SHAPE (mvn)
 
-/* void vfoo[_t0](<X>_t *, v<t0>[xN]_t)
+/* void vfoo[_t0](<X>_t *, <T0>[xN]_t)
 
    where <X> might be tied to <t0> (for non-truncating stores) or might
    depend on the function base name (for truncating stores).
 
    Example: vst1q.
    void [__arm_]vst1q[_s8](int8_t *base, int8x16_t value)
-   void [__arm_]vst1q_p[_s8](int8_t *base, int8x16_t value, mve_pred16_t p)  */
+   void [__arm_]vst1q_p[_s8](int8_t *base, int8x16_t value, mve_pred16_t p)
+
+   Example: vstrb.
+   void [__arm_]vstrbq[_s16](int8_t *base, int16x8_t value)
+   void [__arm_]vstrbq_p[_s16](int8_t *base, int16x8_t value, mve_pred16_t p)  */
 struct store_def : public overloaded_base<0>
 {
   void
diff --git a/gcc/config/arm/arm-mve-builtins-shapes.h b/gcc/config/arm/arm-mve-builtins-shapes.h
index 61aa4fa73b3..45ed27ec920 100644
--- a/gcc/config/arm/arm-mve-builtins-shapes.h
+++ b/gcc/config/arm/arm-mve-builtins-shapes.h
@@ -62,6 +62,7 @@  namespace arm_mve
     extern const function_shape *const create;
     extern const function_shape *const inherent;
     extern const function_shape *const load;
+    extern const function_shape *const load_ext;
     extern const function_shape *const mvn;
     extern const function_shape *const store;
     extern const function_shape *const ternary;