]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/cipher: xorBytes performance ppc64le/ppc64
authorLynn Boger <laboger@linux.vnet.ibm.com>
Tue, 16 Feb 2016 22:05:56 +0000 (16:05 -0600)
committerMinux Ma <minux@golang.org>
Sat, 5 Mar 2016 01:51:33 +0000 (01:51 +0000)
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 <minux@golang.org>
src/crypto/cipher/xor.go

index f88dc8914ac8c98fa8691947ee4721326930e292..020c9e1730e9bb8cc5767d3eafafa8143c8b76eb 100644 (file)
@@ -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.