public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] mips: Use builtins for ffs and ffsll
@ 2024-02-14 16:59 Adhemerval Zanella
  0 siblings, 0 replies; only message in thread
From: Adhemerval Zanella @ 2024-02-14 16:59 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=545480506fc6576ea37a14e56c654935c691709d

commit 545480506fc6576ea37a14e56c654935c691709d
Author: Junxian Zhu <zhujunxian@oss.cipunited.com>
Date:   Tue Feb 6 16:34:56 2024 +0800

    mips: Use builtins for ffs and ffsll
    
    __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>
    Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
    Reviewed-by: Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org>

Diff:
---
 sysdeps/mips/math-use-builtins-ffs.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sysdeps/mips/math-use-builtins-ffs.h b/sysdeps/mips/math-use-builtins-ffs.h
new file mode 100644
index 0000000000..2ab6a03a16
--- /dev/null
+++ b/sysdeps/mips/math-use-builtins-ffs.h
@@ -0,0 +1,3 @@
+#include <sysdep.h>
+#define USE_FFS_BUILTIN (__mips_isa_rev >= 1)
+#define USE_FFSLL_BUILTIN (__mips_isa_rev >= 1)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-02-14 16:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-14 16:59 [glibc] mips: Use builtins for ffs and ffsll Adhemerval Zanella

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).