golang/x/crypto/sha3: use better alignment

Change the build tags for xor.go and xor_unaligned.go
to perform better on ppc64/ppc64le.

This improves performance for these sha3 benchmarks:

benchmark                        old MB/s     new MB/s     speedup
BenchmarkSha3_512_MTU            68.42        76.03        1.11x
BenchmarkSha3_384_MTU            91.12        105.38       1.16x
BenchmarkSha3_256_MTU            110.19       132.63       1.20x
BenchmarkSha3_224_MTU            114.46       139.12       1.22x
BenchmarkShake128_MTU            129.77       163.14       1.26x
BenchmarkShake256_MTU            125.01       151.93       1.22x
BenchmarkShake256_16x            110.60       129.44       1.17x
BenchmarkShake256_1MiB           128.51       154.23       1.20x
BenchmarkSha3_512_1MiB           74.18        82.39        1.11x

Fixes golang/go#14847

Change-Id: I59ba763b4eaf3e567399b132ad820fb2dcbbf129
Reviewed-on: https://go-review.googlesource.com/20821
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Lynn Boger
2016-03-17 20:21:02 +00:00
committed by Brad Fitzpatrick
parent 6025851c7c
commit c197bcf24c
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build !amd64,!386 appengine
// +build !amd64,!386,!ppc64,!ppc64le appengine
package sha3
+1 -1
View File
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build amd64 386
// +build amd64 386 ppc64 ppc64le
// +build !appengine
package sha3