[SYNC] Don't use local_detect_cpu when cross build and fix hip09 costs

This commit is contained in:
liyancheng 2024-12-31 12:14:29 +08:00
parent 3d3705d12d
commit ca80155718
3 changed files with 79 additions and 1 deletions

View File

@ -0,0 +1,27 @@
From cd708367a6558eca37715f8068f044a55402edab Mon Sep 17 00:00:00 2001
From: YunQiang Su <yunqiang@isrc.iscas.ac.cn>
Date: Wed, 18 Dec 2024 14:22:03 +0800
Subject: [PATCH] Don't use local_detect_cpu when cross build
-march=native makes no sense for cross build.
---
gcc/gcc.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index 179d507f255..f2387e0fae2 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -5800,7 +5800,7 @@ do_self_spec (const char *spec)
do_spec_1 (" ", 0, NULL);
const char* tune_native = NULL;
-#if defined (__x86_64__) || defined (__aarch64__)
+#if !defined(CROSS_DIRECTORY_STRUCTURE) && (defined (__x86_64__) || defined (__aarch64__))
tune_native = eval_spec_function ("local_cpu_detect", "cpu", "");
#endif
if (tune_native == NULL)
--
Gitee

View File

@ -0,0 +1,41 @@
From 00cd602772e471a18b3b36abfa3bde382d239b1f Mon Sep 17 00:00:00 2001
From: Mingchuan Wu <wumingchuan1992@foxmail.com>
Date: Thu, 26 Dec 2024 11:11:41 +0800
Subject: [PATCH] [bugfix] fix costs for hip09.
---
gcc/config/aarch64/aarch64.cc | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc
index e487ba12bad..65b684ef60f 100644
--- a/gcc/config/aarch64/aarch64.cc
+++ b/gcc/config/aarch64/aarch64.cc
@@ -749,8 +749,8 @@ static const struct cpu_regmove_cost hip09_regmove_cost =
1, /* GP2GP */
/* Avoid the use of slow int<->fp moves for spilling by setting
their cost higher than memmov_cost. */
- 2, /* GP2FP */
- 3, /* FP2GP */
+ 5, /* GP2FP */
+ 5, /* FP2GP */
2 /* FP2FP */
};
@@ -1923,10 +1923,10 @@ static const struct tune_params hip09_tunings =
4, /* load_pred. */
4 /* store_pred. */
}, /* memmov_cost. */
- 4, /* issue_rate */
+ 2, /* issue_rate */
(AARCH64_FUSE_AES_AESMC | AARCH64_FUSE_ALU_BRANCH
| AARCH64_FUSE_ALU_CBZ), /* fusible_ops */
- "16", /* function_align. */
+ "16:12", /* function_align. */
"4", /* jump_align. */
"8", /* loop_align. */
2, /* int_reassoc_width. */
--
Gitee

View File

@ -2,7 +2,7 @@
%global gcc_major 12
# Note, gcc_release must be integer, if you want to add suffixes to
# %%{release}, append them after %%{gcc_release} on Release: line.
%global gcc_release 65
%global gcc_release 66
%global _unpackaged_files_terminate_build 0
%global _performance_build 1
@ -439,6 +439,8 @@ Patch330: 0330-bugfix-fix-typo-error.patch
Patch331: 0331-fix-function-missing-return-value.patch
Patch332: 0332-Bugfix-Can-not-find-fdata-file.patch
Patch333: 0333-CSPGO-Update-the-gate-of-cspgo.patch
Patch334: 0334-Dont-use-local_detect_cpu-when-cross-build.patch
Patch335: 0335-fix-costs-for-hip09.patch
# Part 1001-1999
%ifarch sw_64
@ -1558,6 +1560,8 @@ not stable, so plugins must be rebuilt any time GCC is updated.
%patch -P331 -p1
%patch -P332 -p1
%patch -P333 -p1
%patch -P334 -p1
%patch -P335 -p1
%ifarch sw_64
%patch -P1001 -p1
@ -4181,6 +4185,12 @@ end
%doc rpm.doc/changelogs/libcc1/ChangeLog*
%changelog
* Tue Dec 31 2024 liyancheng <412998149@qq.com> - 12.3.1-66
- Type:Sync
- ID:NA
- SUG:NA
- DESC:Don't use local_detect_cpu when cross build and fix hip09 costs.
* Mon Dec 30 2024 liyancheng <412998149@qq.com> - 12.3.1-65
- Type:Bugfix
- ID:NA