> -----Original Message----- > From: Christophe Lyon <christophe.l...@arm.com> > Sent: Tuesday, April 18, 2023 2:46 PM > To: gcc-patches@gcc.gnu.org; Kyrylo Tkachov <kyrylo.tkac...@arm.com>; > Richard Earnshaw <richard.earns...@arm.com>; Richard Sandiford > <richard.sandif...@arm.com> > Cc: Christophe Lyon <christophe.l...@arm.com> > Subject: [PATCH 04/22] arm: [MVE intrinsics] Rework vuninitialized > > Implement vuninitialized using the new MVE builtins framework. > > We need to keep the overloaded __arm_vuninitializedq definitions > because their resolution depends on the result type only, which is not > currently supported by the resolver. Ok. Thanks, Kyrill > > 2022-09-08 Murray Steele <murray.ste...@arm.com> > Christophe Lyon <christophe.l...@arm.com> > > gcc/ChangeLog: > > * config/arm/arm-mve-builtins-base.cc (class > vuninitializedq_impl): New. > * config/arm/arm-mve-builtins-base.def (vuninitializedq): New. > * config/arm/arm-mve-builtins-base.h (vuninitializedq): New > declaration. > * config/arm/arm-mve-builtins-shapes.cc (inherent): New. > * config/arm/arm-mve-builtins-shapes.h (inherent): New > declaration. > * config/arm/arm_mve_types.h (__arm_vuninitializedq): Move to ... > * config/arm/arm_mve.h (__arm_vuninitializedq): ... here. > (__arm_vuninitializedq_u8): Remove. > (__arm_vuninitializedq_u16): Remove. > (__arm_vuninitializedq_u32): Remove. > (__arm_vuninitializedq_u64): Remove. > (__arm_vuninitializedq_s8): Remove. > (__arm_vuninitializedq_s16): Remove. > (__arm_vuninitializedq_s32): Remove. > (__arm_vuninitializedq_s64): Remove. > (__arm_vuninitializedq_f16): Remove. > (__arm_vuninitializedq_f32): Remove. > --- > gcc/config/arm/arm-mve-builtins-base.cc | 14 ++ > gcc/config/arm/arm-mve-builtins-base.def | 2 + > gcc/config/arm/arm-mve-builtins-base.h | 1 + > gcc/config/arm/arm-mve-builtins-shapes.cc | 16 ++ > gcc/config/arm/arm-mve-builtins-shapes.h | 7 +- > gcc/config/arm/arm_mve.h | 73 ++++++++++ > gcc/config/arm/arm_mve_types.h | 169 ---------------------- > 7 files changed, 112 insertions(+), 170 deletions(-) > > diff --git a/gcc/config/arm/arm-mve-builtins-base.cc b/gcc/config/arm/arm- > mve-builtins-base.cc > index ad8d500afc6..02a3b23865c 100644 > --- a/gcc/config/arm/arm-mve-builtins-base.cc > +++ b/gcc/config/arm/arm-mve-builtins-base.cc > @@ -65,10 +65,24 @@ class vreinterpretq_impl : public > quiet<function_base> > } > }; > > +/* Implements vuninitializedq_* intrinsics. */ > +class vuninitializedq_impl : public quiet<function_base> > +{ > + > + rtx > + expand (function_expander &e) const override > + { > + rtx target = e.get_reg_target (); > + emit_clobber (copy_rtx (target)); > + return target; > + } > +}; > + > } /* end anonymous namespace */ > > namespace arm_mve { > > FUNCTION (vreinterpretq, vreinterpretq_impl,) > +FUNCTION (vuninitializedq, vuninitializedq_impl,) > > } /* end namespace arm_mve */ > diff --git a/gcc/config/arm/arm-mve-builtins-base.def b/gcc/config/arm/arm- > mve-builtins-base.def > index 5c0c1b9cee7..f669642a259 100644 > --- a/gcc/config/arm/arm-mve-builtins-base.def > +++ b/gcc/config/arm/arm-mve-builtins-base.def > @@ -19,8 +19,10 @@ > > #define REQUIRES_FLOAT false > DEF_MVE_FUNCTION (vreinterpretq, unary_convert, reinterpret_integer, > none) > +DEF_MVE_FUNCTION (vuninitializedq, inherent, all_integer_with_64, none) > #undef REQUIRES_FLOAT > > #define REQUIRES_FLOAT true > DEF_MVE_FUNCTION (vreinterpretq, unary_convert, reinterpret_float, none) > +DEF_MVE_FUNCTION (vuninitializedq, inherent, all_float, none) > #undef REQUIRES_FLOAT > diff --git a/gcc/config/arm/arm-mve-builtins-base.h b/gcc/config/arm/arm- > mve-builtins-base.h > index 60e7bd24eda..ec309cbe572 100644 > --- a/gcc/config/arm/arm-mve-builtins-base.h > +++ b/gcc/config/arm/arm-mve-builtins-base.h > @@ -24,6 +24,7 @@ namespace arm_mve { > namespace functions { > > extern const function_base *const vreinterpretq; > +extern const function_base *const vuninitializedq; > > } /* end namespace arm_mve::functions */ > } /* end namespace arm_mve */ > diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm- > mve-builtins-shapes.cc > index d0da0ffef91..ce476aa196e 100644 > --- a/gcc/config/arm/arm-mve-builtins-shapes.cc > +++ b/gcc/config/arm/arm-mve-builtins-shapes.cc > @@ -338,6 +338,22 @@ struct overloaded_base : public function_shape > } > }; > > +/* <T0>[xN]_t vfoo_t0(). > + > + Example: vuninitializedq. > + int8x16_t [__arm_]vuninitializedq_s8(void) > + int8x16_t [__arm_]vuninitializedq(int8x16_t t) */ > +struct inherent_def : public nonoverloaded_base > +{ > + void > + build (function_builder &b, const function_group_info &group, > + bool preserve_user_namespace) const override > + { > + build_all (b, "t0", group, MODE_none, preserve_user_namespace); > + } > +}; > +SHAPE (inherent) > + > /* <T0>_t foo_t0[_t1](<T1>_t) > > where the target type <t0> must be specified explicitly but the source > diff --git a/gcc/config/arm/arm-mve-builtins-shapes.h b/gcc/config/arm/arm- > mve-builtins-shapes.h > index 04d19a02890..a491369425c 100644 > --- a/gcc/config/arm/arm-mve-builtins-shapes.h > +++ b/gcc/config/arm/arm-mve-builtins-shapes.h > @@ -25,11 +25,16 @@ namespace arm_mve > /* The naming convention is: > > - to use names like "unary" etc. if the rules are somewhat generic, > - especially if there are no ranges involved. */ > + especially if there are no ranges involved. > + > + Also: > + > + - "inherent" means that the function takes no arguments. */ > > namespace shapes > { > > + extern const function_shape *const inherent; > extern const function_shape *const unary_convert; > > } /* end namespace arm_mve::shapes */ > diff --git a/gcc/config/arm/arm_mve.h b/gcc/config/arm/arm_mve.h > index 7688b5a7e53..5dc5ecef134 100644 > --- a/gcc/config/arm/arm_mve.h > +++ b/gcc/config/arm/arm_mve.h > @@ -35382,6 +35382,79 @@ __arm_vgetq_lane (float32x4_t __a, const int > __idx) > } > #endif /* MVE Floating point. */ > > + > +__extension__ extern __inline uint8x16_t > +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) > +__arm_vuninitializedq (uint8x16_t /* __v ATTRIBUTE UNUSED */) > +{ > + return __arm_vuninitializedq_u8 (); > +} > + > +__extension__ extern __inline uint16x8_t > +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) > +__arm_vuninitializedq (uint16x8_t /* __v ATTRIBUTE UNUSED */) > +{ > + return __arm_vuninitializedq_u16 (); > +} > + > +__extension__ extern __inline uint32x4_t > +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) > +__arm_vuninitializedq (uint32x4_t /* __v ATTRIBUTE UNUSED */) > +{ > + return __arm_vuninitializedq_u32 (); > +} > + > +__extension__ extern __inline uint64x2_t > +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) > +__arm_vuninitializedq (uint64x2_t /* __v ATTRIBUTE UNUSED */) > +{ > + return __arm_vuninitializedq_u64 (); > +} > + > +__extension__ extern __inline int8x16_t > +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) > +__arm_vuninitializedq (int8x16_t /* __v ATTRIBUTE UNUSED */) > +{ > + return __arm_vuninitializedq_s8 (); > +} > + > +__extension__ extern __inline int16x8_t > +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) > +__arm_vuninitializedq (int16x8_t /* __v ATTRIBUTE UNUSED */) > +{ > + return __arm_vuninitializedq_s16 (); > +} > + > +__extension__ extern __inline int32x4_t > +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) > +__arm_vuninitializedq (int32x4_t /* __v ATTRIBUTE UNUSED */) > +{ > + return __arm_vuninitializedq_s32 (); > +} > + > +__extension__ extern __inline int64x2_t > +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) > +__arm_vuninitializedq (int64x2_t /* __v ATTRIBUTE UNUSED */) > +{ > + return __arm_vuninitializedq_s64 (); > +} > + > +#if (__ARM_FEATURE_MVE & 2) /* MVE Floating point. */ > +__extension__ extern __inline float16x8_t > +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) > +__arm_vuninitializedq (float16x8_t /* __v ATTRIBUTE UNUSED */) > +{ > + return __arm_vuninitializedq_f16 (); > +} > + > +__extension__ extern __inline float32x4_t > +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) > +__arm_vuninitializedq (float32x4_t /* __v ATTRIBUTE UNUSED */) > +{ > + return __arm_vuninitializedq_f32 (); > +} > +#endif /* __ARM_FEATURE_MVE & 2 (MVE floating point) */ > + > #else > enum { > __ARM_mve_type_fp_n = 1, > diff --git a/gcc/config/arm/arm_mve_types.h > b/gcc/config/arm/arm_mve_types.h > index ae2591faa03..32942e51a74 100644 > --- a/gcc/config/arm/arm_mve_types.h > +++ b/gcc/config/arm/arm_mve_types.h > @@ -29,173 +29,4 @@ typedef float float32_t; > > #pragma GCC arm "arm_mve_types.h" > > -__extension__ extern __inline uint8x16_t > -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) > -__arm_vuninitializedq_u8 (void) > -{ > - uint8x16_t __uninit; > - __asm__ ("": "=w"(__uninit)); > - return __uninit; > -} > - > -__extension__ extern __inline uint16x8_t > -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) > -__arm_vuninitializedq_u16 (void) > -{ > - uint16x8_t __uninit; > - __asm__ ("": "=w"(__uninit)); > - return __uninit; > -} > - > -__extension__ extern __inline uint32x4_t > -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) > -__arm_vuninitializedq_u32 (void) > -{ > - uint32x4_t __uninit; > - __asm__ ("": "=w"(__uninit)); > - return __uninit; > -} > - > -__extension__ extern __inline uint64x2_t > -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) > -__arm_vuninitializedq_u64 (void) > -{ > - uint64x2_t __uninit; > - __asm__ ("": "=w"(__uninit)); > - return __uninit; > -} > - > -__extension__ extern __inline int8x16_t > -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) > -__arm_vuninitializedq_s8 (void) > -{ > - int8x16_t __uninit; > - __asm__ ("": "=w"(__uninit)); > - return __uninit; > -} > - > -__extension__ extern __inline int16x8_t > -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) > -__arm_vuninitializedq_s16 (void) > -{ > - int16x8_t __uninit; > - __asm__ ("": "=w"(__uninit)); > - return __uninit; > -} > - > -__extension__ extern __inline int32x4_t > -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) > -__arm_vuninitializedq_s32 (void) > -{ > - int32x4_t __uninit; > - __asm__ ("": "=w"(__uninit)); > - return __uninit; > -} > - > -__extension__ extern __inline int64x2_t > -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) > -__arm_vuninitializedq_s64 (void) > -{ > - int64x2_t __uninit; > - __asm__ ("": "=w"(__uninit)); > - return __uninit; > -} > - > -#if (__ARM_FEATURE_MVE & 2) /* MVE Floating point. */ > - > -__extension__ extern __inline float16x8_t > -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) > -__arm_vuninitializedq_f16 (void) > -{ > - float16x8_t __uninit; > - __asm__ ("": "=w" (__uninit)); > - return __uninit; > -} > - > -__extension__ extern __inline float32x4_t > -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) > -__arm_vuninitializedq_f32 (void) > -{ > - float32x4_t __uninit; > - __asm__ ("": "=w" (__uninit)); > - return __uninit; > -} > - > -#endif > - > -#ifdef __cplusplus > - > -__extension__ extern __inline uint8x16_t > -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) > -__arm_vuninitializedq (uint8x16_t /* __v ATTRIBUTE UNUSED */) > -{ > - return __arm_vuninitializedq_u8 (); > -} > - > -__extension__ extern __inline uint16x8_t > -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) > -__arm_vuninitializedq (uint16x8_t /* __v ATTRIBUTE UNUSED */) > -{ > - return __arm_vuninitializedq_u16 (); > -} > - > -__extension__ extern __inline uint32x4_t > -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) > -__arm_vuninitializedq (uint32x4_t /* __v ATTRIBUTE UNUSED */) > -{ > - return __arm_vuninitializedq_u32 (); > -} > - > -__extension__ extern __inline uint64x2_t > -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) > -__arm_vuninitializedq (uint64x2_t /* __v ATTRIBUTE UNUSED */) > -{ > - return __arm_vuninitializedq_u64 (); > -} > - > -__extension__ extern __inline int8x16_t > -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) > -__arm_vuninitializedq (int8x16_t /* __v ATTRIBUTE UNUSED */) > -{ > - return __arm_vuninitializedq_s8 (); > -} > - > -__extension__ extern __inline int16x8_t > -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) > -__arm_vuninitializedq (int16x8_t /* __v ATTRIBUTE UNUSED */) > -{ > - return __arm_vuninitializedq_s16 (); > -} > - > -__extension__ extern __inline int32x4_t > -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) > -__arm_vuninitializedq (int32x4_t /* __v ATTRIBUTE UNUSED */) > -{ > - return __arm_vuninitializedq_s32 (); > -} > - > -__extension__ extern __inline int64x2_t > -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) > -__arm_vuninitializedq (int64x2_t /* __v ATTRIBUTE UNUSED */) > -{ > - return __arm_vuninitializedq_s64 (); > -} > - > -#if (__ARM_FEATURE_MVE & 2) /* MVE Floating point. */ > -__extension__ extern __inline float16x8_t > -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) > -__arm_vuninitializedq (float16x8_t /* __v ATTRIBUTE UNUSED */) > -{ > - return __arm_vuninitializedq_f16 (); > -} > - > -__extension__ extern __inline float32x4_t > -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) > -__arm_vuninitializedq (float32x4_t /* __v ATTRIBUTE UNUSED */) > -{ > - return __arm_vuninitializedq_f32 (); > -} > -#endif /* __ARM_FEATURE_MVE & 2 (MVE floating point) */ > -#endif /* __cplusplus */ > - > #endif /* _GCC_ARM_MVE_H. */ > -- > 2.34.1
RE: [PATCH 04/22] arm: [MVE intrinsics] Rework vuninitialized
Kyrylo Tkachov via Gcc-patches Tue, 02 May 2023 09:13:33 -0700
- RE: [PATCH 01/22] arm: move builtin f... Kyrylo Tkachov via Gcc-patches
- [PATCH 02/22] arm: [MVE intrinsics] Add ne... Christophe Lyon via Gcc-patches
- [PATCH 14/22] arm: [MVE intrinsics] add un... Christophe Lyon via Gcc-patches
- RE: [PATCH 14/22] arm: [MVE intrinsic... Kyrylo Tkachov via Gcc-patches
- [PATCH 03/22] arm: [MVE intrinsics] Rework... Christophe Lyon via Gcc-patches
- RE: [PATCH 03/22] arm: [MVE intrinsic... Kyrylo Tkachov via Gcc-patches
- Re: [PATCH 03/22] arm: [MVE intri... Christophe Lyon via Gcc-patches
- RE: [PATCH 03/22] arm: [MVE i... Kyrylo Tkachov via Gcc-patches
- Re: [PATCH 03/22] arm: [M... Christophe Lyon via Gcc-patches
- [PATCH 04/22] arm: [MVE intrinsics] Rework... Christophe Lyon via Gcc-patches
- RE: [PATCH 04/22] arm: [MVE intrinsic... Kyrylo Tkachov via Gcc-patches
- [PATCH 05/22] arm: [MVE intrinsics] add bi... Christophe Lyon via Gcc-patches
- RE: [PATCH 05/22] arm: [MVE intrinsic... Kyrylo Tkachov via Gcc-patches
- [PATCH 07/22] arm: [MVE intrinsics] factor... Christophe Lyon via Gcc-patches
- RE: [PATCH 07/22] arm: [MVE intrinsic... Kyrylo Tkachov via Gcc-patches
- Re: [PATCH 07/22] arm: [MVE intri... Christophe Lyon via Gcc-patches
- [PATCH 15/22] arm: [MVE intrinsics] add cr... Christophe Lyon via Gcc-patches
- RE: [PATCH 15/22] arm: [MVE intrinsic... Kyrylo Tkachov via Gcc-patches
- [PATCH 10/22] arm: [MVE intrinsics] factor... Christophe Lyon via Gcc-patches
- RE: [PATCH 10/22] arm: [MVE intrinsic... Kyrylo Tkachov via Gcc-patches
- [PATCH 09/22] arm: [MVE intrinsics] add bi... Christophe Lyon via Gcc-patches