Provide an optimised assembly implementation of MD5 for RISC-V.
There are significant performance improvements. The assembler takes
advantage of Zbb instructions when they are available.
Results for the VisionFive 2 running Ubuntu 24.04 with
GORISCV64=rva20u64.
goos: linux
goarch: riscv64
pkg: crypto/md5
│ md5_go.txt │ md5_ass.txt │
│ sec/op │ sec/op vs base │
Hash8Bytes 1.202µ ± 0% 1.220µ ± 0% +1.50% (p=0.000 n=10)
Hash64 1.665µ ± 0% 1.518µ ± 0% -8.83% (p=0.000 n=10)
Hash128 2.165µ ± 0% 1.885µ ± 0% -12.94% (p=0.000 n=10)
Hash256 3.162µ ± 0% 2.613µ ± 0% -17.38% (p=0.000 n=10)
Hash512 5.146µ ± 0% 4.063µ ± 0% -21.05% (p=0.000 n=10)
Hash1K 9.115µ ± 0% 6.959µ ± 0% -23.65% (p=0.000 n=10)
Hash8K 64.68µ ± 0% 47.52µ ± 0% -26.54% (p=0.000 n=10)
Hash1M 8.131m ± 0% 5.936m ± 0% -27.00% (p=0.000 n=10)
Hash8M 65.06m ± 0% 47.50m ± 0% -26.99% (p=0.000 n=10)
Hash8BytesUnaligned 1.210µ ± 0% 1.199µ ± 0% -0.91% (p=0.000 n=10)
Hash1KUnaligned 9.114µ ± 0% 8.266µ ± 0% -9.30% (p=0.000 n=10)
Hash8KUnaligned 64.68µ ± 0% 57.97µ ± 0% -10.38% (p=0.000 n=10)
geomean 22.37µ 18.83µ -15.82%
Results for the VisionFive 2 running Ubuntu 24.04 with
GORISCV64=rva22u64.
goos: linux
goarch: riscv64
pkg: crypto/md5
│ md5_g22.txt │ md5_a22.txt │
│ sec/op │ sec/op vs base │
Hash8Bytes 1.175µ ± 0% 1.002µ ± 0% -14.72% (p=0.000 n=10)
Hash64 1.575µ ± 0% 1.274µ ± 0% -19.11% (p=0.000 n=10)
Hash128 2.033µ ± 0% 1.587µ ± 0% -21.92% (p=0.000 n=10)
Hash256 2.943µ ± 0% 2.209µ ± 0% -24.93% (p=0.000 n=10)
Hash512 4.755µ ± 0% 3.443µ ± 0% -27.58% (p=0.000 n=10)
Hash1K 8.378µ ± 0% 5.910µ ± 0% -29.46% (p=0.000 n=10)
Hash8K 59.12µ ± 0% 40.45µ ± 0% -31.58% (p=0.000 n=10)
Hash1M 7.426m ± 0% 5.056m ± 0% -31.92% (p=0.000 n=10)
Hash8M 59.41m ± 0% 40.45m ± 0% -31.91% (p=0.000 n=10)
Hash8BytesUnaligned 1.169µ ± 0% 1.012µ ± 0% -13.43% (p=0.000 n=10)
Hash1KUnaligned 8.379µ ± 0% 7.213µ ± 0% -13.91% (p=0.000 n=10)
Hash8KUnaligned 59.12µ ± 0% 50.90µ ± 0% -13.91% (p=0.000 n=10)
geomean 20.83µ 15.99µ -23.21%
Change-Id: I61e3fa802c2cc50e0b5f71f151b4741691ccb481
Reviewed-on: https://go-review.googlesource.com/c/go/+/527936
Reviewed-by: Joel Sing <joel@sing.id.au>
Auto-Submit: Tim King <taking@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Meng Zhuo <mengzhuo1203@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Tim King <taking@google.com>
|
||
|---|---|---|
| .github | ||
| api | ||
| doc | ||
| lib | ||
| misc | ||
| src | ||
| test | ||
| .gitattributes | ||
| .gitignore | ||
| CONTRIBUTING.md | ||
| LICENSE | ||
| PATENTS | ||
| README.md | ||
| SECURITY.md | ||
| codereview.cfg | ||
| go.env | ||
README.md
The Go Programming Language
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
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.