annotate gcc/config/aarch64/aarch64.h @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 84e7813d76e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Machine description for AArch64 architecture.
kono
parents:
diff changeset
2 Copyright (C) 2009-2017 Free Software Foundation, Inc.
kono
parents:
diff changeset
3 Contributed by ARM Ltd.
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 This file is part of GCC.
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 GCC is free software; you can redistribute it and/or modify it
kono
parents:
diff changeset
8 under the terms of the GNU General Public License as published by
kono
parents:
diff changeset
9 the Free Software Foundation; either version 3, or (at your option)
kono
parents:
diff changeset
10 any later version.
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 GCC is distributed in the hope that it will be useful, but
kono
parents:
diff changeset
13 WITHOUT ANY WARRANTY; without even the implied warranty of
kono
parents:
diff changeset
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
kono
parents:
diff changeset
15 General Public License for more details.
kono
parents:
diff changeset
16
kono
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
18 along with GCC; see the file COPYING3. If not see
kono
parents:
diff changeset
19 <http://www.gnu.org/licenses/>. */
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21
kono
parents:
diff changeset
22 #ifndef GCC_AARCH64_H
kono
parents:
diff changeset
23 #define GCC_AARCH64_H
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25 /* Target CPU builtins. */
kono
parents:
diff changeset
26 #define TARGET_CPU_CPP_BUILTINS() \
kono
parents:
diff changeset
27 aarch64_cpu_cpp_builtins (pfile)
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29
kono
parents:
diff changeset
30
kono
parents:
diff changeset
31 #define REGISTER_TARGET_PRAGMAS() aarch64_register_pragmas ()
kono
parents:
diff changeset
32
kono
parents:
diff changeset
33 /* Target machine storage layout. */
kono
parents:
diff changeset
34
kono
parents:
diff changeset
35 #define PROMOTE_MODE(MODE, UNSIGNEDP, TYPE) \
kono
parents:
diff changeset
36 if (GET_MODE_CLASS (MODE) == MODE_INT \
kono
parents:
diff changeset
37 && GET_MODE_SIZE (MODE) < 4) \
kono
parents:
diff changeset
38 { \
kono
parents:
diff changeset
39 if (MODE == QImode || MODE == HImode) \
kono
parents:
diff changeset
40 { \
kono
parents:
diff changeset
41 MODE = SImode; \
kono
parents:
diff changeset
42 } \
kono
parents:
diff changeset
43 }
kono
parents:
diff changeset
44
kono
parents:
diff changeset
45 /* Bits are always numbered from the LSBit. */
kono
parents:
diff changeset
46 #define BITS_BIG_ENDIAN 0
kono
parents:
diff changeset
47
kono
parents:
diff changeset
48 /* Big/little-endian flavour. */
kono
parents:
diff changeset
49 #define BYTES_BIG_ENDIAN (TARGET_BIG_END != 0)
kono
parents:
diff changeset
50 #define WORDS_BIG_ENDIAN (BYTES_BIG_ENDIAN)
kono
parents:
diff changeset
51
kono
parents:
diff changeset
52 /* AdvSIMD is supported in the default configuration, unless disabled by
kono
parents:
diff changeset
53 -mgeneral-regs-only or by the +nosimd extension. */
kono
parents:
diff changeset
54 #define TARGET_SIMD (!TARGET_GENERAL_REGS_ONLY && AARCH64_ISA_SIMD)
kono
parents:
diff changeset
55 #define TARGET_FLOAT (!TARGET_GENERAL_REGS_ONLY && AARCH64_ISA_FP)
kono
parents:
diff changeset
56
kono
parents:
diff changeset
57 #define UNITS_PER_WORD 8
kono
parents:
diff changeset
58
kono
parents:
diff changeset
59 #define UNITS_PER_VREG 16
kono
parents:
diff changeset
60
kono
parents:
diff changeset
61 #define PARM_BOUNDARY 64
kono
parents:
diff changeset
62
kono
parents:
diff changeset
63 #define STACK_BOUNDARY 128
kono
parents:
diff changeset
64
kono
parents:
diff changeset
65 #define FUNCTION_BOUNDARY 32
kono
parents:
diff changeset
66
kono
parents:
diff changeset
67 #define EMPTY_FIELD_BOUNDARY 32
kono
parents:
diff changeset
68
kono
parents:
diff changeset
69 #define BIGGEST_ALIGNMENT 128
kono
parents:
diff changeset
70
kono
parents:
diff changeset
71 #define SHORT_TYPE_SIZE 16
kono
parents:
diff changeset
72
kono
parents:
diff changeset
73 #define INT_TYPE_SIZE 32
kono
parents:
diff changeset
74
kono
parents:
diff changeset
75 #define LONG_TYPE_SIZE (TARGET_ILP32 ? 32 : 64)
kono
parents:
diff changeset
76
kono
parents:
diff changeset
77 #define POINTER_SIZE (TARGET_ILP32 ? 32 : 64)
kono
parents:
diff changeset
78
kono
parents:
diff changeset
79 #define LONG_LONG_TYPE_SIZE 64
kono
parents:
diff changeset
80
kono
parents:
diff changeset
81 #define FLOAT_TYPE_SIZE 32
kono
parents:
diff changeset
82
kono
parents:
diff changeset
83 #define DOUBLE_TYPE_SIZE 64
kono
parents:
diff changeset
84
kono
parents:
diff changeset
85 #define LONG_DOUBLE_TYPE_SIZE 128
kono
parents:
diff changeset
86
kono
parents:
diff changeset
87 /* The architecture reserves all bits of the address for hardware use,
kono
parents:
diff changeset
88 so the vbit must go into the delta field of pointers to member
kono
parents:
diff changeset
89 functions. This is the same config as that in the AArch32
kono
parents:
diff changeset
90 port. */
kono
parents:
diff changeset
91 #define TARGET_PTRMEMFUNC_VBIT_LOCATION ptrmemfunc_vbit_in_delta
kono
parents:
diff changeset
92
kono
parents:
diff changeset
93 /* Align definitions of arrays, unions and structures so that
kono
parents:
diff changeset
94 initializations and copies can be made more efficient. This is not
kono
parents:
diff changeset
95 ABI-changing, so it only affects places where we can see the
kono
parents:
diff changeset
96 definition. Increasing the alignment tends to introduce padding,
kono
parents:
diff changeset
97 so don't do this when optimizing for size/conserving stack space. */
kono
parents:
diff changeset
98 #define AARCH64_EXPAND_ALIGNMENT(COND, EXP, ALIGN) \
kono
parents:
diff changeset
99 (((COND) && ((ALIGN) < BITS_PER_WORD) \
kono
parents:
diff changeset
100 && (TREE_CODE (EXP) == ARRAY_TYPE \
kono
parents:
diff changeset
101 || TREE_CODE (EXP) == UNION_TYPE \
kono
parents:
diff changeset
102 || TREE_CODE (EXP) == RECORD_TYPE)) ? BITS_PER_WORD : (ALIGN))
kono
parents:
diff changeset
103
kono
parents:
diff changeset
104 /* Align global data. */
kono
parents:
diff changeset
105 #define DATA_ALIGNMENT(EXP, ALIGN) \
kono
parents:
diff changeset
106 AARCH64_EXPAND_ALIGNMENT (!optimize_size, EXP, ALIGN)
kono
parents:
diff changeset
107
kono
parents:
diff changeset
108 /* Similarly, make sure that objects on the stack are sensibly aligned. */
kono
parents:
diff changeset
109 #define LOCAL_ALIGNMENT(EXP, ALIGN) \
kono
parents:
diff changeset
110 AARCH64_EXPAND_ALIGNMENT (!flag_conserve_stack, EXP, ALIGN)
kono
parents:
diff changeset
111
kono
parents:
diff changeset
112 #define STRUCTURE_SIZE_BOUNDARY 8
kono
parents:
diff changeset
113
kono
parents:
diff changeset
114 /* Defined by the ABI */
kono
parents:
diff changeset
115 #define WCHAR_TYPE "unsigned int"
kono
parents:
diff changeset
116 #define WCHAR_TYPE_SIZE 32
kono
parents:
diff changeset
117
kono
parents:
diff changeset
118 /* Using long long breaks -ansi and -std=c90, so these will need to be
kono
parents:
diff changeset
119 made conditional for an LLP64 ABI. */
kono
parents:
diff changeset
120
kono
parents:
diff changeset
121 #define SIZE_TYPE "long unsigned int"
kono
parents:
diff changeset
122
kono
parents:
diff changeset
123 #define PTRDIFF_TYPE "long int"
kono
parents:
diff changeset
124
kono
parents:
diff changeset
125 #define PCC_BITFIELD_TYPE_MATTERS 1
kono
parents:
diff changeset
126
kono
parents:
diff changeset
127 /* Major revision number of the ARM Architecture implemented by the target. */
kono
parents:
diff changeset
128 extern unsigned aarch64_architecture_version;
kono
parents:
diff changeset
129
kono
parents:
diff changeset
130 /* Instruction tuning/selection flags. */
kono
parents:
diff changeset
131
kono
parents:
diff changeset
132 /* Bit values used to identify processor capabilities. */
kono
parents:
diff changeset
133 #define AARCH64_FL_SIMD (1 << 0) /* Has SIMD instructions. */
kono
parents:
diff changeset
134 #define AARCH64_FL_FP (1 << 1) /* Has FP. */
kono
parents:
diff changeset
135 #define AARCH64_FL_CRYPTO (1 << 2) /* Has crypto. */
kono
parents:
diff changeset
136 #define AARCH64_FL_CRC (1 << 3) /* Has CRC. */
kono
parents:
diff changeset
137 /* ARMv8.1-A architecture extensions. */
kono
parents:
diff changeset
138 #define AARCH64_FL_LSE (1 << 4) /* Has Large System Extensions. */
kono
parents:
diff changeset
139 #define AARCH64_FL_RDMA (1 << 5) /* Has Round Double Multiply Add. */
kono
parents:
diff changeset
140 #define AARCH64_FL_V8_1 (1 << 6) /* Has ARMv8.1-A extensions. */
kono
parents:
diff changeset
141 /* ARMv8.2-A architecture extensions. */
kono
parents:
diff changeset
142 #define AARCH64_FL_V8_2 (1 << 8) /* Has ARMv8.2-A features. */
kono
parents:
diff changeset
143 #define AARCH64_FL_F16 (1 << 9) /* Has ARMv8.2-A FP16 extensions. */
kono
parents:
diff changeset
144 /* ARMv8.3-A architecture extensions. */
kono
parents:
diff changeset
145 #define AARCH64_FL_V8_3 (1 << 10) /* Has ARMv8.3-A features. */
kono
parents:
diff changeset
146 #define AARCH64_FL_RCPC (1 << 11) /* Has support for RCpc model. */
kono
parents:
diff changeset
147 #define AARCH64_FL_DOTPROD (1 << 12) /* Has ARMv8.2-A Dot Product ins. */
kono
parents:
diff changeset
148
kono
parents:
diff changeset
149 /* Has FP and SIMD. */
kono
parents:
diff changeset
150 #define AARCH64_FL_FPSIMD (AARCH64_FL_FP | AARCH64_FL_SIMD)
kono
parents:
diff changeset
151
kono
parents:
diff changeset
152 /* Has FP without SIMD. */
kono
parents:
diff changeset
153 #define AARCH64_FL_FPQ16 (AARCH64_FL_FP & ~AARCH64_FL_SIMD)
kono
parents:
diff changeset
154
kono
parents:
diff changeset
155 /* Architecture flags that effect instruction selection. */
kono
parents:
diff changeset
156 #define AARCH64_FL_FOR_ARCH8 (AARCH64_FL_FPSIMD)
kono
parents:
diff changeset
157 #define AARCH64_FL_FOR_ARCH8_1 \
kono
parents:
diff changeset
158 (AARCH64_FL_FOR_ARCH8 | AARCH64_FL_LSE | AARCH64_FL_CRC \
kono
parents:
diff changeset
159 | AARCH64_FL_RDMA | AARCH64_FL_V8_1)
kono
parents:
diff changeset
160 #define AARCH64_FL_FOR_ARCH8_2 \
kono
parents:
diff changeset
161 (AARCH64_FL_FOR_ARCH8_1 | AARCH64_FL_V8_2)
kono
parents:
diff changeset
162 #define AARCH64_FL_FOR_ARCH8_3 \
kono
parents:
diff changeset
163 (AARCH64_FL_FOR_ARCH8_2 | AARCH64_FL_V8_3)
kono
parents:
diff changeset
164
kono
parents:
diff changeset
165 /* Macros to test ISA flags. */
kono
parents:
diff changeset
166
kono
parents:
diff changeset
167 #define AARCH64_ISA_CRC (aarch64_isa_flags & AARCH64_FL_CRC)
kono
parents:
diff changeset
168 #define AARCH64_ISA_CRYPTO (aarch64_isa_flags & AARCH64_FL_CRYPTO)
kono
parents:
diff changeset
169 #define AARCH64_ISA_FP (aarch64_isa_flags & AARCH64_FL_FP)
kono
parents:
diff changeset
170 #define AARCH64_ISA_SIMD (aarch64_isa_flags & AARCH64_FL_SIMD)
kono
parents:
diff changeset
171 #define AARCH64_ISA_LSE (aarch64_isa_flags & AARCH64_FL_LSE)
kono
parents:
diff changeset
172 #define AARCH64_ISA_RDMA (aarch64_isa_flags & AARCH64_FL_RDMA)
kono
parents:
diff changeset
173 #define AARCH64_ISA_V8_2 (aarch64_isa_flags & AARCH64_FL_V8_2)
kono
parents:
diff changeset
174 #define AARCH64_ISA_F16 (aarch64_isa_flags & AARCH64_FL_F16)
kono
parents:
diff changeset
175 #define AARCH64_ISA_V8_3 (aarch64_isa_flags & AARCH64_FL_V8_3)
kono
parents:
diff changeset
176 #define AARCH64_ISA_DOTPROD (aarch64_isa_flags & AARCH64_FL_DOTPROD)
kono
parents:
diff changeset
177
kono
parents:
diff changeset
178 /* Crypto is an optional extension to AdvSIMD. */
kono
parents:
diff changeset
179 #define TARGET_CRYPTO (TARGET_SIMD && AARCH64_ISA_CRYPTO)
kono
parents:
diff changeset
180
kono
parents:
diff changeset
181 /* CRC instructions that can be enabled through +crc arch extension. */
kono
parents:
diff changeset
182 #define TARGET_CRC32 (AARCH64_ISA_CRC)
kono
parents:
diff changeset
183
kono
parents:
diff changeset
184 /* Atomic instructions that can be enabled through the +lse extension. */
kono
parents:
diff changeset
185 #define TARGET_LSE (AARCH64_ISA_LSE)
kono
parents:
diff changeset
186
kono
parents:
diff changeset
187 /* ARMv8.2-A FP16 support that can be enabled through the +fp16 extension. */
kono
parents:
diff changeset
188 #define TARGET_FP_F16INST (TARGET_FLOAT && AARCH64_ISA_F16)
kono
parents:
diff changeset
189 #define TARGET_SIMD_F16INST (TARGET_SIMD && AARCH64_ISA_F16)
kono
parents:
diff changeset
190
kono
parents:
diff changeset
191 /* Dot Product is an optional extension to AdvSIMD enabled through +dotprod. */
kono
parents:
diff changeset
192 #define TARGET_DOTPROD (TARGET_SIMD && AARCH64_ISA_DOTPROD)
kono
parents:
diff changeset
193
kono
parents:
diff changeset
194 /* ARMv8.3-A features. */
kono
parents:
diff changeset
195 #define TARGET_ARMV8_3 (AARCH64_ISA_V8_3)
kono
parents:
diff changeset
196
kono
parents:
diff changeset
197 /* Make sure this is always defined so we don't have to check for ifdefs
kono
parents:
diff changeset
198 but rather use normal ifs. */
kono
parents:
diff changeset
199 #ifndef TARGET_FIX_ERR_A53_835769_DEFAULT
kono
parents:
diff changeset
200 #define TARGET_FIX_ERR_A53_835769_DEFAULT 0
kono
parents:
diff changeset
201 #else
kono
parents:
diff changeset
202 #undef TARGET_FIX_ERR_A53_835769_DEFAULT
kono
parents:
diff changeset
203 #define TARGET_FIX_ERR_A53_835769_DEFAULT 1
kono
parents:
diff changeset
204 #endif
kono
parents:
diff changeset
205
kono
parents:
diff changeset
206 /* Apply the workaround for Cortex-A53 erratum 835769. */
kono
parents:
diff changeset
207 #define TARGET_FIX_ERR_A53_835769 \
kono
parents:
diff changeset
208 ((aarch64_fix_a53_err835769 == 2) \
kono
parents:
diff changeset
209 ? TARGET_FIX_ERR_A53_835769_DEFAULT : aarch64_fix_a53_err835769)
kono
parents:
diff changeset
210
kono
parents:
diff changeset
211 /* Make sure this is always defined so we don't have to check for ifdefs
kono
parents:
diff changeset
212 but rather use normal ifs. */
kono
parents:
diff changeset
213 #ifndef TARGET_FIX_ERR_A53_843419_DEFAULT
kono
parents:
diff changeset
214 #define TARGET_FIX_ERR_A53_843419_DEFAULT 0
kono
parents:
diff changeset
215 #else
kono
parents:
diff changeset
216 #undef TARGET_FIX_ERR_A53_843419_DEFAULT
kono
parents:
diff changeset
217 #define TARGET_FIX_ERR_A53_843419_DEFAULT 1
kono
parents:
diff changeset
218 #endif
kono
parents:
diff changeset
219
kono
parents:
diff changeset
220 /* Apply the workaround for Cortex-A53 erratum 843419. */
kono
parents:
diff changeset
221 #define TARGET_FIX_ERR_A53_843419 \
kono
parents:
diff changeset
222 ((aarch64_fix_a53_err843419 == 2) \
kono
parents:
diff changeset
223 ? TARGET_FIX_ERR_A53_843419_DEFAULT : aarch64_fix_a53_err843419)
kono
parents:
diff changeset
224
kono
parents:
diff changeset
225 /* ARMv8.1-A Adv.SIMD support. */
kono
parents:
diff changeset
226 #define TARGET_SIMD_RDMA (TARGET_SIMD && AARCH64_ISA_RDMA)
kono
parents:
diff changeset
227
kono
parents:
diff changeset
228 /* Standard register usage. */
kono
parents:
diff changeset
229
kono
parents:
diff changeset
230 /* 31 64-bit general purpose registers R0-R30:
kono
parents:
diff changeset
231 R30 LR (link register)
kono
parents:
diff changeset
232 R29 FP (frame pointer)
kono
parents:
diff changeset
233 R19-R28 Callee-saved registers
kono
parents:
diff changeset
234 R18 The platform register; use as temporary register.
kono
parents:
diff changeset
235 R17 IP1 The second intra-procedure-call temporary register
kono
parents:
diff changeset
236 (can be used by call veneers and PLT code); otherwise use
kono
parents:
diff changeset
237 as a temporary register
kono
parents:
diff changeset
238 R16 IP0 The first intra-procedure-call temporary register (can
kono
parents:
diff changeset
239 be used by call veneers and PLT code); otherwise use as a
kono
parents:
diff changeset
240 temporary register
kono
parents:
diff changeset
241 R9-R15 Temporary registers
kono
parents:
diff changeset
242 R8 Structure value parameter / temporary register
kono
parents:
diff changeset
243 R0-R7 Parameter/result registers
kono
parents:
diff changeset
244
kono
parents:
diff changeset
245 SP stack pointer, encoded as X/R31 where permitted.
kono
parents:
diff changeset
246 ZR zero register, encoded as X/R31 elsewhere
kono
parents:
diff changeset
247
kono
parents:
diff changeset
248 32 x 128-bit floating-point/vector registers
kono
parents:
diff changeset
249 V16-V31 Caller-saved (temporary) registers
kono
parents:
diff changeset
250 V8-V15 Callee-saved registers
kono
parents:
diff changeset
251 V0-V7 Parameter/result registers
kono
parents:
diff changeset
252
kono
parents:
diff changeset
253 The vector register V0 holds scalar B0, H0, S0 and D0 in its least
kono
parents:
diff changeset
254 significant bits. Unlike AArch32 S1 is not packed into D0,
kono
parents:
diff changeset
255 etc. */
kono
parents:
diff changeset
256
kono
parents:
diff changeset
257 /* Note that we don't mark X30 as a call-clobbered register. The idea is
kono
parents:
diff changeset
258 that it's really the call instructions themselves which clobber X30.
kono
parents:
diff changeset
259 We don't care what the called function does with it afterwards.
kono
parents:
diff changeset
260
kono
parents:
diff changeset
261 This approach makes it easier to implement sibcalls. Unlike normal
kono
parents:
diff changeset
262 calls, sibcalls don't clobber X30, so the register reaches the
kono
parents:
diff changeset
263 called function intact. EPILOGUE_USES says that X30 is useful
kono
parents:
diff changeset
264 to the called function. */
kono
parents:
diff changeset
265
kono
parents:
diff changeset
266 #define FIXED_REGISTERS \
kono
parents:
diff changeset
267 { \
kono
parents:
diff changeset
268 0, 0, 0, 0, 0, 0, 0, 0, /* R0 - R7 */ \
kono
parents:
diff changeset
269 0, 0, 0, 0, 0, 0, 0, 0, /* R8 - R15 */ \
kono
parents:
diff changeset
270 0, 0, 0, 0, 0, 0, 0, 0, /* R16 - R23 */ \
kono
parents:
diff changeset
271 0, 0, 0, 0, 0, 1, 0, 1, /* R24 - R30, SP */ \
kono
parents:
diff changeset
272 0, 0, 0, 0, 0, 0, 0, 0, /* V0 - V7 */ \
kono
parents:
diff changeset
273 0, 0, 0, 0, 0, 0, 0, 0, /* V8 - V15 */ \
kono
parents:
diff changeset
274 0, 0, 0, 0, 0, 0, 0, 0, /* V16 - V23 */ \
kono
parents:
diff changeset
275 0, 0, 0, 0, 0, 0, 0, 0, /* V24 - V31 */ \
kono
parents:
diff changeset
276 1, 1, 1, /* SFP, AP, CC */ \
kono
parents:
diff changeset
277 }
kono
parents:
diff changeset
278
kono
parents:
diff changeset
279 #define CALL_USED_REGISTERS \
kono
parents:
diff changeset
280 { \
kono
parents:
diff changeset
281 1, 1, 1, 1, 1, 1, 1, 1, /* R0 - R7 */ \
kono
parents:
diff changeset
282 1, 1, 1, 1, 1, 1, 1, 1, /* R8 - R15 */ \
kono
parents:
diff changeset
283 1, 1, 1, 0, 0, 0, 0, 0, /* R16 - R23 */ \
kono
parents:
diff changeset
284 0, 0, 0, 0, 0, 1, 1, 1, /* R24 - R30, SP */ \
kono
parents:
diff changeset
285 1, 1, 1, 1, 1, 1, 1, 1, /* V0 - V7 */ \
kono
parents:
diff changeset
286 0, 0, 0, 0, 0, 0, 0, 0, /* V8 - V15 */ \
kono
parents:
diff changeset
287 1, 1, 1, 1, 1, 1, 1, 1, /* V16 - V23 */ \
kono
parents:
diff changeset
288 1, 1, 1, 1, 1, 1, 1, 1, /* V24 - V31 */ \
kono
parents:
diff changeset
289 1, 1, 1, /* SFP, AP, CC */ \
kono
parents:
diff changeset
290 }
kono
parents:
diff changeset
291
kono
parents:
diff changeset
292 #define REGISTER_NAMES \
kono
parents:
diff changeset
293 { \
kono
parents:
diff changeset
294 "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7", \
kono
parents:
diff changeset
295 "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15", \
kono
parents:
diff changeset
296 "x16", "x17", "x18", "x19", "x20", "x21", "x22", "x23", \
kono
parents:
diff changeset
297 "x24", "x25", "x26", "x27", "x28", "x29", "x30", "sp", \
kono
parents:
diff changeset
298 "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", \
kono
parents:
diff changeset
299 "v8", "v9", "v10", "v11", "v12", "v13", "v14", "v15", \
kono
parents:
diff changeset
300 "v16", "v17", "v18", "v19", "v20", "v21", "v22", "v23", \
kono
parents:
diff changeset
301 "v24", "v25", "v26", "v27", "v28", "v29", "v30", "v31", \
kono
parents:
diff changeset
302 "sfp", "ap", "cc", \
kono
parents:
diff changeset
303 }
kono
parents:
diff changeset
304
kono
parents:
diff changeset
305 /* Generate the register aliases for core register N */
kono
parents:
diff changeset
306 #define R_ALIASES(N) {"r" # N, R0_REGNUM + (N)}, \
kono
parents:
diff changeset
307 {"w" # N, R0_REGNUM + (N)}
kono
parents:
diff changeset
308
kono
parents:
diff changeset
309 #define V_ALIASES(N) {"q" # N, V0_REGNUM + (N)}, \
kono
parents:
diff changeset
310 {"d" # N, V0_REGNUM + (N)}, \
kono
parents:
diff changeset
311 {"s" # N, V0_REGNUM + (N)}, \
kono
parents:
diff changeset
312 {"h" # N, V0_REGNUM + (N)}, \
kono
parents:
diff changeset
313 {"b" # N, V0_REGNUM + (N)}
kono
parents:
diff changeset
314
kono
parents:
diff changeset
315 /* Provide aliases for all of the ISA defined register name forms.
kono
parents:
diff changeset
316 These aliases are convenient for use in the clobber lists of inline
kono
parents:
diff changeset
317 asm statements. */
kono
parents:
diff changeset
318
kono
parents:
diff changeset
319 #define ADDITIONAL_REGISTER_NAMES \
kono
parents:
diff changeset
320 { R_ALIASES(0), R_ALIASES(1), R_ALIASES(2), R_ALIASES(3), \
kono
parents:
diff changeset
321 R_ALIASES(4), R_ALIASES(5), R_ALIASES(6), R_ALIASES(7), \
kono
parents:
diff changeset
322 R_ALIASES(8), R_ALIASES(9), R_ALIASES(10), R_ALIASES(11), \
kono
parents:
diff changeset
323 R_ALIASES(12), R_ALIASES(13), R_ALIASES(14), R_ALIASES(15), \
kono
parents:
diff changeset
324 R_ALIASES(16), R_ALIASES(17), R_ALIASES(18), R_ALIASES(19), \
kono
parents:
diff changeset
325 R_ALIASES(20), R_ALIASES(21), R_ALIASES(22), R_ALIASES(23), \
kono
parents:
diff changeset
326 R_ALIASES(24), R_ALIASES(25), R_ALIASES(26), R_ALIASES(27), \
kono
parents:
diff changeset
327 R_ALIASES(28), R_ALIASES(29), R_ALIASES(30), {"wsp", R0_REGNUM + 31}, \
kono
parents:
diff changeset
328 V_ALIASES(0), V_ALIASES(1), V_ALIASES(2), V_ALIASES(3), \
kono
parents:
diff changeset
329 V_ALIASES(4), V_ALIASES(5), V_ALIASES(6), V_ALIASES(7), \
kono
parents:
diff changeset
330 V_ALIASES(8), V_ALIASES(9), V_ALIASES(10), V_ALIASES(11), \
kono
parents:
diff changeset
331 V_ALIASES(12), V_ALIASES(13), V_ALIASES(14), V_ALIASES(15), \
kono
parents:
diff changeset
332 V_ALIASES(16), V_ALIASES(17), V_ALIASES(18), V_ALIASES(19), \
kono
parents:
diff changeset
333 V_ALIASES(20), V_ALIASES(21), V_ALIASES(22), V_ALIASES(23), \
kono
parents:
diff changeset
334 V_ALIASES(24), V_ALIASES(25), V_ALIASES(26), V_ALIASES(27), \
kono
parents:
diff changeset
335 V_ALIASES(28), V_ALIASES(29), V_ALIASES(30), V_ALIASES(31) \
kono
parents:
diff changeset
336 }
kono
parents:
diff changeset
337
kono
parents:
diff changeset
338 /* Say that the epilogue uses the return address register. Note that
kono
parents:
diff changeset
339 in the case of sibcalls, the values "used by the epilogue" are
kono
parents:
diff changeset
340 considered live at the start of the called function. */
kono
parents:
diff changeset
341
kono
parents:
diff changeset
342 #define EPILOGUE_USES(REGNO) \
kono
parents:
diff changeset
343 (epilogue_completed && (REGNO) == LR_REGNUM)
kono
parents:
diff changeset
344
kono
parents:
diff changeset
345 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
kono
parents:
diff changeset
346 the stack pointer does not matter. This is only true if the function
kono
parents:
diff changeset
347 uses alloca. */
kono
parents:
diff changeset
348 #define EXIT_IGNORE_STACK (cfun->calls_alloca)
kono
parents:
diff changeset
349
kono
parents:
diff changeset
350 #define STATIC_CHAIN_REGNUM R18_REGNUM
kono
parents:
diff changeset
351 #define HARD_FRAME_POINTER_REGNUM R29_REGNUM
kono
parents:
diff changeset
352 #define FRAME_POINTER_REGNUM SFP_REGNUM
kono
parents:
diff changeset
353 #define STACK_POINTER_REGNUM SP_REGNUM
kono
parents:
diff changeset
354 #define ARG_POINTER_REGNUM AP_REGNUM
kono
parents:
diff changeset
355 #define FIRST_PSEUDO_REGISTER 67
kono
parents:
diff changeset
356
kono
parents:
diff changeset
357 /* The number of (integer) argument register available. */
kono
parents:
diff changeset
358 #define NUM_ARG_REGS 8
kono
parents:
diff changeset
359 #define NUM_FP_ARG_REGS 8
kono
parents:
diff changeset
360
kono
parents:
diff changeset
361 /* A Homogeneous Floating-Point or Short-Vector Aggregate may have at most
kono
parents:
diff changeset
362 four members. */
kono
parents:
diff changeset
363 #define HA_MAX_NUM_FLDS 4
kono
parents:
diff changeset
364
kono
parents:
diff changeset
365 /* External dwarf register number scheme. These number are used to
kono
parents:
diff changeset
366 identify registers in dwarf debug information, the values are
kono
parents:
diff changeset
367 defined by the AArch64 ABI. The numbering scheme is independent of
kono
parents:
diff changeset
368 GCC's internal register numbering scheme. */
kono
parents:
diff changeset
369
kono
parents:
diff changeset
370 #define AARCH64_DWARF_R0 0
kono
parents:
diff changeset
371
kono
parents:
diff changeset
372 /* The number of R registers, note 31! not 32. */
kono
parents:
diff changeset
373 #define AARCH64_DWARF_NUMBER_R 31
kono
parents:
diff changeset
374
kono
parents:
diff changeset
375 #define AARCH64_DWARF_SP 31
kono
parents:
diff changeset
376 #define AARCH64_DWARF_V0 64
kono
parents:
diff changeset
377
kono
parents:
diff changeset
378 /* The number of V registers. */
kono
parents:
diff changeset
379 #define AARCH64_DWARF_NUMBER_V 32
kono
parents:
diff changeset
380
kono
parents:
diff changeset
381 /* For signal frames we need to use an alternative return column. This
kono
parents:
diff changeset
382 value must not correspond to a hard register and must be out of the
kono
parents:
diff changeset
383 range of DWARF_FRAME_REGNUM(). */
kono
parents:
diff changeset
384 #define DWARF_ALT_FRAME_RETURN_COLUMN \
kono
parents:
diff changeset
385 (AARCH64_DWARF_V0 + AARCH64_DWARF_NUMBER_V)
kono
parents:
diff changeset
386
kono
parents:
diff changeset
387 /* We add 1 extra frame register for use as the
kono
parents:
diff changeset
388 DWARF_ALT_FRAME_RETURN_COLUMN. */
kono
parents:
diff changeset
389 #define DWARF_FRAME_REGISTERS (DWARF_ALT_FRAME_RETURN_COLUMN + 1)
kono
parents:
diff changeset
390
kono
parents:
diff changeset
391
kono
parents:
diff changeset
392 #define DBX_REGISTER_NUMBER(REGNO) aarch64_dbx_register_number (REGNO)
kono
parents:
diff changeset
393 /* Provide a definition of DWARF_FRAME_REGNUM here so that fallback unwinders
kono
parents:
diff changeset
394 can use DWARF_ALT_FRAME_RETURN_COLUMN defined below. This is just the same
kono
parents:
diff changeset
395 as the default definition in dwarf2out.c. */
kono
parents:
diff changeset
396 #undef DWARF_FRAME_REGNUM
kono
parents:
diff changeset
397 #define DWARF_FRAME_REGNUM(REGNO) DBX_REGISTER_NUMBER (REGNO)
kono
parents:
diff changeset
398
kono
parents:
diff changeset
399 #define DWARF_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (LR_REGNUM)
kono
parents:
diff changeset
400
kono
parents:
diff changeset
401 #define DWARF2_UNWIND_INFO 1
kono
parents:
diff changeset
402
kono
parents:
diff changeset
403 /* Use R0 through R3 to pass exception handling information. */
kono
parents:
diff changeset
404 #define EH_RETURN_DATA_REGNO(N) \
kono
parents:
diff changeset
405 ((N) < 4 ? ((unsigned int) R0_REGNUM + (N)) : INVALID_REGNUM)
kono
parents:
diff changeset
406
kono
parents:
diff changeset
407 /* Select a format to encode pointers in exception handling data. */
kono
parents:
diff changeset
408 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \
kono
parents:
diff changeset
409 aarch64_asm_preferred_eh_data_format ((CODE), (GLOBAL))
kono
parents:
diff changeset
410
kono
parents:
diff changeset
411 /* Output the assembly strings we want to add to a function definition. */
kono
parents:
diff changeset
412 #define ASM_DECLARE_FUNCTION_NAME(STR, NAME, DECL) \
kono
parents:
diff changeset
413 aarch64_declare_function_name (STR, NAME, DECL)
kono
parents:
diff changeset
414
kono
parents:
diff changeset
415 /* For EH returns X4 contains the stack adjustment. */
kono
parents:
diff changeset
416 #define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, R4_REGNUM)
kono
parents:
diff changeset
417 #define EH_RETURN_HANDLER_RTX aarch64_eh_return_handler_rtx ()
kono
parents:
diff changeset
418
kono
parents:
diff changeset
419 /* Don't use __builtin_setjmp until we've defined it. */
kono
parents:
diff changeset
420 #undef DONT_USE_BUILTIN_SETJMP
kono
parents:
diff changeset
421 #define DONT_USE_BUILTIN_SETJMP 1
kono
parents:
diff changeset
422
kono
parents:
diff changeset
423 /* Register in which the structure value is to be returned. */
kono
parents:
diff changeset
424 #define AARCH64_STRUCT_VALUE_REGNUM R8_REGNUM
kono
parents:
diff changeset
425
kono
parents:
diff changeset
426 /* Non-zero if REGNO is part of the Core register set.
kono
parents:
diff changeset
427
kono
parents:
diff changeset
428 The rather unusual way of expressing this check is to avoid
kono
parents:
diff changeset
429 warnings when building the compiler when R0_REGNUM is 0 and REGNO
kono
parents:
diff changeset
430 is unsigned. */
kono
parents:
diff changeset
431 #define GP_REGNUM_P(REGNO) \
kono
parents:
diff changeset
432 (((unsigned) (REGNO - R0_REGNUM)) <= (R30_REGNUM - R0_REGNUM))
kono
parents:
diff changeset
433
kono
parents:
diff changeset
434 #define FP_REGNUM_P(REGNO) \
kono
parents:
diff changeset
435 (((unsigned) (REGNO - V0_REGNUM)) <= (V31_REGNUM - V0_REGNUM))
kono
parents:
diff changeset
436
kono
parents:
diff changeset
437 #define FP_LO_REGNUM_P(REGNO) \
kono
parents:
diff changeset
438 (((unsigned) (REGNO - V0_REGNUM)) <= (V15_REGNUM - V0_REGNUM))
kono
parents:
diff changeset
439
kono
parents:
diff changeset
440
kono
parents:
diff changeset
441 /* Register and constant classes. */
kono
parents:
diff changeset
442
kono
parents:
diff changeset
443 enum reg_class
kono
parents:
diff changeset
444 {
kono
parents:
diff changeset
445 NO_REGS,
kono
parents:
diff changeset
446 CALLER_SAVE_REGS,
kono
parents:
diff changeset
447 GENERAL_REGS,
kono
parents:
diff changeset
448 STACK_REG,
kono
parents:
diff changeset
449 POINTER_REGS,
kono
parents:
diff changeset
450 FP_LO_REGS,
kono
parents:
diff changeset
451 FP_REGS,
kono
parents:
diff changeset
452 POINTER_AND_FP_REGS,
kono
parents:
diff changeset
453 ALL_REGS,
kono
parents:
diff changeset
454 LIM_REG_CLASSES /* Last */
kono
parents:
diff changeset
455 };
kono
parents:
diff changeset
456
kono
parents:
diff changeset
457 #define N_REG_CLASSES ((int) LIM_REG_CLASSES)
kono
parents:
diff changeset
458
kono
parents:
diff changeset
459 #define REG_CLASS_NAMES \
kono
parents:
diff changeset
460 { \
kono
parents:
diff changeset
461 "NO_REGS", \
kono
parents:
diff changeset
462 "CALLER_SAVE_REGS", \
kono
parents:
diff changeset
463 "GENERAL_REGS", \
kono
parents:
diff changeset
464 "STACK_REG", \
kono
parents:
diff changeset
465 "POINTER_REGS", \
kono
parents:
diff changeset
466 "FP_LO_REGS", \
kono
parents:
diff changeset
467 "FP_REGS", \
kono
parents:
diff changeset
468 "POINTER_AND_FP_REGS", \
kono
parents:
diff changeset
469 "ALL_REGS" \
kono
parents:
diff changeset
470 }
kono
parents:
diff changeset
471
kono
parents:
diff changeset
472 #define REG_CLASS_CONTENTS \
kono
parents:
diff changeset
473 { \
kono
parents:
diff changeset
474 { 0x00000000, 0x00000000, 0x00000000 }, /* NO_REGS */ \
kono
parents:
diff changeset
475 { 0x0007ffff, 0x00000000, 0x00000000 }, /* CALLER_SAVE_REGS */ \
kono
parents:
diff changeset
476 { 0x7fffffff, 0x00000000, 0x00000003 }, /* GENERAL_REGS */ \
kono
parents:
diff changeset
477 { 0x80000000, 0x00000000, 0x00000000 }, /* STACK_REG */ \
kono
parents:
diff changeset
478 { 0xffffffff, 0x00000000, 0x00000003 }, /* POINTER_REGS */ \
kono
parents:
diff changeset
479 { 0x00000000, 0x0000ffff, 0x00000000 }, /* FP_LO_REGS */ \
kono
parents:
diff changeset
480 { 0x00000000, 0xffffffff, 0x00000000 }, /* FP_REGS */ \
kono
parents:
diff changeset
481 { 0xffffffff, 0xffffffff, 0x00000003 }, /* POINTER_AND_FP_REGS */\
kono
parents:
diff changeset
482 { 0xffffffff, 0xffffffff, 0x00000007 } /* ALL_REGS */ \
kono
parents:
diff changeset
483 }
kono
parents:
diff changeset
484
kono
parents:
diff changeset
485 #define REGNO_REG_CLASS(REGNO) aarch64_regno_regclass (REGNO)
kono
parents:
diff changeset
486
kono
parents:
diff changeset
487 #define INDEX_REG_CLASS GENERAL_REGS
kono
parents:
diff changeset
488 #define BASE_REG_CLASS POINTER_REGS
kono
parents:
diff changeset
489
kono
parents:
diff changeset
490 /* Register pairs used to eliminate unneeded registers that point into
kono
parents:
diff changeset
491 the stack frame. */
kono
parents:
diff changeset
492 #define ELIMINABLE_REGS \
kono
parents:
diff changeset
493 { \
kono
parents:
diff changeset
494 { ARG_POINTER_REGNUM, STACK_POINTER_REGNUM }, \
kono
parents:
diff changeset
495 { ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM }, \
kono
parents:
diff changeset
496 { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM }, \
kono
parents:
diff changeset
497 { FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM }, \
kono
parents:
diff changeset
498 }
kono
parents:
diff changeset
499
kono
parents:
diff changeset
500 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
kono
parents:
diff changeset
501 (OFFSET) = aarch64_initial_elimination_offset (FROM, TO)
kono
parents:
diff changeset
502
kono
parents:
diff changeset
503 /* CPU/ARCH option handling. */
kono
parents:
diff changeset
504 #include "config/aarch64/aarch64-opts.h"
kono
parents:
diff changeset
505
kono
parents:
diff changeset
506 enum target_cpus
kono
parents:
diff changeset
507 {
kono
parents:
diff changeset
508 #define AARCH64_CORE(NAME, INTERNAL_IDENT, SCHED, ARCH, FLAGS, COSTS, IMP, PART, VARIANT) \
kono
parents:
diff changeset
509 TARGET_CPU_##INTERNAL_IDENT,
kono
parents:
diff changeset
510 #include "aarch64-cores.def"
kono
parents:
diff changeset
511 TARGET_CPU_generic
kono
parents:
diff changeset
512 };
kono
parents:
diff changeset
513
kono
parents:
diff changeset
514 /* If there is no CPU defined at configure, use generic as default. */
kono
parents:
diff changeset
515 #ifndef TARGET_CPU_DEFAULT
kono
parents:
diff changeset
516 #define TARGET_CPU_DEFAULT \
kono
parents:
diff changeset
517 (TARGET_CPU_generic | (AARCH64_CPU_DEFAULT_FLAGS << 6))
kono
parents:
diff changeset
518 #endif
kono
parents:
diff changeset
519
kono
parents:
diff changeset
520 /* If inserting NOP before a mult-accumulate insn remember to adjust the
kono
parents:
diff changeset
521 length so that conditional branching code is updated appropriately. */
kono
parents:
diff changeset
522 #define ADJUST_INSN_LENGTH(insn, length) \
kono
parents:
diff changeset
523 do \
kono
parents:
diff changeset
524 { \
kono
parents:
diff changeset
525 if (aarch64_madd_needs_nop (insn)) \
kono
parents:
diff changeset
526 length += 4; \
kono
parents:
diff changeset
527 } while (0)
kono
parents:
diff changeset
528
kono
parents:
diff changeset
529 #define FINAL_PRESCAN_INSN(INSN, OPVEC, NOPERANDS) \
kono
parents:
diff changeset
530 aarch64_final_prescan_insn (INSN); \
kono
parents:
diff changeset
531
kono
parents:
diff changeset
532 /* The processor for which instructions should be scheduled. */
kono
parents:
diff changeset
533 extern enum aarch64_processor aarch64_tune;
kono
parents:
diff changeset
534
kono
parents:
diff changeset
535 /* RTL generation support. */
kono
parents:
diff changeset
536 #define INIT_EXPANDERS aarch64_init_expanders ()
kono
parents:
diff changeset
537
kono
parents:
diff changeset
538
kono
parents:
diff changeset
539 /* Stack layout; function entry, exit and calling. */
kono
parents:
diff changeset
540 #define STACK_GROWS_DOWNWARD 1
kono
parents:
diff changeset
541
kono
parents:
diff changeset
542 #define FRAME_GROWS_DOWNWARD 1
kono
parents:
diff changeset
543
kono
parents:
diff changeset
544 #define ACCUMULATE_OUTGOING_ARGS 1
kono
parents:
diff changeset
545
kono
parents:
diff changeset
546 #define FIRST_PARM_OFFSET(FNDECL) 0
kono
parents:
diff changeset
547
kono
parents:
diff changeset
548 /* Fix for VFP */
kono
parents:
diff changeset
549 #define LIBCALL_VALUE(MODE) \
kono
parents:
diff changeset
550 gen_rtx_REG (MODE, FLOAT_MODE_P (MODE) ? V0_REGNUM : R0_REGNUM)
kono
parents:
diff changeset
551
kono
parents:
diff changeset
552 #define DEFAULT_PCC_STRUCT_RETURN 0
kono
parents:
diff changeset
553
kono
parents:
diff changeset
554 #ifdef HOST_WIDE_INT
kono
parents:
diff changeset
555 struct GTY (()) aarch64_frame
kono
parents:
diff changeset
556 {
kono
parents:
diff changeset
557 HOST_WIDE_INT reg_offset[FIRST_PSEUDO_REGISTER];
kono
parents:
diff changeset
558
kono
parents:
diff changeset
559 /* The number of extra stack bytes taken up by register varargs.
kono
parents:
diff changeset
560 This area is allocated by the callee at the very top of the
kono
parents:
diff changeset
561 frame. This value is rounded up to a multiple of
kono
parents:
diff changeset
562 STACK_BOUNDARY. */
kono
parents:
diff changeset
563 HOST_WIDE_INT saved_varargs_size;
kono
parents:
diff changeset
564
kono
parents:
diff changeset
565 /* The size of the saved callee-save int/FP registers. */
kono
parents:
diff changeset
566
kono
parents:
diff changeset
567 HOST_WIDE_INT saved_regs_size;
kono
parents:
diff changeset
568
kono
parents:
diff changeset
569 /* Offset from the base of the frame (incomming SP) to the
kono
parents:
diff changeset
570 top of the locals area. This value is always a multiple of
kono
parents:
diff changeset
571 STACK_BOUNDARY. */
kono
parents:
diff changeset
572 HOST_WIDE_INT locals_offset;
kono
parents:
diff changeset
573
kono
parents:
diff changeset
574 /* Offset from the base of the frame (incomming SP) to the
kono
parents:
diff changeset
575 hard_frame_pointer. This value is always a multiple of
kono
parents:
diff changeset
576 STACK_BOUNDARY. */
kono
parents:
diff changeset
577 HOST_WIDE_INT hard_fp_offset;
kono
parents:
diff changeset
578
kono
parents:
diff changeset
579 /* The size of the frame. This value is the offset from base of the
kono
parents:
diff changeset
580 * frame (incomming SP) to the stack_pointer. This value is always
kono
parents:
diff changeset
581 * a multiple of STACK_BOUNDARY. */
kono
parents:
diff changeset
582 HOST_WIDE_INT frame_size;
kono
parents:
diff changeset
583
kono
parents:
diff changeset
584 /* The size of the initial stack adjustment before saving callee-saves. */
kono
parents:
diff changeset
585 HOST_WIDE_INT initial_adjust;
kono
parents:
diff changeset
586
kono
parents:
diff changeset
587 /* The writeback value when pushing callee-save registers.
kono
parents:
diff changeset
588 It is zero when no push is used. */
kono
parents:
diff changeset
589 HOST_WIDE_INT callee_adjust;
kono
parents:
diff changeset
590
kono
parents:
diff changeset
591 /* The offset from SP to the callee-save registers after initial_adjust.
kono
parents:
diff changeset
592 It may be non-zero if no push is used (ie. callee_adjust == 0). */
kono
parents:
diff changeset
593 HOST_WIDE_INT callee_offset;
kono
parents:
diff changeset
594
kono
parents:
diff changeset
595 /* The size of the stack adjustment after saving callee-saves. */
kono
parents:
diff changeset
596 HOST_WIDE_INT final_adjust;
kono
parents:
diff changeset
597
kono
parents:
diff changeset
598 /* Store FP,LR and setup a frame pointer. */
kono
parents:
diff changeset
599 bool emit_frame_chain;
kono
parents:
diff changeset
600
kono
parents:
diff changeset
601 unsigned wb_candidate1;
kono
parents:
diff changeset
602 unsigned wb_candidate2;
kono
parents:
diff changeset
603
kono
parents:
diff changeset
604 bool laid_out;
kono
parents:
diff changeset
605 };
kono
parents:
diff changeset
606
kono
parents:
diff changeset
607 typedef struct GTY (()) machine_function
kono
parents:
diff changeset
608 {
kono
parents:
diff changeset
609 struct aarch64_frame frame;
kono
parents:
diff changeset
610 /* One entry for each hard register. */
kono
parents:
diff changeset
611 bool reg_is_wrapped_separately[LAST_SAVED_REGNUM];
kono
parents:
diff changeset
612 } machine_function;
kono
parents:
diff changeset
613 #endif
kono
parents:
diff changeset
614
kono
parents:
diff changeset
615 /* Which ABI to use. */
kono
parents:
diff changeset
616 enum aarch64_abi_type
kono
parents:
diff changeset
617 {
kono
parents:
diff changeset
618 AARCH64_ABI_LP64 = 0,
kono
parents:
diff changeset
619 AARCH64_ABI_ILP32 = 1
kono
parents:
diff changeset
620 };
kono
parents:
diff changeset
621
kono
parents:
diff changeset
622 #ifndef AARCH64_ABI_DEFAULT
kono
parents:
diff changeset
623 #define AARCH64_ABI_DEFAULT AARCH64_ABI_LP64
kono
parents:
diff changeset
624 #endif
kono
parents:
diff changeset
625
kono
parents:
diff changeset
626 #define TARGET_ILP32 (aarch64_abi & AARCH64_ABI_ILP32)
kono
parents:
diff changeset
627
kono
parents:
diff changeset
628 enum arm_pcs
kono
parents:
diff changeset
629 {
kono
parents:
diff changeset
630 ARM_PCS_AAPCS64, /* Base standard AAPCS for 64 bit. */
kono
parents:
diff changeset
631 ARM_PCS_UNKNOWN
kono
parents:
diff changeset
632 };
kono
parents:
diff changeset
633
kono
parents:
diff changeset
634
kono
parents:
diff changeset
635
kono
parents:
diff changeset
636
kono
parents:
diff changeset
637 /* We can't use machine_mode inside a generator file because it
kono
parents:
diff changeset
638 hasn't been created yet; we shouldn't be using any code that
kono
parents:
diff changeset
639 needs the real definition though, so this ought to be safe. */
kono
parents:
diff changeset
640 #ifdef GENERATOR_FILE
kono
parents:
diff changeset
641 #define MACHMODE int
kono
parents:
diff changeset
642 #else
kono
parents:
diff changeset
643 #include "insn-modes.h"
kono
parents:
diff changeset
644 #define MACHMODE machine_mode
kono
parents:
diff changeset
645 #endif
kono
parents:
diff changeset
646
kono
parents:
diff changeset
647 #ifndef USED_FOR_TARGET
kono
parents:
diff changeset
648 /* AAPCS related state tracking. */
kono
parents:
diff changeset
649 typedef struct
kono
parents:
diff changeset
650 {
kono
parents:
diff changeset
651 enum arm_pcs pcs_variant;
kono
parents:
diff changeset
652 int aapcs_arg_processed; /* No need to lay out this argument again. */
kono
parents:
diff changeset
653 int aapcs_ncrn; /* Next Core register number. */
kono
parents:
diff changeset
654 int aapcs_nextncrn; /* Next next core register number. */
kono
parents:
diff changeset
655 int aapcs_nvrn; /* Next Vector register number. */
kono
parents:
diff changeset
656 int aapcs_nextnvrn; /* Next Next Vector register number. */
kono
parents:
diff changeset
657 rtx aapcs_reg; /* Register assigned to this argument. This
kono
parents:
diff changeset
658 is NULL_RTX if this parameter goes on
kono
parents:
diff changeset
659 the stack. */
kono
parents:
diff changeset
660 MACHMODE aapcs_vfp_rmode;
kono
parents:
diff changeset
661 int aapcs_stack_words; /* If the argument is passed on the stack, this
kono
parents:
diff changeset
662 is the number of words needed, after rounding
kono
parents:
diff changeset
663 up. Only meaningful when
kono
parents:
diff changeset
664 aapcs_reg == NULL_RTX. */
kono
parents:
diff changeset
665 int aapcs_stack_size; /* The total size (in words, per 8 byte) of the
kono
parents:
diff changeset
666 stack arg area so far. */
kono
parents:
diff changeset
667 } CUMULATIVE_ARGS;
kono
parents:
diff changeset
668 #endif
kono
parents:
diff changeset
669
kono
parents:
diff changeset
670 #define BLOCK_REG_PADDING(MODE, TYPE, FIRST) \
kono
parents:
diff changeset
671 (aarch64_pad_reg_upward (MODE, TYPE, FIRST) ? PAD_UPWARD : PAD_DOWNWARD)
kono
parents:
diff changeset
672
kono
parents:
diff changeset
673 #define PAD_VARARGS_DOWN 0
kono
parents:
diff changeset
674
kono
parents:
diff changeset
675 #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, FNDECL, N_NAMED_ARGS) \
kono
parents:
diff changeset
676 aarch64_init_cumulative_args (&(CUM), FNTYPE, LIBNAME, FNDECL, N_NAMED_ARGS)
kono
parents:
diff changeset
677
kono
parents:
diff changeset
678 #define FUNCTION_ARG_REGNO_P(REGNO) \
kono
parents:
diff changeset
679 aarch64_function_arg_regno_p(REGNO)
kono
parents:
diff changeset
680
kono
parents:
diff changeset
681
kono
parents:
diff changeset
682 /* ISA Features. */
kono
parents:
diff changeset
683
kono
parents:
diff changeset
684 /* Addressing modes, etc. */
kono
parents:
diff changeset
685 #define HAVE_POST_INCREMENT 1
kono
parents:
diff changeset
686 #define HAVE_PRE_INCREMENT 1
kono
parents:
diff changeset
687 #define HAVE_POST_DECREMENT 1
kono
parents:
diff changeset
688 #define HAVE_PRE_DECREMENT 1
kono
parents:
diff changeset
689 #define HAVE_POST_MODIFY_DISP 1
kono
parents:
diff changeset
690 #define HAVE_PRE_MODIFY_DISP 1
kono
parents:
diff changeset
691
kono
parents:
diff changeset
692 #define MAX_REGS_PER_ADDRESS 2
kono
parents:
diff changeset
693
kono
parents:
diff changeset
694 #define CONSTANT_ADDRESS_P(X) aarch64_constant_address_p(X)
kono
parents:
diff changeset
695
kono
parents:
diff changeset
696 #define REGNO_OK_FOR_BASE_P(REGNO) \
kono
parents:
diff changeset
697 aarch64_regno_ok_for_base_p (REGNO, true)
kono
parents:
diff changeset
698
kono
parents:
diff changeset
699 #define REGNO_OK_FOR_INDEX_P(REGNO) \
kono
parents:
diff changeset
700 aarch64_regno_ok_for_index_p (REGNO, true)
kono
parents:
diff changeset
701
kono
parents:
diff changeset
702 #define LEGITIMATE_PIC_OPERAND_P(X) \
kono
parents:
diff changeset
703 aarch64_legitimate_pic_operand_p (X)
kono
parents:
diff changeset
704
kono
parents:
diff changeset
705 #define CASE_VECTOR_MODE Pmode
kono
parents:
diff changeset
706
kono
parents:
diff changeset
707 #define DEFAULT_SIGNED_CHAR 0
kono
parents:
diff changeset
708
kono
parents:
diff changeset
709 /* An integer expression for the size in bits of the largest integer machine
kono
parents:
diff changeset
710 mode that should actually be used. We allow pairs of registers. */
kono
parents:
diff changeset
711 #define MAX_FIXED_MODE_SIZE GET_MODE_BITSIZE (TImode)
kono
parents:
diff changeset
712
kono
parents:
diff changeset
713 /* Maximum bytes moved by a single instruction (load/store pair). */
kono
parents:
diff changeset
714 #define MOVE_MAX (UNITS_PER_WORD * 2)
kono
parents:
diff changeset
715
kono
parents:
diff changeset
716 /* The base cost overhead of a memcpy call, for MOVE_RATIO and friends. */
kono
parents:
diff changeset
717 #define AARCH64_CALL_RATIO 8
kono
parents:
diff changeset
718
kono
parents:
diff changeset
719 /* MOVE_RATIO dictates when we will use the move_by_pieces infrastructure.
kono
parents:
diff changeset
720 move_by_pieces will continually copy the largest safe chunks. So a
kono
parents:
diff changeset
721 7-byte copy is a 4-byte + 2-byte + byte copy. This proves inefficient
kono
parents:
diff changeset
722 for both size and speed of copy, so we will instead use the "movmem"
kono
parents:
diff changeset
723 standard name to implement the copy. This logic does not apply when
kono
parents:
diff changeset
724 targeting -mstrict-align, so keep a sensible default in that case. */
kono
parents:
diff changeset
725 #define MOVE_RATIO(speed) \
kono
parents:
diff changeset
726 (!STRICT_ALIGNMENT ? 2 : (((speed) ? 15 : AARCH64_CALL_RATIO) / 2))
kono
parents:
diff changeset
727
kono
parents:
diff changeset
728 /* For CLEAR_RATIO, when optimizing for size, give a better estimate
kono
parents:
diff changeset
729 of the length of a memset call, but use the default otherwise. */
kono
parents:
diff changeset
730 #define CLEAR_RATIO(speed) \
kono
parents:
diff changeset
731 ((speed) ? 15 : AARCH64_CALL_RATIO)
kono
parents:
diff changeset
732
kono
parents:
diff changeset
733 /* SET_RATIO is similar to CLEAR_RATIO, but for a non-zero constant, so when
kono
parents:
diff changeset
734 optimizing for size adjust the ratio to account for the overhead of loading
kono
parents:
diff changeset
735 the constant. */
kono
parents:
diff changeset
736 #define SET_RATIO(speed) \
kono
parents:
diff changeset
737 ((speed) ? 15 : AARCH64_CALL_RATIO - 2)
kono
parents:
diff changeset
738
kono
parents:
diff changeset
739 /* Disable auto-increment in move_by_pieces et al. Use of auto-increment is
kono
parents:
diff changeset
740 rarely a good idea in straight-line code since it adds an extra address
kono
parents:
diff changeset
741 dependency between each instruction. Better to use incrementing offsets. */
kono
parents:
diff changeset
742 #define USE_LOAD_POST_INCREMENT(MODE) 0
kono
parents:
diff changeset
743 #define USE_LOAD_POST_DECREMENT(MODE) 0
kono
parents:
diff changeset
744 #define USE_LOAD_PRE_INCREMENT(MODE) 0
kono
parents:
diff changeset
745 #define USE_LOAD_PRE_DECREMENT(MODE) 0
kono
parents:
diff changeset
746 #define USE_STORE_POST_INCREMENT(MODE) 0
kono
parents:
diff changeset
747 #define USE_STORE_POST_DECREMENT(MODE) 0
kono
parents:
diff changeset
748 #define USE_STORE_PRE_INCREMENT(MODE) 0
kono
parents:
diff changeset
749 #define USE_STORE_PRE_DECREMENT(MODE) 0
kono
parents:
diff changeset
750
kono
parents:
diff changeset
751 /* WORD_REGISTER_OPERATIONS does not hold for AArch64.
kono
parents:
diff changeset
752 The assigned word_mode is DImode but operations narrower than SImode
kono
parents:
diff changeset
753 behave as 32-bit operations if using the W-form of the registers rather
kono
parents:
diff changeset
754 than as word_mode (64-bit) operations as WORD_REGISTER_OPERATIONS
kono
parents:
diff changeset
755 expects. */
kono
parents:
diff changeset
756 #define WORD_REGISTER_OPERATIONS 0
kono
parents:
diff changeset
757
kono
parents:
diff changeset
758 /* Define if loading from memory in MODE, an integral mode narrower than
kono
parents:
diff changeset
759 BITS_PER_WORD will either zero-extend or sign-extend. The value of this
kono
parents:
diff changeset
760 macro should be the code that says which one of the two operations is
kono
parents:
diff changeset
761 implicitly done, or UNKNOWN if none. */
kono
parents:
diff changeset
762 #define LOAD_EXTEND_OP(MODE) ZERO_EXTEND
kono
parents:
diff changeset
763
kono
parents:
diff changeset
764 /* Define this macro to be non-zero if instructions will fail to work
kono
parents:
diff changeset
765 if given data not on the nominal alignment. */
kono
parents:
diff changeset
766 #define STRICT_ALIGNMENT TARGET_STRICT_ALIGN
kono
parents:
diff changeset
767
kono
parents:
diff changeset
768 /* Define this macro to be non-zero if accessing less than a word of
kono
parents:
diff changeset
769 memory is no faster than accessing a word of memory, i.e., if such
kono
parents:
diff changeset
770 accesses require more than one instruction or if there is no
kono
parents:
diff changeset
771 difference in cost.
kono
parents:
diff changeset
772 Although there's no difference in instruction count or cycles,
kono
parents:
diff changeset
773 in AArch64 we don't want to expand to a sub-word to a 64-bit access
kono
parents:
diff changeset
774 if we don't have to, for power-saving reasons. */
kono
parents:
diff changeset
775 #define SLOW_BYTE_ACCESS 0
kono
parents:
diff changeset
776
kono
parents:
diff changeset
777 #define NO_FUNCTION_CSE 1
kono
parents:
diff changeset
778
kono
parents:
diff changeset
779 /* Specify the machine mode that the hardware addresses have.
kono
parents:
diff changeset
780 After generation of rtl, the compiler makes no further distinction
kono
parents:
diff changeset
781 between pointers and any other objects of this machine mode. */
kono
parents:
diff changeset
782 #define Pmode DImode
kono
parents:
diff changeset
783
kono
parents:
diff changeset
784 /* A C expression whose value is zero if pointers that need to be extended
kono
parents:
diff changeset
785 from being `POINTER_SIZE' bits wide to `Pmode' are sign-extended and
kono
parents:
diff changeset
786 greater then zero if they are zero-extended and less then zero if the
kono
parents:
diff changeset
787 ptr_extend instruction should be used. */
kono
parents:
diff changeset
788 #define POINTERS_EXTEND_UNSIGNED 1
kono
parents:
diff changeset
789
kono
parents:
diff changeset
790 /* Mode of a function address in a call instruction (for indexing purposes). */
kono
parents:
diff changeset
791 #define FUNCTION_MODE Pmode
kono
parents:
diff changeset
792
kono
parents:
diff changeset
793 #define SELECT_CC_MODE(OP, X, Y) aarch64_select_cc_mode (OP, X, Y)
kono
parents:
diff changeset
794
kono
parents:
diff changeset
795 #define REVERSIBLE_CC_MODE(MODE) 1
kono
parents:
diff changeset
796
kono
parents:
diff changeset
797 #define REVERSE_CONDITION(CODE, MODE) \
kono
parents:
diff changeset
798 (((MODE) == CCFPmode || (MODE) == CCFPEmode) \
kono
parents:
diff changeset
799 ? reverse_condition_maybe_unordered (CODE) \
kono
parents:
diff changeset
800 : reverse_condition (CODE))
kono
parents:
diff changeset
801
kono
parents:
diff changeset
802 #define CLZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) \
kono
parents:
diff changeset
803 ((VALUE) = GET_MODE_UNIT_BITSIZE (MODE), 2)
kono
parents:
diff changeset
804 #define CTZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) \
kono
parents:
diff changeset
805 ((VALUE) = GET_MODE_UNIT_BITSIZE (MODE), 2)
kono
parents:
diff changeset
806
kono
parents:
diff changeset
807 #define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (Pmode, LR_REGNUM)
kono
parents:
diff changeset
808
kono
parents:
diff changeset
809 #define RETURN_ADDR_RTX aarch64_return_addr
kono
parents:
diff changeset
810
kono
parents:
diff changeset
811 /* 3 insns + padding + 2 pointer-sized entries. */
kono
parents:
diff changeset
812 #define TRAMPOLINE_SIZE (TARGET_ILP32 ? 24 : 32)
kono
parents:
diff changeset
813
kono
parents:
diff changeset
814 /* Trampolines contain dwords, so must be dword aligned. */
kono
parents:
diff changeset
815 #define TRAMPOLINE_ALIGNMENT 64
kono
parents:
diff changeset
816
kono
parents:
diff changeset
817 /* Put trampolines in the text section so that mapping symbols work
kono
parents:
diff changeset
818 correctly. */
kono
parents:
diff changeset
819 #define TRAMPOLINE_SECTION text_section
kono
parents:
diff changeset
820
kono
parents:
diff changeset
821 /* To start with. */
kono
parents:
diff changeset
822 #define BRANCH_COST(SPEED_P, PREDICTABLE_P) \
kono
parents:
diff changeset
823 (aarch64_branch_cost (SPEED_P, PREDICTABLE_P))
kono
parents:
diff changeset
824
kono
parents:
diff changeset
825
kono
parents:
diff changeset
826 /* Assembly output. */
kono
parents:
diff changeset
827
kono
parents:
diff changeset
828 /* For now we'll make all jump tables pc-relative. */
kono
parents:
diff changeset
829 #define CASE_VECTOR_PC_RELATIVE 1
kono
parents:
diff changeset
830
kono
parents:
diff changeset
831 #define CASE_VECTOR_SHORTEN_MODE(min, max, body) \
kono
parents:
diff changeset
832 ((min < -0x1fff0 || max > 0x1fff0) ? SImode \
kono
parents:
diff changeset
833 : (min < -0x1f0 || max > 0x1f0) ? HImode \
kono
parents:
diff changeset
834 : QImode)
kono
parents:
diff changeset
835
kono
parents:
diff changeset
836 /* Jump table alignment is explicit in ASM_OUTPUT_CASE_LABEL. */
kono
parents:
diff changeset
837 #define ADDR_VEC_ALIGN(JUMPTABLE) 0
kono
parents:
diff changeset
838
kono
parents:
diff changeset
839 #define MCOUNT_NAME "_mcount"
kono
parents:
diff changeset
840
kono
parents:
diff changeset
841 #define NO_PROFILE_COUNTERS 1
kono
parents:
diff changeset
842
kono
parents:
diff changeset
843 /* Emit rtl for profiling. Output assembler code to FILE
kono
parents:
diff changeset
844 to call "_mcount" for profiling a function entry. */
kono
parents:
diff changeset
845 #define PROFILE_HOOK(LABEL) \
kono
parents:
diff changeset
846 { \
kono
parents:
diff changeset
847 rtx fun, lr; \
kono
parents:
diff changeset
848 lr = get_hard_reg_initial_val (Pmode, LR_REGNUM); \
kono
parents:
diff changeset
849 fun = gen_rtx_SYMBOL_REF (Pmode, MCOUNT_NAME); \
kono
parents:
diff changeset
850 emit_library_call (fun, LCT_NORMAL, VOIDmode, lr, Pmode); \
kono
parents:
diff changeset
851 }
kono
parents:
diff changeset
852
kono
parents:
diff changeset
853 /* All the work done in PROFILE_HOOK, but still required. */
kono
parents:
diff changeset
854 #define FUNCTION_PROFILER(STREAM, LABELNO) do { } while (0)
kono
parents:
diff changeset
855
kono
parents:
diff changeset
856 /* For some reason, the Linux headers think they know how to define
kono
parents:
diff changeset
857 these macros. They don't!!! */
kono
parents:
diff changeset
858 #undef ASM_APP_ON
kono
parents:
diff changeset
859 #undef ASM_APP_OFF
kono
parents:
diff changeset
860 #define ASM_APP_ON "\t" ASM_COMMENT_START " Start of user assembly\n"
kono
parents:
diff changeset
861 #define ASM_APP_OFF "\t" ASM_COMMENT_START " End of user assembly\n"
kono
parents:
diff changeset
862
kono
parents:
diff changeset
863 #define CONSTANT_POOL_BEFORE_FUNCTION 0
kono
parents:
diff changeset
864
kono
parents:
diff changeset
865 /* This definition should be relocated to aarch64-elf-raw.h. This macro
kono
parents:
diff changeset
866 should be undefined in aarch64-linux.h and a clear_cache pattern
kono
parents:
diff changeset
867 implmented to emit either the call to __aarch64_sync_cache_range()
kono
parents:
diff changeset
868 directly or preferably the appropriate sycall or cache clear
kono
parents:
diff changeset
869 instructions inline. */
kono
parents:
diff changeset
870 #define CLEAR_INSN_CACHE(beg, end) \
kono
parents:
diff changeset
871 extern void __aarch64_sync_cache_range (void *, void *); \
kono
parents:
diff changeset
872 __aarch64_sync_cache_range (beg, end)
kono
parents:
diff changeset
873
kono
parents:
diff changeset
874 #define SHIFT_COUNT_TRUNCATED (!TARGET_SIMD)
kono
parents:
diff changeset
875
kono
parents:
diff changeset
876 /* Choose appropriate mode for caller saves, so we do the minimum
kono
parents:
diff changeset
877 required size of load/store. */
kono
parents:
diff changeset
878 #define HARD_REGNO_CALLER_SAVE_MODE(REGNO, NREGS, MODE) \
kono
parents:
diff changeset
879 aarch64_hard_regno_caller_save_mode ((REGNO), (NREGS), (MODE))
kono
parents:
diff changeset
880
kono
parents:
diff changeset
881 #undef SWITCHABLE_TARGET
kono
parents:
diff changeset
882 #define SWITCHABLE_TARGET 1
kono
parents:
diff changeset
883
kono
parents:
diff changeset
884 /* Check TLS Descriptors mechanism is selected. */
kono
parents:
diff changeset
885 #define TARGET_TLS_DESC (aarch64_tls_dialect == TLS_DESCRIPTORS)
kono
parents:
diff changeset
886
kono
parents:
diff changeset
887 extern enum aarch64_code_model aarch64_cmodel;
kono
parents:
diff changeset
888
kono
parents:
diff changeset
889 /* When using the tiny addressing model conditional and unconditional branches
kono
parents:
diff changeset
890 can span the whole of the available address space (1MB). */
kono
parents:
diff changeset
891 #define HAS_LONG_COND_BRANCH \
kono
parents:
diff changeset
892 (aarch64_cmodel == AARCH64_CMODEL_TINY \
kono
parents:
diff changeset
893 || aarch64_cmodel == AARCH64_CMODEL_TINY_PIC)
kono
parents:
diff changeset
894
kono
parents:
diff changeset
895 #define HAS_LONG_UNCOND_BRANCH \
kono
parents:
diff changeset
896 (aarch64_cmodel == AARCH64_CMODEL_TINY \
kono
parents:
diff changeset
897 || aarch64_cmodel == AARCH64_CMODEL_TINY_PIC)
kono
parents:
diff changeset
898
kono
parents:
diff changeset
899 #define TARGET_SUPPORTS_WIDE_INT 1
kono
parents:
diff changeset
900
kono
parents:
diff changeset
901 /* Modes valid for AdvSIMD D registers, i.e. that fit in half a Q register. */
kono
parents:
diff changeset
902 #define AARCH64_VALID_SIMD_DREG_MODE(MODE) \
kono
parents:
diff changeset
903 ((MODE) == V2SImode || (MODE) == V4HImode || (MODE) == V8QImode \
kono
parents:
diff changeset
904 || (MODE) == V2SFmode || (MODE) == V4HFmode || (MODE) == DImode \
kono
parents:
diff changeset
905 || (MODE) == DFmode)
kono
parents:
diff changeset
906
kono
parents:
diff changeset
907 /* Modes valid for AdvSIMD Q registers. */
kono
parents:
diff changeset
908 #define AARCH64_VALID_SIMD_QREG_MODE(MODE) \
kono
parents:
diff changeset
909 ((MODE) == V4SImode || (MODE) == V8HImode || (MODE) == V16QImode \
kono
parents:
diff changeset
910 || (MODE) == V4SFmode || (MODE) == V8HFmode || (MODE) == V2DImode \
kono
parents:
diff changeset
911 || (MODE) == V2DFmode)
kono
parents:
diff changeset
912
kono
parents:
diff changeset
913 #define ENDIAN_LANE_N(mode, n) \
kono
parents:
diff changeset
914 (BYTES_BIG_ENDIAN ? GET_MODE_NUNITS (mode) - 1 - n : n)
kono
parents:
diff changeset
915
kono
parents:
diff changeset
916 /* Support for a configure-time default CPU, etc. We currently support
kono
parents:
diff changeset
917 --with-arch and --with-cpu. Both are ignored if either is specified
kono
parents:
diff changeset
918 explicitly on the command line at run time. */
kono
parents:
diff changeset
919 #define OPTION_DEFAULT_SPECS \
kono
parents:
diff changeset
920 {"arch", "%{!march=*:%{!mcpu=*:-march=%(VALUE)}}" }, \
kono
parents:
diff changeset
921 {"cpu", "%{!march=*:%{!mcpu=*:-mcpu=%(VALUE)}}" },
kono
parents:
diff changeset
922
kono
parents:
diff changeset
923 #define MCPU_TO_MARCH_SPEC \
kono
parents:
diff changeset
924 " %{mcpu=*:-march=%:rewrite_mcpu(%{mcpu=*:%*})}"
kono
parents:
diff changeset
925
kono
parents:
diff changeset
926 extern const char *aarch64_rewrite_mcpu (int argc, const char **argv);
kono
parents:
diff changeset
927 #define MCPU_TO_MARCH_SPEC_FUNCTIONS \
kono
parents:
diff changeset
928 { "rewrite_mcpu", aarch64_rewrite_mcpu },
kono
parents:
diff changeset
929
kono
parents:
diff changeset
930 #if defined(__aarch64__)
kono
parents:
diff changeset
931 extern const char *host_detect_local_cpu (int argc, const char **argv);
kono
parents:
diff changeset
932 # define EXTRA_SPEC_FUNCTIONS \
kono
parents:
diff changeset
933 { "local_cpu_detect", host_detect_local_cpu }, \
kono
parents:
diff changeset
934 MCPU_TO_MARCH_SPEC_FUNCTIONS
kono
parents:
diff changeset
935
kono
parents:
diff changeset
936 # define MCPU_MTUNE_NATIVE_SPECS \
kono
parents:
diff changeset
937 " %{march=native:%<march=native %:local_cpu_detect(arch)}" \
kono
parents:
diff changeset
938 " %{mcpu=native:%<mcpu=native %:local_cpu_detect(cpu)}" \
kono
parents:
diff changeset
939 " %{mtune=native:%<mtune=native %:local_cpu_detect(tune)}"
kono
parents:
diff changeset
940 #else
kono
parents:
diff changeset
941 # define MCPU_MTUNE_NATIVE_SPECS ""
kono
parents:
diff changeset
942 # define EXTRA_SPEC_FUNCTIONS MCPU_TO_MARCH_SPEC_FUNCTIONS
kono
parents:
diff changeset
943 #endif
kono
parents:
diff changeset
944
kono
parents:
diff changeset
945 #define ASM_CPU_SPEC \
kono
parents:
diff changeset
946 MCPU_TO_MARCH_SPEC
kono
parents:
diff changeset
947
kono
parents:
diff changeset
948 #define EXTRA_SPECS \
kono
parents:
diff changeset
949 { "asm_cpu_spec", ASM_CPU_SPEC }
kono
parents:
diff changeset
950
kono
parents:
diff changeset
951 #define ASM_OUTPUT_POOL_EPILOGUE aarch64_asm_output_pool_epilogue
kono
parents:
diff changeset
952
kono
parents:
diff changeset
953 /* This type is the user-visible __fp16, and a pointer to that type. We
kono
parents:
diff changeset
954 need it in many places in the backend. Defined in aarch64-builtins.c. */
kono
parents:
diff changeset
955 extern tree aarch64_fp16_type_node;
kono
parents:
diff changeset
956 extern tree aarch64_fp16_ptr_type_node;
kono
parents:
diff changeset
957
kono
parents:
diff changeset
958 /* The generic unwind code in libgcc does not initialize the frame pointer.
kono
parents:
diff changeset
959 So in order to unwind a function using a frame pointer, the very first
kono
parents:
diff changeset
960 function that is unwound must save the frame pointer. That way the frame
kono
parents:
diff changeset
961 pointer is restored and its value is now valid - otherwise _Unwind_GetGR
kono
parents:
diff changeset
962 crashes. Libgcc can now be safely built with -fomit-frame-pointer. */
kono
parents:
diff changeset
963 #define LIBGCC2_UNWIND_ATTRIBUTE \
kono
parents:
diff changeset
964 __attribute__((optimize ("no-omit-frame-pointer")))
kono
parents:
diff changeset
965
kono
parents:
diff changeset
966 #endif /* GCC_AARCH64_H */