aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunxian Zhu <zhujunxian@oss.cipunited.com>2024-02-06 16:34:56 +0800
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2024-02-14 12:20:49 -0300
commit545480506fc6576ea37a14e56c654935c691709d (patch)
tree35a29428ec2c82aef6ed6a0f3af2ebd9a40726be
parent491e55beab7457ed310a4a47496f4a333c5d1032 (diff)
downloadglibc-545480506fc6576ea37a14e56c654935c691709d.zip
glibc-545480506fc6576ea37a14e56c654935c691709d.tar.gz
glibc-545480506fc6576ea37a14e56c654935c691709d.tar.bz2
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>
-rw-r--r--sysdeps/mips/math-use-builtins-ffs.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/sysdeps/mips/math-use-builtins-ffs.h b/sysdeps/mips/math-use-builtins-ffs.h
new file mode 100644
index 0000000..2ab6a03
--- /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)