1
2
3
4
5 package cpu
6
7 const CacheLinePadSize = 32
8
9
10
11
12 var HWCap uint
13 var HWCap2 uint
14
15
16 const (
17 hwcap_VFPv4 = 1 << 16
18 hwcap_IDIVA = 1 << 17
19 )
20
21 func doinit() {
22 options = []option{
23 {Name: "vfpv4", Feature: &ARM.HasVFPv4},
24 {Name: "idiva", Feature: &ARM.HasIDIVA},
25 }
26
27
28 ARM.HasVFPv4 = isSet(HWCap, hwcap_VFPv4)
29 ARM.HasIDIVA = isSet(HWCap, hwcap_IDIVA)
30 }
31
32 func isSet(hwc uint, value uint) bool {
33 return hwc&value != 0
34 }
35
View as plain text