package arm
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 (
SWP Feature = 1 << iota
HALF
THUMB
BIT26
FASTMUL
FPA
VFP
EDSP
JAVA
IWMMXT
CRUNCH
THUMBEE
NEON
VFPv3
VFPv3D16
TLS
VFPv4
IDIVA
IDIVT
VFPD32
LPAE
EVTSTRM
AES
PMULL
SHA1
SHA2
CRC32
)
func ABI () CPU {
cpu := CPU (0 )
cpu .set (SWP , ARM .HasSWP )
cpu .set (HALF , ARM .HasHALF )
cpu .set (THUMB , ARM .HasTHUMB )
cpu .set (BIT26 , ARM .Has26BIT )
cpu .set (FASTMUL , ARM .HasFASTMUL )
cpu .set (FPA , ARM .HasFPA )
cpu .set (VFP , ARM .HasVFP )
cpu .set (EDSP , ARM .HasEDSP )
cpu .set (JAVA , ARM .HasJAVA )
cpu .set (IWMMXT , ARM .HasIWMMXT )
cpu .set (CRUNCH , ARM .HasCRUNCH )
cpu .set (THUMBEE , ARM .HasTHUMBEE )
cpu .set (NEON , ARM .HasNEON )
cpu .set (VFPv3 , ARM .HasVFPv3 )
cpu .set (VFPv3D16 , ARM .HasVFPv3D16 )
cpu .set (TLS , ARM .HasTLS )
cpu .set (VFPv4 , ARM .HasVFPv4 )
cpu .set (IDIVA , ARM .HasIDIVA )
cpu .set (IDIVT , ARM .HasIDIVT )
cpu .set (VFPD32 , ARM .HasVFPD32 )
cpu .set (LPAE , ARM .HasLPAE )
cpu .set (EVTSTRM , ARM .HasEVTSTRM )
cpu .set (AES , ARM .HasAES )
cpu .set (PMULL , ARM .HasPMULL )
cpu .set (SHA1 , ARM .HasSHA1 )
cpu .set (SHA2 , ARM .HasSHA2 )
cpu .set (CRC32 , ARM .HasCRC32 )
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 .