aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/link/internal
diff options
context:
space:
mode:
authorWANG Xuerui <git@xen0n.name>2023-04-04 16:35:06 +0800
committerGopher Robot <gobot@golang.org>2023-04-07 20:21:44 +0000
commit0d3c23fe87ca0ee727d833ce11ab16b405a93ea3 (patch)
tree05721cb6c7a05295dfa885bd0eccc2f92e16a1ad /src/cmd/link/internal
parent157999f51260a36d9078e4aa2d711695e4c0c66d (diff)
downloadgo-0d3c23fe87ca0ee727d833ce11ab16b405a93ea3.tar.xz
cmd/link: bump loong64 function alignment to 16 bytes
The loong64 PCALIGN directive works with PCs relative to beginning of functions. So if the function alignment is less than that requested by PCALIGN, the following code may in fact not be aligned as such, leading to unexpected performance. The current function alignment on loong64 is 8 bytes, which seems to stem from mips64 or riscv64. In order to make performance more predictable on loong64, it is raised to 16 bytes to ensure that at least `PCALIGN $16` works. As alignment of loops written in Go is yet to be tackled, and the codegen is not otherwise touched, benchmark numbers for this change are not going to be meaningful, and not included. Change-Id: I2120ef3746ce067e274920c82091810073bfa3be Reviewed-on: https://go-review.googlesource.com/c/go/+/481936 Auto-Submit: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> Run-TryBot: WANG Xuerui <git@xen0n.name> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/cmd/link/internal')
-rw-r--r--src/cmd/link/internal/loong64/l.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/link/internal/loong64/l.go b/src/cmd/link/internal/loong64/l.go
index e97a8686bf..a6309f1a3a 100644
--- a/src/cmd/link/internal/loong64/l.go
+++ b/src/cmd/link/internal/loong64/l.go
@@ -7,7 +7,7 @@ package loong64
const (
maxAlign = 32 // max data alignment
minAlign = 1 // min data alignment
- funcAlign = 8
+ funcAlign = 16
)
/* Used by ../../internal/ld/dwarf.go */