mirror of
https://github.com/pgsty/minio.git
synced 2026-08-10 00:03:29 +03:00
Update reedsolomon/highwayhash to start using ppc64le support (#7003)
Thanks to @fwessels for the upstream work on reedsolomon and highwayhash which has resulted in 10x performance improvement on ppc64 architecture.
This commit is contained in:
committed by
Nitish Tiwari
parent
bc67410548
commit
def04f01cf
+67
@@ -0,0 +1,67 @@
|
||||
//+build !noasm
|
||||
//+build !appengine
|
||||
//+build !gccgo
|
||||
|
||||
// Copyright 2015, Klaus Post, see LICENSE for details.
|
||||
// Copyright 2018, Minio, Inc.
|
||||
|
||||
package reedsolomon
|
||||
|
||||
//go:noescape
|
||||
func galMulPpc(low, high, in, out []byte)
|
||||
|
||||
//go:noescape
|
||||
func galMulPpcXor(low, high, in, out []byte)
|
||||
|
||||
// This is what the assembler routines do in blocks of 16 bytes:
|
||||
/*
|
||||
func galMulPpc(low, high, in, out []byte) {
|
||||
for n, input := range in {
|
||||
l := input & 0xf
|
||||
h := input >> 4
|
||||
out[n] = low[l] ^ high[h]
|
||||
}
|
||||
}
|
||||
func galMulPpcXor(low, high, in, out []byte) {
|
||||
for n, input := range in {
|
||||
l := input & 0xf
|
||||
h := input >> 4
|
||||
out[n] ^= low[l] ^ high[h]
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
func galMulSlice(c byte, in, out []byte, ssse3, avx2 bool) {
|
||||
done := (len(in) >> 4) << 4
|
||||
if done > 0 {
|
||||
galMulPpc(mulTableLow[c][:], mulTableHigh[c][:], in[:done], out)
|
||||
}
|
||||
remain := len(in) - done
|
||||
if remain > 0 {
|
||||
mt := mulTable[c]
|
||||
for i := done; i < len(in); i++ {
|
||||
out[i] = mt[in[i]]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func galMulSliceXor(c byte, in, out []byte, ssse3, avx2 bool) {
|
||||
done := (len(in) >> 4) << 4
|
||||
if done > 0 {
|
||||
galMulPpcXor(mulTableLow[c][:], mulTableHigh[c][:], in[:done], out)
|
||||
}
|
||||
remain := len(in) - done
|
||||
if remain > 0 {
|
||||
mt := mulTable[c]
|
||||
for i := done; i < len(in); i++ {
|
||||
out[i] ^= mt[in[i]]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// slice galois add
|
||||
func sliceXor(in, out []byte, sse2 bool) {
|
||||
for n, input := range in {
|
||||
out[n] ^= input
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user