2 * Copyright (c) 2014 ARM Ltd
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. The name of the company may not be used to endorse or promote
14 * products derived from this software without specific prior written
17 * THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
18 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
22 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 /* ACLE standardises a set of pre-defines that describe the ARM architecture.
34 These were mostly implemented in GCC around GCC-4.8; older versions
35 have no, or only partial support. To provide a level of backwards
36 compatibility we try to work out what the definitions should be, given
37 the older pre-defines that GCC did produce. This isn't complete, but
38 it should be enough for use by routines that depend on this header. */
40 /* No need to handle ARMv8, GCC had ACLE support before that. */
42 #define __ARM_ACLE 101
44 # ifdef __ARM_ARCH_7__
45 /* The common subset of ARMv7 in all profiles. */
47 # define __ARM_ARCH_ISA_THUMB 2
48 # define __ARM_FEATURE_CLZ
49 # define __ARM_FEATURE_LDREX 7
50 # define __ARM_FEATURE_UNALIGNED
53 # if defined (__ARM_ARCH_7A__) || defined (__ARM_ARCH_7R__)
55 # define __ARM_ARCH_ISA_THUMB 2
56 # define __ARM_ARCH_ISA_ARM
57 # define __ARM_FEATURE_CLZ
58 # define __ARM_FEATURE_SIMD32
59 # define __ARM_FEATURE_DSP
60 # define __ARM_FEATURE_QBIT
61 # define __ARM_FEATURE_SAT
62 # define __ARM_FEATURE_LDREX 15
63 # define __ARM_FEATURE_UNALIGNED
64 # ifdef __ARM_ARCH_7A__
65 # define __ARM_ARCH_PROFILE 'A'
67 # define __ARM_ARCH_PROFILE 'R'
71 # ifdef __ARM_ARCH_7EM__
73 # define __ARM_ARCH_ISA_THUMB 2
74 # define __ARM_FEATURE_CLZ
75 # define __ARM_FEATURE_SIMD32
76 # define __ARM_FEATURE_DSP
77 # define __ARM_FEATURE_QBIT
78 # define __ARM_FEATURE_SAT
79 # define __ARM_FEATURE_LDREX 7
80 # define __ARM_FEATURE_UNALIGNED
81 # define __ARM_ARCH_PROFILE 'M'
84 # ifdef __ARM_ARCH_7M__
86 # define __ARM_ARCH_ISA_THUMB 2
87 # define __ARM_FEATURE_CLZ
88 # define __ARM_FEATURE_QBIT
89 # define __ARM_FEATURE_SAT
90 # define __ARM_FEATURE_LDREX 7
91 # define __ARM_FEATURE_UNALIGNED
92 # define __ARM_ARCH_PROFILE 'M'
95 # ifdef __ARM_ARCH_6T2__
97 # define __ARM_ARCH_ISA_THUMB 2
98 # define __ARM_ARCH_ISA_ARM
99 # define __ARM_FEATURE_CLZ
100 # define __ARM_FEATURE_SIMD32
101 # define __ARM_FEATURE_DSP
102 # define __ARM_FEATURE_QBIT
103 # define __ARM_FEATURE_SAT
104 # define __ARM_FEATURE_LDREX 4
105 # define __ARM_FEATURE_UNALIGNED
108 # ifdef __ARM_ARCH_6M__
109 # define __ARM_ARCH 6
110 # define __ARM_ARCH_ISA_THUMB 1
111 # define __ARM_ARCH_PROFILE 'M'
114 # if defined (__ARM_ARCH_6__) || defined (__ARM_ARCH_6J__) \
115 || defined (__ARM_ARCH_6K__) || defined (__ARM_ARCH_6Z__) \
116 || defined (__ARM_ARCH_6ZK__)
117 # define __ARM_ARCH 6
118 # define __ARM_ARCH_ISA_THUMB 1
119 # define __ARM_ARCH_ISA_ARM
120 # define __ARM_FEATURE_CLZ
121 # define __ARM_FEATURE_SIMD32
122 # define __ARM_FEATURE_DSP
123 # define __ARM_FEATURE_QBIT
124 # define __ARM_FEATURE_SAT
125 # define __ARM_FEATURE_UNALIGNED
127 # if defined (__ARM_ARCH_6K__) || defined (__ARM_ARCH_6ZK__)
128 # define __ARM_FEATURE_LDREX 15
130 # define __ARM_FEATURE_LDREX 4
135 # if defined (__ARM_ARCH_5TE__) || defined (__ARM_ARCH_5E__)
136 # define __ARM_ARCH 5
137 # define __ARM_ARCH_ISA_ARM
138 # ifdef __ARM_ARCH_5TE__
139 # define __ARM_ARCH_ISA_THUMB 1
141 # define __ARM_FEATURE_CLZ
142 # define __ARM_FEATURE_DSP
145 # if defined (__ARM_ARCH_5T__) || defined (__ARM_ARCH_5__)
146 # define __ARM_ARCH 5
147 # define __ARM_ARCH_ISA_ARM
148 # ifdef __ARM_ARCH_5TE__
149 # define __ARM_ARCH_ISA_THUMB 1
151 # define __ARM_FEATURE_CLZ
154 # ifdef __ARM_ARCH_4T__
155 # define __ARM_ARCH 4
156 # define __ARM_ARCH_ISA_ARM
157 # define __ARM_ARCH_ISA_THUMB 1
160 # ifdef __ARM_ARCH_4__
161 # define __ARM_ARCH 4
162 # define __ARM_ARCH_ISA_ARM
165 # if defined (__ARM_ARCH_3__) || defined (__ARM_ARCH_3M__)
166 # define __ARM_ARCH 3
167 # define __ARM_ARCH_ISA_ARM
170 # ifdef __ARM_ARCH_2__
171 # define __ARM_ARCH 2
172 # define __ARM_ARCH_ISA_ARM
176 # define __ARM_BIG_ENDIAN
179 /* If we still don't know what the target architecture is, then we're
180 probably not using GCC. */
182 # error Unable to determine architecture version.
185 #endif /* __ARM_ARCH */