mirror of
https://github.com/pgsty/minio.git
synced 2026-09-15 23:14:04 +03:00
Build fix for go1.11rc1 (#6354)
Vendorized the following packages - "github.com/rjeczalik/notify" - "github.com/minio/highwayhash" Fixes #6315
This commit is contained in:
committed by
Nitish Tiwari
parent
52f6d5aafc
commit
01721a840a
+16
-17
@@ -7,18 +7,14 @@
|
||||
|
||||
package highwayhash
|
||||
|
||||
import "golang.org/x/sys/cpu"
|
||||
|
||||
var (
|
||||
useSSE4 = supportsSSE4()
|
||||
useAVX2 = supportsAVX2()
|
||||
useSSE4 = cpu.X86.HasSSE41
|
||||
useAVX2 = cpu.X86.HasAVX2
|
||||
useNEON = false
|
||||
)
|
||||
|
||||
//go:noescape
|
||||
func supportsSSE4() bool
|
||||
|
||||
//go:noescape
|
||||
func supportsAVX2() bool
|
||||
|
||||
//go:noescape
|
||||
func initializeSSE4(state *[16]uint64, key []byte)
|
||||
|
||||
@@ -38,31 +34,34 @@ func finalizeSSE4(out []byte, state *[16]uint64)
|
||||
func finalizeAVX2(out []byte, state *[16]uint64)
|
||||
|
||||
func initialize(state *[16]uint64, key []byte) {
|
||||
if useAVX2 {
|
||||
switch {
|
||||
case useAVX2:
|
||||
initializeAVX2(state, key)
|
||||
} else if useSSE4 {
|
||||
case useSSE4:
|
||||
initializeSSE4(state, key)
|
||||
} else {
|
||||
default:
|
||||
initializeGeneric(state, key)
|
||||
}
|
||||
}
|
||||
|
||||
func update(state *[16]uint64, msg []byte) {
|
||||
if useAVX2 {
|
||||
switch {
|
||||
case useAVX2:
|
||||
updateAVX2(state, msg)
|
||||
} else if useSSE4 {
|
||||
case useSSE4:
|
||||
updateSSE4(state, msg)
|
||||
} else {
|
||||
default:
|
||||
updateGeneric(state, msg)
|
||||
}
|
||||
}
|
||||
|
||||
func finalize(out []byte, state *[16]uint64) {
|
||||
if useAVX2 {
|
||||
switch {
|
||||
case useAVX2:
|
||||
finalizeAVX2(out, state)
|
||||
} else if useSSE4 {
|
||||
case useSSE4:
|
||||
finalizeSSE4(out, state)
|
||||
} else {
|
||||
default:
|
||||
finalizeGeneric(out, state)
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -248,8 +248,3 @@ hash64:
|
||||
MOVQ DX, 0(BX)
|
||||
RET
|
||||
|
||||
// func supportsAVX2() bool
|
||||
TEXT ·supportsAVX2(SB), 4, $0-1
|
||||
MOVQ runtime·support_avx2(SB), AX
|
||||
MOVB AX, ret+0(FP)
|
||||
RET
|
||||
|
||||
+3
-4
@@ -7,15 +7,14 @@
|
||||
|
||||
package highwayhash
|
||||
|
||||
import "golang.org/x/sys/cpu"
|
||||
|
||||
var (
|
||||
useSSE4 = supportsSSE4()
|
||||
useSSE4 = cpu.X86.HasSSE41
|
||||
useAVX2 = false
|
||||
useNEON = false
|
||||
)
|
||||
|
||||
//go:noescape
|
||||
func supportsSSE4() bool
|
||||
|
||||
//go:noescape
|
||||
func initializeSSE4(state *[16]uint64, key []byte)
|
||||
|
||||
|
||||
-9
@@ -292,12 +292,3 @@ hash64:
|
||||
MOVQ m10, DX
|
||||
MOVQ DX, 0(BX)
|
||||
RET
|
||||
|
||||
// func supportsSSE4() bool
|
||||
TEXT ·supportsSSE4(SB), 4, $0-1
|
||||
MOVL $1, AX
|
||||
CPUID
|
||||
SHRL $19, CX // Bit 19 indicates SSE4 support
|
||||
ANDL $1, CX // CX != 0 if support SSE4
|
||||
MOVB CX, ret+0(FP)
|
||||
RET
|
||||
|
||||
Reference in New Issue
Block a user