[ARM] Add -march=armv7ve
[gcc.git] / gcc / config / arm / bpabi.h
1 /* Configuration file for ARM BPABI targets.
2 Copyright (C) 2004-2014 Free Software Foundation, Inc.
3 Contributed by CodeSourcery, LLC
4
5 This file is part of GCC.
6
7 GCC is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published
9 by the Free Software Foundation; either version 3, or (at your
10 option) any later version.
11
12 GCC is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
15 License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
20
21 /* Use the AAPCS ABI by default. */
22 #define ARM_DEFAULT_ABI ARM_ABI_AAPCS
23
24 /* Assume that AAPCS ABIs should adhere to the full BPABI. */
25 #define TARGET_BPABI (TARGET_AAPCS_BASED)
26
27 /* BPABI targets use EABI frame unwinding tables. */
28 #undef ARM_UNWIND_INFO
29 #define ARM_UNWIND_INFO 1
30
31 /* Section 4.1 of the AAPCS requires the use of VFP format. */
32 #undef FPUTYPE_DEFAULT
33 #define FPUTYPE_DEFAULT "vfp"
34
35 /* TARGET_BIG_ENDIAN_DEFAULT is set in
36 config.gcc for big endian configurations. */
37 #if TARGET_BIG_ENDIAN_DEFAULT
38 #define TARGET_ENDIAN_DEFAULT MASK_BIG_END
39 #else
40 #define TARGET_ENDIAN_DEFAULT 0
41 #endif
42
43 /* EABI targets should enable interworking by default. */
44 #undef TARGET_DEFAULT
45 #define TARGET_DEFAULT (MASK_INTERWORK | TARGET_ENDIAN_DEFAULT)
46
47 /* The ARM BPABI functions return a boolean; they use no special
48 calling convention. */
49 #define FLOAT_LIB_COMPARE_RETURNS_BOOL(MODE, COMPARISON) TARGET_BPABI
50
51 /* The BPABI integer comparison routines return { -1, 0, 1 }. */
52 #define TARGET_LIB_INT_CMP_BIASED !TARGET_BPABI
53
54 #define TARGET_FIX_V4BX_SPEC " %{mcpu=arm8|mcpu=arm810|mcpu=strongarm*"\
55 "|march=armv4|mcpu=fa526|mcpu=fa626:--fix-v4bx}"
56
57 #if TARGET_BIG_ENDIAN_DEFAULT
58 #define BE8_LINK_SPEC \
59 " %{!mlittle-endian:%{march=armv7-a|mcpu=cortex-a5 \
60 |mcpu=cortex-a7 \
61 |mcpu=cortex-a8|mcpu=cortex-a9|mcpu=cortex-a15 \
62 |mcpu=cortex-a12 \
63 |mcpu=cortex-a15.cortex-a7 \
64 |mcpu=marvell-pj4 \
65 |mcpu=cortex-a53 \
66 |mcpu=cortex-a57 \
67 |mcpu=cortex-a57.cortex-a53 \
68 |mcpu=generic-armv7-a \
69 |march=armv7ve \
70 |march=armv7-m|mcpu=cortex-m3 \
71 |march=armv7e-m|mcpu=cortex-m4 \
72 |march=armv6-m|mcpu=cortex-m0 \
73 |march=armv8-a \
74 :%{!r:--be8}}}"
75 #else
76 #define BE8_LINK_SPEC \
77 " %{mbig-endian:%{march=armv7-a|mcpu=cortex-a5 \
78 |mcpu=cortex-a7 \
79 |mcpu=cortex-a8|mcpu=cortex-a9|mcpu=cortex-a15 \
80 |mcpu=cortex-a12 \
81 |mcpu=cortex-a15.cortex-a7 \
82 |mcpu=cortex-a53 \
83 |mcpu=cortex-a57 \
84 |mcpu=cortex-a57.cortex-a53 \
85 |mcpu=marvell-pj4 \
86 |mcpu=generic-armv7-a \
87 |march=armv7ve \
88 |march=armv7-m|mcpu=cortex-m3 \
89 |march=armv7e-m|mcpu=cortex-m4 \
90 |march=armv6-m|mcpu=cortex-m0 \
91 |march=armv8-a \
92 :%{!r:--be8}}}"
93 #endif
94
95 /* Tell the assembler to build BPABI binaries. */
96 #undef SUBTARGET_EXTRA_ASM_SPEC
97 #define SUBTARGET_EXTRA_ASM_SPEC \
98 "%{mabi=apcs-gnu|mabi=atpcs:-meabi=gnu;:-meabi=5}" TARGET_FIX_V4BX_SPEC
99
100 #ifndef SUBTARGET_EXTRA_LINK_SPEC
101 #define SUBTARGET_EXTRA_LINK_SPEC ""
102 #endif
103
104 /* Split out the EABI common values so other targets can use it. */
105 #define EABI_LINK_SPEC \
106 TARGET_FIX_V4BX_SPEC BE8_LINK_SPEC
107
108 /* The generic link spec in elf.h does not support shared libraries. */
109 #define BPABI_LINK_SPEC \
110 "%{mbig-endian:-EB} %{mlittle-endian:-EL} " \
111 "%{static:-Bstatic} %{shared:-shared} %{symbolic:-Bsymbolic} " \
112 "-X" SUBTARGET_EXTRA_LINK_SPEC EABI_LINK_SPEC
113
114 #undef LINK_SPEC
115 #define LINK_SPEC BPABI_LINK_SPEC
116
117 /* The BPABI requires that we always use an out-of-line implementation
118 of RTTI comparison, even if the target supports weak symbols,
119 because the same object file might be used on a target that does
120 not support merging symbols across DLL boundaries. This macro is
121 broken out separately so that it can be used within
122 TARGET_OS_CPP_BUILTINS in configuration files for systems based on
123 the BPABI. */
124 #define TARGET_BPABI_CPP_BUILTINS() \
125 do \
126 { \
127 builtin_define ("__GXX_TYPEINFO_EQUALITY_INLINE=0"); \
128 } \
129 while (false)
130
131 #undef TARGET_OS_CPP_BUILTINS
132 #define TARGET_OS_CPP_BUILTINS() \
133 TARGET_BPABI_CPP_BUILTINS()
134
135 /* The BPABI specifies the use of .{init,fini}_array. Therefore, we
136 do not want GCC to put anything into the .{init,fini} sections. */
137 #undef INIT_SECTION_ASM_OP
138 #undef FINI_SECTION_ASM_OP
139 #define INIT_ARRAY_SECTION_ASM_OP ARM_EABI_CTORS_SECTION_OP
140 #define FINI_ARRAY_SECTION_ASM_OP ARM_EABI_DTORS_SECTION_OP
141
142 /* The legacy _mcount implementation assumes r11 points to a
143 4-word APCS frame. This is generally not true for EABI targets,
144 particularly not in Thumb mode. We assume the mcount
145 implementation does not require a counter variable (No Counter).
146 Note that __gnu_mcount_nc will be entered with a misaligned stack.
147 This is OK because it uses a special calling convention anyway. */
148
149 #undef NO_PROFILE_COUNTERS
150 #define NO_PROFILE_COUNTERS 1
151 #undef ARM_FUNCTION_PROFILER
152 #define ARM_FUNCTION_PROFILER(STREAM, LABELNO) \
153 { \
154 fprintf (STREAM, "\tpush\t{lr}\n"); \
155 fprintf (STREAM, "\tbl\t__gnu_mcount_nc\n"); \
156 }
157
158 #undef SUBTARGET_FRAME_POINTER_REQUIRED
159 #define SUBTARGET_FRAME_POINTER_REQUIRED 0
160
161 /* __gnu_mcount_nc restores the original LR value before returning. Ensure
162 that there is no unnecessary hook set up. */
163 #undef PROFILE_HOOK