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>
This commit is contained in:
Junxian Zhu 2024-02-06 16:34:56 +08:00 committed by Adhemerval Zanella
parent 491e55beab
commit 545480506f

View File

@ -0,0 +1,3 @@
#include <sysdep.h>
#define USE_FFS_BUILTIN (__mips_isa_rev >= 1)
#define USE_FFSLL_BUILTIN (__mips_isa_rev >= 1)