1 /* Copyright (C) 2012-2015 Free Software Foundation, Inc.
2 Contributed by Richard Henderson <rth@redhat.com>.
4 This file is part of the GNU Atomic Library (libatomic).
6 Libatomic is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 Libatomic is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 Under Section 7 of GPL version 3, you are granted additional
17 permissions described in the GCC Runtime Library Exception, version
18 3.1, as published by the Free Software Foundation.
20 You should have received a copy of the GNU General Public License and
21 a copy of the GCC Runtime Library Exception along with this program;
22 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23 <http://www.gnu.org/licenses/>. */
26 #if defined(__ARM_ARCH_2__)
27 # define __ARM_ARCH__ 2
30 #if defined(__ARM_ARCH_3__)
31 # define __ARM_ARCH__ 3
34 #if defined(__ARM_ARCH_3M__) || defined(__ARM_ARCH_4__) \
35 || defined(__ARM_ARCH_4T__)
36 /* We use __ARM_ARCH__ set to 4 here, but in reality it's any processor with
37 long multiply instructions. That includes v3M. */
38 # define __ARM_ARCH__ 4
41 #if defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) \
42 || defined(__ARM_ARCH_5E__) || defined(__ARM_ARCH_5TE__) \
43 || defined(__ARM_ARCH_5TEJ__)
44 # define __ARM_ARCH__ 5
47 #if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \
48 || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) \
49 || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__) \
50 || defined(__ARM_ARCH_6M__)
51 # define __ARM_ARCH__ 6
54 #if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \
55 || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) \
56 || defined(__ARM_ARCH_7EM__)
57 # define __ARM_ARCH__ 7
60 #if defined(__ARM_ARCH_8A__)
61 # define __ARM_ARCH__ 8
65 #error Unable to determine architecture.
68 #if __ARM_ARCH__ >= 7 || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6ZK__)
70 # define HAVE_STREXBHD 1
71 #elif __ARM_ARCH__ == 6
77 #elif __ARM_ARCH__ == 6
78 # define HAVE_DMB_MCR 1