mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
This CL amends HasAVX512 flag with GFNI check. This is needed because our SIMD API supports Galois Field operations. Change-Id: I3e957b7b2215d2b7b6b8a7a0ca3e2e60d453b2e5 Reviewed-on: https://go-review.googlesource.com/c/go/+/685295 Reviewed-by: David Chase <drchase@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
22 lines
660 B
Go
22 lines
660 B
Go
// Copyright 2025 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
//go:build goexperiment.simd
|
|
|
|
// The build condition == if the experiment is not on, cmd/api TestCheck will see this and complain
|
|
// see also go/doc/comment, where "simd" is inserted to the package list of the experiment is not on.
|
|
|
|
package simd
|
|
|
|
import "internal/cpu"
|
|
|
|
// HasAVX512GFNI checks AVX512 CPU feature F+CD+BW+DQ+VL+GFNI.
|
|
func HasAVX512GFNI() bool {
|
|
return cpu.X86.HasAVX512GFNI
|
|
}
|
|
|
|
// HasAVX512 checks AVX512 CPU feature F+CD+BW+DQ+VL.
|
|
func HasAVX512() bool {
|
|
return cpu.X86.HasAVX512
|
|
}
|