package runtimefunc cpuid(, uint32) (, , , uint32)func xgetbv() (, uint32)// HasAVX2 is whether the CPU and the OS support AVX2.varHasAVX2 = detectAVX2()func detectAVX2() bool { , , , := cpuid(0, 0)if < 7 {returnfalse } , , , := cpuid(1, 0)const , = 1 << 27, 1 << 28if & == 0 || & == 0 {returnfalse }// the OS saves the YMM registers.if , := xgetbv(); &6 != 6 {returnfalse } , , , := cpuid(7, 0)const = 1 << 5return & != 0}
The pages are generated with Goldsv0.8.7. (GOOS=linux 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 @zigo_101 (reachable from the left QR code) to get the latest news of Golds.