package arm64
import (
"github.com/segmentio/asm/cpu/cpuid"
. "golang.org/x/sys/cpu"
)
type CPU cpuid .CPU
func (cpu CPU ) Has (feature Feature ) bool {
return cpuid .CPU (cpu ).Has (cpuid .Feature (feature ))
}
func (cpu *CPU ) set (feature Feature , enable bool ) {
(*cpuid .CPU )(cpu ).Set (cpuid .Feature (feature ), enable )
}
type Feature cpuid .Feature
const (
FP Feature = 1 << iota
ASIMD
EVTSTRM
AES
PMULL
SHA1
SHA2
CRC32
ATOMICS
FPHP
ASIMDHP
CPUID
ASIMDRDM
JSCVT
FCMA
LRCPC
DCPOP
SHA3
SM3
SM4
ASIMDDP
SHA512
SVE
ASIMDFHM
)
func ABI () CPU {
cpu := CPU (0 )
cpu .set (FP , ARM64 .HasFP )
cpu .set (ASIMD , ARM64 .HasASIMD )
cpu .set (EVTSTRM , ARM64 .HasEVTSTRM )
cpu .set (AES , ARM64 .HasAES )
cpu .set (PMULL , ARM64 .HasPMULL )
cpu .set (SHA1 , ARM64 .HasSHA1 )
cpu .set (SHA2 , ARM64 .HasSHA2 )
cpu .set (CRC32 , ARM64 .HasCRC32 )
cpu .set (ATOMICS , ARM64 .HasATOMICS )
cpu .set (FPHP , ARM64 .HasFPHP )
cpu .set (ASIMDHP , ARM64 .HasASIMDHP )
cpu .set (CPUID , ARM64 .HasCPUID )
cpu .set (ASIMDRDM , ARM64 .HasASIMDRDM )
cpu .set (JSCVT , ARM64 .HasJSCVT )
cpu .set (FCMA , ARM64 .HasFCMA )
cpu .set (LRCPC , ARM64 .HasLRCPC )
cpu .set (DCPOP , ARM64 .HasDCPOP )
cpu .set (SHA3 , ARM64 .HasSHA3 )
cpu .set (SM3 , ARM64 .HasSM3 )
cpu .set (SM4 , ARM64 .HasSM4 )
cpu .set (ASIMDDP , ARM64 .HasASIMDDP )
cpu .set (SHA512 , ARM64 .HasSHA512 )
cpu .set (SVE , ARM64 .HasSVE )
cpu .set (ASIMDFHM , ARM64 .HasASIMDFHM )
return cpu
}
The pages are generated with Golds v0.6.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 @Go100and1 (reachable from the left QR code) to get the latest news of Golds .