[1/9] arm: MVE: Convert vcmp[eq|ne]* in arm_mve.h to use only 's' builtin version

Message ID 1619791790-628-1-git-send-email-christophe.lyon@linaro.org
State New
Headers show
Series
  • [1/9] arm: MVE: Convert vcmp[eq|ne]* in arm_mve.h to use only 's' builtin version
Related show

Commit Message

Gaius Mulley via Gcc-patches April 30, 2021, 2:09 p.m.
There is no need to have a signed and an unsigned version of these
builtins. This is similar to what we do for Neon in arm_neon.h.
This mechanical patch enables later cleanup patches.

2021-03-01  Christophe Lyon  <christophe.lyon@linaro.org>

	gcc/
	* config/arm/arm_mve.h (__arm_vcmpeq*u*, __arm_vcmpne*u*): Call
	the 's' version of the builtin.
---
 gcc/config/arm/arm_mve.h | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

-- 
2.7.4

Comments

Gaius Mulley via Gcc-patches May 10, 2021, 11:21 a.m. | #1
Ping for the series?

On Fri, 30 Apr 2021 at 16:09, Christophe Lyon
<christophe.lyon@linaro.org> wrote:
>

> There is no need to have a signed and an unsigned version of these

> builtins. This is similar to what we do for Neon in arm_neon.h.

> This mechanical patch enables later cleanup patches.

>

> 2021-03-01  Christophe Lyon  <christophe.lyon@linaro.org>

>

>         gcc/

>         * config/arm/arm_mve.h (__arm_vcmpeq*u*, __arm_vcmpne*u*): Call

>         the 's' version of the builtin.

> ---

>  gcc/config/arm/arm_mve.h | 24 ++++++++++++------------

>  1 file changed, 12 insertions(+), 12 deletions(-)

>

> diff --git a/gcc/config/arm/arm_mve.h b/gcc/config/arm/arm_mve.h

> index 3a40c6e..e4dfe91 100644

> --- a/gcc/config/arm/arm_mve.h

> +++ b/gcc/config/arm/arm_mve.h

> @@ -3695,21 +3695,21 @@ __extension__ extern __inline mve_pred16_t

>  __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))

>  __arm_vcmpneq_u8 (uint8x16_t __a, uint8x16_t __b)

>  {

> -  return __builtin_mve_vcmpneq_uv16qi (__a, __b);

> +  return __builtin_mve_vcmpneq_sv16qi ((int8x16_t)__a, (int8x16_t)__b);

>  }

>

>  __extension__ extern __inline mve_pred16_t

>  __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))

>  __arm_vcmpneq_u16 (uint16x8_t __a, uint16x8_t __b)

>  {

> -  return __builtin_mve_vcmpneq_uv8hi (__a, __b);

> +  return __builtin_mve_vcmpneq_sv8hi ((int16x8_t)__a, (int16x8_t)__b);

>  }

>

>  __extension__ extern __inline mve_pred16_t

>  __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))

>  __arm_vcmpneq_u32 (uint32x4_t __a, uint32x4_t __b)

>  {

> -  return __builtin_mve_vcmpneq_uv4si (__a, __b);

> +  return __builtin_mve_vcmpneq_sv4si ((int32x4_t)__a, (int32x4_t)__b);

>  }

>

>  __extension__ extern __inline int8x16_t

> @@ -3932,7 +3932,7 @@ __extension__ extern __inline mve_pred16_t

>  __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))

>  __arm_vcmpneq_n_u8 (uint8x16_t __a, uint8_t __b)

>  {

> -  return __builtin_mve_vcmpneq_n_uv16qi (__a, __b);

> +  return __builtin_mve_vcmpneq_n_sv16qi ((int8x16_t)__a, (int8_t)__b);

>  }

>

>  __extension__ extern __inline mve_pred16_t

> @@ -3953,14 +3953,14 @@ __extension__ extern __inline mve_pred16_t

>  __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))

>  __arm_vcmpeqq_u8 (uint8x16_t __a, uint8x16_t __b)

>  {

> -  return __builtin_mve_vcmpeqq_uv16qi (__a, __b);

> +  return __builtin_mve_vcmpeqq_sv16qi ((int8x16_t)__a, (int8x16_t)__b);

>  }

>

>  __extension__ extern __inline mve_pred16_t

>  __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))

>  __arm_vcmpeqq_n_u8 (uint8x16_t __a, uint8_t __b)

>  {

> -  return __builtin_mve_vcmpeqq_n_uv16qi (__a, __b);

> +  return __builtin_mve_vcmpeqq_n_sv16qi ((int8x16_t)__a, (int8_t)__b);

>  }

>

>  __extension__ extern __inline mve_pred16_t

> @@ -4774,7 +4774,7 @@ __extension__ extern __inline mve_pred16_t

>  __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))

>  __arm_vcmpneq_n_u16 (uint16x8_t __a, uint16_t __b)

>  {

> -  return __builtin_mve_vcmpneq_n_uv8hi (__a, __b);

> +  return __builtin_mve_vcmpneq_n_sv8hi ((int16x8_t)__a, (int16_t)__b);

>  }

>

>  __extension__ extern __inline mve_pred16_t

> @@ -4795,14 +4795,14 @@ __extension__ extern __inline mve_pred16_t

>  __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))

>  __arm_vcmpeqq_u16 (uint16x8_t __a, uint16x8_t __b)

>  {

> -  return __builtin_mve_vcmpeqq_uv8hi (__a, __b);

> +  return __builtin_mve_vcmpeqq_sv8hi ((int16x8_t)__a, (int16x8_t)__b);

>  }

>

>  __extension__ extern __inline mve_pred16_t

>  __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))

>  __arm_vcmpeqq_n_u16 (uint16x8_t __a, uint16_t __b)

>  {

> -  return __builtin_mve_vcmpeqq_n_uv8hi (__a, __b);

> +  return __builtin_mve_vcmpeqq_n_sv8hi ((int16x8_t)__a, (int16_t)__b);

>  }

>

>  __extension__ extern __inline mve_pred16_t

> @@ -5616,7 +5616,7 @@ __extension__ extern __inline mve_pred16_t

>  __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))

>  __arm_vcmpneq_n_u32 (uint32x4_t __a, uint32_t __b)

>  {

> -  return __builtin_mve_vcmpneq_n_uv4si (__a, __b);

> +  return __builtin_mve_vcmpneq_n_sv4si ((int32x4_t)__a, (int32_t)__b);

>  }

>

>  __extension__ extern __inline mve_pred16_t

> @@ -5637,14 +5637,14 @@ __extension__ extern __inline mve_pred16_t

>  __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))

>  __arm_vcmpeqq_u32 (uint32x4_t __a, uint32x4_t __b)

>  {

> -  return __builtin_mve_vcmpeqq_uv4si (__a, __b);

> +  return __builtin_mve_vcmpeqq_sv4si ((int32x4_t)__a, (int32x4_t)__b);

>  }

>

>  __extension__ extern __inline mve_pred16_t

>  __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))

>  __arm_vcmpeqq_n_u32 (uint32x4_t __a, uint32_t __b)

>  {

> -  return __builtin_mve_vcmpeqq_n_uv4si (__a, __b);

> +  return __builtin_mve_vcmpeqq_n_sv4si ((int32x4_t)__a, (int32_t)__b);

>  }

>

>  __extension__ extern __inline mve_pred16_t

> --

> 2.7.4

>
Gaius Mulley via Gcc-patches May 10, 2021, 11:54 a.m. | #2
> -----Original Message-----

> From: Gcc-patches <gcc-patches-bounces@gcc.gnu.org> On Behalf Of

> Christophe Lyon via Gcc-patches

> Sent: 30 April 2021 15:10

> To: gcc-patches@gcc.gnu.org

> Subject: [PATCH 1/9] arm: MVE: Convert vcmp[eq|ne]* in arm_mve.h to use

> only 's' builtin version

> 

> There is no need to have a signed and an unsigned version of these

> builtins. This is similar to what we do for Neon in arm_neon.h.

> This mechanical patch enables later cleanup patches.


Ok.
Thanks, the patches up to 4/9 seem good mechanical clean ups, the code gen changes are after 5/9. I'll get to them soon...
Kyrill

> 

> 2021-03-01  Christophe Lyon  <christophe.lyon@linaro.org>

> 

> 	gcc/

> 	* config/arm/arm_mve.h (__arm_vcmpeq*u*, __arm_vcmpne*u*):

> Call

> 	the 's' version of the builtin.

> ---

>  gcc/config/arm/arm_mve.h | 24 ++++++++++++------------

>  1 file changed, 12 insertions(+), 12 deletions(-)

> 

> diff --git a/gcc/config/arm/arm_mve.h b/gcc/config/arm/arm_mve.h

> index 3a40c6e..e4dfe91 100644

> --- a/gcc/config/arm/arm_mve.h

> +++ b/gcc/config/arm/arm_mve.h

> @@ -3695,21 +3695,21 @@ __extension__ extern __inline mve_pred16_t

>  __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))

>  __arm_vcmpneq_u8 (uint8x16_t __a, uint8x16_t __b)

>  {

> -  return __builtin_mve_vcmpneq_uv16qi (__a, __b);

> +  return __builtin_mve_vcmpneq_sv16qi ((int8x16_t)__a, (int8x16_t)__b);

>  }

> 

>  __extension__ extern __inline mve_pred16_t

>  __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))

>  __arm_vcmpneq_u16 (uint16x8_t __a, uint16x8_t __b)

>  {

> -  return __builtin_mve_vcmpneq_uv8hi (__a, __b);

> +  return __builtin_mve_vcmpneq_sv8hi ((int16x8_t)__a, (int16x8_t)__b);

>  }

> 

>  __extension__ extern __inline mve_pred16_t

>  __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))

>  __arm_vcmpneq_u32 (uint32x4_t __a, uint32x4_t __b)

>  {

> -  return __builtin_mve_vcmpneq_uv4si (__a, __b);

> +  return __builtin_mve_vcmpneq_sv4si ((int32x4_t)__a, (int32x4_t)__b);

>  }

> 

>  __extension__ extern __inline int8x16_t

> @@ -3932,7 +3932,7 @@ __extension__ extern __inline mve_pred16_t

>  __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))

>  __arm_vcmpneq_n_u8 (uint8x16_t __a, uint8_t __b)

>  {

> -  return __builtin_mve_vcmpneq_n_uv16qi (__a, __b);

> +  return __builtin_mve_vcmpneq_n_sv16qi ((int8x16_t)__a, (int8_t)__b);

>  }

> 

>  __extension__ extern __inline mve_pred16_t

> @@ -3953,14 +3953,14 @@ __extension__ extern __inline mve_pred16_t

>  __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))

>  __arm_vcmpeqq_u8 (uint8x16_t __a, uint8x16_t __b)

>  {

> -  return __builtin_mve_vcmpeqq_uv16qi (__a, __b);

> +  return __builtin_mve_vcmpeqq_sv16qi ((int8x16_t)__a, (int8x16_t)__b);

>  }

> 

>  __extension__ extern __inline mve_pred16_t

>  __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))

>  __arm_vcmpeqq_n_u8 (uint8x16_t __a, uint8_t __b)

>  {

> -  return __builtin_mve_vcmpeqq_n_uv16qi (__a, __b);

> +  return __builtin_mve_vcmpeqq_n_sv16qi ((int8x16_t)__a, (int8_t)__b);

>  }

> 

>  __extension__ extern __inline mve_pred16_t

> @@ -4774,7 +4774,7 @@ __extension__ extern __inline mve_pred16_t

>  __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))

>  __arm_vcmpneq_n_u16 (uint16x8_t __a, uint16_t __b)

>  {

> -  return __builtin_mve_vcmpneq_n_uv8hi (__a, __b);

> +  return __builtin_mve_vcmpneq_n_sv8hi ((int16x8_t)__a, (int16_t)__b);

>  }

> 

>  __extension__ extern __inline mve_pred16_t

> @@ -4795,14 +4795,14 @@ __extension__ extern __inline mve_pred16_t

>  __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))

>  __arm_vcmpeqq_u16 (uint16x8_t __a, uint16x8_t __b)

>  {

> -  return __builtin_mve_vcmpeqq_uv8hi (__a, __b);

> +  return __builtin_mve_vcmpeqq_sv8hi ((int16x8_t)__a, (int16x8_t)__b);

>  }

> 

>  __extension__ extern __inline mve_pred16_t

>  __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))

>  __arm_vcmpeqq_n_u16 (uint16x8_t __a, uint16_t __b)

>  {

> -  return __builtin_mve_vcmpeqq_n_uv8hi (__a, __b);

> +  return __builtin_mve_vcmpeqq_n_sv8hi ((int16x8_t)__a, (int16_t)__b);

>  }

> 

>  __extension__ extern __inline mve_pred16_t

> @@ -5616,7 +5616,7 @@ __extension__ extern __inline mve_pred16_t

>  __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))

>  __arm_vcmpneq_n_u32 (uint32x4_t __a, uint32_t __b)

>  {

> -  return __builtin_mve_vcmpneq_n_uv4si (__a, __b);

> +  return __builtin_mve_vcmpneq_n_sv4si ((int32x4_t)__a, (int32_t)__b);

>  }

> 

>  __extension__ extern __inline mve_pred16_t

> @@ -5637,14 +5637,14 @@ __extension__ extern __inline mve_pred16_t

>  __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))

>  __arm_vcmpeqq_u32 (uint32x4_t __a, uint32x4_t __b)

>  {

> -  return __builtin_mve_vcmpeqq_uv4si (__a, __b);

> +  return __builtin_mve_vcmpeqq_sv4si ((int32x4_t)__a, (int32x4_t)__b);

>  }

> 

>  __extension__ extern __inline mve_pred16_t

>  __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))

>  __arm_vcmpeqq_n_u32 (uint32x4_t __a, uint32_t __b)

>  {

> -  return __builtin_mve_vcmpeqq_n_uv4si (__a, __b);

> +  return __builtin_mve_vcmpeqq_n_sv4si ((int32x4_t)__a, (int32_t)__b);

>  }

> 

>  __extension__ extern __inline mve_pred16_t

> --

> 2.7.4

Patch

diff --git a/gcc/config/arm/arm_mve.h b/gcc/config/arm/arm_mve.h
index 3a40c6e..e4dfe91 100644
--- a/gcc/config/arm/arm_mve.h
+++ b/gcc/config/arm/arm_mve.h
@@ -3695,21 +3695,21 @@  __extension__ extern __inline mve_pred16_t
 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
 __arm_vcmpneq_u8 (uint8x16_t __a, uint8x16_t __b)
 {
-  return __builtin_mve_vcmpneq_uv16qi (__a, __b);
+  return __builtin_mve_vcmpneq_sv16qi ((int8x16_t)__a, (int8x16_t)__b);
 }
 
 __extension__ extern __inline mve_pred16_t
 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
 __arm_vcmpneq_u16 (uint16x8_t __a, uint16x8_t __b)
 {
-  return __builtin_mve_vcmpneq_uv8hi (__a, __b);
+  return __builtin_mve_vcmpneq_sv8hi ((int16x8_t)__a, (int16x8_t)__b);
 }
 
 __extension__ extern __inline mve_pred16_t
 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
 __arm_vcmpneq_u32 (uint32x4_t __a, uint32x4_t __b)
 {
-  return __builtin_mve_vcmpneq_uv4si (__a, __b);
+  return __builtin_mve_vcmpneq_sv4si ((int32x4_t)__a, (int32x4_t)__b);
 }
 
 __extension__ extern __inline int8x16_t
@@ -3932,7 +3932,7 @@  __extension__ extern __inline mve_pred16_t
 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
 __arm_vcmpneq_n_u8 (uint8x16_t __a, uint8_t __b)
 {
-  return __builtin_mve_vcmpneq_n_uv16qi (__a, __b);
+  return __builtin_mve_vcmpneq_n_sv16qi ((int8x16_t)__a, (int8_t)__b);
 }
 
 __extension__ extern __inline mve_pred16_t
@@ -3953,14 +3953,14 @@  __extension__ extern __inline mve_pred16_t
 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
 __arm_vcmpeqq_u8 (uint8x16_t __a, uint8x16_t __b)
 {
-  return __builtin_mve_vcmpeqq_uv16qi (__a, __b);
+  return __builtin_mve_vcmpeqq_sv16qi ((int8x16_t)__a, (int8x16_t)__b);
 }
 
 __extension__ extern __inline mve_pred16_t
 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
 __arm_vcmpeqq_n_u8 (uint8x16_t __a, uint8_t __b)
 {
-  return __builtin_mve_vcmpeqq_n_uv16qi (__a, __b);
+  return __builtin_mve_vcmpeqq_n_sv16qi ((int8x16_t)__a, (int8_t)__b);
 }
 
 __extension__ extern __inline mve_pred16_t
@@ -4774,7 +4774,7 @@  __extension__ extern __inline mve_pred16_t
 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
 __arm_vcmpneq_n_u16 (uint16x8_t __a, uint16_t __b)
 {
-  return __builtin_mve_vcmpneq_n_uv8hi (__a, __b);
+  return __builtin_mve_vcmpneq_n_sv8hi ((int16x8_t)__a, (int16_t)__b);
 }
 
 __extension__ extern __inline mve_pred16_t
@@ -4795,14 +4795,14 @@  __extension__ extern __inline mve_pred16_t
 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
 __arm_vcmpeqq_u16 (uint16x8_t __a, uint16x8_t __b)
 {
-  return __builtin_mve_vcmpeqq_uv8hi (__a, __b);
+  return __builtin_mve_vcmpeqq_sv8hi ((int16x8_t)__a, (int16x8_t)__b);
 }
 
 __extension__ extern __inline mve_pred16_t
 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
 __arm_vcmpeqq_n_u16 (uint16x8_t __a, uint16_t __b)
 {
-  return __builtin_mve_vcmpeqq_n_uv8hi (__a, __b);
+  return __builtin_mve_vcmpeqq_n_sv8hi ((int16x8_t)__a, (int16_t)__b);
 }
 
 __extension__ extern __inline mve_pred16_t
@@ -5616,7 +5616,7 @@  __extension__ extern __inline mve_pred16_t
 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
 __arm_vcmpneq_n_u32 (uint32x4_t __a, uint32_t __b)
 {
-  return __builtin_mve_vcmpneq_n_uv4si (__a, __b);
+  return __builtin_mve_vcmpneq_n_sv4si ((int32x4_t)__a, (int32_t)__b);
 }
 
 __extension__ extern __inline mve_pred16_t
@@ -5637,14 +5637,14 @@  __extension__ extern __inline mve_pred16_t
 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
 __arm_vcmpeqq_u32 (uint32x4_t __a, uint32x4_t __b)
 {
-  return __builtin_mve_vcmpeqq_uv4si (__a, __b);
+  return __builtin_mve_vcmpeqq_sv4si ((int32x4_t)__a, (int32x4_t)__b);
 }
 
 __extension__ extern __inline mve_pred16_t
 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
 __arm_vcmpeqq_n_u32 (uint32x4_t __a, uint32_t __b)
 {
-  return __builtin_mve_vcmpeqq_n_uv4si (__a, __b);
+  return __builtin_mve_vcmpeqq_n_sv4si ((int32x4_t)__a, (int32_t)__b);
 }
 
 __extension__ extern __inline mve_pred16_t