mirror of
git://sourceware.org/git/glibc.git
synced 2025-03-06 20:58:33 +01:00
LoongArch: Use builtins for ffs and ffsll
On LoongArch GCC compiles __builtin_ffs{,ll} to basically `(x ? __builtin_ctz (x) : -1) + 1`. Since a hardware ctz instruction is available, this is much better than the table-driven generic implementation. Tested on loongarch64. Signed-off-by: Xi Ruoyao <xry111@xry111.site> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
This commit is contained in:
parent
814ed22eab
commit
2e80f13937
1 changed files with 2 additions and 0 deletions
2
sysdeps/loongarch/math-use-builtins-ffs.h
Normal file
2
sysdeps/loongarch/math-use-builtins-ffs.h
Normal file
|
@ -0,0 +1,2 @@
|
|||
#define USE_FFS_BUILTIN 1
|
||||
#define USE_FFSLL_BUILTIN 1
|
Loading…
Add table
Reference in a new issue