public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
To: Junxian Zhu <zhujunxian@oss.cipunited.com>, libc-alpha@sourceware.org
Subject: Re: [PATCH] mips: Use builtins for ffs and ffsll
Date: Mon, 5 Feb 2024 15:28:59 -0300	[thread overview]
Message-ID: <850a7fa0-e9c0-4c92-bde8-9f4f6773381f@linaro.org> (raw)
In-Reply-To: <c9369b99-6425-4f6f-b661-c9bb7c1c94bd@linaro.org>



On 05/02/24 11:19, Adhemerval Zanella Netto wrote:
> 
> 
> On 04/02/24 07:11, Junxian Zhu wrote:
>> From: Junxian Zhu <zhujunxian@oss.cipunited.com>
>>
>> __builtin_ffs{,ll} basically on __builtin_ctz{,ll} in MIPS GCC compiler.
>> The hardware ctz instructions were available after MIPS{32,64} Release1. By using builtin ctz. It can also reduce code size of ffs/ffsll.
>>
>> Checked on mips o32. mips64.
>>
>> Signed-off-by: Junxian Zhu <zhujunxian@oss.cipunited.com>
> 
> LGTM, thanks.
> 
> Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
> 
>> ---
>>  sysdeps/mips/math-use-builtins-ffs.h | 2 ++
>>  1 file changed, 2 insertions(+)
>>  create mode 100644 sysdeps/mips/math-use-builtins-ffs.h
>>
>> diff --git a/sysdeps/mips/math-use-builtins-ffs.h b/sysdeps/mips/math-use-builtins-ffs.h
>> new file mode 100644
>> index 0000000000..78b3f14fae
>> --- /dev/null
>> +++ b/sysdeps/mips/math-use-builtins-ffs.h
>> @@ -0,0 +1,2 @@
>> +#define USE_FFS_BUILTIN (__mips_isa_rev >= 1)
>> +#define USE_FFSLL_BUILTIN (__mips_isa_rev >= 1)

In fact you need to include <sysdep.h> since gcc only defines __mips_isa_rev
for -mips32 or higher.

  reply	other threads:[~2024-02-05 18:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-04 10:11 Junxian Zhu
2024-02-05 14:19 ` Adhemerval Zanella Netto
2024-02-05 18:28   ` Adhemerval Zanella Netto [this message]
2024-05-12 17:06     ` Maciej W. Rozycki

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=850a7fa0-e9c0-4c92-bde8-9f4f6773381f@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.org \
    --cc=zhujunxian@oss.cipunited.com \
    /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).