diff options
author | Xi Ruoyao <xry111@xry111.site> | 2024-02-04 08:27:50 +0800 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2024-02-05 15:19:41 -0300 |
commit | 2e80f139376450acdb7d879d799439578a41810e (patch) | |
tree | 9888c8627c488da707f338232ab4c480c618eba9 /sysdeps | |
parent | 814ed22eab4f3f43bb02229edab5d50004310258 (diff) | |
download | glibc-2e80f139376450acdb7d879d799439578a41810e.tar.gz glibc-2e80f139376450acdb7d879d799439578a41810e.tar.xz glibc-2e80f139376450acdb7d879d799439578a41810e.zip |
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>
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/loongarch/math-use-builtins-ffs.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sysdeps/loongarch/math-use-builtins-ffs.h b/sysdeps/loongarch/math-use-builtins-ffs.h new file mode 100644 index 0000000000..a83bb15414 --- /dev/null +++ b/sysdeps/loongarch/math-use-builtins-ffs.h @@ -0,0 +1,2 @@ +#define USE_FFS_BUILTIN 1 +#define USE_FFSLL_BUILTIN 1 |