The Go programming language https://go.dev
  • Go 95.2%
  • Assembly 4.5%
  • C 0.1%
Find a file
XiaolinZhao 49178db21a crypto/sha1: shorten MIX dependency chain on loong64
MIX(a, b, c, d, e, key) previously computed
e = e + f + w[i] + k + ROTL(a,5) as four ADD instructions chained
serially through e, even though f, w[i], k, and ROTL(a,5) are
mutually independent and only need to be combined into e at the end.

On the 3C6000, the performance of sha1‑related operations is
improved by 2.81%.

goos: linux
goarch: loong64
pkg: crypto/sha1
cpu: Loongson-3C6000/S @ 2200.00MHz
                 |  bench.old  |             bench.new              |
                 |   sec/op    |   sec/op     vs base               |
Hash8Bytes/New     203.3n ± 0%   199.6n ± 0%  -1.82% (p=0.000 n=10)
Hash8Bytes/Sum     202.1n ± 0%   195.4n ± 0%  -3.34% (p=0.000 n=10)
Hash320Bytes/New   965.8n ± 0%   934.7n ± 0%  -3.23% (p=0.000 n=10)
Hash320Bytes/Sum   963.1n ± 0%   934.6n ± 0%  -2.96% (p=0.000 n=10)
Hash1K/New         2.642µ ± 0%   2.566µ ± 0%  -2.88% (p=0.000 n=10)
Hash1K/Sum         2.640µ ± 0%   2.564µ ± 0%  -2.88% (p=0.000 n=10)
Hash8K/New         19.64µ ± 0%   19.14µ ± 0%  -2.54% (p=0.000 n=10)
Hash8K/Sum         19.70µ ± 0%   19.15µ ± 0%  -2.82% (p=0.000 n=10)
geomean            1.785µ        1.735µ       -2.81%

                 |  bench.old   |              bench.new              |
                 |     B/s      |     B/s       vs base               |
Hash8Bytes/New     37.54Mi ± 0%   38.21Mi ± 0%  +1.80% (p=0.000 n=10)
Hash8Bytes/Sum     37.74Mi ± 0%   39.05Mi ± 0%  +3.49% (p=0.000 n=10)
Hash320Bytes/New   316.0Mi ± 0%   326.5Mi ± 0%  +3.33% (p=0.000 n=10)
Hash320Bytes/Sum   316.9Mi ± 0%   326.5Mi ± 0%  +3.05% (p=0.000 n=10)
Hash1K/New         369.7Mi ± 0%   380.6Mi ± 0%  +2.95% (p=0.000 n=10)
Hash1K/Sum         369.9Mi ± 0%   380.9Mi ± 0%  +2.98% (p=0.000 n=10)
Hash8K/New         397.9Mi ± 0%   408.2Mi ± 0%  +2.60% (p=0.000 n=10)
Hash8K/Sum         396.5Mi ± 0%   408.0Mi ± 0%  +2.91% (p=0.000 n=10)
geomean            204.5Mi        210.4Mi       +2.89%

This CL also adds comments to the macro definitions and a short
overview above them documenting these implicit inputs/outputs, so
that future changes to these macros don't inadvertently break the
cross-macro data flow.

Change-Id: I0cc8bb35d3cfd9c59f8bd73d891e731e7de23ca8
Reviewed-on: https://go-review.googlesource.com/c/go/+/818380
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2026-08-24 17:53:01 -07:00
.github .github: update PULL_REQUEST_TEMPLATE to match the latest instruction 2026-05-26 15:10:06 -07:00
api flag: add All iterators and Flag.IsSet 2026-08-24 07:17:30 -07:00
doc flag: add All iterators and Flag.IsSet 2026-08-24 07:17:30 -07:00
lib lib/time: update to 2026c/2026c 2026-07-09 11:24:04 -07:00
misc all: replace strings.Split with strings.SplitSeq 2025-09-15 17:34:45 -07:00
src crypto/sha1: shorten MIX dependency chain on loong64 2026-08-24 17:53:01 -07:00
test cmd/compile/internal/ssagen: mark (*state).temp's temporary addrtaken 2026-08-24 12:48:52 -07:00
.gitattributes all: treat all files as binary, but check in .bat with CRLF 2020-06-08 15:31:43 +00:00
.gitignore .gitignore: ignore go test artifacts 2025-11-10 12:41:03 -08:00
codereview.cfg codereview.cfg: add codereview.cfg for master branch 2021-02-19 18:44:53 +00:00
CONTRIBUTING.md doc: normalize proposal-process links 2023-03-29 22:00:27 +00:00
go.env cmd/go: additional doc-inspired tests and bug fixes 2023-06-06 19:18:46 +00:00
LICENSE LICENSE: update per Google Legal 2024-08-09 14:54:31 +00:00
PATENTS LICENSE: separate, change PATENTS text 2010-12-06 16:31:59 -05:00
README.md README: fix CC BY license name 2024-07-22 17:45:27 +00:00
SECURITY.md SECURITY.md: update the Reporting a Vulnerability link 2023-09-22 21:17:24 +00:00

The Go Programming Language

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.

Gopher image Gopher image by Renee French, licensed under Creative Commons 4.0 Attribution license.

Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.

Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.

Download and Install

Binary Distributions

Official binary distributions are available at https://go.dev/dl/.

After downloading a binary release, visit https://go.dev/doc/install for installation instructions.

Install From Source

If a binary distribution is not available for your combination of operating system and architecture, visit https://go.dev/doc/install/source for source installation instructions.

Contributing

Go is the work of thousands of contributors. We appreciate your help!

To contribute, please read the contribution guidelines at https://go.dev/doc/contribute.

Note that the Go project uses the issue tracker for bug reports and proposals only. See https://go.dev/wiki/Questions for a list of places to ask questions about the Go language.