cpu_arm.go 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. // Copyright 2018 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. const cacheLineSize = 32
  6. // HWCAP/HWCAP2 bits.
  7. // These are specific to Linux.
  8. const (
  9. hwcap_SWP = 1 << 0
  10. hwcap_HALF = 1 << 1
  11. hwcap_THUMB = 1 << 2
  12. hwcap_26BIT = 1 << 3
  13. hwcap_FAST_MULT = 1 << 4
  14. hwcap_FPA = 1 << 5
  15. hwcap_VFP = 1 << 6
  16. hwcap_EDSP = 1 << 7
  17. hwcap_JAVA = 1 << 8
  18. hwcap_IWMMXT = 1 << 9
  19. hwcap_CRUNCH = 1 << 10
  20. hwcap_THUMBEE = 1 << 11
  21. hwcap_NEON = 1 << 12
  22. hwcap_VFPv3 = 1 << 13
  23. hwcap_VFPv3D16 = 1 << 14
  24. hwcap_TLS = 1 << 15
  25. hwcap_VFPv4 = 1 << 16
  26. hwcap_IDIVA = 1 << 17
  27. hwcap_IDIVT = 1 << 18
  28. hwcap_VFPD32 = 1 << 19
  29. hwcap_LPAE = 1 << 20
  30. hwcap_EVTSTRM = 1 << 21
  31. hwcap2_AES = 1 << 0
  32. hwcap2_PMULL = 1 << 1
  33. hwcap2_SHA1 = 1 << 2
  34. hwcap2_SHA2 = 1 << 3
  35. hwcap2_CRC32 = 1 << 4
  36. )
  37. func initOptions() {
  38. options = []option{
  39. {Name: "pmull", Feature: &ARM.HasPMULL},
  40. {Name: "sha1", Feature: &ARM.HasSHA1},
  41. {Name: "sha2", Feature: &ARM.HasSHA2},
  42. {Name: "swp", Feature: &ARM.HasSWP},
  43. {Name: "thumb", Feature: &ARM.HasTHUMB},
  44. {Name: "thumbee", Feature: &ARM.HasTHUMBEE},
  45. {Name: "tls", Feature: &ARM.HasTLS},
  46. {Name: "vfp", Feature: &ARM.HasVFP},
  47. {Name: "vfpd32", Feature: &ARM.HasVFPD32},
  48. {Name: "vfpv3", Feature: &ARM.HasVFPv3},
  49. {Name: "vfpv3d16", Feature: &ARM.HasVFPv3D16},
  50. {Name: "vfpv4", Feature: &ARM.HasVFPv4},
  51. {Name: "half", Feature: &ARM.HasHALF},
  52. {Name: "26bit", Feature: &ARM.Has26BIT},
  53. {Name: "fastmul", Feature: &ARM.HasFASTMUL},
  54. {Name: "fpa", Feature: &ARM.HasFPA},
  55. {Name: "edsp", Feature: &ARM.HasEDSP},
  56. {Name: "java", Feature: &ARM.HasJAVA},
  57. {Name: "iwmmxt", Feature: &ARM.HasIWMMXT},
  58. {Name: "crunch", Feature: &ARM.HasCRUNCH},
  59. {Name: "neon", Feature: &ARM.HasNEON},
  60. {Name: "idivt", Feature: &ARM.HasIDIVT},
  61. {Name: "idiva", Feature: &ARM.HasIDIVA},
  62. {Name: "lpae", Feature: &ARM.HasLPAE},
  63. {Name: "evtstrm", Feature: &ARM.HasEVTSTRM},
  64. {Name: "aes", Feature: &ARM.HasAES},
  65. {Name: "crc32", Feature: &ARM.HasCRC32},
  66. }
  67. }