mips: Use builtins for ffs and ffsll
commit545480506fc6576ea37a14e56c654935c691709d
authorJunxian Zhu <zhujunxian@oss.cipunited.com>
Tue, 6 Feb 2024 08:34:56 +0000 (6 16:34 +0800)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 14 Feb 2024 15:20:49 +0000 (14 12:20 -0300)
tree35a29428ec2c82aef6ed6a0f3af2ebd9a40726be
parent491e55beab7457ed310a4a47496f4a333c5d1032
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>
sysdeps/mips/math-use-builtins-ffs.h [new file with mode: 0644]