Sha256: fe531fbdba6442864ab16d2728175d4cd5a9ee1ab334c5ad66c117fd08ae8e0f

Contents?: true

Size: 1.13 KB

Versions: 16

Compression:

Stored size: 1.13 KB

Contents

package xxh3

import (
	"unsafe"

	"github.com/klauspost/cpuid/v2"
)

var (
	hasAVX2   = cpuid.CPU.Has(cpuid.AVX2)
	hasSSE2   = cpuid.CPU.Has(cpuid.SSE2) // Always true on amd64
	hasAVX512 = cpuid.CPU.Has(cpuid.AVX512F)
)

//go:noescape
func accumAVX2(acc *[8]u64, data, key unsafe.Pointer, len u64)

//go:noescape
func accumAVX512(acc *[8]u64, data, key unsafe.Pointer, len u64)

//go:noescape
func accumSSE(acc *[8]u64, data, key unsafe.Pointer, len u64)

//go:noescape
func accumBlockAVX2(acc *[8]u64, data, key unsafe.Pointer)

//go:noescape
func accumBlockSSE(acc *[8]u64, data, key unsafe.Pointer)

func withOverrides(avx512, avx2, sse2 bool, cb func()) {
	avx512Orig, avx2Orig, sse2Orig := hasAVX512, hasAVX2, hasSSE2
	hasAVX512, hasAVX2, hasSSE2 = avx512, avx2, sse2
	defer func() { hasAVX512, hasAVX2, hasSSE2 = avx512Orig, avx2Orig, sse2Orig }()
	cb()
}

func withAVX512(cb func())  { withOverrides(hasAVX512, false, false, cb) }
func withAVX2(cb func())    { withOverrides(false, hasAVX2, false, cb) }
func withSSE2(cb func())    { withOverrides(false, false, hasSSE2, cb) }
func withGeneric(cb func()) { withOverrides(false, false, false, cb) }

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
ruby_snowflake_client-1.3.7 ext/vendor/github.com/zeebo/xxh3/accum_stubs_amd64.go
ruby_snowflake_client-1.3.6 ext/vendor/github.com/zeebo/xxh3/accum_stubs_amd64.go
ruby_snowflake_client-1.3.5 ext/vendor/github.com/zeebo/xxh3/accum_stubs_amd64.go
ruby_snowflake_client-1.3.4 ext/vendor/github.com/zeebo/xxh3/accum_stubs_amd64.go
ruby_snowflake_client-1.3.4.pre.debug ext/vendor/github.com/zeebo/xxh3/accum_stubs_amd64.go
ruby_snowflake_client-1.3.3.pre.debug ext/vendor/github.com/zeebo/xxh3/accum_stubs_amd64.go
ruby_snowflake_client-1.3.2 ext/vendor/github.com/zeebo/xxh3/accum_stubs_amd64.go
ruby_snowflake_client-1.3.1 ext/vendor/github.com/zeebo/xxh3/accum_stubs_amd64.go
ruby_snowflake_client-1.3.0 ext/vendor/github.com/zeebo/xxh3/accum_stubs_amd64.go
ruby_snowflake_client-1.2.1 ext/vendor/github.com/zeebo/xxh3/accum_stubs_amd64.go
ruby_snowflake_client-1.2.0 ext/vendor/github.com/zeebo/xxh3/accum_stubs_amd64.go
ruby_snowflake_client-1.1.1 ext/vendor/github.com/zeebo/xxh3/accum_stubs_amd64.go
ruby_snowflake_client-1.1.0 ext/vendor/github.com/zeebo/xxh3/accum_stubs_amd64.go
ruby_snowflake_client-1.0.2 ext/vendor/github.com/zeebo/xxh3/accum_stubs_amd64.go
ruby_snowflake_client-1.0.1 ext/vendor/github.com/zeebo/xxh3/accum_stubs_amd64.go
ruby_snowflake_client-1.0.0 ext/vendor/github.com/zeebo/xxh3/accum_stubs_amd64.go