1 Star 0 Fork 15

ocs-commit-check/glibc

forked from OpenCloudOS Stream/glibc 
Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
文件
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
0001-LoongArch-Use-builtins-for-ffs-and-ffsll.patch 998 Bytes
Copy Edit Raw Blame History
ticat_fp authored 2024-11-07 15:19 . LoongArch: Sync from glibc upstream
From 288d144301d20104e1b79fe5695f09af336574eb Mon Sep 17 00:00:00 2001
From: Xi Ruoyao <xry111@xry111.site>
Date: Sun, 4 Feb 2024 08:27:50 +0800
Subject: [PATCH 01/15] 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>
---
sysdeps/loongarch/math-use-builtins-ffs.h | 2 ++
1 file changed, 2 insertions(+)
create mode 100644 sysdeps/loongarch/math-use-builtins-ffs.h
diff --git a/sysdeps/loongarch/math-use-builtins-ffs.h b/sysdeps/loongarch/math-use-builtins-ffs.h
new file mode 100644
index 00000000..a83bb154
--- /dev/null
+++ b/sysdeps/loongarch/math-use-builtins-ffs.h
@@ -0,0 +1,2 @@
+#define USE_FFS_BUILTIN 1
+#define USE_FFSLL_BUILTIN 1
--
2.43.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ocs-commit-check/glibc.git
git@gitee.com:ocs-commit-check/glibc.git
ocs-commit-check
glibc
glibc
master

Search