aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile
diff options
context:
space:
mode:
authorCherry Mui <cherryyz@google.com>2025-10-24 15:06:41 -0400
committerCherry Mui <cherryyz@google.com>2025-10-26 08:38:45 -0700
commit53ad68de4b124fc441d859c9b123a8aedf626aec (patch)
treeff60f4a89bcc3de1ac2793193e43ab1ad0f82542 /src/cmd/compile
parent12ec09f434dca930b7dbd76c6edbcd9b4457f2f0 (diff)
downloadgo-53ad68de4b124fc441d859c9b123a8aedf626aec.tar.xz
cmd/compile: allow unaligned load/store on Wasm
Wasm supports unaligned load/store instructions. Use them. This speeds up map hashing slightly (among others): goos: js goarch: wasm pkg: runtime │ old.txt │ new.txt │ │ sec/op │ sec/op vs base │ Hash5 14.06n ± 2% 13.83n ± 5% ~ (p=0.186 n=10) Hash16 17.52n ± 1% 17.04n ± 1% -2.71% (p=0.000 n=10) Hash64 28.68n ± 1% 26.61n ± 1% -7.18% (p=0.000 n=10) Hash1024 271.4n ± 0% 243.6n ± 1% -10.21% (p=0.000 n=10) Hash65536 16.66µ ± 0% 15.74µ ± 1% -5.49% (p=0.000 n=10) HashStringSpeed 29.23n ± 1% 28.70n ± 1% -1.83% (p=0.000 n=10) HashBytesSpeed 46.11n ± 4% 45.17n ± 5% -2.04% (p=0.008 n=10) HashInt32Speed 20.39n ± 1% 20.24n ± 5% ~ (p=0.239 n=10) HashInt64Speed 20.81n ± 7% 20.58n ± 7% ~ (p=0.238 n=10) HashStringArraySpeed 76.65n ± 2% 73.72n ± 1% -3.83% (p=0.000 n=10) FastrandHashiter 87.65n ± 1% 87.58n ± 1% ~ (p=0.725 n=10) geomean 67.03n 64.75n -3.40% Change-Id: I7fd1817c74323f628f310393b0330a0a51ffa3a7 Reviewed-on: https://go-review.googlesource.com/c/go/+/714720 Reviewed-by: Michael Knyszek <mknyszek@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/cmd/compile')
-rw-r--r--src/cmd/compile/internal/ssa/config.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/ssa/config.go b/src/cmd/compile/internal/ssa/config.go
index 0f41bdea8b..7cc16ce26d 100644
--- a/src/cmd/compile/internal/ssa/config.go
+++ b/src/cmd/compile/internal/ssa/config.go
@@ -356,6 +356,7 @@ func NewConfig(arch string, types Types, ctxt *obj.Link, optimize, softfloat boo
c.hasGReg = true
c.useAvg = false
c.useHmul = false
+ c.unalignedOK = true
default:
ctxt.Diag("arch %s not implemented", arch)
}