From: Lynn Boger Date: Tue, 16 Feb 2016 22:05:56 +0000 (-0600) Subject: crypto/cipher: xorBytes performance ppc64le/ppc64 X-Git-Tag: go1.7beta1~1541 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=8b51ee831518584ebe063ac972b3b2ab28637853;p=gostls13.git crypto/cipher: xorBytes performance ppc64le/ppc64 Update supportsUnaligned in xor.go to be true for GOARCH values ppc64le and ppc64. This allows the xor of long buffers to be done on double words (8 bytes) instead of a single byte at a time, which significantly improves performance. Fixes #14350 Change-Id: Iccc6b9d3df2e604a55f4c1e4890bdd3bb0d77ab0 Reviewed-on: https://go-review.googlesource.com/19519 Reviewed-by: Minux Ma --- diff --git a/src/crypto/cipher/xor.go b/src/crypto/cipher/xor.go index f88dc8914a..020c9e1730 100644 --- a/src/crypto/cipher/xor.go +++ b/src/crypto/cipher/xor.go @@ -10,7 +10,7 @@ import ( ) const wordSize = int(unsafe.Sizeof(uintptr(0))) -const supportsUnaligned = runtime.GOARCH == "386" || runtime.GOARCH == "amd64" +const supportsUnaligned = runtime.GOARCH == "386" || runtime.GOARCH == "amd64" || runtime.GOARCH == "ppc64" || runtime.GOARCH == "ppc64le" // fastXORBytes xors in bulk. It only works on architectures that // support unaligned read/writes.