Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

math/big: ppc64 has no assembly implementation of arith.go functions #16621

Closed
izzystardust opened this issue Aug 5, 2016 · 2 comments
Closed

Comments

@izzystardust
Copy link
Contributor

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?
    go version devel +b882707 Thu Jul 21 15:33:00 2016 -0500 linux/ppc64le
  2. What operating system and processor architecture are you using (go env)?
    linux/ppc64le
  3. What did you do?
    I noticed that performance of crypto/ecdsa on POWER was significantly slower than on Intel, due in large part to time spent in functions in arith.go
  4. What did you expect to see?
    Similar performance profile to Intel.

I have a change that optimizes hotspots in ppc64 assembly.

@bradfitz bradfitz changed the title ppc64 has no assembly implementation of arith.go functions math/big: ppc64 has no assembly implementation of arith.go functions Aug 5, 2016
@bradfitz bradfitz added this to the Go1.8Maybe milestone Aug 5, 2016
@bradfitz
Copy link
Contributor

bradfitz commented Aug 5, 2016

/cc @laboger

@gopherbot
Copy link

CL https://golang.org/cl/26951 mentions this issue.

ceseo pushed a commit to powertechpreview/go that referenced this issue Dec 1, 2016
The existing implementation used a pure go implementation, leading to slow
cryptographic performance.

Implemented mulWW, subVV, mulAddVWW, addMulVVW, and bitLen for
ppc64{le}.
Implemented divWW for ppc64le only, as the DIVDEU instruction is only
available on Power8 or newer.

benchcmp output:

benchmark                         old ns/op     new ns/op     delta
BenchmarkSignP384                 28934360      10877330      -62.41%
BenchmarkRSA2048Decrypt           41261033      5139930       -87.54%
BenchmarkRSA2048Sign              45231300      7610985       -83.17%
Benchmark3PrimeRSA2048Decrypt     20487300      2481408       -87.89%

Fixes golang#16621

Change-Id: If8b68963bb49909bde832f2bda08a3791c4f5b7a
Reviewed-on: https://go-review.googlesource.com/26951
Run-TryBot: Michael Munday <munday@ca.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Munday <munday@ca.ibm.com>
ceseo pushed a commit to powertechpreview/go that referenced this issue Dec 1, 2016
The existing implementation used a pure go implementation, leading to slow
cryptographic performance.

Implemented mulWW, subVV, mulAddVWW, addMulVVW, and bitLen for
ppc64{le}.
Implemented divWW for ppc64le only, as the DIVDEU instruction is only
available on Power8 or newer.

benchcmp output:

benchmark                         old ns/op     new ns/op     delta
BenchmarkSignP384                 28934360      10877330      -62.41%
BenchmarkRSA2048Decrypt           41261033      5139930       -87.54%
BenchmarkRSA2048Sign              45231300      7610985       -83.17%
Benchmark3PrimeRSA2048Decrypt     20487300      2481408       -87.89%

Fixes golang#16621

Change-Id: If8b68963bb49909bde832f2bda08a3791c4f5b7a
Reviewed-on: https://go-review.googlesource.com/26951
Run-TryBot: Michael Munday <munday@ca.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Munday <munday@ca.ibm.com>
@golang golang locked and limited conversation to collaborators Aug 29, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants