blake2b: Revert "blake2b: use internal/cpu to determine AVX and SSE 4 support"
This reverts commit because of golang/go#24828.
Run-TryBot: Tobias Klauser
package blake2b
-import _ "unsafe"
-
-//go:linkname x86_HasAVX internal/cpu.X86.HasAVX
-var x86_HasAVX bool
+func init() {
+ useAVX2 = supportsAVX2()
+ useAVX = supportsAVX()
+ useSSE4 = supportsSSE4()
+}
-//go:linkname x86_HasAVX2 internal/cpu.X86.HasAVX2
-var x86_HasAVX2 bool
+//go:noescape
+func supportsSSE4() bool
-//go:linkname x86_HasAVX internal/cpu.X86.HasSSE4
-var x86_HasSSE4 bool
+//go:noescape
+func supportsAVX() bool
-func init() {
- useAVX2 = x86_HasAVX2
- useAVX = x86_HasAVX
- useSSE4 = x86_HasSSE4
-}
+//go:noescape
+func supportsAVX2() bool
//go:noescape
func hashBlocksAVX2(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte)
