gotosocial/vendor/github.com/zeebo/blake3/internal/consts/cpu.go

18 lines
289 B
Go
Raw Normal View History

2022-01-16 17:52:30 +00:00
package consts
import (
"os"
"golang.org/x/sys/cpu"
)
var (
HasAVX2 = cpu.X86.HasAVX2 &&
os.Getenv("BLAKE3_DISABLE_AVX2") == "" &&
os.Getenv("BLAKE3_PUREGO") == ""
HasSSE41 = cpu.X86.HasSSE41 &&
os.Getenv("BLAKE3_DISABLE_SSE41") == "" &&
os.Getenv("BLAKE3_PUREGO") == ""
)