From 545480506fc6576ea37a14e56c654935c691709d Mon Sep 17 00:00:00 2001 From: Junxian Zhu Date: Tue, 6 Feb 2024 16:34:56 +0800 Subject: 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 Reviewed-by: Adhemerval Zanella Reviewed-by: Maxim Kuvyrkov --- sysdeps/mips/math-use-builtins-ffs.h | 3 +++ 1 file changed, 3 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..2ab6a03a16 --- /dev/null +++ b/sysdeps/mips/math-use-builtins-ffs.h @@ -0,0 +1,3 @@ +#include +#define USE_FFS_BUILTIN (__mips_isa_rev >= 1) +#define USE_FFSLL_BUILTIN (__mips_isa_rev >= 1) -- cgit v1.2.3