-
Notifications
You must be signed in to change notification settings - Fork 35
/
gmu_amd64.go
33 lines (27 loc) · 769 Bytes
/
gmu_amd64.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright (c) 2017 Temple3x ([email protected])
//
// Use of this source code is governed by the MIT License
// that can be found in the LICENSE file.
package reedsolomon
func (g *gmu) initFunc(feat int) {
switch feat {
case featAVX2:
g.mulVect = mulVectAVX2C
g.mulVectXOR = mulVectXORAVX2C
default:
g.mulVect = mulVectNoSIMD
g.mulVectXOR = mulVectXORNoSIMD
}
}
func mulVectAVX2C(c byte, input, output []byte) {
tbl := lowHighTbl[int(c)*32 : int(c)*32+32]
mulVectAVX2(tbl, input, output)
}
func mulVectXORAVX2C(c byte, input, output []byte) {
tbl := lowHighTbl[int(c)*32 : int(c)*32+32]
mulVectXORAVX2(tbl, input, output)
}
//go:noescape
func mulVectAVX2(tbl, input, output []byte)
//go:noescape
func mulVectXORAVX2(tbl, input, output []byte)