From 8b51ee831518584ebe063ac972b3b2ab28637853 Mon Sep 17 00:00:00 2001 From: Lynn Boger Date: Tue, 16 Feb 2016 16:05:56 -0600 Subject: [PATCH] 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 --- src/crypto/cipher/xor.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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. -- 2.48.1