Skip to content

Why use klauspost/cpuid rather than x/sys/cpu for avx2 and sse4 detection? #29

@coolaj86

Description

@coolaj86

I see that the github.com/klauspost/cpuid is being used for avx2 and sse4 detection here:

HasAVX2 = cpuid.CPU.Has(cpuid.AVX2) &&
os.Getenv("BLAKE3_DISABLE_AVX2") == "" &&
os.Getenv("BLAKE3_PUREGO") == ""
HasSSE41 = cpuid.CPU.Has(cpuid.SSE4) &&
os.Getenv("BLAKE3_DISABLE_SSE41") == "" &&
os.Getenv("BLAKE3_PUREGO") == ""

Is there any particular reason to not use the Go team's implementation?
https://pkg.go.dev/golang.org/x/sys/cpu

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions