RE: [ARM] PR66791: Replace builtin in vld1_dup intrinsics

2021-08-24 Thread Kyrylo Tkachov via Gcc-patches


> -Original Message-
> From: Prathamesh Kulkarni 
> Sent: 24 August 2021 09:01
> To: gcc Patches ; Kyrylo Tkachov
> ; Richard Earnshaw
> 
> Subject: Re: [ARM] PR66791: Replace builtin in vld1_dup intrinsics
> 
> On Fri, 13 Aug 2021 at 16:40, Prathamesh Kulkarni
>  wrote:
> >
> > On Thu, 5 Aug 2021 at 15:37, Prathamesh Kulkarni
> >  wrote:
> > >
> > > On Thu, 29 Jul 2021 at 19:58, Prathamesh Kulkarni
> > >  wrote:
> > > >
> > > > Hi,
> > > > The attached patch replaces builtins in vld1_dup intrinsics with call
> > > > to corresponding vdup_n intrinsic and removes entry for vld1_dup from
> > > > arm_neon_builtins.def.
> > > > Bootstrapped+tested on arm-linux-gnueabihf.
> > > > OK to commit ?
> > > ping https://gcc.gnu.org/pipermail/gcc-patches/2021-July/576321.html
> > ping * 2 https://gcc.gnu.org/pipermail/gcc-patches/2021-July/576321.html
> ping * 3 https://gcc.gnu.org/pipermail/gcc-patches/2021-July/576321.html

Sorry for the slow response.
I don't think this approach improves anything. With the current setup we'd be 
guaranteeing generation of the load-and-dup instruction even at low 
optimisation levels, but with this change we'd be relying on RTL optimisers 
merging the load and dup together. I don't think it gains us anything?

Thanks,
Kyrill

> 
> Thanks,
> Prathamesh
> >
> > Thanks,
> > Prathamesh
> > >
> > > Thanks,
> > > Prathamesh
> > > >
> > > > Thanks,
> > > > Prathamesh


Re: [ARM] PR66791: Replace builtin in vld1_dup intrinsics

2021-08-24 Thread Prathamesh Kulkarni via Gcc-patches
On Fri, 13 Aug 2021 at 16:40, Prathamesh Kulkarni
 wrote:
>
> On Thu, 5 Aug 2021 at 15:37, Prathamesh Kulkarni
>  wrote:
> >
> > On Thu, 29 Jul 2021 at 19:58, Prathamesh Kulkarni
> >  wrote:
> > >
> > > Hi,
> > > The attached patch replaces builtins in vld1_dup intrinsics with call
> > > to corresponding vdup_n intrinsic and removes entry for vld1_dup from
> > > arm_neon_builtins.def.
> > > Bootstrapped+tested on arm-linux-gnueabihf.
> > > OK to commit ?
> > ping https://gcc.gnu.org/pipermail/gcc-patches/2021-July/576321.html
> ping * 2 https://gcc.gnu.org/pipermail/gcc-patches/2021-July/576321.html
ping * 3 https://gcc.gnu.org/pipermail/gcc-patches/2021-July/576321.html

Thanks,
Prathamesh
>
> Thanks,
> Prathamesh
> >
> > Thanks,
> > Prathamesh
> > >
> > > Thanks,
> > > Prathamesh


Re: [ARM] PR66791: Replace builtin in vld1_dup intrinsics

2021-08-13 Thread Prathamesh Kulkarni via Gcc-patches
On Thu, 5 Aug 2021 at 15:37, Prathamesh Kulkarni
 wrote:
>
> On Thu, 29 Jul 2021 at 19:58, Prathamesh Kulkarni
>  wrote:
> >
> > Hi,
> > The attached patch replaces builtins in vld1_dup intrinsics with call
> > to corresponding vdup_n intrinsic and removes entry for vld1_dup from
> > arm_neon_builtins.def.
> > Bootstrapped+tested on arm-linux-gnueabihf.
> > OK to commit ?
> ping https://gcc.gnu.org/pipermail/gcc-patches/2021-July/576321.html
ping * 2 https://gcc.gnu.org/pipermail/gcc-patches/2021-July/576321.html

Thanks,
Prathamesh
>
> Thanks,
> Prathamesh
> >
> > Thanks,
> > Prathamesh


Re: [ARM] PR66791: Replace builtin in vld1_dup intrinsics

2021-08-05 Thread Prathamesh Kulkarni via Gcc-patches
On Thu, 29 Jul 2021 at 19:58, Prathamesh Kulkarni
 wrote:
>
> Hi,
> The attached patch replaces builtins in vld1_dup intrinsics with call
> to corresponding vdup_n intrinsic and removes entry for vld1_dup from
> arm_neon_builtins.def.
> Bootstrapped+tested on arm-linux-gnueabihf.
> OK to commit ?
ping https://gcc.gnu.org/pipermail/gcc-patches/2021-July/576321.html

Thanks,
Prathamesh
>
> Thanks,
> Prathamesh


[ARM] PR66791: Replace builtin in vld1_dup intrinsics

2021-07-29 Thread Prathamesh Kulkarni via Gcc-patches
Hi,
The attached patch replaces builtins in vld1_dup intrinsics with call
to corresponding vdup_n intrinsic and removes entry for vld1_dup from
arm_neon_builtins.def.
Bootstrapped+tested on arm-linux-gnueabihf.
OK to commit ?

Thanks,
Prathamesh
gcc/ChangeLog:

PR target/66791
* config/arm/arm_neon.h (vld1_dup_s8): Replace builtin with call to
corresponding vdup_n intrinsic.
(vld1_dup_s16): Likewise.
(vld1_dup_s32): Likewise.
(vld1_dup_f32): Likewise.
(vld1_dup_u8): Likewise.
(vld1_dup_u16): Likewise.
(vld1_dup_u32): Likewise.
(vld1_dup_p8): Likewise.
(vld1_dup_p16): Likewise.
(vld1_dup_p64): Likewise.
(vld1_dup_s64): Likewise.
(vld1_dup_u64): Likewise.
(vld1q_dup_s8): Likewise.
(vld1q_dup_s16): Likewise.
(vld1q_dup_s32): Likewise.
(vld1q_dup_f32): Likewise.
(vld1q_dup_u8): Likewise.
(vld1q_dup_u16): Likewise.
(vld1q_dup_u32): Likewise.
(vld1q_dup_p8): Likewise.
(vld1q_dup_p16): Likewise.
(vld1q_dup_p64): Likewise.
(vld1q_dup_s64): Likewise.
(vld1q_dup_u64): Likewise.
* config/arm/arm_neon_builtins.def (vld1_dup): Remove entry.


diff --git a/gcc/config/arm/arm_neon.h b/gcc/config/arm/arm_neon.h
index 41b596b5fc6..bc55dacffd3 100644
--- a/gcc/config/arm/arm_neon.h
+++ b/gcc/config/arm/arm_neon.h
@@ -10683,21 +10683,21 @@ __extension__ extern __inline int8x8_t
 __attribute__  ((__always_inline__, __gnu_inline__, __artificial__))
 vld1_dup_s8 (const int8_t * __a)
 {
-  return (int8x8_t)__builtin_neon_vld1_dupv8qi ((const __builtin_neon_qi *) 
__a);
+  return vdup_n_s8 (*__a);
 }
 
 __extension__ extern __inline int16x4_t
 __attribute__  ((__always_inline__, __gnu_inline__, __artificial__))
 vld1_dup_s16 (const int16_t * __a)
 {
-  return (int16x4_t)__builtin_neon_vld1_dupv4hi ((const __builtin_neon_hi *) 
__a);
+  return vdup_n_s16 (*__a);
 }
 
 __extension__ extern __inline int32x2_t
 __attribute__  ((__always_inline__, __gnu_inline__, __artificial__))
 vld1_dup_s32 (const int32_t * __a)
 {
-  return (int32x2_t)__builtin_neon_vld1_dupv2si ((const __builtin_neon_si *) 
__a);
+  return vdup_n_s32 (*__a);
 }
 
 #if defined (__ARM_FP16_FORMAT_IEEE) || defined (__ARM_FP16_FORMAT_ALTERNATIVE)
@@ -10714,42 +10714,42 @@ __extension__ extern __inline float32x2_t
 __attribute__  ((__always_inline__, __gnu_inline__, __artificial__))
 vld1_dup_f32 (const float32_t * __a)
 {
-  return (float32x2_t)__builtin_neon_vld1_dupv2sf ((const __builtin_neon_sf *) 
__a);
+  return vdup_n_f32 (*__a);
 }
 
 __extension__ extern __inline uint8x8_t
 __attribute__  ((__always_inline__, __gnu_inline__, __artificial__))
 vld1_dup_u8 (const uint8_t * __a)
 {
-  return (uint8x8_t)__builtin_neon_vld1_dupv8qi ((const __builtin_neon_qi *) 
__a);
+  return vdup_n_u8 (*__a);
 }
 
 __extension__ extern __inline uint16x4_t
 __attribute__  ((__always_inline__, __gnu_inline__, __artificial__))
 vld1_dup_u16 (const uint16_t * __a)
 {
-  return (uint16x4_t)__builtin_neon_vld1_dupv4hi ((const __builtin_neon_hi *) 
__a);
+  return vdup_n_u16 (*__a);
 }
 
 __extension__ extern __inline uint32x2_t
 __attribute__  ((__always_inline__, __gnu_inline__, __artificial__))
 vld1_dup_u32 (const uint32_t * __a)
 {
-  return (uint32x2_t)__builtin_neon_vld1_dupv2si ((const __builtin_neon_si *) 
__a);
+  return vdup_n_u32 (*__a);
 }
 
 __extension__ extern __inline poly8x8_t
 __attribute__  ((__always_inline__, __gnu_inline__, __artificial__))
 vld1_dup_p8 (const poly8_t * __a)
 {
-  return (poly8x8_t)__builtin_neon_vld1_dupv8qi ((const __builtin_neon_qi *) 
__a);
+  return vdup_n_p8 (*__a);
 }
 
 __extension__ extern __inline poly16x4_t
 __attribute__  ((__always_inline__, __gnu_inline__, __artificial__))
 vld1_dup_p16 (const poly16_t * __a)
 {
-  return (poly16x4_t)__builtin_neon_vld1_dupv4hi ((const __builtin_neon_hi *) 
__a);
+  return vdup_n_p16 (*__a);
 }
 
 #pragma GCC push_options
@@ -10758,7 +10758,7 @@ __extension__ extern __inline poly64x1_t
 __attribute__  ((__always_inline__, __gnu_inline__, __artificial__))
 vld1_dup_p64 (const poly64_t * __a)
 {
-  return (poly64x1_t)__builtin_neon_vld1_dupdi ((const __builtin_neon_di *) 
__a);
+  return vdup_n_p64 (*__a);
 }
 
 #pragma GCC pop_options
@@ -10766,35 +10766,35 @@ __extension__ extern __inline int64x1_t
 __attribute__  ((__always_inline__, __gnu_inline__, __artificial__))
 vld1_dup_s64 (const int64_t * __a)
 {
-  return (int64x1_t)__builtin_neon_vld1_dupdi ((const __builtin_neon_di *) 
__a);
+  return vdup_n_s64 (*__a);
 }
 
 __extension__ extern __inline uint64x1_t
 __attribute__  ((__always_inline__, __gnu_inline__, __artificial__))
 vld1_dup_u64 (const uint64_t * __a)
 {
-  return (uint64x1_t)__builtin_neon_vld1_dupdi ((const __builtin_neon_di *) 
__a);
+  return vdup_n_u64 (*__a);
 }
 
 __extension__ extern __inline int8x16_t
 __attribute__  ((__always_inline__, __gnu_inline__,