Skip to content

iwdgo/processorfeatures

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Reference Go Report Card codecov

amd64 arm v linux windows

Processor characteristics

Processor variables direct the Go compiler to use some processor instructions. The variable has an effect only when cross-compiling or re-compiling go locally. The intent is to ease the detection of processor characteristics and the set of the related processor variables.

Linux

Pseudo-file /proc/cpuinfo is parsed to load processor flags. Reported flags are used to determine version of processor. Pseudo-file is /proc/self/auxv is parsed to load machine features.

Windows

Win32 API call IsProcessorFeaturePresent is used to collect the features of the processor.

amd64

Several checks are available but not every instruction of each version. Impact should be limited as the standard expects instructions to all be present for each version. Level is set when all verifiable features are present. Details are available in the structure ProcessorFeatures.

arm

The availability of VFP defines level 6 or higher for GOARM. If v8 instruction set is available, GOARM is unset and GOARCH is set to ARM64.

Further reading

amd64

Microarchitecture_levels Default for Go on amd64 is v1.

arm

ARM Developer handbook

Version history

API is still evolving.
arm machine features are not used for now.

Releases

No releases published

Packages

No packages published

Languages