[PATCH v6 2/2] aarch64: add __ifunc_hwcap function to be used in ifunc resolvers

Yury Khrustalev yury.khrustalev@arm.com
Thu Jun 5 12:25:50 GMT 2025


On Tue, Jun 03, 2025 at 09:42:06AM +0100, Yury Khrustalev wrote:
> Hi Adhemerval,
> 
> > > +/* A helper function to obtain HWCAP element by its ID from the
> > > +   parameters ARG0 and ARG1 passed to the ifunc resolver.  Note that
> > > +   ID 1 corresponds to AT_HWCAP, ID 2 corresponds to AT_HWCAP2, etc.
> > > +   If there is no element available for the requested ID then 0 is
> > > +   returned.  If ID doesn't much any supported AT_HWCAP{,2,...} value,
> > > +   then 0 is also returned.  */
> > 
> > I am not sure how confusing and error-prone using a blank integer would
> > be, specially by not using the default 0-base index from C.  Maybe 
> > by using an enum to specify which hwcap user want would hide this
> > implementation detail.
> 
> The v4 patch [1] had a enum but then discussion seem to be against it. I don't
> have a strong opinion here but we need to make up our mind.
> 
> [1]: https://inbox.sourceware.org/libc-alpha/20250425113522.3310684-4-yury.khrustalev@arm.com/
> 

I've sent v7 [1] with enum added back. I suppose if 2 vs 1 are pro having an
enum, it's worth adding it. Hopefully, the patches look good now.

[1]: https://patchwork.sourceware.org/project/glibc/list/?series=48235

Kind regards,
Yury



More information about the Libc-alpha mailing list