[go] cmd/compile: allow equal functions to perform unaligned load on loong64

0 views
Skip to first unread message

Gopher Robot (Gerrit)

unread,
Feb 6, 2026, 2:29:43 PM (2 days ago) Feb 6
to abner chenc, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Michael Pratt, Michael Knyszek, Meidan Li, Go LUCI, sophie zhao, golang-co...@googlegroups.com

Gopher Robot submitted the change

Change information

Commit message:
cmd/compile: allow equal functions to perform unaligned load on loong64

The Go compiler always generates Loong64 binaries, which can execute any
processor of LA364, LA464, LA664 or higher core. And these processors
support unaligned memory access [1].

goos: linux
goarch: loong64
pkg: strings
cpu: Loongson-3A6000 @ 2500.00MHz
| old.txt | new.txt |
| sec/op | sec/op vs base |
StringPrefix3 4.0040n ± 0% 0.4003n ± 0% -90.00% (p=0.000 n=10)
StringPrefix5 4.0040n ± 0% 0.4003n ± 0% -90.00% (p=0.000 n=10)
StringPrefix6 3.6030n ± 0% 0.4002n ± 0% -88.89% (p=0.000 n=10)
StringPrefix7 4.0040n ± 0% 0.4002n ± 0% -90.00% (p=0.000 n=10)
geomean 3.900n 0.4003n -89.74%

goos: linux
goarch: loong64
pkg: strings
cpu: Loongson-3A5000-HV @ 2500.00MHz
| old.txt │ new.txt |
| sec/op │ sec/op vs base |
StringPrefix3 5.6160n ± 0% 0.4011n ± 0% -92.86% (p=0.000 n=10)
StringPrefix5 5.6180n ± 0% 0.4011n ± 0% -92.86% (p=0.000 n=10)
StringPrefix6 5.2170n ± 0% 0.4011n ± 0% -92.31% (p=0.000 n=10)
StringPrefix7 5.6170n ± 0% 0.4009n ± 0% -92.86% (p=0.000 n=10)
geomean 5.514n 0.4010n -92.73%

goos: linux
goarch: loong64
pkg: strings
cpu: Loongson-3B6000M @ 2400.00MHz
| old.txt │ new.txt |
| sec/op │ sec/op vs base |
StringPrefix3 5.0060n ± 0% 0.4223n ± 1% -91.56% (p=0.000 n=10)
StringPrefix5 4.5890n ± 0% 0.4214n ± 0% -90.82% (p=0.000 n=10)
StringPrefix6 4.5890n ± 0% 0.4190n ± 1% -90.87% (p=0.000 n=10)
StringPrefix7 4.5890n ± 0% 0.4226n ± 1% -90.79% (p=0.000 n=10)
geomean 4.690n 0.4213n -91.02%

[1]: https://go.dev/wiki/MinimumRequirements#loong64
Change-Id: I1870080e0122a7d136685e3045699d0cf1e4194d
Reviewed-by: Meidan Li <lime...@loongson.cn>
Reviewed-by: Michael Pratt <mpr...@google.com>
Reviewed-by: Michael Knyszek <mkny...@google.com>
Auto-Submit: Michael Pratt <mpr...@google.com>
Files:
  • M src/cmd/internal/sys/arch.go
  • M test/codegen/comparisons.go
Change size: S
Delta: 2 files changed, 9 insertions(+), 1 deletion(-)
Branch: refs/heads/master
Submit Requirements:
  • requirement satisfiedCode-Review: +2 by Meidan Li, +1 by Michael Pratt, +1 by Michael Knyszek
  • requirement satisfiedTryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I1870080e0122a7d136685e3045699d0cf1e4194d
Gerrit-Change-Number: 742260
Gerrit-PatchSet: 2
Gerrit-Owner: abner chenc <chen...@loongson.cn>
Gerrit-Reviewer: Gopher Robot <go...@golang.org>
Gerrit-Reviewer: Meidan Li <lime...@loongson.cn>
Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
Gerrit-Reviewer: abner chenc <chen...@loongson.cn>
Gerrit-Reviewer: sophie zhao <zhaox...@loongson.cn>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages