From c197bcf24cde29d3f73c7b4ac6fd41f4384e8af6 Mon Sep 17 00:00:00 2001 From: Lynn Boger Date: Thu, 17 Mar 2016 15:08:20 -0500 Subject: [PATCH] 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 --- sha3/xor.go | 2 +- sha3/xor_unaligned.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sha3/xor.go b/sha3/xor.go index d622979..30711f1 100644 --- a/sha3/xor.go +++ b/sha3/xor.go @@ -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 diff --git a/sha3/xor_unaligned.go b/sha3/xor_unaligned.go index c7851a1..ca07a72 100644 --- a/sha3/xor_unaligned.go +++ b/sha3/xor_unaligned.go @@ -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