1
0
mirror of https://github.com/golang/go synced 2024-11-19 11:44:45 -07:00

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 <minux@golang.org>
This commit is contained in:
Lynn Boger 2016-02-16 16:05:56 -06:00 committed by Minux Ma
parent eb6ee75add
commit 8b51ee8315

View 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.