Source File
cpu.go
Belonging Package
internal/cpu
package cpu
var DebugOptions bool
type CacheLinePad struct{ _ [CacheLinePadSize]byte }
var ARM struct {
_ CacheLinePad
HasVFPv4 bool
HasIDIVA bool
_ CacheLinePad
}
var ARM64 struct {
_ CacheLinePad
HasAES bool
HasPMULL bool
HasSHA1 bool
HasSHA2 bool
HasCRC32 bool
HasATOMICS bool
HasCPUID bool
IsNeoverseN1 bool
IsZeus bool
_ CacheLinePad
}
var MIPS64X struct {
_ CacheLinePad
HasMSA bool // MIPS SIMD architecture
_ CacheLinePad
}
var PPC64 struct {
_ CacheLinePad
HasDARN bool // Hardware random number generator (requires kernel enablement)
HasSCV bool // Syscall vectored (requires kernel enablement)
IsPOWER8 bool // ISA v2.07 (POWER8)
IsPOWER9 bool // ISA v3.00 (POWER9)
_ CacheLinePad
}
var S390X struct {
_ CacheLinePad
HasZARCH bool // z architecture mode is active [mandatory]
HasSTFLE bool // store facility list extended [mandatory]
HasLDISP bool // long (20-bit) displacements [mandatory]
HasEIMM bool // 32-bit immediates [mandatory]
HasDFP bool // decimal floating point
HasETF3EH bool // ETF-3 enhanced
HasMSA bool // message security assist (CPACF)
HasAES bool // KM-AES{128,192,256} functions
HasAESCBC bool // KMC-AES{128,192,256} functions
HasAESCTR bool // KMCTR-AES{128,192,256} functions
HasAESGCM bool // KMA-GCM-AES{128,192,256} functions
HasGHASH bool // KIMD-GHASH function
HasSHA1 bool // K{I,L}MD-SHA-1 functions
HasSHA256 bool // K{I,L}MD-SHA-256 functions
HasSHA512 bool // K{I,L}MD-SHA-512 functions
HasSHA3 bool // K{I,L}MD-SHA3-{224,256,384,512} and K{I,L}MD-SHAKE-{128,256} functions
HasVX bool // vector facility. Note: the runtime sets this when it processes auxv records.
HasVXE bool // vector-enhancements facility 1
HasKDSA bool // elliptic curve functions
HasECDSA bool // NIST curves
HasEDDSA bool // Edwards curves
_ CacheLinePad
}
func ( string) {
doinit()
processOptions()
}
func ( string) {
:
for != "" {
:= ""
:= indexByte(, ',')
if < 0 {
, = , ""
} else {
, = [:], [+1:]
}
if len() < 4 || [:4] != "cpu." {
continue
}
= indexByte(, '=')
if < 0 {
print("GODEBUG: no value specified for \"", , "\"\n")
continue
}
, := [4:], [+1:] // e.g. "SSE2", "on"
var bool
switch {
case "on":
= true
case "off":
= false
default:
print("GODEBUG: value \"", , "\" not supported for cpu option \"", , "\"\n")
continue
}
if == "all" {
for := range options {
options[].Specified = true
options[].Enable = || options[].Required
}
continue
}
for := range options {
if options[].Name == {
options[].Specified = true
options[].Enable =
continue
}
}
print("GODEBUG: unknown cpu feature \"", , "\"\n")
}
for , := range options {
if !.Specified {
continue
}
if .Enable && !*.Feature {
print("GODEBUG: can not enable \"", .Name, "\", missing CPU support\n")
continue
}
if !.Enable && .Required {
print("GODEBUG: can not disable \"", .Name, "\", required CPU feature\n")
continue
}
*.Feature = .Enable
}
}
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |