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__, __artificial__)) vld1q_dup_s8 (const int8_t * __a) { - return (int8x16_t)__builtin_neon_vld1_dupv16qi ((const __builtin_neon_qi *) __a); + return vdupq_n_s8 (*__a); } __extension__ extern __inline int16x8_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vld1q_dup_s16 (const int16_t * __a) { - return (int16x8_t)__builtin_neon_vld1_dupv8hi ((const __builtin_neon_hi *) __a); + return vdupq_n_s16 (*__a); } __extension__ extern __inline int32x4_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vld1q_dup_s32 (const int32_t * __a) { - return (int32x4_t)__builtin_neon_vld1_dupv4si ((const __builtin_neon_si *) __a); + return vdupq_n_s32 (*__a); } #if defined (__ARM_FP16_FORMAT_IEEE) || defined (__ARM_FP16_FORMAT_ALTERNATIVE) @@ -10811,42 +10811,42 @@ __extension__ extern __inline float32x4_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vld1q_dup_f32 (const float32_t * __a) { - return (float32x4_t)__builtin_neon_vld1_dupv4sf ((const __builtin_neon_sf *) __a); + return vdupq_n_f32 (*__a); } __extension__ extern __inline uint8x16_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vld1q_dup_u8 (const uint8_t * __a) { - return (uint8x16_t)__builtin_neon_vld1_dupv16qi ((const __builtin_neon_qi *) __a); + return vdupq_n_u8 (*__a); } __extension__ extern __inline uint16x8_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vld1q_dup_u16 (const uint16_t * __a) { - return (uint16x8_t)__builtin_neon_vld1_dupv8hi ((const __builtin_neon_hi *) __a); + return vdupq_n_u16 (*__a); } __extension__ extern __inline uint32x4_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vld1q_dup_u32 (const uint32_t * __a) { - return (uint32x4_t)__builtin_neon_vld1_dupv4si ((const __builtin_neon_si *) __a); + return vdupq_n_u32 (*__a); } __extension__ extern __inline poly8x16_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vld1q_dup_p8 (const poly8_t * __a) { - return (poly8x16_t)__builtin_neon_vld1_dupv16qi ((const __builtin_neon_qi *) __a); + return vdupq_n_p8 (*__a); } __extension__ extern __inline poly16x8_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vld1q_dup_p16 (const poly16_t * __a) { - return (poly16x8_t)__builtin_neon_vld1_dupv8hi ((const __builtin_neon_hi *) __a); + return vdupq_n_p16 (*__a); } #pragma GCC push_options @@ -10855,7 +10855,7 @@ __extension__ extern __inline poly64x2_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vld1q_dup_p64 (const poly64_t * __a) { - return (poly64x2_t)__builtin_neon_vld1_dupv2di ((const __builtin_neon_di *) __a); + return vdupq_n_p64 (*__a); } #pragma GCC pop_options @@ -10863,14 +10863,14 @@ __extension__ extern __inline int64x2_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vld1q_dup_s64 (const int64_t * __a) { - return (int64x2_t)__builtin_neon_vld1_dupv2di ((const __builtin_neon_di *) __a); + return vdupq_n_s64 (*__a); } __extension__ extern __inline uint64x2_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vld1q_dup_u64 (const uint64_t * __a) { - return (uint64x2_t)__builtin_neon_vld1_dupv2di ((const __builtin_neon_di *) __a); + return vdupq_n_u64 (*__a); } #pragma GCC push_options diff --git a/gcc/config/arm/arm_neon_builtins.def b/gcc/config/arm/arm_neon_builtins.def index 70438ac1848..a2aeb21f350 100644 --- a/gcc/config/arm/arm_neon_builtins.def +++ b/gcc/config/arm/arm_neon_builtins.def @@ -307,8 +307,6 @@ VAR14 (LOAD1, vld1, v4bf, v8bf) VAR12 (LOAD1LANE, vld1_lane, v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf, v2di, v4bf, v8bf) -VAR10 (LOAD1, vld1_dup, - v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf, v2di) VAR14 (STORE1, vst1, v8qi, v4hi, v4hf, v2si, v2sf, di, v16qi, v8hi, v8hf, v4si, v4sf, v2di, v4bf, v8bf)