665f33e1 |
1 | #ifndef __ARM_FEATURES_H__ |
2 | #define __ARM_FEATURES_H__ |
3 | |
8638b7ee |
4 | /* note: features only available since: |
5 | * __ARM_ARCH gcc 4.8/clang 3.2 |
6 | * ARMv8 support gcc 4.8/clang 3.4 |
7 | * ARM64 support gcc 4.8/clang 3.5 |
8 | */ |
9 | |
10 | #if defined(__aarch64__) |
11 | |
12 | #elif (defined(__ARM_ARCH) && __ARM_ARCH >= 8) |
663fc559 |
13 | |
14 | #define HAVE_ARMV8 |
15 | #define HAVE_ARMV7 |
16 | #define HAVE_ARMV6 |
17 | #define HAVE_ARMV5 |
18 | |
8638b7ee |
19 | #elif (defined(__ARM_ARCH) && __ARM_ARCH >= 7) \ |
20 | || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \ |
21 | || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) \ |
22 | || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7S__) |
665f33e1 |
23 | |
24 | #define HAVE_ARMV7 |
25 | #define HAVE_ARMV6 |
26 | #define HAVE_ARMV5 |
27 | |
8638b7ee |
28 | #elif (defined(__ARM_ARCH) && __ARM_ARCH >= 6) \ |
29 | || defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \ |
30 | || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) \ |
31 | || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__) \ |
32 | || defined(__ARM_ARCH_6M__) |
665f33e1 |
33 | |
34 | #define HAVE_ARMV6 |
35 | #define HAVE_ARMV5 |
8638b7ee |
36 | #define HAVE_PRE_ARMV7 |
665f33e1 |
37 | |
38 | #elif defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5E__) \ |
39 | || defined(__ARM_ARCH_5T__) || defined(__ARM_ARCH_5TE__) || defined(__ARM_ARCH_5TEJ__) |
40 | |
41 | #define HAVE_ARMV5 |
8638b7ee |
42 | #define HAVE_PRE_ARMV7 |
43 | |
44 | #elif defined(__arm__) |
45 | |
46 | #define HAVE_PRE_ARMV7 |
665f33e1 |
47 | |
48 | #endif |
49 | |
657d141e |
50 | /* gcc defines __ARM_NEON__ consistently for 32bit, but apple clang defines it for 64bit also... */ |
51 | #if defined(HAVE_ARMV7) && defined(__ARM_NEON__) |
52 | #define HAVE_NEON32 |
53 | #endif |
665f33e1 |
54 | |
4ae83961 |
55 | /* global function/external symbol */ |
5c6457c3 |
56 | #ifndef __MACH__ |
4ae83961 |
57 | #define ESYM(name) name |
58 | |
5c6457c3 |
59 | #define FUNCTION(name) \ |
4ae83961 |
60 | .globl name; \ |
5c6457c3 |
61 | .type name, %function; \ |
62 | name |
63 | |
5df0e313 |
64 | #define EXTRA_UNSAVED_REGS |
65 | |
5c6457c3 |
66 | #else |
4ae83961 |
67 | #define ESYM(name) _##name |
68 | |
5c6457c3 |
69 | #define FUNCTION(name) \ |
4ae83961 |
70 | .globl ESYM(name); \ |
71 | name: \ |
72 | ESYM(name) |
5c6457c3 |
73 | |
5df0e313 |
74 | // r7 is preserved, but add it for EABI alignment.. |
75 | #define EXTRA_UNSAVED_REGS r7, r9, |
76 | |
5c6457c3 |
77 | #endif |
78 | |
0e4ad319 |
79 | #if defined(__MACH__) || defined(__PIC__) |
80 | #define TEXRELS_FORBIDDEN |
81 | #endif |
82 | |
665f33e1 |
83 | #endif /* __ARM_FEATURES_H__ */ |