From: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
To: Xi Ruoyao <xry111@xry111.site>, libc-alpha@sourceware.org
Cc: caiyinyu@loongson.cn
Subject: Re: [PATCH] LoongArch: Use builtins for ffs and ffsll
Date: Mon, 5 Feb 2024 10:57:34 -0300 [thread overview]
Message-ID: <e45348f8-e145-42a8-8434-93ac13435ce7@linaro.org> (raw)
In-Reply-To: <20240204002750.402652-1-xry111@xry111.site>
On 03/02/24 21:27, Xi Ruoyao wrote:
> On LoongArch GCC compiles __builtin_ffs{,ll} to basically
> `(x ? __builtin_ctz (x) : -1) + 1`. Since a hardware ctz instruction is
> available, this is much better than the table-driven generic
> implementation.
>
> Tested on loongarch64.
>
> Signed-off-by: Xi Ruoyao <xry111@xry111.site>
LGTM, thanks.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
> ---
> sysdeps/loongarch/math-use-builtins-ffs.h | 2 ++
> 1 file changed, 2 insertions(+)
> create mode 100644 sysdeps/loongarch/math-use-builtins-ffs.h
>
> diff --git a/sysdeps/loongarch/math-use-builtins-ffs.h b/sysdeps/loongarch/math-use-builtins-ffs.h
> new file mode 100644
> index 0000000000..a83bb15414
> --- /dev/null
> +++ b/sysdeps/loongarch/math-use-builtins-ffs.h
> @@ -0,0 +1,2 @@
> +#define USE_FFS_BUILTIN 1
> +#define USE_FFSLL_BUILTIN 1
prev parent reply other threads:[~2024-02-05 13:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-04 0:27 Xi Ruoyao
2024-02-05 13:57 ` Adhemerval Zanella Netto [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=e45348f8-e145-42a8-8434-93ac13435ce7@linaro.org \
--to=adhemerval.zanella@linaro.org \
--cc=caiyinyu@loongson.cn \
--cc=libc-alpha@sourceware.org \
--cc=xry111@xry111.site \
/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).