arm_arch.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #ifndef __ARM_ARCH_H__
  2. # define __ARM_ARCH_H__
  3. # if !defined(__ARM_ARCH__)
  4. # if defined(__CC_ARM)
  5. # define __ARM_ARCH__ __TARGET_ARCH_ARM
  6. # if defined(__BIG_ENDIAN)
  7. # define __ARMEB__
  8. # else
  9. # define __ARMEL__
  10. # endif
  11. # elif defined(__GNUC__)
  12. # if defined(__aarch64__)
  13. # define __ARM_ARCH__ 8
  14. # if __BYTE_ORDER__==__ORDER_BIG_ENDIAN__
  15. # define __ARMEB__
  16. # else
  17. # define __ARMEL__
  18. # endif
  19. /*
  20. * Why doesn't gcc define __ARM_ARCH__? Instead it defines
  21. * bunch of below macros. See all_architectires[] table in
  22. * gcc/config/arm/arm.c. On a side note it defines
  23. * __ARMEL__/__ARMEB__ for little-/big-endian.
  24. */
  25. # elif defined(__ARM_ARCH)
  26. # define __ARM_ARCH__ __ARM_ARCH
  27. # elif defined(__ARM_ARCH_8A__)
  28. # define __ARM_ARCH__ 8
  29. # elif defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || \
  30. defined(__ARM_ARCH_7R__)|| defined(__ARM_ARCH_7M__) || \
  31. defined(__ARM_ARCH_7EM__)
  32. # define __ARM_ARCH__ 7
  33. # elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || \
  34. defined(__ARM_ARCH_6K__)|| defined(__ARM_ARCH_6M__) || \
  35. defined(__ARM_ARCH_6Z__)|| defined(__ARM_ARCH_6ZK__) || \
  36. defined(__ARM_ARCH_6T2__)
  37. # define __ARM_ARCH__ 6
  38. # elif defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) || \
  39. defined(__ARM_ARCH_5E__)|| defined(__ARM_ARCH_5TE__) || \
  40. defined(__ARM_ARCH_5TEJ__)
  41. # define __ARM_ARCH__ 5
  42. # elif defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__)
  43. # define __ARM_ARCH__ 4
  44. # else
  45. # error "unsupported ARM architecture"
  46. # endif
  47. # endif
  48. # endif
  49. # if !defined(__ARM_MAX_ARCH__)
  50. # define __ARM_MAX_ARCH__ __ARM_ARCH__
  51. # endif
  52. # if __ARM_MAX_ARCH__<__ARM_ARCH__
  53. # error "__ARM_MAX_ARCH__ can't be less than __ARM_ARCH__"
  54. # elif __ARM_MAX_ARCH__!=__ARM_ARCH__
  55. # if __ARM_ARCH__<7 && __ARM_MAX_ARCH__>=7 && defined(__ARMEB__)
  56. # error "can't build universal big-endian binary"
  57. # endif
  58. # endif
  59. # if !__ASSEMBLER__
  60. extern unsigned int OPENSSL_armcap_P;
  61. # endif
  62. # define ARMV7_NEON (1<<0)
  63. # define ARMV7_TICK (1<<1)
  64. # define ARMV8_AES (1<<2)
  65. # define ARMV8_SHA1 (1<<3)
  66. # define ARMV8_SHA256 (1<<4)
  67. # define ARMV8_PMULL (1<<5)
  68. #endif