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