crypto/sha256: add assembly implementation for ppc64 #50785
Labels
arch-ppc64x
FeatureRequest
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Performance
Milestone
What version of Go are you using (
go version
)?Please note: Our "build machine" is Linux, from which we compile for Linux (linux/amd64) and cross-compile for our other platforms (windows/amd64, aix/ppc64, linux/ppc64le).
Does this issue reproduce with the latest release?
Yes, for all versions of Go used to compile programs for aix/ppc64.
What operating system and processor architecture are you using (
go env
)?Please note: Our "build machine" is Linux, from which we compile for Linux (linux/amd64) and cross-compile for our other platforms (windows/amd64, aix/ppc64, linux/ppc64le).
go env
OutputWhat did you do?
NOTE: This issue is related to issue #50784
Tagging @Helflym (Clement) for this issue as well.
Our company implements a cross-platform application (linux/amd64, windows/amd64, aix/ppc, linux/ppc64le) that makes extensive use of sha256 hashing. As a part of our development/test cycle, we CPU profile our application in different scenarios (using pprof). When doing so on AIX, we discovered that the sha256 hashing implementation was implemented in "generic" Go and not pseudo-assembler (as with ppc64le).
To work around these limitations, we've worked on customizing the Golang language by porting over the ppc64le implementation of sha256 hashing into a new
src/crypto/sha256/sha256block_ppc64.s
ppc64 file, then adding "ppc64" to the "build" annotation forsrc/crypto/sha256/sha256block_decl.go
and "!ppc64" forsrc/crypto/sha256/sha256block_generic.go
.The purpose of this issue is to see whether we could get these changes added to Golang so that this customization is no longer needed for us or others making extensive use of sha256 hashing (especially with small block sizes) with Golang on aix/ppc64.
What did you expect to see?
Similar performance for sha256 hashing as with other platforms.
What did you see instead?
Performance was significantly worse on aix/ppc64 since this platform uses ("generic") Golang implementations and not optimized assembler functions.
The text was updated successfully, but these errors were encountered: