Updated version of klauspost/reedsolomon with NEON support for ARM (#4865)

This commit is contained in:
Frank Wessels
2017-08-30 09:49:00 -07:00
committed by Dee Koder
parent 6dca044ea8
commit 93f126364e
10 changed files with 1143 additions and 15 deletions

View File

@@ -10,10 +10,10 @@ import (
type Option func(*options)
type options struct {
maxGoroutines int
minSplitSize int
useAVX2, useSSSE3 bool
usePAR1Matrix bool
maxGoroutines int
minSplitSize int
useAVX2, useSSSE3, useSSE2 bool
usePAR1Matrix bool
}
var defaultOptions = options{
@@ -28,6 +28,7 @@ func init() {
// Detect CPU capabilities.
defaultOptions.useSSSE3 = cpuid.CPU.SSSE3()
defaultOptions.useAVX2 = cpuid.CPU.AVX2()
defaultOptions.useSSE2 = cpuid.CPU.SSE2()
}
// WithMaxGoroutines is the maximum number of goroutines number for encoding & decoding.
@@ -67,6 +68,12 @@ func withAVX2(enabled bool) Option {
}
}
func withSSE2(enabled bool) Option {
return func(o *options) {
o.useSSE2 = enabled
}
}
// WithPAR1Matrix causes the encoder to build the matrix how PARv1
// does. Note that the method they use is buggy, and may lead to cases
// where recovery is impossible, even if there are enough parity