cpu_linux_arm.go 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright 2019 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. package cpu
  5. func doinit() {
  6. ARM.HasSWP = isSet(hwCap, hwcap_SWP)
  7. ARM.HasHALF = isSet(hwCap, hwcap_HALF)
  8. ARM.HasTHUMB = isSet(hwCap, hwcap_THUMB)
  9. ARM.Has26BIT = isSet(hwCap, hwcap_26BIT)
  10. ARM.HasFASTMUL = isSet(hwCap, hwcap_FAST_MULT)
  11. ARM.HasFPA = isSet(hwCap, hwcap_FPA)
  12. ARM.HasVFP = isSet(hwCap, hwcap_VFP)
  13. ARM.HasEDSP = isSet(hwCap, hwcap_EDSP)
  14. ARM.HasJAVA = isSet(hwCap, hwcap_JAVA)
  15. ARM.HasIWMMXT = isSet(hwCap, hwcap_IWMMXT)
  16. ARM.HasCRUNCH = isSet(hwCap, hwcap_CRUNCH)
  17. ARM.HasTHUMBEE = isSet(hwCap, hwcap_THUMBEE)
  18. ARM.HasNEON = isSet(hwCap, hwcap_NEON)
  19. ARM.HasVFPv3 = isSet(hwCap, hwcap_VFPv3)
  20. ARM.HasVFPv3D16 = isSet(hwCap, hwcap_VFPv3D16)
  21. ARM.HasTLS = isSet(hwCap, hwcap_TLS)
  22. ARM.HasVFPv4 = isSet(hwCap, hwcap_VFPv4)
  23. ARM.HasIDIVA = isSet(hwCap, hwcap_IDIVA)
  24. ARM.HasIDIVT = isSet(hwCap, hwcap_IDIVT)
  25. ARM.HasVFPD32 = isSet(hwCap, hwcap_VFPD32)
  26. ARM.HasLPAE = isSet(hwCap, hwcap_LPAE)
  27. ARM.HasEVTSTRM = isSet(hwCap, hwcap_EVTSTRM)
  28. ARM.HasAES = isSet(hwCap2, hwcap2_AES)
  29. ARM.HasPMULL = isSet(hwCap2, hwcap2_PMULL)
  30. ARM.HasSHA1 = isSet(hwCap2, hwcap2_SHA1)
  31. ARM.HasSHA2 = isSet(hwCap2, hwcap2_SHA2)
  32. ARM.HasCRC32 = isSet(hwCap2, hwcap2_CRC32)
  33. }
  34. func isSet(hwc uint, value uint) bool {
  35. return hwc&value != 0
  36. }