21 Star 26 Fork 93

src-openEuler / gcc

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
LoongArch-Slightly-simplify-loongarch_block_move_str.patch 1.42 KB
一键复制 编辑 原始数据 按行查看 历史
ticat_fp 提交于 2024-03-26 09:26 . LoongArch: update from gcc upstream
From f4a0248c80fedff3a6841407ff95b732dfbb93a1 Mon Sep 17 00:00:00 2001
From: Xi Ruoyao <xry111@xry111.site>
Date: Fri, 8 Sep 2023 00:29:57 +0800
Subject: [PATCH 073/124] LoongArch: Slightly simplify
loongarch_block_move_straight
gcc/ChangeLog:
* config/loongarch/loongarch.cc (loongarch_block_move_straight):
Check precondition (delta must be a power of 2) and use
popcount_hwi instead of a homebrew loop.
Signed-off-by: Peng Fan <fanpeng@loongson.cn>
Signed-off-by: ticat_fp <fanpeng@loongson.cn>
---
gcc/config/loongarch/loongarch.cc | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/gcc/config/loongarch/loongarch.cc b/gcc/config/loongarch/loongarch.cc
index baa5c2354..baa9831aa 100644
--- a/gcc/config/loongarch/loongarch.cc
+++ b/gcc/config/loongarch/loongarch.cc
@@ -5221,9 +5221,8 @@ loongarch_block_move_straight (rtx dest, rtx src, HOST_WIDE_INT length,
emit two ld.d/st.d pairs, one ld.w/st.w pair, and one ld.b/st.b
pair. For each load/store pair we use a dedicated register to keep
the pipeline as populated as possible. */
- HOST_WIDE_INT num_reg = length / delta;
- for (delta_cur = delta / 2; delta_cur != 0; delta_cur /= 2)
- num_reg += !!(length & delta_cur);
+ gcc_assert (pow2p_hwi (delta));
+ HOST_WIDE_INT num_reg = length / delta + popcount_hwi (length % delta);
/* Allocate a buffer for the temporary registers. */
regs = XALLOCAVEC (rtx, num_reg);
--
2.33.0
1
https://gitee.com/src-openeuler/gcc.git
git@gitee.com:src-openeuler/gcc.git
src-openeuler
gcc
gcc
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891