From: Szabolcs Nagy <szabolcs.nagy@arm.com>
To: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
Cc: 'GNU C Library' <libc-alpha@sourceware.org>
Subject: Re: [PATCH] aarch64: Cleanup memset ifunc
Date: Tue, 25 Oct 2022 13:53:23 +0100 [thread overview]
Message-ID: <Y1fcQ2zEO6OIsYkI@arm.com> (raw)
In-Reply-To: <AS4PR08MB790128ED50E70D3E1F30D4FE83229@AS4PR08MB7901.eurprd08.prod.outlook.com>
The 10/12/2022 15:17, Wilco Dijkstra via Libc-alpha wrote:
>
> Cleanup memset ifunc selectors. The A64FX memset relies on a ZVA size of 256,
> so add an explicit check.
>
> Passes regress, OK for commit?
this is ok to commit, thanks.
>
> ---
>
> diff --git a/sysdeps/aarch64/multiarch/ifunc-impl-list.c b/sysdeps/aarch64/multiarch/ifunc-impl-list.c
> index e7c4dcc0ed5a68ecd8dacc06256d0749b76912cb..ed61cac5448e345b8c93eec21d493af5aabe1d3a 100644
> --- a/sysdeps/aarch64/multiarch/ifunc-impl-list.c
> +++ b/sysdeps/aarch64/multiarch/ifunc-impl-list.c
> @@ -53,7 +53,7 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
> IFUNC_IMPL_ADD (array, i, memset, (zva_size == 64), __memset_emag)
> IFUNC_IMPL_ADD (array, i, memset, 1, __memset_kunpeng)
> #if HAVE_AARCH64_SVE_ASM
> - IFUNC_IMPL_ADD (array, i, memset, sve, __memset_a64fx)
> + IFUNC_IMPL_ADD (array, i, memset, sve && zva_size == 256, __memset_a64fx)
> #endif
> IFUNC_IMPL_ADD (array, i, memset, 1, __memset_generic))
> IFUNC_IMPL (i, name, memchr,
> diff --git a/sysdeps/aarch64/multiarch/memset.c b/sysdeps/aarch64/multiarch/memset.c
> index 884f08a3acbaeeaf5dafad3fe6e7d535c7a379f4..59bd0e64f894b4ab748fe385cdfb136f2707da94 100644
> --- a/sysdeps/aarch64/multiarch/memset.c
> +++ b/sysdeps/aarch64/multiarch/memset.c
> @@ -30,23 +30,31 @@ extern __typeof (__redirect_memset) __libc_memset;
>
> extern __typeof (__redirect_memset) __memset_emag attribute_hidden;
> extern __typeof (__redirect_memset) __memset_kunpeng attribute_hidden;
> -# if HAVE_AARCH64_SVE_ASM
> extern __typeof (__redirect_memset) __memset_a64fx attribute_hidden;
> -# endif
> extern __typeof (__redirect_memset) __memset_generic attribute_hidden;
>
> -libc_ifunc (__libc_memset,
> - IS_KUNPENG920 (midr)
> - ?__memset_kunpeng
> - : (IS_EMAG (midr) && zva_size == 64
> - ? __memset_emag
> -# if HAVE_AARCH64_SVE_ASM
> - : (IS_A64FX (midr) && sve
> - ? __memset_a64fx
> - : __memset_generic)));
> -# else
> - : __memset_generic));
> -# endif
> +static inline __typeof (__redirect_memset) *
> +select_memset_ifunc (void)
> +{
> + INIT_ARCH ();
> +
> + if (sve && HAVE_AARCH64_SVE_ASM)
> + {
> + if (IS_A64FX (midr) && zva_size == 256)
> + return __memset_a64fx;
> + return __memset_generic;
> + }
> +
> + if (IS_KUNPENG920 (midr))
> + return __memset_kunpeng;
> +
> + if (IS_EMAG (midr) && zva_size == 64)
> + return __memset_emag;
> +
> + return __memset_generic;
> +}
> +
> +libc_ifunc (__libc_memset, select_memset_ifunc ());
>
> # undef memset
> strong_alias (__libc_memset, memset);
>
prev parent reply other threads:[~2022-10-25 12:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-12 15:17 Wilco Dijkstra
2022-10-25 12:53 ` Szabolcs Nagy [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y1fcQ2zEO6OIsYkI@arm.com \
--to=szabolcs.nagy@arm.com \
--cc=Wilco.Dijkstra@arm.com \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).