arm.h revision 1.1.1.1.4.2 1 1.1.1.1.4.2 yamt /* Definitions of target machine for GNU compiler, for ARM.
2 1.1.1.1.4.2 yamt Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
3 1.1.1.1.4.2 yamt 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
4 1.1.1.1.4.2 yamt Free Software Foundation, Inc.
5 1.1.1.1.4.2 yamt Contributed by Pieter `Tiggr' Schoenmakers (rcpieter (at) win.tue.nl)
6 1.1.1.1.4.2 yamt and Martin Simmons (@harleqn.co.uk).
7 1.1.1.1.4.2 yamt More major hacks by Richard Earnshaw (rearnsha (at) arm.com)
8 1.1.1.1.4.2 yamt Minor hacks by Nick Clifton (nickc (at) cygnus.com)
9 1.1.1.1.4.2 yamt
10 1.1.1.1.4.2 yamt This file is part of GCC.
11 1.1.1.1.4.2 yamt
12 1.1.1.1.4.2 yamt GCC is free software; you can redistribute it and/or modify it
13 1.1.1.1.4.2 yamt under the terms of the GNU General Public License as published
14 1.1.1.1.4.2 yamt by the Free Software Foundation; either version 3, or (at your
15 1.1.1.1.4.2 yamt option) any later version.
16 1.1.1.1.4.2 yamt
17 1.1.1.1.4.2 yamt GCC is distributed in the hope that it will be useful, but WITHOUT
18 1.1.1.1.4.2 yamt ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 1.1.1.1.4.2 yamt or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
20 1.1.1.1.4.2 yamt License for more details.
21 1.1.1.1.4.2 yamt
22 1.1.1.1.4.2 yamt You should have received a copy of the GNU General Public License
23 1.1.1.1.4.2 yamt along with GCC; see the file COPYING3. If not see
24 1.1.1.1.4.2 yamt <http://www.gnu.org/licenses/>. */
25 1.1.1.1.4.2 yamt
26 1.1.1.1.4.2 yamt #ifndef GCC_ARM_H
27 1.1.1.1.4.2 yamt #define GCC_ARM_H
28 1.1.1.1.4.2 yamt
29 1.1.1.1.4.2 yamt /* We can't use enum machine_mode inside a generator file because it
30 1.1.1.1.4.2 yamt hasn't been created yet; we shouldn't be using any code that
31 1.1.1.1.4.2 yamt needs the real definition though, so this ought to be safe. */
32 1.1.1.1.4.2 yamt #ifdef GENERATOR_FILE
33 1.1.1.1.4.2 yamt #define MACHMODE int
34 1.1.1.1.4.2 yamt #else
35 1.1.1.1.4.2 yamt #include "insn-modes.h"
36 1.1.1.1.4.2 yamt #define MACHMODE enum machine_mode
37 1.1.1.1.4.2 yamt #endif
38 1.1.1.1.4.2 yamt
39 1.1.1.1.4.2 yamt #include "config/vxworks-dummy.h"
40 1.1.1.1.4.2 yamt
41 1.1.1.1.4.2 yamt /* The architecture define. */
42 1.1.1.1.4.2 yamt extern char arm_arch_name[];
43 1.1.1.1.4.2 yamt
44 1.1.1.1.4.2 yamt /* Target CPU builtins. */
45 1.1.1.1.4.2 yamt #define TARGET_CPU_CPP_BUILTINS() \
46 1.1.1.1.4.2 yamt do \
47 1.1.1.1.4.2 yamt { \
48 1.1.1.1.4.2 yamt /* Define __arm__ even when in thumb mode, for \
49 1.1.1.1.4.2 yamt consistency with armcc. */ \
50 1.1.1.1.4.2 yamt builtin_define ("__arm__"); \
51 1.1.1.1.4.2 yamt builtin_define ("__APCS_32__"); \
52 1.1.1.1.4.2 yamt if (TARGET_THUMB) \
53 1.1.1.1.4.2 yamt builtin_define ("__thumb__"); \
54 1.1.1.1.4.2 yamt if (TARGET_THUMB2) \
55 1.1.1.1.4.2 yamt builtin_define ("__thumb2__"); \
56 1.1.1.1.4.2 yamt \
57 1.1.1.1.4.2 yamt if (TARGET_BIG_END) \
58 1.1.1.1.4.2 yamt { \
59 1.1.1.1.4.2 yamt builtin_define ("__ARMEB__"); \
60 1.1.1.1.4.2 yamt if (TARGET_THUMB) \
61 1.1.1.1.4.2 yamt builtin_define ("__THUMBEB__"); \
62 1.1.1.1.4.2 yamt if (TARGET_LITTLE_WORDS) \
63 1.1.1.1.4.2 yamt builtin_define ("__ARMWEL__"); \
64 1.1.1.1.4.2 yamt } \
65 1.1.1.1.4.2 yamt else \
66 1.1.1.1.4.2 yamt { \
67 1.1.1.1.4.2 yamt builtin_define ("__ARMEL__"); \
68 1.1.1.1.4.2 yamt if (TARGET_THUMB) \
69 1.1.1.1.4.2 yamt builtin_define ("__THUMBEL__"); \
70 1.1.1.1.4.2 yamt } \
71 1.1.1.1.4.2 yamt \
72 1.1.1.1.4.2 yamt if (TARGET_SOFT_FLOAT) \
73 1.1.1.1.4.2 yamt builtin_define ("__SOFTFP__"); \
74 1.1.1.1.4.2 yamt \
75 1.1.1.1.4.2 yamt if (TARGET_VFP) \
76 1.1.1.1.4.2 yamt builtin_define ("__VFP_FP__"); \
77 1.1.1.1.4.2 yamt \
78 1.1.1.1.4.2 yamt if (TARGET_NEON) \
79 1.1.1.1.4.2 yamt builtin_define ("__ARM_NEON__"); \
80 1.1.1.1.4.2 yamt \
81 1.1.1.1.4.2 yamt /* Add a define for interworking. \
82 1.1.1.1.4.2 yamt Needed when building libgcc.a. */ \
83 1.1.1.1.4.2 yamt if (arm_cpp_interwork) \
84 1.1.1.1.4.2 yamt builtin_define ("__THUMB_INTERWORK__"); \
85 1.1.1.1.4.2 yamt \
86 1.1.1.1.4.2 yamt builtin_assert ("cpu=arm"); \
87 1.1.1.1.4.2 yamt builtin_assert ("machine=arm"); \
88 1.1.1.1.4.2 yamt \
89 1.1.1.1.4.2 yamt builtin_define (arm_arch_name); \
90 1.1.1.1.4.2 yamt if (arm_arch_cirrus) \
91 1.1.1.1.4.2 yamt builtin_define ("__MAVERICK__"); \
92 1.1.1.1.4.2 yamt if (arm_arch_xscale) \
93 1.1.1.1.4.2 yamt builtin_define ("__XSCALE__"); \
94 1.1.1.1.4.2 yamt if (arm_arch_iwmmxt) \
95 1.1.1.1.4.2 yamt builtin_define ("__IWMMXT__"); \
96 1.1.1.1.4.2 yamt if (TARGET_AAPCS_BASED) \
97 1.1.1.1.4.2 yamt { \
98 1.1.1.1.4.2 yamt builtin_define ("__ARM_EABI__"); \
99 1.1.1.1.4.2 yamt builtin_define ("__ARM_PCS"); \
100 1.1.1.1.4.2 yamt if (TARGET_HARD_FLOAT && TARGET_VFP) \
101 1.1.1.1.4.2 yamt builtin_define ("__ARM_PCS_VFP"); \
102 1.1.1.1.4.2 yamt } \
103 1.1.1.1.4.2 yamt if (TARGET_IDIV) \
104 1.1.1.1.4.2 yamt builtin_define ("__ARM_ARCH_EXT_IDIV__"); \
105 1.1.1.1.4.2 yamt } while (0)
106 1.1.1.1.4.2 yamt
107 1.1.1.1.4.2 yamt /* The various ARM cores. */
108 1.1.1.1.4.2 yamt enum processor_type
109 1.1.1.1.4.2 yamt {
110 1.1.1.1.4.2 yamt #define ARM_CORE(NAME, IDENT, ARCH, FLAGS, COSTS) \
111 1.1.1.1.4.2 yamt IDENT,
112 1.1.1.1.4.2 yamt #include "arm-cores.def"
113 1.1.1.1.4.2 yamt #undef ARM_CORE
114 1.1.1.1.4.2 yamt /* Used to indicate that no processor has been specified. */
115 1.1.1.1.4.2 yamt arm_none
116 1.1.1.1.4.2 yamt };
117 1.1.1.1.4.2 yamt
118 1.1.1.1.4.2 yamt enum target_cpus
119 1.1.1.1.4.2 yamt {
120 1.1.1.1.4.2 yamt #define ARM_CORE(NAME, IDENT, ARCH, FLAGS, COSTS) \
121 1.1.1.1.4.2 yamt TARGET_CPU_##IDENT,
122 1.1.1.1.4.2 yamt #include "arm-cores.def"
123 1.1.1.1.4.2 yamt #undef ARM_CORE
124 1.1.1.1.4.2 yamt TARGET_CPU_generic
125 1.1.1.1.4.2 yamt };
126 1.1.1.1.4.2 yamt
127 1.1.1.1.4.2 yamt /* The processor for which instructions should be scheduled. */
128 1.1.1.1.4.2 yamt extern enum processor_type arm_tune;
129 1.1.1.1.4.2 yamt
130 1.1.1.1.4.2 yamt typedef enum arm_cond_code
131 1.1.1.1.4.2 yamt {
132 1.1.1.1.4.2 yamt ARM_EQ = 0, ARM_NE, ARM_CS, ARM_CC, ARM_MI, ARM_PL, ARM_VS, ARM_VC,
133 1.1.1.1.4.2 yamt ARM_HI, ARM_LS, ARM_GE, ARM_LT, ARM_GT, ARM_LE, ARM_AL, ARM_NV
134 1.1.1.1.4.2 yamt }
135 1.1.1.1.4.2 yamt arm_cc;
136 1.1.1.1.4.2 yamt
137 1.1.1.1.4.2 yamt extern arm_cc arm_current_cc;
138 1.1.1.1.4.2 yamt
139 1.1.1.1.4.2 yamt #define ARM_INVERSE_CONDITION_CODE(X) ((arm_cc) (((int)X) ^ 1))
140 1.1.1.1.4.2 yamt
141 1.1.1.1.4.2 yamt extern int arm_target_label;
142 1.1.1.1.4.2 yamt extern int arm_ccfsm_state;
143 1.1.1.1.4.2 yamt extern GTY(()) rtx arm_target_insn;
144 1.1.1.1.4.2 yamt /* The label of the current constant pool. */
145 1.1.1.1.4.2 yamt extern rtx pool_vector_label;
146 1.1.1.1.4.2 yamt /* Set to 1 when a return insn is output, this means that the epilogue
147 1.1.1.1.4.2 yamt is not needed. */
148 1.1.1.1.4.2 yamt extern int return_used_this_function;
149 1.1.1.1.4.2 yamt /* Callback to output language specific object attributes. */
150 1.1.1.1.4.2 yamt extern void (*arm_lang_output_object_attributes_hook)(void);
151 1.1.1.1.4.2 yamt
152 1.1.1.1.4.2 yamt /* Just in case configure has failed to define anything. */
154 1.1.1.1.4.2 yamt #ifndef TARGET_CPU_DEFAULT
155 1.1.1.1.4.2 yamt #define TARGET_CPU_DEFAULT TARGET_CPU_generic
156 1.1.1.1.4.2 yamt #endif
157 1.1.1.1.4.2 yamt
158 1.1.1.1.4.2 yamt
159 1.1.1.1.4.2 yamt #undef CPP_SPEC
160 1.1.1.1.4.2 yamt #define CPP_SPEC "%(subtarget_cpp_spec) \
161 1.1.1.1.4.2 yamt %{msoft-float:%{mhard-float: \
162 1.1.1.1.4.2 yamt %e-msoft-float and -mhard_float may not be used together}} \
163 1.1.1.1.4.2 yamt %{mbig-endian:%{mlittle-endian: \
164 1.1.1.1.4.2 yamt %e-mbig-endian and -mlittle-endian may not be used together}}"
165 1.1.1.1.4.2 yamt
166 1.1.1.1.4.2 yamt #ifndef CC1_SPEC
167 1.1.1.1.4.2 yamt #define CC1_SPEC ""
168 1.1.1.1.4.2 yamt #endif
169 1.1.1.1.4.2 yamt
170 1.1.1.1.4.2 yamt /* This macro defines names of additional specifications to put in the specs
171 1.1.1.1.4.2 yamt that can be used in various specifications like CC1_SPEC. Its definition
172 1.1.1.1.4.2 yamt is an initializer with a subgrouping for each command option.
173 1.1.1.1.4.2 yamt
174 1.1.1.1.4.2 yamt Each subgrouping contains a string constant, that defines the
175 1.1.1.1.4.2 yamt specification name, and a string constant that used by the GCC driver
176 1.1.1.1.4.2 yamt program.
177 1.1.1.1.4.2 yamt
178 1.1.1.1.4.2 yamt Do not define this macro if it does not need to do anything. */
179 1.1.1.1.4.2 yamt #define EXTRA_SPECS \
180 1.1.1.1.4.2 yamt { "subtarget_cpp_spec", SUBTARGET_CPP_SPEC }, \
181 1.1.1.1.4.2 yamt SUBTARGET_EXTRA_SPECS
182 1.1.1.1.4.2 yamt
183 1.1.1.1.4.2 yamt #ifndef SUBTARGET_EXTRA_SPECS
184 1.1.1.1.4.2 yamt #define SUBTARGET_EXTRA_SPECS
185 1.1.1.1.4.2 yamt #endif
186 1.1.1.1.4.2 yamt
187 1.1.1.1.4.2 yamt #ifndef SUBTARGET_CPP_SPEC
188 1.1.1.1.4.2 yamt #define SUBTARGET_CPP_SPEC ""
189 1.1.1.1.4.2 yamt #endif
190 1.1.1.1.4.2 yamt
191 1.1.1.1.4.2 yamt /* Run-time Target Specification. */
193 1.1.1.1.4.2 yamt #ifndef TARGET_VERSION
194 1.1.1.1.4.2 yamt #define TARGET_VERSION fputs (" (ARM/generic)", stderr);
195 1.1.1.1.4.2 yamt #endif
196 1.1.1.1.4.2 yamt
197 1.1.1.1.4.2 yamt #define TARGET_SOFT_FLOAT (arm_float_abi == ARM_FLOAT_ABI_SOFT)
198 1.1.1.1.4.2 yamt /* Use hardware floating point instructions. */
199 1.1.1.1.4.2 yamt #define TARGET_HARD_FLOAT (arm_float_abi != ARM_FLOAT_ABI_SOFT)
200 1.1.1.1.4.2 yamt /* Use hardware floating point calling convention. */
201 1.1.1.1.4.2 yamt #define TARGET_HARD_FLOAT_ABI (arm_float_abi == ARM_FLOAT_ABI_HARD)
202 1.1.1.1.4.2 yamt #define TARGET_FPA (arm_fpu_desc->model == ARM_FP_MODEL_FPA)
203 1.1.1.1.4.2 yamt #define TARGET_MAVERICK (arm_fpu_desc->model == ARM_FP_MODEL_MAVERICK)
204 1.1.1.1.4.2 yamt #define TARGET_VFP (arm_fpu_desc->model == ARM_FP_MODEL_VFP)
205 1.1.1.1.4.2 yamt #define TARGET_IWMMXT (arm_arch_iwmmxt)
206 1.1.1.1.4.2 yamt #define TARGET_REALLY_IWMMXT (TARGET_IWMMXT && TARGET_32BIT)
207 1.1.1.1.4.2 yamt #define TARGET_IWMMXT_ABI (TARGET_32BIT && arm_abi == ARM_ABI_IWMMXT)
208 1.1.1.1.4.2 yamt #define TARGET_ARM (! TARGET_THUMB)
209 1.1.1.1.4.2 yamt #define TARGET_EITHER 1 /* (TARGET_ARM | TARGET_THUMB) */
210 1.1.1.1.4.2 yamt #define TARGET_BACKTRACE (leaf_function_p () \
211 1.1.1.1.4.2 yamt ? TARGET_TPCS_LEAF_FRAME \
212 1.1.1.1.4.2 yamt : TARGET_TPCS_FRAME)
213 1.1.1.1.4.2 yamt #define TARGET_LDRD (arm_arch5e && ARM_DOUBLEWORD_ALIGN)
214 1.1.1.1.4.2 yamt #define TARGET_AAPCS_BASED \
215 1.1.1.1.4.2 yamt (arm_abi != ARM_ABI_APCS && arm_abi != ARM_ABI_ATPCS)
216 1.1.1.1.4.2 yamt
217 1.1.1.1.4.2 yamt #define TARGET_HARD_TP (target_thread_pointer == TP_CP15)
218 1.1.1.1.4.2 yamt #define TARGET_SOFT_TP (target_thread_pointer == TP_SOFT)
219 1.1.1.1.4.2 yamt
220 1.1.1.1.4.2 yamt /* Only 16-bit thumb code. */
221 1.1.1.1.4.2 yamt #define TARGET_THUMB1 (TARGET_THUMB && !arm_arch_thumb2)
222 1.1.1.1.4.2 yamt /* Arm or Thumb-2 32-bit code. */
223 1.1.1.1.4.2 yamt #define TARGET_32BIT (TARGET_ARM || arm_arch_thumb2)
224 1.1.1.1.4.2 yamt /* 32-bit Thumb-2 code. */
225 1.1.1.1.4.2 yamt #define TARGET_THUMB2 (TARGET_THUMB && arm_arch_thumb2)
226 1.1.1.1.4.2 yamt /* Thumb-1 only. */
227 1.1.1.1.4.2 yamt #define TARGET_THUMB1_ONLY (TARGET_THUMB1 && !arm_arch_notm)
228 1.1.1.1.4.2 yamt /* FPA emulator without LFM. */
229 1.1.1.1.4.2 yamt #define TARGET_FPA_EMU2 (TARGET_FPA && arm_fpu_desc->rev == 2)
230 1.1.1.1.4.2 yamt
231 1.1.1.1.4.2 yamt /* The following two macros concern the ability to execute coprocessor
232 1.1.1.1.4.2 yamt instructions for VFPv3 or NEON. TARGET_VFP3/TARGET_VFPD32 are currently
233 1.1.1.1.4.2 yamt only ever tested when we know we are generating for VFP hardware; we need
234 1.1.1.1.4.2 yamt to be more careful with TARGET_NEON as noted below. */
235 1.1.1.1.4.2 yamt
236 1.1.1.1.4.2 yamt /* FPU is has the full VFPv3/NEON register file of 32 D registers. */
237 1.1.1.1.4.2 yamt #define TARGET_VFPD32 (TARGET_VFP && arm_fpu_desc->regs == VFP_REG_D32)
238 1.1.1.1.4.2 yamt
239 1.1.1.1.4.2 yamt /* FPU supports VFPv3 instructions. */
240 1.1.1.1.4.2 yamt #define TARGET_VFP3 (TARGET_VFP && arm_fpu_desc->rev >= 3)
241 1.1.1.1.4.2 yamt
242 1.1.1.1.4.2 yamt /* FPU only supports VFP single-precision instructions. */
243 1.1.1.1.4.2 yamt #define TARGET_VFP_SINGLE (TARGET_VFP && arm_fpu_desc->regs == VFP_REG_SINGLE)
244 1.1.1.1.4.2 yamt
245 1.1.1.1.4.2 yamt /* FPU supports VFP double-precision instructions. */
246 1.1.1.1.4.2 yamt #define TARGET_VFP_DOUBLE (TARGET_VFP && arm_fpu_desc->regs != VFP_REG_SINGLE)
247 1.1.1.1.4.2 yamt
248 1.1.1.1.4.2 yamt /* FPU supports half-precision floating-point with NEON element load/store. */
249 1.1.1.1.4.2 yamt #define TARGET_NEON_FP16 \
250 1.1.1.1.4.2 yamt (TARGET_VFP && arm_fpu_desc->neon && arm_fpu_desc->fp16)
251 1.1.1.1.4.2 yamt
252 1.1.1.1.4.2 yamt /* FPU supports VFP half-precision floating-point. */
253 1.1.1.1.4.2 yamt #define TARGET_FP16 (TARGET_VFP && arm_fpu_desc->fp16)
254 1.1.1.1.4.2 yamt
255 1.1.1.1.4.2 yamt /* FPU supports Neon instructions. The setting of this macro gets
256 1.1.1.1.4.2 yamt revealed via __ARM_NEON__ so we add extra guards upon TARGET_32BIT
257 1.1.1.1.4.2 yamt and TARGET_HARD_FLOAT to ensure that NEON instructions are
258 1.1.1.1.4.2 yamt available. */
259 1.1.1.1.4.2 yamt #define TARGET_NEON (TARGET_32BIT && TARGET_HARD_FLOAT \
260 1.1.1.1.4.2 yamt && TARGET_VFP && arm_fpu_desc->neon)
261 1.1.1.1.4.2 yamt
262 1.1.1.1.4.2 yamt /* "DSP" multiply instructions, eg. SMULxy. */
263 1.1.1.1.4.2 yamt #define TARGET_DSP_MULTIPLY \
264 1.1.1.1.4.2 yamt (TARGET_32BIT && arm_arch5e && (arm_arch_notm || arm_arch7em))
265 1.1.1.1.4.2 yamt /* Integer SIMD instructions, and extend-accumulate instructions. */
266 1.1.1.1.4.2 yamt #define TARGET_INT_SIMD \
267 1.1.1.1.4.2 yamt (TARGET_32BIT && arm_arch6 && (arm_arch_notm || arm_arch7em))
268 1.1.1.1.4.2 yamt
269 1.1.1.1.4.2 yamt /* Should MOVW/MOVT be used in preference to a constant pool. */
270 1.1.1.1.4.2 yamt #define TARGET_USE_MOVT (arm_arch_thumb2 && !optimize_size)
271 1.1.1.1.4.2 yamt
272 1.1.1.1.4.2 yamt /* We could use unified syntax for arm mode, but for now we just use it
273 1.1.1.1.4.2 yamt for Thumb-2. */
274 1.1.1.1.4.2 yamt #define TARGET_UNIFIED_ASM TARGET_THUMB2
275 1.1.1.1.4.2 yamt
276 1.1.1.1.4.2 yamt /* Nonzero if integer division instructions supported. */
277 1.1.1.1.4.2 yamt #define TARGET_IDIV (arm_arch_hwdiv)
278 1.1.1.1.4.2 yamt
279 1.1.1.1.4.2 yamt /* True iff the full BPABI is being used. If TARGET_BPABI is true,
280 1.1.1.1.4.2 yamt then TARGET_AAPCS_BASED must be true -- but the converse does not
281 1.1.1.1.4.2 yamt hold. TARGET_BPABI implies the use of the BPABI runtime library,
282 1.1.1.1.4.2 yamt etc., in addition to just the AAPCS calling conventions. */
283 1.1.1.1.4.2 yamt #ifndef TARGET_BPABI
284 1.1.1.1.4.2 yamt #define TARGET_BPABI false
285 1.1.1.1.4.2 yamt #endif
286 1.1.1.1.4.2 yamt
287 1.1.1.1.4.2 yamt /* Support for a compile-time default CPU, et cetera. The rules are:
288 1.1.1.1.4.2 yamt --with-arch is ignored if -march or -mcpu are specified.
289 1.1.1.1.4.2 yamt --with-cpu is ignored if -march or -mcpu are specified, and is overridden
290 1.1.1.1.4.2 yamt by --with-arch.
291 1.1.1.1.4.2 yamt --with-tune is ignored if -mtune or -mcpu are specified (but not affected
292 1.1.1.1.4.2 yamt by -march).
293 1.1.1.1.4.2 yamt --with-float is ignored if -mhard-float, -msoft-float or -mfloat-abi are
294 1.1.1.1.4.2 yamt specified.
295 1.1.1.1.4.2 yamt --with-fpu is ignored if -mfpu is specified.
296 1.1.1.1.4.2 yamt --with-abi is ignored is -mabi is specified. */
297 1.1.1.1.4.2 yamt #define OPTION_DEFAULT_SPECS \
298 1.1.1.1.4.2 yamt {"arch", "%{!march=*:%{!mcpu=*:-march=%(VALUE)}}" }, \
299 1.1.1.1.4.2 yamt {"cpu", "%{!march=*:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \
300 1.1.1.1.4.2 yamt {"tune", "%{!mcpu=*:%{!mtune=*:-mtune=%(VALUE)}}" }, \
301 1.1.1.1.4.2 yamt {"float", \
302 1.1.1.1.4.2 yamt "%{!msoft-float:%{!mhard-float:%{!mfloat-abi=*:-mfloat-abi=%(VALUE)}}}" }, \
303 1.1.1.1.4.2 yamt {"fpu", "%{!mfpu=*:-mfpu=%(VALUE)}"}, \
304 1.1.1.1.4.2 yamt {"abi", "%{!mabi=*:-mabi=%(VALUE)}"}, \
305 1.1.1.1.4.2 yamt {"mode", "%{!marm:%{!mthumb:-m%(VALUE)}}"},
306 1.1.1.1.4.2 yamt
307 1.1.1.1.4.2 yamt /* Which floating point model to use. */
308 1.1.1.1.4.2 yamt enum arm_fp_model
309 1.1.1.1.4.2 yamt {
310 1.1.1.1.4.2 yamt ARM_FP_MODEL_UNKNOWN,
311 1.1.1.1.4.2 yamt /* FPA model (Hardware or software). */
312 1.1.1.1.4.2 yamt ARM_FP_MODEL_FPA,
313 1.1.1.1.4.2 yamt /* Cirrus Maverick floating point model. */
314 1.1.1.1.4.2 yamt ARM_FP_MODEL_MAVERICK,
315 1.1.1.1.4.2 yamt /* VFP floating point model. */
316 1.1.1.1.4.2 yamt ARM_FP_MODEL_VFP
317 1.1.1.1.4.2 yamt };
318 1.1.1.1.4.2 yamt
319 1.1.1.1.4.2 yamt enum vfp_reg_type
320 1.1.1.1.4.2 yamt {
321 1.1.1.1.4.2 yamt VFP_NONE = 0,
322 1.1.1.1.4.2 yamt VFP_REG_D16,
323 1.1.1.1.4.2 yamt VFP_REG_D32,
324 1.1.1.1.4.2 yamt VFP_REG_SINGLE
325 1.1.1.1.4.2 yamt };
326 1.1.1.1.4.2 yamt
327 1.1.1.1.4.2 yamt extern const struct arm_fpu_desc
328 1.1.1.1.4.2 yamt {
329 1.1.1.1.4.2 yamt const char *name;
330 1.1.1.1.4.2 yamt enum arm_fp_model model;
331 1.1.1.1.4.2 yamt int rev;
332 1.1.1.1.4.2 yamt enum vfp_reg_type regs;
333 1.1.1.1.4.2 yamt int neon;
334 1.1.1.1.4.2 yamt int fp16;
335 1.1.1.1.4.2 yamt } *arm_fpu_desc;
336 1.1.1.1.4.2 yamt
337 1.1.1.1.4.2 yamt /* Which floating point hardware to schedule for. */
338 1.1.1.1.4.2 yamt extern int arm_fpu_attr;
339 1.1.1.1.4.2 yamt
340 1.1.1.1.4.2 yamt enum float_abi_type
341 1.1.1.1.4.2 yamt {
342 1.1.1.1.4.2 yamt ARM_FLOAT_ABI_SOFT,
343 1.1.1.1.4.2 yamt ARM_FLOAT_ABI_SOFTFP,
344 1.1.1.1.4.2 yamt ARM_FLOAT_ABI_HARD
345 1.1.1.1.4.2 yamt };
346 1.1.1.1.4.2 yamt
347 1.1.1.1.4.2 yamt extern enum float_abi_type arm_float_abi;
348 1.1.1.1.4.2 yamt
349 1.1.1.1.4.2 yamt #ifndef TARGET_DEFAULT_FLOAT_ABI
350 1.1.1.1.4.2 yamt #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT
351 1.1.1.1.4.2 yamt #endif
352 1.1.1.1.4.2 yamt
353 1.1.1.1.4.2 yamt /* Which __fp16 format to use.
354 1.1.1.1.4.2 yamt The enumeration values correspond to the numbering for the
355 1.1.1.1.4.2 yamt Tag_ABI_FP_16bit_format attribute.
356 1.1.1.1.4.2 yamt */
357 1.1.1.1.4.2 yamt enum arm_fp16_format_type
358 1.1.1.1.4.2 yamt {
359 1.1.1.1.4.2 yamt ARM_FP16_FORMAT_NONE = 0,
360 1.1.1.1.4.2 yamt ARM_FP16_FORMAT_IEEE = 1,
361 1.1.1.1.4.2 yamt ARM_FP16_FORMAT_ALTERNATIVE = 2
362 1.1.1.1.4.2 yamt };
363 1.1.1.1.4.2 yamt
364 1.1.1.1.4.2 yamt extern enum arm_fp16_format_type arm_fp16_format;
365 1.1.1.1.4.2 yamt #define LARGEST_EXPONENT_IS_NORMAL(bits) \
366 1.1.1.1.4.2 yamt ((bits) == 16 && arm_fp16_format == ARM_FP16_FORMAT_ALTERNATIVE)
367 1.1.1.1.4.2 yamt
368 1.1.1.1.4.2 yamt /* Which ABI to use. */
369 1.1.1.1.4.2 yamt enum arm_abi_type
370 1.1.1.1.4.2 yamt {
371 1.1.1.1.4.2 yamt ARM_ABI_APCS,
372 1.1.1.1.4.2 yamt ARM_ABI_ATPCS,
373 1.1.1.1.4.2 yamt ARM_ABI_AAPCS,
374 1.1.1.1.4.2 yamt ARM_ABI_IWMMXT,
375 1.1.1.1.4.2 yamt ARM_ABI_AAPCS_LINUX
376 1.1.1.1.4.2 yamt };
377 1.1.1.1.4.2 yamt
378 1.1.1.1.4.2 yamt extern enum arm_abi_type arm_abi;
379 1.1.1.1.4.2 yamt
380 1.1.1.1.4.2 yamt #ifndef ARM_DEFAULT_ABI
381 1.1.1.1.4.2 yamt #define ARM_DEFAULT_ABI ARM_ABI_APCS
382 1.1.1.1.4.2 yamt #endif
383 1.1.1.1.4.2 yamt
384 1.1.1.1.4.2 yamt /* Which thread pointer access sequence to use. */
385 1.1.1.1.4.2 yamt enum arm_tp_type {
386 1.1.1.1.4.2 yamt TP_AUTO,
387 1.1.1.1.4.2 yamt TP_SOFT,
388 1.1.1.1.4.2 yamt TP_CP15
389 1.1.1.1.4.2 yamt };
390 1.1.1.1.4.2 yamt
391 1.1.1.1.4.2 yamt extern enum arm_tp_type target_thread_pointer;
392 1.1.1.1.4.2 yamt
393 1.1.1.1.4.2 yamt /* Nonzero if this chip supports the ARM Architecture 3M extensions. */
394 1.1.1.1.4.2 yamt extern int arm_arch3m;
395 1.1.1.1.4.2 yamt
396 1.1.1.1.4.2 yamt /* Nonzero if this chip supports the ARM Architecture 4 extensions. */
397 1.1.1.1.4.2 yamt extern int arm_arch4;
398 1.1.1.1.4.2 yamt
399 1.1.1.1.4.2 yamt /* Nonzero if this chip supports the ARM Architecture 4T extensions. */
400 1.1.1.1.4.2 yamt extern int arm_arch4t;
401 1.1.1.1.4.2 yamt
402 1.1.1.1.4.2 yamt /* Nonzero if this chip supports the ARM Architecture 5 extensions. */
403 1.1.1.1.4.2 yamt extern int arm_arch5;
404 1.1.1.1.4.2 yamt
405 1.1.1.1.4.2 yamt /* Nonzero if this chip supports the ARM Architecture 5E extensions. */
406 1.1.1.1.4.2 yamt extern int arm_arch5e;
407 1.1.1.1.4.2 yamt
408 1.1.1.1.4.2 yamt /* Nonzero if this chip supports the ARM Architecture 6 extensions. */
409 1.1.1.1.4.2 yamt extern int arm_arch6;
410 1.1.1.1.4.2 yamt
411 1.1.1.1.4.2 yamt /* Nonzero if instructions not present in the 'M' profile can be used. */
412 1.1.1.1.4.2 yamt extern int arm_arch_notm;
413 1.1.1.1.4.2 yamt
414 1.1.1.1.4.2 yamt /* Nonzero if instructions present in ARMv7E-M can be used. */
415 1.1.1.1.4.2 yamt extern int arm_arch7em;
416 1.1.1.1.4.2 yamt
417 1.1.1.1.4.2 yamt /* Nonzero if this chip can benefit from load scheduling. */
418 1.1.1.1.4.2 yamt extern int arm_ld_sched;
419 1.1.1.1.4.2 yamt
420 1.1.1.1.4.2 yamt /* Nonzero if generating thumb code. */
421 1.1.1.1.4.2 yamt extern int thumb_code;
422 1.1.1.1.4.2 yamt
423 1.1.1.1.4.2 yamt /* Nonzero if this chip is a StrongARM. */
424 1.1.1.1.4.2 yamt extern int arm_tune_strongarm;
425 1.1.1.1.4.2 yamt
426 1.1.1.1.4.2 yamt /* Nonzero if this chip is a Cirrus variant. */
427 1.1.1.1.4.2 yamt extern int arm_arch_cirrus;
428 1.1.1.1.4.2 yamt
429 1.1.1.1.4.2 yamt /* Nonzero if this chip supports Intel XScale with Wireless MMX technology. */
430 1.1.1.1.4.2 yamt extern int arm_arch_iwmmxt;
431 1.1.1.1.4.2 yamt
432 1.1.1.1.4.2 yamt /* Nonzero if this chip is an XScale. */
433 1.1.1.1.4.2 yamt extern int arm_arch_xscale;
434 1.1.1.1.4.2 yamt
435 1.1.1.1.4.2 yamt /* Nonzero if tuning for XScale. */
436 1.1.1.1.4.2 yamt extern int arm_tune_xscale;
437 1.1.1.1.4.2 yamt
438 1.1.1.1.4.2 yamt /* Nonzero if tuning for stores via the write buffer. */
439 1.1.1.1.4.2 yamt extern int arm_tune_wbuf;
440 1.1.1.1.4.2 yamt
441 1.1.1.1.4.2 yamt /* Nonzero if tuning for Cortex-A9. */
442 1.1.1.1.4.2 yamt extern int arm_tune_cortex_a9;
443 1.1.1.1.4.2 yamt
444 1.1.1.1.4.2 yamt /* Nonzero if we should define __THUMB_INTERWORK__ in the
445 1.1.1.1.4.2 yamt preprocessor.
446 1.1.1.1.4.2 yamt XXX This is a bit of a hack, it's intended to help work around
447 1.1.1.1.4.2 yamt problems in GLD which doesn't understand that armv5t code is
448 1.1.1.1.4.2 yamt interworking clean. */
449 1.1.1.1.4.2 yamt extern int arm_cpp_interwork;
450 1.1.1.1.4.2 yamt
451 1.1.1.1.4.2 yamt /* Nonzero if chip supports Thumb 2. */
452 1.1.1.1.4.2 yamt extern int arm_arch_thumb2;
453 1.1.1.1.4.2 yamt
454 1.1.1.1.4.2 yamt /* Nonzero if chip supports integer division instruction. */
455 1.1.1.1.4.2 yamt extern int arm_arch_hwdiv;
456 1.1.1.1.4.2 yamt
457 1.1.1.1.4.2 yamt #ifndef TARGET_DEFAULT
458 1.1.1.1.4.2 yamt #define TARGET_DEFAULT (MASK_APCS_FRAME)
459 1.1.1.1.4.2 yamt #endif
460 1.1.1.1.4.2 yamt
461 1.1.1.1.4.2 yamt /* The frame pointer register used in gcc has nothing to do with debugging;
462 1.1.1.1.4.2 yamt that is controlled by the APCS-FRAME option. */
463 1.1.1.1.4.2 yamt #define CAN_DEBUG_WITHOUT_FP
464 1.1.1.1.4.2 yamt
465 1.1.1.1.4.2 yamt #define OVERRIDE_OPTIONS arm_override_options ()
466 1.1.1.1.4.2 yamt
467 1.1.1.1.4.2 yamt #define OPTIMIZATION_OPTIONS(LEVEL,SIZE) \
468 1.1.1.1.4.2 yamt arm_optimization_options ((LEVEL), (SIZE))
469 1.1.1.1.4.2 yamt
470 1.1.1.1.4.2 yamt /* Nonzero if PIC code requires explicit qualifiers to generate
471 1.1.1.1.4.2 yamt PLT and GOT relocs rather than the assembler doing so implicitly.
472 1.1.1.1.4.2 yamt Subtargets can override these if required. */
473 1.1.1.1.4.2 yamt #ifndef NEED_GOT_RELOC
474 1.1.1.1.4.2 yamt #define NEED_GOT_RELOC 0
475 1.1.1.1.4.2 yamt #endif
476 1.1.1.1.4.2 yamt #ifndef NEED_PLT_RELOC
477 1.1.1.1.4.2 yamt #define NEED_PLT_RELOC 0
478 1.1.1.1.4.2 yamt #endif
479 1.1.1.1.4.2 yamt
480 1.1.1.1.4.2 yamt /* Nonzero if we need to refer to the GOT with a PC-relative
481 1.1.1.1.4.2 yamt offset. In other words, generate
482 1.1.1.1.4.2 yamt
483 1.1.1.1.4.2 yamt .word _GLOBAL_OFFSET_TABLE_ - [. - (.Lxx + 8)]
484 1.1.1.1.4.2 yamt
485 1.1.1.1.4.2 yamt rather than
486 1.1.1.1.4.2 yamt
487 1.1.1.1.4.2 yamt .word _GLOBAL_OFFSET_TABLE_ - (.Lxx + 8)
488 1.1.1.1.4.2 yamt
489 1.1.1.1.4.2 yamt The default is true, which matches NetBSD. Subtargets can
490 1.1.1.1.4.2 yamt override this if required. */
491 1.1.1.1.4.2 yamt #ifndef GOT_PCREL
492 1.1.1.1.4.2 yamt #define GOT_PCREL 1
493 1.1.1.1.4.2 yamt #endif
494 1.1.1.1.4.2 yamt
495 1.1.1.1.4.2 yamt /* Target machine storage Layout. */
497 1.1.1.1.4.2 yamt
498 1.1.1.1.4.2 yamt
499 1.1.1.1.4.2 yamt /* Define this macro if it is advisable to hold scalars in registers
500 1.1.1.1.4.2 yamt in a wider mode than that declared by the program. In such cases,
501 1.1.1.1.4.2 yamt the value is constrained to be within the bounds of the declared
502 1.1.1.1.4.2 yamt type, but kept valid in the wider mode. The signedness of the
503 1.1.1.1.4.2 yamt extension may differ from that of the type. */
504 1.1.1.1.4.2 yamt
505 1.1.1.1.4.2 yamt /* It is far faster to zero extend chars than to sign extend them */
506 1.1.1.1.4.2 yamt
507 1.1.1.1.4.2 yamt #define PROMOTE_MODE(MODE, UNSIGNEDP, TYPE) \
508 1.1.1.1.4.2 yamt if (GET_MODE_CLASS (MODE) == MODE_INT \
509 1.1.1.1.4.2 yamt && GET_MODE_SIZE (MODE) < 4) \
510 1.1.1.1.4.2 yamt { \
511 1.1.1.1.4.2 yamt if (MODE == QImode) \
512 1.1.1.1.4.2 yamt UNSIGNEDP = 1; \
513 1.1.1.1.4.2 yamt else if (MODE == HImode) \
514 1.1.1.1.4.2 yamt UNSIGNEDP = 1; \
515 1.1.1.1.4.2 yamt (MODE) = SImode; \
516 1.1.1.1.4.2 yamt }
517 1.1.1.1.4.2 yamt
518 1.1.1.1.4.2 yamt /* Define this if most significant bit is lowest numbered
519 1.1.1.1.4.2 yamt in instructions that operate on numbered bit-fields. */
520 1.1.1.1.4.2 yamt #define BITS_BIG_ENDIAN 0
521 1.1.1.1.4.2 yamt
522 1.1.1.1.4.2 yamt /* Define this if most significant byte of a word is the lowest numbered.
523 1.1.1.1.4.2 yamt Most ARM processors are run in little endian mode, so that is the default.
524 1.1.1.1.4.2 yamt If you want to have it run-time selectable, change the definition in a
525 1.1.1.1.4.2 yamt cover file to be TARGET_BIG_ENDIAN. */
526 1.1.1.1.4.2 yamt #define BYTES_BIG_ENDIAN (TARGET_BIG_END != 0)
527 1.1.1.1.4.2 yamt
528 1.1.1.1.4.2 yamt /* Define this if most significant word of a multiword number is the lowest
529 1.1.1.1.4.2 yamt numbered.
530 1.1.1.1.4.2 yamt This is always false, even when in big-endian mode. */
531 1.1.1.1.4.2 yamt #define WORDS_BIG_ENDIAN (BYTES_BIG_ENDIAN && ! TARGET_LITTLE_WORDS)
532 1.1.1.1.4.2 yamt
533 1.1.1.1.4.2 yamt /* LIBGCC2_WORDS_BIG_ENDIAN has to be a constant, so we define this based
534 1.1.1.1.4.2 yamt on processor pre-defineds when compiling libgcc2.c. */
535 1.1.1.1.4.2 yamt #if defined(__ARMEB__) && !defined(__ARMWEL__)
536 1.1.1.1.4.2 yamt #define LIBGCC2_WORDS_BIG_ENDIAN 1
537 1.1.1.1.4.2 yamt #else
538 1.1.1.1.4.2 yamt #define LIBGCC2_WORDS_BIG_ENDIAN 0
539 1.1.1.1.4.2 yamt #endif
540 1.1.1.1.4.2 yamt
541 1.1.1.1.4.2 yamt /* Define this if most significant word of doubles is the lowest numbered.
542 1.1.1.1.4.2 yamt The rules are different based on whether or not we use FPA-format,
543 1.1.1.1.4.2 yamt VFP-format or some other floating point co-processor's format doubles. */
544 1.1.1.1.4.2 yamt #define FLOAT_WORDS_BIG_ENDIAN (arm_float_words_big_endian ())
545 1.1.1.1.4.2 yamt
546 1.1.1.1.4.2 yamt #define UNITS_PER_WORD 4
547 1.1.1.1.4.2 yamt
548 1.1.1.1.4.2 yamt /* Use the option -mvectorize-with-neon-quad to override the use of doubleword
549 1.1.1.1.4.2 yamt registers when autovectorizing for Neon, at least until multiple vector
550 1.1.1.1.4.2 yamt widths are supported properly by the middle-end. */
551 1.1.1.1.4.2 yamt #define UNITS_PER_SIMD_WORD(MODE) \
552 1.1.1.1.4.2 yamt (TARGET_NEON ? (TARGET_NEON_VECTORIZE_QUAD ? 16 : 8) : UNITS_PER_WORD)
553 1.1.1.1.4.2 yamt
554 1.1.1.1.4.2 yamt /* True if natural alignment is used for doubleword types. */
555 1.1.1.1.4.2 yamt #define ARM_DOUBLEWORD_ALIGN TARGET_AAPCS_BASED
556 1.1.1.1.4.2 yamt
557 1.1.1.1.4.2 yamt #define DOUBLEWORD_ALIGNMENT 64
558 1.1.1.1.4.2 yamt
559 1.1.1.1.4.2 yamt #define PARM_BOUNDARY 32
560 1.1.1.1.4.2 yamt
561 1.1.1.1.4.2 yamt #define STACK_BOUNDARY (ARM_DOUBLEWORD_ALIGN ? DOUBLEWORD_ALIGNMENT : 32)
562 1.1.1.1.4.2 yamt
563 1.1.1.1.4.2 yamt #define PREFERRED_STACK_BOUNDARY \
564 1.1.1.1.4.2 yamt (arm_abi == ARM_ABI_ATPCS ? 64 : STACK_BOUNDARY)
565 1.1.1.1.4.2 yamt
566 1.1.1.1.4.2 yamt #define FUNCTION_BOUNDARY ((TARGET_THUMB && optimize_size) ? 16 : 32)
567 1.1.1.1.4.2 yamt
568 1.1.1.1.4.2 yamt /* The lowest bit is used to indicate Thumb-mode functions, so the
569 1.1.1.1.4.2 yamt vbit must go into the delta field of pointers to member
570 1.1.1.1.4.2 yamt functions. */
571 1.1.1.1.4.2 yamt #define TARGET_PTRMEMFUNC_VBIT_LOCATION ptrmemfunc_vbit_in_delta
572 1.1.1.1.4.2 yamt
573 1.1.1.1.4.2 yamt #define EMPTY_FIELD_BOUNDARY 32
574 1.1.1.1.4.2 yamt
575 1.1.1.1.4.2 yamt #define BIGGEST_ALIGNMENT (ARM_DOUBLEWORD_ALIGN ? DOUBLEWORD_ALIGNMENT : 32)
576 1.1.1.1.4.2 yamt
577 1.1.1.1.4.2 yamt /* XXX Blah -- this macro is used directly by libobjc. Since it
578 1.1.1.1.4.2 yamt supports no vector modes, cut out the complexity and fall back
579 1.1.1.1.4.2 yamt on BIGGEST_FIELD_ALIGNMENT. */
580 1.1.1.1.4.2 yamt #ifdef IN_TARGET_LIBS
581 1.1.1.1.4.2 yamt #define BIGGEST_FIELD_ALIGNMENT 64
582 1.1.1.1.4.2 yamt #endif
583 1.1.1.1.4.2 yamt
584 1.1.1.1.4.2 yamt /* Make strings word-aligned so strcpy from constants will be faster. */
585 1.1.1.1.4.2 yamt #define CONSTANT_ALIGNMENT_FACTOR (TARGET_THUMB || ! arm_tune_xscale ? 1 : 2)
586 1.1.1.1.4.2 yamt
587 1.1.1.1.4.2 yamt #define CONSTANT_ALIGNMENT(EXP, ALIGN) \
588 1.1.1.1.4.2 yamt ((TREE_CODE (EXP) == STRING_CST \
589 1.1.1.1.4.2 yamt && !optimize_size \
590 1.1.1.1.4.2 yamt && (ALIGN) < BITS_PER_WORD * CONSTANT_ALIGNMENT_FACTOR) \
591 1.1.1.1.4.2 yamt ? BITS_PER_WORD * CONSTANT_ALIGNMENT_FACTOR : (ALIGN))
592 1.1.1.1.4.2 yamt
593 1.1.1.1.4.2 yamt /* Align definitions of arrays, unions and structures so that
594 1.1.1.1.4.2 yamt initializations and copies can be made more efficient. This is not
595 1.1.1.1.4.2 yamt ABI-changing, so it only affects places where we can see the
596 1.1.1.1.4.2 yamt definition. */
597 1.1.1.1.4.2 yamt #define DATA_ALIGNMENT(EXP, ALIGN) \
598 1.1.1.1.4.2 yamt ((((ALIGN) < BITS_PER_WORD) \
599 1.1.1.1.4.2 yamt && (TREE_CODE (EXP) == ARRAY_TYPE \
600 1.1.1.1.4.2 yamt || TREE_CODE (EXP) == UNION_TYPE \
601 1.1.1.1.4.2 yamt || TREE_CODE (EXP) == RECORD_TYPE)) ? BITS_PER_WORD : (ALIGN))
602 1.1.1.1.4.2 yamt
603 1.1.1.1.4.2 yamt /* Similarly, make sure that objects on the stack are sensibly aligned. */
604 1.1.1.1.4.2 yamt #define LOCAL_ALIGNMENT(EXP, ALIGN) DATA_ALIGNMENT(EXP, ALIGN)
605 1.1.1.1.4.2 yamt
606 1.1.1.1.4.2 yamt /* Setting STRUCTURE_SIZE_BOUNDARY to 32 produces more efficient code, but the
607 1.1.1.1.4.2 yamt value set in previous versions of this toolchain was 8, which produces more
608 1.1.1.1.4.2 yamt compact structures. The command line option -mstructure_size_boundary=<n>
609 1.1.1.1.4.2 yamt can be used to change this value. For compatibility with the ARM SDK
610 1.1.1.1.4.2 yamt however the value should be left at 32. ARM SDT Reference Manual (ARM DUI
611 1.1.1.1.4.2 yamt 0020D) page 2-20 says "Structures are aligned on word boundaries".
612 1.1.1.1.4.2 yamt The AAPCS specifies a value of 8. */
613 1.1.1.1.4.2 yamt #define STRUCTURE_SIZE_BOUNDARY arm_structure_size_boundary
614 1.1.1.1.4.2 yamt extern int arm_structure_size_boundary;
615 1.1.1.1.4.2 yamt
616 1.1.1.1.4.2 yamt /* This is the value used to initialize arm_structure_size_boundary. If a
617 1.1.1.1.4.2 yamt particular arm target wants to change the default value it should change
618 1.1.1.1.4.2 yamt the definition of this macro, not STRUCTURE_SIZE_BOUNDARY. See netbsd.h
619 1.1.1.1.4.2 yamt for an example of this. */
620 1.1.1.1.4.2 yamt #ifndef DEFAULT_STRUCTURE_SIZE_BOUNDARY
621 1.1.1.1.4.2 yamt #define DEFAULT_STRUCTURE_SIZE_BOUNDARY 32
622 1.1.1.1.4.2 yamt #endif
623 1.1.1.1.4.2 yamt
624 1.1.1.1.4.2 yamt /* Nonzero if move instructions will actually fail to work
625 1.1.1.1.4.2 yamt when given unaligned data. */
626 1.1.1.1.4.2 yamt #define STRICT_ALIGNMENT 1
627 1.1.1.1.4.2 yamt
628 1.1.1.1.4.2 yamt /* wchar_t is unsigned under the AAPCS. */
629 1.1.1.1.4.2 yamt #ifndef WCHAR_TYPE
630 1.1.1.1.4.2 yamt #define WCHAR_TYPE (TARGET_AAPCS_BASED ? "unsigned int" : "int")
631 1.1.1.1.4.2 yamt
632 1.1.1.1.4.2 yamt #define WCHAR_TYPE_SIZE BITS_PER_WORD
633 1.1.1.1.4.2 yamt #endif
634 1.1.1.1.4.2 yamt
635 1.1.1.1.4.2 yamt #ifndef SIZE_TYPE
636 1.1.1.1.4.2 yamt #define SIZE_TYPE (TARGET_AAPCS_BASED ? "unsigned int" : "long unsigned int")
637 1.1.1.1.4.2 yamt #endif
638 1.1.1.1.4.2 yamt
639 1.1.1.1.4.2 yamt #ifndef PTRDIFF_TYPE
640 1.1.1.1.4.2 yamt #define PTRDIFF_TYPE (TARGET_AAPCS_BASED ? "int" : "long int")
641 1.1.1.1.4.2 yamt #endif
642 1.1.1.1.4.2 yamt
643 1.1.1.1.4.2 yamt /* AAPCS requires that structure alignment is affected by bitfields. */
644 1.1.1.1.4.2 yamt #ifndef PCC_BITFIELD_TYPE_MATTERS
645 1.1.1.1.4.2 yamt #define PCC_BITFIELD_TYPE_MATTERS TARGET_AAPCS_BASED
646 1.1.1.1.4.2 yamt #endif
647 1.1.1.1.4.2 yamt
648 1.1.1.1.4.2 yamt
649 1.1.1.1.4.2 yamt /* Standard register usage. */
651 1.1.1.1.4.2 yamt
652 1.1.1.1.4.2 yamt /* Register allocation in ARM Procedure Call Standard (as used on RISCiX):
653 1.1.1.1.4.2 yamt (S - saved over call).
654 1.1.1.1.4.2 yamt
655 1.1.1.1.4.2 yamt r0 * argument word/integer result
656 1.1.1.1.4.2 yamt r1-r3 argument word
657 1.1.1.1.4.2 yamt
658 1.1.1.1.4.2 yamt r4-r8 S register variable
659 1.1.1.1.4.2 yamt r9 S (rfp) register variable (real frame pointer)
660 1.1.1.1.4.2 yamt
661 1.1.1.1.4.2 yamt r10 F S (sl) stack limit (used by -mapcs-stack-check)
662 1.1.1.1.4.2 yamt r11 F S (fp) argument pointer
663 1.1.1.1.4.2 yamt r12 (ip) temp workspace
664 1.1.1.1.4.2 yamt r13 F S (sp) lower end of current stack frame
665 1.1.1.1.4.2 yamt r14 (lr) link address/workspace
666 1.1.1.1.4.2 yamt r15 F (pc) program counter
667 1.1.1.1.4.2 yamt
668 1.1.1.1.4.2 yamt f0 floating point result
669 1.1.1.1.4.2 yamt f1-f3 floating point scratch
670 1.1.1.1.4.2 yamt
671 1.1.1.1.4.2 yamt f4-f7 S floating point variable
672 1.1.1.1.4.2 yamt
673 1.1.1.1.4.2 yamt cc This is NOT a real register, but is used internally
674 1.1.1.1.4.2 yamt to represent things that use or set the condition
675 1.1.1.1.4.2 yamt codes.
676 1.1.1.1.4.2 yamt sfp This isn't either. It is used during rtl generation
677 1.1.1.1.4.2 yamt since the offset between the frame pointer and the
678 1.1.1.1.4.2 yamt auto's isn't known until after register allocation.
679 1.1.1.1.4.2 yamt afp Nor this, we only need this because of non-local
680 1.1.1.1.4.2 yamt goto. Without it fp appears to be used and the
681 1.1.1.1.4.2 yamt elimination code won't get rid of sfp. It tracks
682 1.1.1.1.4.2 yamt fp exactly at all times.
683 1.1.1.1.4.2 yamt
684 1.1.1.1.4.2 yamt *: See CONDITIONAL_REGISTER_USAGE */
685 1.1.1.1.4.2 yamt
686 1.1.1.1.4.2 yamt /*
687 1.1.1.1.4.2 yamt mvf0 Cirrus floating point result
688 1.1.1.1.4.2 yamt mvf1-mvf3 Cirrus floating point scratch
689 1.1.1.1.4.2 yamt mvf4-mvf15 S Cirrus floating point variable. */
690 1.1.1.1.4.2 yamt
691 1.1.1.1.4.2 yamt /* s0-s15 VFP scratch (aka d0-d7).
692 1.1.1.1.4.2 yamt s16-s31 S VFP variable (aka d8-d15).
693 1.1.1.1.4.2 yamt vfpcc Not a real register. Represents the VFP condition
694 1.1.1.1.4.2 yamt code flags. */
695 1.1.1.1.4.2 yamt
696 1.1.1.1.4.2 yamt /* The stack backtrace structure is as follows:
697 1.1.1.1.4.2 yamt fp points to here: | save code pointer | [fp]
698 1.1.1.1.4.2 yamt | return link value | [fp, #-4]
699 1.1.1.1.4.2 yamt | return sp value | [fp, #-8]
700 1.1.1.1.4.2 yamt | return fp value | [fp, #-12]
701 1.1.1.1.4.2 yamt [| saved r10 value |]
702 1.1.1.1.4.2 yamt [| saved r9 value |]
703 1.1.1.1.4.2 yamt [| saved r8 value |]
704 1.1.1.1.4.2 yamt [| saved r7 value |]
705 1.1.1.1.4.2 yamt [| saved r6 value |]
706 1.1.1.1.4.2 yamt [| saved r5 value |]
707 1.1.1.1.4.2 yamt [| saved r4 value |]
708 1.1.1.1.4.2 yamt [| saved r3 value |]
709 1.1.1.1.4.2 yamt [| saved r2 value |]
710 1.1.1.1.4.2 yamt [| saved r1 value |]
711 1.1.1.1.4.2 yamt [| saved r0 value |]
712 1.1.1.1.4.2 yamt [| saved f7 value |] three words
713 1.1.1.1.4.2 yamt [| saved f6 value |] three words
714 1.1.1.1.4.2 yamt [| saved f5 value |] three words
715 1.1.1.1.4.2 yamt [| saved f4 value |] three words
716 1.1.1.1.4.2 yamt r0-r3 are not normally saved in a C function. */
717 1.1.1.1.4.2 yamt
718 1.1.1.1.4.2 yamt /* 1 for registers that have pervasive standard uses
719 1.1.1.1.4.2 yamt and are not available for the register allocator. */
720 1.1.1.1.4.2 yamt #define FIXED_REGISTERS \
721 1.1.1.1.4.2 yamt { \
722 1.1.1.1.4.2 yamt 0,0,0,0,0,0,0,0, \
723 1.1.1.1.4.2 yamt 0,0,0,0,0,1,0,1, \
724 1.1.1.1.4.2 yamt 0,0,0,0,0,0,0,0, \
725 1.1.1.1.4.2 yamt 1,1,1, \
726 1.1.1.1.4.2 yamt 1,1,1,1,1,1,1,1, \
727 1.1.1.1.4.2 yamt 1,1,1,1,1,1,1,1, \
728 1.1.1.1.4.2 yamt 1,1,1,1,1,1,1,1, \
729 1.1.1.1.4.2 yamt 1,1,1,1,1,1,1,1, \
730 1.1.1.1.4.2 yamt 1,1,1,1, \
731 1.1.1.1.4.2 yamt 1,1,1,1,1,1,1,1, \
732 1.1.1.1.4.2 yamt 1,1,1,1,1,1,1,1, \
733 1.1.1.1.4.2 yamt 1,1,1,1,1,1,1,1, \
734 1.1.1.1.4.2 yamt 1,1,1,1,1,1,1,1, \
735 1.1.1.1.4.2 yamt 1,1,1,1,1,1,1,1, \
736 1.1.1.1.4.2 yamt 1,1,1,1,1,1,1,1, \
737 1.1.1.1.4.2 yamt 1,1,1,1,1,1,1,1, \
738 1.1.1.1.4.2 yamt 1,1,1,1,1,1,1,1, \
739 1.1.1.1.4.2 yamt 1 \
740 1.1.1.1.4.2 yamt }
741 1.1.1.1.4.2 yamt
742 1.1.1.1.4.2 yamt /* 1 for registers not available across function calls.
743 1.1.1.1.4.2 yamt These must include the FIXED_REGISTERS and also any
744 1.1.1.1.4.2 yamt registers that can be used without being saved.
745 1.1.1.1.4.2 yamt The latter must include the registers where values are returned
746 1.1.1.1.4.2 yamt and the register where structure-value addresses are passed.
747 1.1.1.1.4.2 yamt Aside from that, you can include as many other registers as you like.
748 1.1.1.1.4.2 yamt The CC is not preserved over function calls on the ARM 6, so it is
749 1.1.1.1.4.2 yamt easier to assume this for all. SFP is preserved, since FP is. */
750 1.1.1.1.4.2 yamt #define CALL_USED_REGISTERS \
751 1.1.1.1.4.2 yamt { \
752 1.1.1.1.4.2 yamt 1,1,1,1,0,0,0,0, \
753 1.1.1.1.4.2 yamt 0,0,0,0,1,1,1,1, \
754 1.1.1.1.4.2 yamt 1,1,1,1,0,0,0,0, \
755 1.1.1.1.4.2 yamt 1,1,1, \
756 1.1.1.1.4.2 yamt 1,1,1,1,1,1,1,1, \
757 1.1.1.1.4.2 yamt 1,1,1,1,1,1,1,1, \
758 1.1.1.1.4.2 yamt 1,1,1,1,1,1,1,1, \
759 1.1.1.1.4.2 yamt 1,1,1,1,1,1,1,1, \
760 1.1.1.1.4.2 yamt 1,1,1,1, \
761 1.1.1.1.4.2 yamt 1,1,1,1,1,1,1,1, \
762 1.1.1.1.4.2 yamt 1,1,1,1,1,1,1,1, \
763 1.1.1.1.4.2 yamt 1,1,1,1,1,1,1,1, \
764 1.1.1.1.4.2 yamt 1,1,1,1,1,1,1,1, \
765 1.1.1.1.4.2 yamt 1,1,1,1,1,1,1,1, \
766 1.1.1.1.4.2 yamt 1,1,1,1,1,1,1,1, \
767 1.1.1.1.4.2 yamt 1,1,1,1,1,1,1,1, \
768 1.1.1.1.4.2 yamt 1,1,1,1,1,1,1,1, \
769 1.1.1.1.4.2 yamt 1 \
770 1.1.1.1.4.2 yamt }
771 1.1.1.1.4.2 yamt
772 1.1.1.1.4.2 yamt #ifndef SUBTARGET_CONDITIONAL_REGISTER_USAGE
773 1.1.1.1.4.2 yamt #define SUBTARGET_CONDITIONAL_REGISTER_USAGE
774 1.1.1.1.4.2 yamt #endif
775 1.1.1.1.4.2 yamt
776 1.1.1.1.4.2 yamt #define CONDITIONAL_REGISTER_USAGE \
777 1.1.1.1.4.2 yamt { \
778 1.1.1.1.4.2 yamt int regno; \
779 1.1.1.1.4.2 yamt \
780 1.1.1.1.4.2 yamt if (TARGET_SOFT_FLOAT || TARGET_THUMB1 || !TARGET_FPA) \
781 1.1.1.1.4.2 yamt { \
782 1.1.1.1.4.2 yamt for (regno = FIRST_FPA_REGNUM; \
783 1.1.1.1.4.2 yamt regno <= LAST_FPA_REGNUM; ++regno) \
784 1.1.1.1.4.2 yamt fixed_regs[regno] = call_used_regs[regno] = 1; \
785 1.1.1.1.4.2 yamt } \
786 1.1.1.1.4.2 yamt \
787 1.1.1.1.4.2 yamt if (TARGET_THUMB && optimize_size) \
788 1.1.1.1.4.2 yamt { \
789 1.1.1.1.4.2 yamt /* When optimizing for size, it's better not to use \
790 1.1.1.1.4.2 yamt the HI regs, because of the overhead of stacking \
791 1.1.1.1.4.2 yamt them. */ \
792 1.1.1.1.4.2 yamt /* ??? Is this still true for thumb2? */ \
793 1.1.1.1.4.2 yamt for (regno = FIRST_HI_REGNUM; \
794 1.1.1.1.4.2 yamt regno <= LAST_HI_REGNUM; ++regno) \
795 1.1.1.1.4.2 yamt fixed_regs[regno] = call_used_regs[regno] = 1; \
796 1.1.1.1.4.2 yamt } \
797 1.1.1.1.4.2 yamt \
798 1.1.1.1.4.2 yamt /* The link register can be clobbered by any branch insn, \
799 1.1.1.1.4.2 yamt but we have no way to track that at present, so mark \
800 1.1.1.1.4.2 yamt it as unavailable. */ \
801 1.1.1.1.4.2 yamt if (TARGET_THUMB1) \
802 1.1.1.1.4.2 yamt fixed_regs[LR_REGNUM] = call_used_regs[LR_REGNUM] = 1; \
803 1.1.1.1.4.2 yamt \
804 1.1.1.1.4.2 yamt if (TARGET_32BIT && TARGET_HARD_FLOAT) \
805 1.1.1.1.4.2 yamt { \
806 1.1.1.1.4.2 yamt if (TARGET_MAVERICK) \
807 1.1.1.1.4.2 yamt { \
808 1.1.1.1.4.2 yamt for (regno = FIRST_FPA_REGNUM; \
809 1.1.1.1.4.2 yamt regno <= LAST_FPA_REGNUM; ++ regno) \
810 1.1.1.1.4.2 yamt fixed_regs[regno] = call_used_regs[regno] = 1; \
811 1.1.1.1.4.2 yamt for (regno = FIRST_CIRRUS_FP_REGNUM; \
812 1.1.1.1.4.2 yamt regno <= LAST_CIRRUS_FP_REGNUM; ++ regno) \
813 1.1.1.1.4.2 yamt { \
814 1.1.1.1.4.2 yamt fixed_regs[regno] = 0; \
815 1.1.1.1.4.2 yamt call_used_regs[regno] = regno < FIRST_CIRRUS_FP_REGNUM + 4; \
816 1.1.1.1.4.2 yamt } \
817 1.1.1.1.4.2 yamt } \
818 1.1.1.1.4.2 yamt if (TARGET_VFP) \
819 1.1.1.1.4.2 yamt { \
820 1.1.1.1.4.2 yamt /* VFPv3 registers are disabled when earlier VFP \
821 1.1.1.1.4.2 yamt versions are selected due to the definition of \
822 1.1.1.1.4.2 yamt LAST_VFP_REGNUM. */ \
823 1.1.1.1.4.2 yamt for (regno = FIRST_VFP_REGNUM; \
824 1.1.1.1.4.2 yamt regno <= LAST_VFP_REGNUM; ++ regno) \
825 1.1.1.1.4.2 yamt { \
826 1.1.1.1.4.2 yamt fixed_regs[regno] = 0; \
827 1.1.1.1.4.2 yamt call_used_regs[regno] = regno < FIRST_VFP_REGNUM + 16 \
828 1.1.1.1.4.2 yamt || regno >= FIRST_VFP_REGNUM + 32; \
829 1.1.1.1.4.2 yamt } \
830 1.1.1.1.4.2 yamt } \
831 1.1.1.1.4.2 yamt } \
832 1.1.1.1.4.2 yamt \
833 1.1.1.1.4.2 yamt if (TARGET_REALLY_IWMMXT) \
834 1.1.1.1.4.2 yamt { \
835 1.1.1.1.4.2 yamt regno = FIRST_IWMMXT_GR_REGNUM; \
836 1.1.1.1.4.2 yamt /* The 2002/10/09 revision of the XScale ABI has wCG0 \
837 1.1.1.1.4.2 yamt and wCG1 as call-preserved registers. The 2002/11/21 \
838 1.1.1.1.4.2 yamt revision changed this so that all wCG registers are \
839 1.1.1.1.4.2 yamt scratch registers. */ \
840 1.1.1.1.4.2 yamt for (regno = FIRST_IWMMXT_GR_REGNUM; \
841 1.1.1.1.4.2 yamt regno <= LAST_IWMMXT_GR_REGNUM; ++ regno) \
842 1.1.1.1.4.2 yamt fixed_regs[regno] = 0; \
843 1.1.1.1.4.2 yamt /* The XScale ABI has wR0 - wR9 as scratch registers, \
844 1.1.1.1.4.2 yamt the rest as call-preserved registers. */ \
845 1.1.1.1.4.2 yamt for (regno = FIRST_IWMMXT_REGNUM; \
846 1.1.1.1.4.2 yamt regno <= LAST_IWMMXT_REGNUM; ++ regno) \
847 1.1.1.1.4.2 yamt { \
848 1.1.1.1.4.2 yamt fixed_regs[regno] = 0; \
849 1.1.1.1.4.2 yamt call_used_regs[regno] = regno < FIRST_IWMMXT_REGNUM + 10; \
850 1.1.1.1.4.2 yamt } \
851 1.1.1.1.4.2 yamt } \
852 1.1.1.1.4.2 yamt \
853 1.1.1.1.4.2 yamt if ((unsigned) PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM) \
854 1.1.1.1.4.2 yamt { \
855 1.1.1.1.4.2 yamt fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \
856 1.1.1.1.4.2 yamt call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \
857 1.1.1.1.4.2 yamt } \
858 1.1.1.1.4.2 yamt else if (TARGET_APCS_STACK) \
859 1.1.1.1.4.2 yamt { \
860 1.1.1.1.4.2 yamt fixed_regs[10] = 1; \
861 1.1.1.1.4.2 yamt call_used_regs[10] = 1; \
862 1.1.1.1.4.2 yamt } \
863 1.1.1.1.4.2 yamt /* -mcaller-super-interworking reserves r11 for calls to \
864 1.1.1.1.4.2 yamt _interwork_r11_call_via_rN(). Making the register global \
865 1.1.1.1.4.2 yamt is an easy way of ensuring that it remains valid for all \
866 1.1.1.1.4.2 yamt calls. */ \
867 1.1.1.1.4.2 yamt if (TARGET_APCS_FRAME || TARGET_CALLER_INTERWORKING \
868 1.1.1.1.4.2 yamt || TARGET_TPCS_FRAME || TARGET_TPCS_LEAF_FRAME) \
869 1.1.1.1.4.2 yamt { \
870 1.1.1.1.4.2 yamt fixed_regs[ARM_HARD_FRAME_POINTER_REGNUM] = 1; \
871 1.1.1.1.4.2 yamt call_used_regs[ARM_HARD_FRAME_POINTER_REGNUM] = 1; \
872 1.1.1.1.4.2 yamt if (TARGET_CALLER_INTERWORKING) \
873 1.1.1.1.4.2 yamt global_regs[ARM_HARD_FRAME_POINTER_REGNUM] = 1; \
874 1.1.1.1.4.2 yamt } \
875 1.1.1.1.4.2 yamt SUBTARGET_CONDITIONAL_REGISTER_USAGE \
876 1.1.1.1.4.2 yamt }
877 1.1.1.1.4.2 yamt
878 1.1.1.1.4.2 yamt /* These are a couple of extensions to the formats accepted
879 1.1.1.1.4.2 yamt by asm_fprintf:
880 1.1.1.1.4.2 yamt %@ prints out ASM_COMMENT_START
881 1.1.1.1.4.2 yamt %r prints out REGISTER_PREFIX reg_names[arg] */
882 1.1.1.1.4.2 yamt #define ASM_FPRINTF_EXTENSIONS(FILE, ARGS, P) \
883 1.1.1.1.4.2 yamt case '@': \
884 1.1.1.1.4.2 yamt fputs (ASM_COMMENT_START, FILE); \
885 1.1.1.1.4.2 yamt break; \
886 1.1.1.1.4.2 yamt \
887 1.1.1.1.4.2 yamt case 'r': \
888 1.1.1.1.4.2 yamt fputs (REGISTER_PREFIX, FILE); \
889 1.1.1.1.4.2 yamt fputs (reg_names [va_arg (ARGS, int)], FILE); \
890 1.1.1.1.4.2 yamt break;
891 1.1.1.1.4.2 yamt
892 1.1.1.1.4.2 yamt /* Round X up to the nearest word. */
893 1.1.1.1.4.2 yamt #define ROUND_UP_WORD(X) (((X) + 3) & ~3)
894 1.1.1.1.4.2 yamt
895 1.1.1.1.4.2 yamt /* Convert fron bytes to ints. */
896 1.1.1.1.4.2 yamt #define ARM_NUM_INTS(X) (((X) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
897 1.1.1.1.4.2 yamt
898 1.1.1.1.4.2 yamt /* The number of (integer) registers required to hold a quantity of type MODE.
899 1.1.1.1.4.2 yamt Also used for VFP registers. */
900 1.1.1.1.4.2 yamt #define ARM_NUM_REGS(MODE) \
901 1.1.1.1.4.2 yamt ARM_NUM_INTS (GET_MODE_SIZE (MODE))
902 1.1.1.1.4.2 yamt
903 1.1.1.1.4.2 yamt /* The number of (integer) registers required to hold a quantity of TYPE MODE. */
904 1.1.1.1.4.2 yamt #define ARM_NUM_REGS2(MODE, TYPE) \
905 1.1.1.1.4.2 yamt ARM_NUM_INTS ((MODE) == BLKmode ? \
906 1.1.1.1.4.2 yamt int_size_in_bytes (TYPE) : GET_MODE_SIZE (MODE))
907 1.1.1.1.4.2 yamt
908 1.1.1.1.4.2 yamt /* The number of (integer) argument register available. */
909 1.1.1.1.4.2 yamt #define NUM_ARG_REGS 4
910 1.1.1.1.4.2 yamt
911 1.1.1.1.4.2 yamt /* And similarly for the VFP. */
912 1.1.1.1.4.2 yamt #define NUM_VFP_ARG_REGS 16
913 1.1.1.1.4.2 yamt
914 1.1.1.1.4.2 yamt /* Return the register number of the N'th (integer) argument. */
915 1.1.1.1.4.2 yamt #define ARG_REGISTER(N) (N - 1)
916 1.1.1.1.4.2 yamt
917 1.1.1.1.4.2 yamt /* Specify the registers used for certain standard purposes.
918 1.1.1.1.4.2 yamt The values of these macros are register numbers. */
919 1.1.1.1.4.2 yamt
920 1.1.1.1.4.2 yamt /* The number of the last argument register. */
921 1.1.1.1.4.2 yamt #define LAST_ARG_REGNUM ARG_REGISTER (NUM_ARG_REGS)
922 1.1.1.1.4.2 yamt
923 1.1.1.1.4.2 yamt /* The numbers of the Thumb register ranges. */
924 1.1.1.1.4.2 yamt #define FIRST_LO_REGNUM 0
925 1.1.1.1.4.2 yamt #define LAST_LO_REGNUM 7
926 1.1.1.1.4.2 yamt #define FIRST_HI_REGNUM 8
927 1.1.1.1.4.2 yamt #define LAST_HI_REGNUM 11
928 1.1.1.1.4.2 yamt
929 1.1.1.1.4.2 yamt #ifndef TARGET_UNWIND_INFO
930 1.1.1.1.4.2 yamt /* We use sjlj exceptions for backwards compatibility. */
931 1.1.1.1.4.2 yamt #define MUST_USE_SJLJ_EXCEPTIONS 1
932 1.1.1.1.4.2 yamt #endif
933 1.1.1.1.4.2 yamt
934 1.1.1.1.4.2 yamt /* We can generate DWARF2 Unwind info, even though we don't use it. */
935 1.1.1.1.4.2 yamt #define DWARF2_UNWIND_INFO 1
936 1.1.1.1.4.2 yamt
937 1.1.1.1.4.2 yamt /* Use r0 and r1 to pass exception handling information. */
938 1.1.1.1.4.2 yamt #define EH_RETURN_DATA_REGNO(N) (((N) < 2) ? N : INVALID_REGNUM)
939 1.1.1.1.4.2 yamt
940 1.1.1.1.4.2 yamt /* The register that holds the return address in exception handlers. */
941 1.1.1.1.4.2 yamt #define ARM_EH_STACKADJ_REGNUM 2
942 1.1.1.1.4.2 yamt #define EH_RETURN_STACKADJ_RTX gen_rtx_REG (SImode, ARM_EH_STACKADJ_REGNUM)
943 1.1.1.1.4.2 yamt
944 1.1.1.1.4.2 yamt /* The native (Norcroft) Pascal compiler for the ARM passes the static chain
945 1.1.1.1.4.2 yamt as an invisible last argument (possible since varargs don't exist in
946 1.1.1.1.4.2 yamt Pascal), so the following is not true. */
947 1.1.1.1.4.2 yamt #define STATIC_CHAIN_REGNUM 12
948 1.1.1.1.4.2 yamt
949 1.1.1.1.4.2 yamt /* Define this to be where the real frame pointer is if it is not possible to
950 1.1.1.1.4.2 yamt work out the offset between the frame pointer and the automatic variables
951 1.1.1.1.4.2 yamt until after register allocation has taken place. FRAME_POINTER_REGNUM
952 1.1.1.1.4.2 yamt should point to a special register that we will make sure is eliminated.
953 1.1.1.1.4.2 yamt
954 1.1.1.1.4.2 yamt For the Thumb we have another problem. The TPCS defines the frame pointer
955 1.1.1.1.4.2 yamt as r11, and GCC believes that it is always possible to use the frame pointer
956 1.1.1.1.4.2 yamt as base register for addressing purposes. (See comments in
957 1.1.1.1.4.2 yamt find_reloads_address()). But - the Thumb does not allow high registers,
958 1.1.1.1.4.2 yamt including r11, to be used as base address registers. Hence our problem.
959 1.1.1.1.4.2 yamt
960 1.1.1.1.4.2 yamt The solution used here, and in the old thumb port is to use r7 instead of
961 1.1.1.1.4.2 yamt r11 as the hard frame pointer and to have special code to generate
962 1.1.1.1.4.2 yamt backtrace structures on the stack (if required to do so via a command line
963 1.1.1.1.4.2 yamt option) using r11. This is the only 'user visible' use of r11 as a frame
964 1.1.1.1.4.2 yamt pointer. */
965 1.1.1.1.4.2 yamt #define ARM_HARD_FRAME_POINTER_REGNUM 11
966 1.1.1.1.4.2 yamt #define THUMB_HARD_FRAME_POINTER_REGNUM 7
967 1.1.1.1.4.2 yamt
968 1.1.1.1.4.2 yamt #define HARD_FRAME_POINTER_REGNUM \
969 1.1.1.1.4.2 yamt (TARGET_ARM \
970 1.1.1.1.4.2 yamt ? ARM_HARD_FRAME_POINTER_REGNUM \
971 1.1.1.1.4.2 yamt : THUMB_HARD_FRAME_POINTER_REGNUM)
972 1.1.1.1.4.2 yamt
973 1.1.1.1.4.2 yamt #define FP_REGNUM HARD_FRAME_POINTER_REGNUM
974 1.1.1.1.4.2 yamt
975 1.1.1.1.4.2 yamt /* Register to use for pushing function arguments. */
976 1.1.1.1.4.2 yamt #define STACK_POINTER_REGNUM SP_REGNUM
977 1.1.1.1.4.2 yamt
978 1.1.1.1.4.2 yamt /* ARM floating pointer registers. */
979 1.1.1.1.4.2 yamt #define FIRST_FPA_REGNUM 16
980 1.1.1.1.4.2 yamt #define LAST_FPA_REGNUM 23
981 1.1.1.1.4.2 yamt #define IS_FPA_REGNUM(REGNUM) \
982 1.1.1.1.4.2 yamt (((REGNUM) >= FIRST_FPA_REGNUM) && ((REGNUM) <= LAST_FPA_REGNUM))
983 1.1.1.1.4.2 yamt
984 1.1.1.1.4.2 yamt #define FIRST_IWMMXT_GR_REGNUM 43
985 1.1.1.1.4.2 yamt #define LAST_IWMMXT_GR_REGNUM 46
986 1.1.1.1.4.2 yamt #define FIRST_IWMMXT_REGNUM 47
987 1.1.1.1.4.2 yamt #define LAST_IWMMXT_REGNUM 62
988 1.1.1.1.4.2 yamt #define IS_IWMMXT_REGNUM(REGNUM) \
989 1.1.1.1.4.2 yamt (((REGNUM) >= FIRST_IWMMXT_REGNUM) && ((REGNUM) <= LAST_IWMMXT_REGNUM))
990 1.1.1.1.4.2 yamt #define IS_IWMMXT_GR_REGNUM(REGNUM) \
991 1.1.1.1.4.2 yamt (((REGNUM) >= FIRST_IWMMXT_GR_REGNUM) && ((REGNUM) <= LAST_IWMMXT_GR_REGNUM))
992 1.1.1.1.4.2 yamt
993 1.1.1.1.4.2 yamt /* Base register for access to local variables of the function. */
994 1.1.1.1.4.2 yamt #define FRAME_POINTER_REGNUM 25
995 1.1.1.1.4.2 yamt
996 1.1.1.1.4.2 yamt /* Base register for access to arguments of the function. */
997 1.1.1.1.4.2 yamt #define ARG_POINTER_REGNUM 26
998 1.1.1.1.4.2 yamt
999 1.1.1.1.4.2 yamt #define FIRST_CIRRUS_FP_REGNUM 27
1000 1.1.1.1.4.2 yamt #define LAST_CIRRUS_FP_REGNUM 42
1001 1.1.1.1.4.2 yamt #define IS_CIRRUS_REGNUM(REGNUM) \
1002 1.1.1.1.4.2 yamt (((REGNUM) >= FIRST_CIRRUS_FP_REGNUM) && ((REGNUM) <= LAST_CIRRUS_FP_REGNUM))
1003 1.1.1.1.4.2 yamt
1004 1.1.1.1.4.2 yamt #define FIRST_VFP_REGNUM 63
1005 1.1.1.1.4.2 yamt #define D7_VFP_REGNUM 78 /* Registers 77 and 78 == VFP reg D7. */
1006 1.1.1.1.4.2 yamt #define LAST_VFP_REGNUM \
1007 1.1.1.1.4.2 yamt (TARGET_VFPD32 ? LAST_HI_VFP_REGNUM : LAST_LO_VFP_REGNUM)
1008 1.1.1.1.4.2 yamt
1009 1.1.1.1.4.2 yamt #define IS_VFP_REGNUM(REGNUM) \
1010 1.1.1.1.4.2 yamt (((REGNUM) >= FIRST_VFP_REGNUM) && ((REGNUM) <= LAST_VFP_REGNUM))
1011 1.1.1.1.4.2 yamt
1012 1.1.1.1.4.2 yamt /* VFP registers are split into two types: those defined by VFP versions < 3
1013 1.1.1.1.4.2 yamt have D registers overlaid on consecutive pairs of S registers. VFP version 3
1014 1.1.1.1.4.2 yamt defines 16 new D registers (d16-d31) which, for simplicity and correctness
1015 1.1.1.1.4.2 yamt in various parts of the backend, we implement as "fake" single-precision
1016 1.1.1.1.4.2 yamt registers (which would be S32-S63, but cannot be used in that way). The
1017 1.1.1.1.4.2 yamt following macros define these ranges of registers. */
1018 1.1.1.1.4.2 yamt #define LAST_LO_VFP_REGNUM 94
1019 1.1.1.1.4.2 yamt #define FIRST_HI_VFP_REGNUM 95
1020 1.1.1.1.4.2 yamt #define LAST_HI_VFP_REGNUM 126
1021 1.1.1.1.4.2 yamt
1022 1.1.1.1.4.2 yamt #define VFP_REGNO_OK_FOR_SINGLE(REGNUM) \
1023 1.1.1.1.4.2 yamt ((REGNUM) <= LAST_LO_VFP_REGNUM)
1024 1.1.1.1.4.2 yamt
1025 1.1.1.1.4.2 yamt /* DFmode values are only valid in even register pairs. */
1026 1.1.1.1.4.2 yamt #define VFP_REGNO_OK_FOR_DOUBLE(REGNUM) \
1027 1.1.1.1.4.2 yamt ((((REGNUM) - FIRST_VFP_REGNUM) & 1) == 0)
1028 1.1.1.1.4.2 yamt
1029 1.1.1.1.4.2 yamt /* Neon Quad values must start at a multiple of four registers. */
1030 1.1.1.1.4.2 yamt #define NEON_REGNO_OK_FOR_QUAD(REGNUM) \
1031 1.1.1.1.4.2 yamt ((((REGNUM) - FIRST_VFP_REGNUM) & 3) == 0)
1032 1.1.1.1.4.2 yamt
1033 1.1.1.1.4.2 yamt /* Neon structures of vectors must be in even register pairs and there
1034 1.1.1.1.4.2 yamt must be enough registers available. Because of various patterns
1035 1.1.1.1.4.2 yamt requiring quad registers, we require them to start at a multiple of
1036 1.1.1.1.4.2 yamt four. */
1037 1.1.1.1.4.2 yamt #define NEON_REGNO_OK_FOR_NREGS(REGNUM, N) \
1038 1.1.1.1.4.2 yamt ((((REGNUM) - FIRST_VFP_REGNUM) & 3) == 0 \
1039 1.1.1.1.4.2 yamt && (LAST_VFP_REGNUM - (REGNUM) >= 2 * (N) - 1))
1040 1.1.1.1.4.2 yamt
1041 1.1.1.1.4.2 yamt /* The number of hard registers is 16 ARM + 8 FPA + 1 CC + 1 SFP + 1 AFP. */
1042 1.1.1.1.4.2 yamt /* + 16 Cirrus registers take us up to 43. */
1043 1.1.1.1.4.2 yamt /* Intel Wireless MMX Technology registers add 16 + 4 more. */
1044 1.1.1.1.4.2 yamt /* VFP (VFP3) adds 32 (64) + 1 more. */
1045 1.1.1.1.4.2 yamt #define FIRST_PSEUDO_REGISTER 128
1046 1.1.1.1.4.2 yamt
1047 1.1.1.1.4.2 yamt #define DBX_REGISTER_NUMBER(REGNO) arm_dbx_register_number (REGNO)
1048 1.1.1.1.4.2 yamt
1049 1.1.1.1.4.2 yamt /* Value should be nonzero if functions must have frame pointers.
1050 1.1.1.1.4.2 yamt Zero means the frame pointer need not be set up (and parms may be accessed
1051 1.1.1.1.4.2 yamt via the stack pointer) in functions that seem suitable.
1052 1.1.1.1.4.2 yamt If we have to have a frame pointer we might as well make use of it.
1053 1.1.1.1.4.2 yamt APCS says that the frame pointer does not need to be pushed in leaf
1054 1.1.1.1.4.2 yamt functions, or simple tail call functions. */
1055 1.1.1.1.4.2 yamt
1056 1.1.1.1.4.2 yamt #ifndef SUBTARGET_FRAME_POINTER_REQUIRED
1057 1.1.1.1.4.2 yamt #define SUBTARGET_FRAME_POINTER_REQUIRED 0
1058 1.1.1.1.4.2 yamt #endif
1059 1.1.1.1.4.2 yamt
1060 1.1.1.1.4.2 yamt /* Return number of consecutive hard regs needed starting at reg REGNO
1061 1.1.1.1.4.2 yamt to hold something of mode MODE.
1062 1.1.1.1.4.2 yamt This is ordinarily the length in words of a value of mode MODE
1063 1.1.1.1.4.2 yamt but can be less for certain modes in special long registers.
1064 1.1.1.1.4.2 yamt
1065 1.1.1.1.4.2 yamt On the ARM regs are UNITS_PER_WORD bits wide; FPA regs can hold any FP
1066 1.1.1.1.4.2 yamt mode. */
1067 1.1.1.1.4.2 yamt #define HARD_REGNO_NREGS(REGNO, MODE) \
1068 1.1.1.1.4.2 yamt ((TARGET_32BIT \
1069 1.1.1.1.4.2 yamt && REGNO >= FIRST_FPA_REGNUM \
1070 1.1.1.1.4.2 yamt && REGNO != FRAME_POINTER_REGNUM \
1071 1.1.1.1.4.2 yamt && REGNO != ARG_POINTER_REGNUM) \
1072 1.1.1.1.4.2 yamt && !IS_VFP_REGNUM (REGNO) \
1073 1.1.1.1.4.2 yamt ? 1 : ARM_NUM_REGS (MODE))
1074 1.1.1.1.4.2 yamt
1075 1.1.1.1.4.2 yamt /* Return true if REGNO is suitable for holding a quantity of type MODE. */
1076 1.1.1.1.4.2 yamt #define HARD_REGNO_MODE_OK(REGNO, MODE) \
1077 1.1.1.1.4.2 yamt arm_hard_regno_mode_ok ((REGNO), (MODE))
1078 1.1.1.1.4.2 yamt
1079 1.1.1.1.4.2 yamt /* Value is 1 if it is a good idea to tie two pseudo registers
1080 1.1.1.1.4.2 yamt when one has mode MODE1 and one has mode MODE2.
1081 1.1.1.1.4.2 yamt If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
1082 1.1.1.1.4.2 yamt for any hard reg, then this must be 0 for correct output. */
1083 1.1.1.1.4.2 yamt #define MODES_TIEABLE_P(MODE1, MODE2) \
1084 1.1.1.1.4.2 yamt (GET_MODE_CLASS (MODE1) == GET_MODE_CLASS (MODE2))
1085 1.1.1.1.4.2 yamt
1086 1.1.1.1.4.2 yamt #define VALID_IWMMXT_REG_MODE(MODE) \
1087 1.1.1.1.4.2 yamt (arm_vector_mode_supported_p (MODE) || (MODE) == DImode)
1088 1.1.1.1.4.2 yamt
1089 1.1.1.1.4.2 yamt /* Modes valid for Neon D registers. */
1090 1.1.1.1.4.2 yamt #define VALID_NEON_DREG_MODE(MODE) \
1091 1.1.1.1.4.2 yamt ((MODE) == V2SImode || (MODE) == V4HImode || (MODE) == V8QImode \
1092 1.1.1.1.4.2 yamt || (MODE) == V2SFmode || (MODE) == DImode)
1093 1.1.1.1.4.2 yamt
1094 1.1.1.1.4.2 yamt /* Modes valid for Neon Q registers. */
1095 1.1.1.1.4.2 yamt #define VALID_NEON_QREG_MODE(MODE) \
1096 1.1.1.1.4.2 yamt ((MODE) == V4SImode || (MODE) == V8HImode || (MODE) == V16QImode \
1097 1.1.1.1.4.2 yamt || (MODE) == V4SFmode || (MODE) == V2DImode)
1098 1.1.1.1.4.2 yamt
1099 1.1.1.1.4.2 yamt /* Structure modes valid for Neon registers. */
1100 1.1.1.1.4.2 yamt #define VALID_NEON_STRUCT_MODE(MODE) \
1101 1.1.1.1.4.2 yamt ((MODE) == TImode || (MODE) == EImode || (MODE) == OImode \
1102 1.1.1.1.4.2 yamt || (MODE) == CImode || (MODE) == XImode)
1103 1.1.1.1.4.2 yamt
1104 1.1.1.1.4.2 yamt /* The order in which register should be allocated. It is good to use ip
1105 1.1.1.1.4.2 yamt since no saving is required (though calls clobber it) and it never contains
1106 1.1.1.1.4.2 yamt function parameters. It is quite good to use lr since other calls may
1107 1.1.1.1.4.2 yamt clobber it anyway. Allocate r0 through r3 in reverse order since r3 is
1108 1.1.1.1.4.2 yamt least likely to contain a function parameter; in addition results are
1109 1.1.1.1.4.2 yamt returned in r0.
1110 1.1.1.1.4.2 yamt For VFP/VFPv3, allocate D16-D31 first, then caller-saved registers (D0-D7),
1111 1.1.1.1.4.2 yamt then D8-D15. The reason for doing this is to attempt to reduce register
1112 1.1.1.1.4.2 yamt pressure when both single- and double-precision registers are used in a
1113 1.1.1.1.4.2 yamt function. */
1114 1.1.1.1.4.2 yamt
1115 1.1.1.1.4.2 yamt #define REG_ALLOC_ORDER \
1116 1.1.1.1.4.2 yamt { \
1117 1.1.1.1.4.2 yamt 3, 2, 1, 0, 12, 14, 4, 5, \
1118 1.1.1.1.4.2 yamt 6, 7, 8, 10, 9, 11, 13, 15, \
1119 1.1.1.1.4.2 yamt 16, 17, 18, 19, 20, 21, 22, 23, \
1120 1.1.1.1.4.2 yamt 27, 28, 29, 30, 31, 32, 33, 34, \
1121 1.1.1.1.4.2 yamt 35, 36, 37, 38, 39, 40, 41, 42, \
1122 1.1.1.1.4.2 yamt 43, 44, 45, 46, 47, 48, 49, 50, \
1123 1.1.1.1.4.2 yamt 51, 52, 53, 54, 55, 56, 57, 58, \
1124 1.1.1.1.4.2 yamt 59, 60, 61, 62, \
1125 1.1.1.1.4.2 yamt 24, 25, 26, \
1126 1.1.1.1.4.2 yamt 95, 96, 97, 98, 99, 100, 101, 102, \
1127 1.1.1.1.4.2 yamt 103, 104, 105, 106, 107, 108, 109, 110, \
1128 1.1.1.1.4.2 yamt 111, 112, 113, 114, 115, 116, 117, 118, \
1129 1.1.1.1.4.2 yamt 119, 120, 121, 122, 123, 124, 125, 126, \
1130 1.1.1.1.4.2 yamt 78, 77, 76, 75, 74, 73, 72, 71, \
1131 1.1.1.1.4.2 yamt 70, 69, 68, 67, 66, 65, 64, 63, \
1132 1.1.1.1.4.2 yamt 79, 80, 81, 82, 83, 84, 85, 86, \
1133 1.1.1.1.4.2 yamt 87, 88, 89, 90, 91, 92, 93, 94, \
1134 1.1.1.1.4.2 yamt 127 \
1135 1.1.1.1.4.2 yamt }
1136 1.1.1.1.4.2 yamt
1137 1.1.1.1.4.2 yamt /* Use different register alloc ordering for Thumb. */
1138 1.1.1.1.4.2 yamt #define ORDER_REGS_FOR_LOCAL_ALLOC arm_order_regs_for_local_alloc ()
1139 1.1.1.1.4.2 yamt
1140 1.1.1.1.4.2 yamt /* Interrupt functions can only use registers that have already been
1141 1.1.1.1.4.2 yamt saved by the prologue, even if they would normally be
1142 1.1.1.1.4.2 yamt call-clobbered. */
1143 1.1.1.1.4.2 yamt #define HARD_REGNO_RENAME_OK(SRC, DST) \
1144 1.1.1.1.4.2 yamt (! IS_INTERRUPT (cfun->machine->func_type) || \
1145 1.1.1.1.4.2 yamt df_regs_ever_live_p (DST))
1146 1.1.1.1.4.2 yamt
1147 1.1.1.1.4.2 yamt /* Register and constant classes. */
1149 1.1.1.1.4.2 yamt
1150 1.1.1.1.4.2 yamt /* Register classes: used to be simple, just all ARM regs or all FPA regs
1151 1.1.1.1.4.2 yamt Now that the Thumb is involved it has become more complicated. */
1152 1.1.1.1.4.2 yamt enum reg_class
1153 1.1.1.1.4.2 yamt {
1154 1.1.1.1.4.2 yamt NO_REGS,
1155 1.1.1.1.4.2 yamt FPA_REGS,
1156 1.1.1.1.4.2 yamt CIRRUS_REGS,
1157 1.1.1.1.4.2 yamt VFP_D0_D7_REGS,
1158 1.1.1.1.4.2 yamt VFP_LO_REGS,
1159 1.1.1.1.4.2 yamt VFP_HI_REGS,
1160 1.1.1.1.4.2 yamt VFP_REGS,
1161 1.1.1.1.4.2 yamt IWMMXT_GR_REGS,
1162 1.1.1.1.4.2 yamt IWMMXT_REGS,
1163 1.1.1.1.4.2 yamt LO_REGS,
1164 1.1.1.1.4.2 yamt STACK_REG,
1165 1.1.1.1.4.2 yamt BASE_REGS,
1166 1.1.1.1.4.2 yamt HI_REGS,
1167 1.1.1.1.4.2 yamt CC_REG,
1168 1.1.1.1.4.2 yamt VFPCC_REG,
1169 1.1.1.1.4.2 yamt GENERAL_REGS,
1170 1.1.1.1.4.2 yamt CORE_REGS,
1171 1.1.1.1.4.2 yamt ALL_REGS,
1172 1.1.1.1.4.2 yamt LIM_REG_CLASSES
1173 1.1.1.1.4.2 yamt };
1174 1.1.1.1.4.2 yamt
1175 1.1.1.1.4.2 yamt #define N_REG_CLASSES (int) LIM_REG_CLASSES
1176 1.1.1.1.4.2 yamt
1177 1.1.1.1.4.2 yamt /* Give names of register classes as strings for dump file. */
1178 1.1.1.1.4.2 yamt #define REG_CLASS_NAMES \
1179 1.1.1.1.4.2 yamt { \
1180 1.1.1.1.4.2 yamt "NO_REGS", \
1181 1.1.1.1.4.2 yamt "FPA_REGS", \
1182 1.1.1.1.4.2 yamt "CIRRUS_REGS", \
1183 1.1.1.1.4.2 yamt "VFP_D0_D7_REGS", \
1184 1.1.1.1.4.2 yamt "VFP_LO_REGS", \
1185 1.1.1.1.4.2 yamt "VFP_HI_REGS", \
1186 1.1.1.1.4.2 yamt "VFP_REGS", \
1187 1.1.1.1.4.2 yamt "IWMMXT_GR_REGS", \
1188 1.1.1.1.4.2 yamt "IWMMXT_REGS", \
1189 1.1.1.1.4.2 yamt "LO_REGS", \
1190 1.1.1.1.4.2 yamt "STACK_REG", \
1191 1.1.1.1.4.2 yamt "BASE_REGS", \
1192 1.1.1.1.4.2 yamt "HI_REGS", \
1193 1.1.1.1.4.2 yamt "CC_REG", \
1194 1.1.1.1.4.2 yamt "VFPCC_REG", \
1195 1.1.1.1.4.2 yamt "GENERAL_REGS", \
1196 1.1.1.1.4.2 yamt "CORE_REGS", \
1197 1.1.1.1.4.2 yamt "ALL_REGS", \
1198 1.1.1.1.4.2 yamt }
1199 1.1.1.1.4.2 yamt
1200 1.1.1.1.4.2 yamt /* Define which registers fit in which classes.
1201 1.1.1.1.4.2 yamt This is an initializer for a vector of HARD_REG_SET
1202 1.1.1.1.4.2 yamt of length N_REG_CLASSES. */
1203 1.1.1.1.4.2 yamt #define REG_CLASS_CONTENTS \
1204 1.1.1.1.4.2 yamt { \
1205 1.1.1.1.4.2 yamt { 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, /* NO_REGS */ \
1206 1.1.1.1.4.2 yamt { 0x00FF0000, 0x00000000, 0x00000000, 0x00000000 }, /* FPA_REGS */ \
1207 1.1.1.1.4.2 yamt { 0xF8000000, 0x000007FF, 0x00000000, 0x00000000 }, /* CIRRUS_REGS */ \
1208 1.1.1.1.4.2 yamt { 0x00000000, 0x80000000, 0x00007FFF, 0x00000000 }, /* VFP_D0_D7_REGS */ \
1209 1.1.1.1.4.2 yamt { 0x00000000, 0x80000000, 0x7FFFFFFF, 0x00000000 }, /* VFP_LO_REGS */ \
1210 1.1.1.1.4.2 yamt { 0x00000000, 0x00000000, 0x80000000, 0x7FFFFFFF }, /* VFP_HI_REGS */ \
1211 1.1.1.1.4.2 yamt { 0x00000000, 0x80000000, 0xFFFFFFFF, 0x7FFFFFFF }, /* VFP_REGS */ \
1212 1.1.1.1.4.2 yamt { 0x00000000, 0x00007800, 0x00000000, 0x00000000 }, /* IWMMXT_GR_REGS */ \
1213 1.1.1.1.4.2 yamt { 0x00000000, 0x7FFF8000, 0x00000000, 0x00000000 }, /* IWMMXT_REGS */ \
1214 1.1.1.1.4.2 yamt { 0x000000FF, 0x00000000, 0x00000000, 0x00000000 }, /* LO_REGS */ \
1215 1.1.1.1.4.2 yamt { 0x00002000, 0x00000000, 0x00000000, 0x00000000 }, /* STACK_REG */ \
1216 1.1.1.1.4.2 yamt { 0x000020FF, 0x00000000, 0x00000000, 0x00000000 }, /* BASE_REGS */ \
1217 1.1.1.1.4.2 yamt { 0x0000DF00, 0x00000000, 0x00000000, 0x00000000 }, /* HI_REGS */ \
1218 1.1.1.1.4.2 yamt { 0x01000000, 0x00000000, 0x00000000, 0x00000000 }, /* CC_REG */ \
1219 1.1.1.1.4.2 yamt { 0x00000000, 0x00000000, 0x00000000, 0x80000000 }, /* VFPCC_REG */ \
1220 1.1.1.1.4.2 yamt { 0x0200DFFF, 0x00000000, 0x00000000, 0x00000000 }, /* GENERAL_REGS */ \
1221 1.1.1.1.4.2 yamt { 0x0200FFFF, 0x00000000, 0x00000000, 0x00000000 }, /* CORE_REGS */ \
1222 1.1.1.1.4.2 yamt { 0xFAFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x7FFFFFFF } /* ALL_REGS */ \
1223 1.1.1.1.4.2 yamt }
1224 1.1.1.1.4.2 yamt
1225 1.1.1.1.4.2 yamt /* Any of the VFP register classes. */
1226 1.1.1.1.4.2 yamt #define IS_VFP_CLASS(X) \
1227 1.1.1.1.4.2 yamt ((X) == VFP_D0_D7_REGS || (X) == VFP_LO_REGS \
1228 1.1.1.1.4.2 yamt || (X) == VFP_HI_REGS || (X) == VFP_REGS)
1229 1.1.1.1.4.2 yamt
1230 1.1.1.1.4.2 yamt /* The same information, inverted:
1231 1.1.1.1.4.2 yamt Return the class number of the smallest class containing
1232 1.1.1.1.4.2 yamt reg number REGNO. This could be a conditional expression
1233 1.1.1.1.4.2 yamt or could index an array. */
1234 1.1.1.1.4.2 yamt #define REGNO_REG_CLASS(REGNO) arm_regno_class (REGNO)
1235 1.1.1.1.4.2 yamt
1236 1.1.1.1.4.2 yamt /* The following macro defines cover classes for Integrated Register
1237 1.1.1.1.4.2 yamt Allocator. Cover classes is a set of non-intersected register
1238 1.1.1.1.4.2 yamt classes covering all hard registers used for register allocation
1239 1.1.1.1.4.2 yamt purpose. Any move between two registers of a cover class should be
1240 1.1.1.1.4.2 yamt cheaper than load or store of the registers. The macro value is
1241 1.1.1.1.4.2 yamt array of register classes with LIM_REG_CLASSES used as the end
1242 1.1.1.1.4.2 yamt marker. */
1243 1.1.1.1.4.2 yamt
1244 1.1.1.1.4.2 yamt #define IRA_COVER_CLASSES \
1245 1.1.1.1.4.2 yamt { \
1246 1.1.1.1.4.2 yamt GENERAL_REGS, FPA_REGS, CIRRUS_REGS, VFP_REGS, IWMMXT_GR_REGS, IWMMXT_REGS,\
1247 1.1.1.1.4.2 yamt LIM_REG_CLASSES \
1248 1.1.1.1.4.2 yamt }
1249 1.1.1.1.4.2 yamt
1250 1.1.1.1.4.2 yamt /* FPA registers can't do subreg as all values are reformatted to internal
1251 1.1.1.1.4.2 yamt precision. VFP registers may only be accessed in the mode they
1252 1.1.1.1.4.2 yamt were set. */
1253 1.1.1.1.4.2 yamt #define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \
1254 1.1.1.1.4.2 yamt (GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO) \
1255 1.1.1.1.4.2 yamt ? reg_classes_intersect_p (FPA_REGS, (CLASS)) \
1256 1.1.1.1.4.2 yamt || reg_classes_intersect_p (VFP_REGS, (CLASS)) \
1257 1.1.1.1.4.2 yamt : 0)
1258 1.1.1.1.4.2 yamt
1259 1.1.1.1.4.2 yamt /* We need to define this for LO_REGS on thumb. Otherwise we can end up
1260 1.1.1.1.4.2 yamt using r0-r4 for function arguments, r7 for the stack frame and don't
1261 1.1.1.1.4.2 yamt have enough left over to do doubleword arithmetic. */
1262 1.1.1.1.4.2 yamt #define CLASS_LIKELY_SPILLED_P(CLASS) \
1263 1.1.1.1.4.2 yamt ((TARGET_THUMB && (CLASS) == LO_REGS) \
1264 1.1.1.1.4.2 yamt || (CLASS) == CC_REG)
1265 1.1.1.1.4.2 yamt
1266 1.1.1.1.4.2 yamt /* The class value for index registers, and the one for base regs. */
1267 1.1.1.1.4.2 yamt #define INDEX_REG_CLASS (TARGET_THUMB1 ? LO_REGS : GENERAL_REGS)
1268 1.1.1.1.4.2 yamt #define BASE_REG_CLASS (TARGET_THUMB1 ? LO_REGS : CORE_REGS)
1269 1.1.1.1.4.2 yamt
1270 1.1.1.1.4.2 yamt /* For the Thumb the high registers cannot be used as base registers
1271 1.1.1.1.4.2 yamt when addressing quantities in QI or HI mode; if we don't know the
1272 1.1.1.1.4.2 yamt mode, then we must be conservative. */
1273 1.1.1.1.4.2 yamt #define MODE_BASE_REG_CLASS(MODE) \
1274 1.1.1.1.4.2 yamt (TARGET_32BIT ? CORE_REGS : \
1275 1.1.1.1.4.2 yamt (((MODE) == SImode) ? BASE_REGS : LO_REGS))
1276 1.1.1.1.4.2 yamt
1277 1.1.1.1.4.2 yamt /* For Thumb we can not support SP+reg addressing, so we return LO_REGS
1278 1.1.1.1.4.2 yamt instead of BASE_REGS. */
1279 1.1.1.1.4.2 yamt #define MODE_BASE_REG_REG_CLASS(MODE) BASE_REG_CLASS
1280 1.1.1.1.4.2 yamt
1281 1.1.1.1.4.2 yamt /* When SMALL_REGISTER_CLASSES is nonzero, the compiler allows
1282 1.1.1.1.4.2 yamt registers explicitly used in the rtl to be used as spill registers
1283 1.1.1.1.4.2 yamt but prevents the compiler from extending the lifetime of these
1284 1.1.1.1.4.2 yamt registers. */
1285 1.1.1.1.4.2 yamt #define SMALL_REGISTER_CLASSES TARGET_THUMB1
1286 1.1.1.1.4.2 yamt
1287 1.1.1.1.4.2 yamt /* Given an rtx X being reloaded into a reg required to be
1288 1.1.1.1.4.2 yamt in class CLASS, return the class of reg to actually use.
1289 1.1.1.1.4.2 yamt In general this is just CLASS, but for the Thumb core registers and
1290 1.1.1.1.4.2 yamt immediate constants we prefer a LO_REGS class or a subset. */
1291 1.1.1.1.4.2 yamt #define PREFERRED_RELOAD_CLASS(X, CLASS) \
1292 1.1.1.1.4.2 yamt (TARGET_32BIT ? (CLASS) : \
1293 1.1.1.1.4.2 yamt ((CLASS) == GENERAL_REGS || (CLASS) == HI_REGS \
1294 1.1.1.1.4.2 yamt || (CLASS) == NO_REGS || (CLASS) == STACK_REG \
1295 1.1.1.1.4.2 yamt ? LO_REGS : (CLASS)))
1296 1.1.1.1.4.2 yamt
1297 1.1.1.1.4.2 yamt /* Must leave BASE_REGS reloads alone */
1298 1.1.1.1.4.2 yamt #define THUMB_SECONDARY_INPUT_RELOAD_CLASS(CLASS, MODE, X) \
1299 1.1.1.1.4.2 yamt ((CLASS) != LO_REGS && (CLASS) != BASE_REGS \
1300 1.1.1.1.4.2 yamt ? ((true_regnum (X) == -1 ? LO_REGS \
1301 1.1.1.1.4.2 yamt : (true_regnum (X) + HARD_REGNO_NREGS (0, MODE) > 8) ? LO_REGS \
1302 1.1.1.1.4.2 yamt : NO_REGS)) \
1303 1.1.1.1.4.2 yamt : NO_REGS)
1304 1.1.1.1.4.2 yamt
1305 1.1.1.1.4.2 yamt #define THUMB_SECONDARY_OUTPUT_RELOAD_CLASS(CLASS, MODE, X) \
1306 1.1.1.1.4.2 yamt ((CLASS) != LO_REGS && (CLASS) != BASE_REGS \
1307 1.1.1.1.4.2 yamt ? ((true_regnum (X) == -1 ? LO_REGS \
1308 1.1.1.1.4.2 yamt : (true_regnum (X) + HARD_REGNO_NREGS (0, MODE) > 8) ? LO_REGS \
1309 1.1.1.1.4.2 yamt : NO_REGS)) \
1310 1.1.1.1.4.2 yamt : NO_REGS)
1311 1.1.1.1.4.2 yamt
1312 1.1.1.1.4.2 yamt /* Return the register class of a scratch register needed to copy IN into
1313 1.1.1.1.4.2 yamt or out of a register in CLASS in MODE. If it can be done directly,
1314 1.1.1.1.4.2 yamt NO_REGS is returned. */
1315 1.1.1.1.4.2 yamt #define SECONDARY_OUTPUT_RELOAD_CLASS(CLASS, MODE, X) \
1316 1.1.1.1.4.2 yamt /* Restrict which direct reloads are allowed for VFP/iWMMXt regs. */ \
1317 1.1.1.1.4.2 yamt ((TARGET_VFP && TARGET_HARD_FLOAT \
1318 1.1.1.1.4.2 yamt && IS_VFP_CLASS (CLASS)) \
1319 1.1.1.1.4.2 yamt ? coproc_secondary_reload_class (MODE, X, FALSE) \
1320 1.1.1.1.4.2 yamt : (TARGET_IWMMXT && (CLASS) == IWMMXT_REGS) \
1321 1.1.1.1.4.2 yamt ? coproc_secondary_reload_class (MODE, X, TRUE) \
1322 1.1.1.1.4.2 yamt : TARGET_32BIT \
1323 1.1.1.1.4.2 yamt ? (((MODE) == HImode && ! arm_arch4 && true_regnum (X) == -1) \
1324 1.1.1.1.4.2 yamt ? GENERAL_REGS : NO_REGS) \
1325 1.1.1.1.4.2 yamt : THUMB_SECONDARY_OUTPUT_RELOAD_CLASS (CLASS, MODE, X))
1326 1.1.1.1.4.2 yamt
1327 1.1.1.1.4.2 yamt /* If we need to load shorts byte-at-a-time, then we need a scratch. */
1328 1.1.1.1.4.2 yamt #define SECONDARY_INPUT_RELOAD_CLASS(CLASS, MODE, X) \
1329 1.1.1.1.4.2 yamt /* Restrict which direct reloads are allowed for VFP/iWMMXt regs. */ \
1330 1.1.1.1.4.2 yamt ((TARGET_VFP && TARGET_HARD_FLOAT \
1331 1.1.1.1.4.2 yamt && IS_VFP_CLASS (CLASS)) \
1332 1.1.1.1.4.2 yamt ? coproc_secondary_reload_class (MODE, X, FALSE) : \
1333 1.1.1.1.4.2 yamt (TARGET_IWMMXT && (CLASS) == IWMMXT_REGS) ? \
1334 1.1.1.1.4.2 yamt coproc_secondary_reload_class (MODE, X, TRUE) : \
1335 1.1.1.1.4.2 yamt /* Cannot load constants into Cirrus registers. */ \
1336 1.1.1.1.4.2 yamt (TARGET_MAVERICK && TARGET_HARD_FLOAT \
1337 1.1.1.1.4.2 yamt && (CLASS) == CIRRUS_REGS \
1338 1.1.1.1.4.2 yamt && (CONSTANT_P (X) || GET_CODE (X) == SYMBOL_REF)) \
1339 1.1.1.1.4.2 yamt ? GENERAL_REGS : \
1340 1.1.1.1.4.2 yamt (TARGET_32BIT ? \
1341 1.1.1.1.4.2 yamt (((CLASS) == IWMMXT_REGS || (CLASS) == IWMMXT_GR_REGS) \
1342 1.1.1.1.4.2 yamt && CONSTANT_P (X)) \
1343 1.1.1.1.4.2 yamt ? GENERAL_REGS : \
1344 1.1.1.1.4.2 yamt (((MODE) == HImode && ! arm_arch4 \
1345 1.1.1.1.4.2 yamt && (GET_CODE (X) == MEM \
1346 1.1.1.1.4.2 yamt || ((GET_CODE (X) == REG || GET_CODE (X) == SUBREG) \
1347 1.1.1.1.4.2 yamt && true_regnum (X) == -1))) \
1348 1.1.1.1.4.2 yamt ? GENERAL_REGS : NO_REGS) \
1349 1.1.1.1.4.2 yamt : THUMB_SECONDARY_INPUT_RELOAD_CLASS (CLASS, MODE, X)))
1350 1.1.1.1.4.2 yamt
1351 1.1.1.1.4.2 yamt /* Try a machine-dependent way of reloading an illegitimate address
1352 1.1.1.1.4.2 yamt operand. If we find one, push the reload and jump to WIN. This
1353 1.1.1.1.4.2 yamt macro is used in only one place: `find_reloads_address' in reload.c.
1354 1.1.1.1.4.2 yamt
1355 1.1.1.1.4.2 yamt For the ARM, we wish to handle large displacements off a base
1356 1.1.1.1.4.2 yamt register by splitting the addend across a MOV and the mem insn.
1357 1.1.1.1.4.2 yamt This can cut the number of reloads needed. */
1358 1.1.1.1.4.2 yamt #define ARM_LEGITIMIZE_RELOAD_ADDRESS(X, MODE, OPNUM, TYPE, IND, WIN) \
1359 1.1.1.1.4.2 yamt do \
1360 1.1.1.1.4.2 yamt { \
1361 1.1.1.1.4.2 yamt if (GET_CODE (X) == PLUS \
1362 1.1.1.1.4.2 yamt && GET_CODE (XEXP (X, 0)) == REG \
1363 1.1.1.1.4.2 yamt && REGNO (XEXP (X, 0)) < FIRST_PSEUDO_REGISTER \
1364 1.1.1.1.4.2 yamt && REG_MODE_OK_FOR_BASE_P (XEXP (X, 0), MODE) \
1365 1.1.1.1.4.2 yamt && GET_CODE (XEXP (X, 1)) == CONST_INT) \
1366 1.1.1.1.4.2 yamt { \
1367 1.1.1.1.4.2 yamt HOST_WIDE_INT val = INTVAL (XEXP (X, 1)); \
1368 1.1.1.1.4.2 yamt HOST_WIDE_INT low, high; \
1369 1.1.1.1.4.2 yamt \
1370 1.1.1.1.4.2 yamt if (MODE == DImode || (MODE == DFmode && TARGET_SOFT_FLOAT)) \
1371 1.1.1.1.4.2 yamt low = ((val & 0xf) ^ 0x8) - 0x8; \
1372 1.1.1.1.4.2 yamt else if (TARGET_MAVERICK && TARGET_HARD_FLOAT) \
1373 1.1.1.1.4.2 yamt /* Need to be careful, -256 is not a valid offset. */ \
1374 1.1.1.1.4.2 yamt low = val >= 0 ? (val & 0xff) : -((-val) & 0xff); \
1375 1.1.1.1.4.2 yamt else if (MODE == SImode \
1376 1.1.1.1.4.2 yamt || (MODE == SFmode && TARGET_SOFT_FLOAT) \
1377 1.1.1.1.4.2 yamt || ((MODE == HImode || MODE == QImode) && ! arm_arch4)) \
1378 1.1.1.1.4.2 yamt /* Need to be careful, -4096 is not a valid offset. */ \
1379 1.1.1.1.4.2 yamt low = val >= 0 ? (val & 0xfff) : -((-val) & 0xfff); \
1380 1.1.1.1.4.2 yamt else if ((MODE == HImode || MODE == QImode) && arm_arch4) \
1381 1.1.1.1.4.2 yamt /* Need to be careful, -256 is not a valid offset. */ \
1382 1.1.1.1.4.2 yamt low = val >= 0 ? (val & 0xff) : -((-val) & 0xff); \
1383 1.1.1.1.4.2 yamt else if (GET_MODE_CLASS (MODE) == MODE_FLOAT \
1384 1.1.1.1.4.2 yamt && TARGET_HARD_FLOAT && TARGET_FPA) \
1385 1.1.1.1.4.2 yamt /* Need to be careful, -1024 is not a valid offset. */ \
1386 1.1.1.1.4.2 yamt low = val >= 0 ? (val & 0x3ff) : -((-val) & 0x3ff); \
1387 1.1.1.1.4.2 yamt else \
1388 1.1.1.1.4.2 yamt break; \
1389 1.1.1.1.4.2 yamt \
1390 1.1.1.1.4.2 yamt high = ((((val - low) & (unsigned HOST_WIDE_INT) 0xffffffff) \
1391 1.1.1.1.4.2 yamt ^ (unsigned HOST_WIDE_INT) 0x80000000) \
1392 1.1.1.1.4.2 yamt - (unsigned HOST_WIDE_INT) 0x80000000); \
1393 1.1.1.1.4.2 yamt /* Check for overflow or zero */ \
1394 1.1.1.1.4.2 yamt if (low == 0 || high == 0 || (high + low != val)) \
1395 1.1.1.1.4.2 yamt break; \
1396 1.1.1.1.4.2 yamt \
1397 1.1.1.1.4.2 yamt /* Reload the high part into a base reg; leave the low part \
1398 1.1.1.1.4.2 yamt in the mem. */ \
1399 1.1.1.1.4.2 yamt X = gen_rtx_PLUS (GET_MODE (X), \
1400 1.1.1.1.4.2 yamt gen_rtx_PLUS (GET_MODE (X), XEXP (X, 0), \
1401 1.1.1.1.4.2 yamt GEN_INT (high)), \
1402 1.1.1.1.4.2 yamt GEN_INT (low)); \
1403 1.1.1.1.4.2 yamt push_reload (XEXP (X, 0), NULL_RTX, &XEXP (X, 0), NULL, \
1404 1.1.1.1.4.2 yamt MODE_BASE_REG_CLASS (MODE), GET_MODE (X), \
1405 1.1.1.1.4.2 yamt VOIDmode, 0, 0, OPNUM, TYPE); \
1406 1.1.1.1.4.2 yamt goto WIN; \
1407 1.1.1.1.4.2 yamt } \
1408 1.1.1.1.4.2 yamt } \
1409 1.1.1.1.4.2 yamt while (0)
1410 1.1.1.1.4.2 yamt
1411 1.1.1.1.4.2 yamt /* XXX If an HImode FP+large_offset address is converted to an HImode
1412 1.1.1.1.4.2 yamt SP+large_offset address, then reload won't know how to fix it. It sees
1413 1.1.1.1.4.2 yamt only that SP isn't valid for HImode, and so reloads the SP into an index
1414 1.1.1.1.4.2 yamt register, but the resulting address is still invalid because the offset
1415 1.1.1.1.4.2 yamt is too big. We fix it here instead by reloading the entire address. */
1416 1.1.1.1.4.2 yamt /* We could probably achieve better results by defining PROMOTE_MODE to help
1417 1.1.1.1.4.2 yamt cope with the variances between the Thumb's signed and unsigned byte and
1418 1.1.1.1.4.2 yamt halfword load instructions. */
1419 1.1.1.1.4.2 yamt /* ??? This should be safe for thumb2, but we may be able to do better. */
1420 1.1.1.1.4.2 yamt #define THUMB_LEGITIMIZE_RELOAD_ADDRESS(X, MODE, OPNUM, TYPE, IND_L, WIN) \
1421 1.1.1.1.4.2 yamt do { \
1422 1.1.1.1.4.2 yamt rtx new_x = thumb_legitimize_reload_address (&X, MODE, OPNUM, TYPE, IND_L); \
1423 1.1.1.1.4.2 yamt if (new_x) \
1424 1.1.1.1.4.2 yamt { \
1425 1.1.1.1.4.2 yamt X = new_x; \
1426 1.1.1.1.4.2 yamt goto WIN; \
1427 1.1.1.1.4.2 yamt } \
1428 1.1.1.1.4.2 yamt } while (0)
1429 1.1.1.1.4.2 yamt
1430 1.1.1.1.4.2 yamt #define LEGITIMIZE_RELOAD_ADDRESS(X, MODE, OPNUM, TYPE, IND_LEVELS, WIN) \
1431 1.1.1.1.4.2 yamt if (TARGET_ARM) \
1432 1.1.1.1.4.2 yamt ARM_LEGITIMIZE_RELOAD_ADDRESS (X, MODE, OPNUM, TYPE, IND_LEVELS, WIN); \
1433 1.1.1.1.4.2 yamt else \
1434 1.1.1.1.4.2 yamt THUMB_LEGITIMIZE_RELOAD_ADDRESS (X, MODE, OPNUM, TYPE, IND_LEVELS, WIN)
1435 1.1.1.1.4.2 yamt
1436 1.1.1.1.4.2 yamt /* Return the maximum number of consecutive registers
1437 1.1.1.1.4.2 yamt needed to represent mode MODE in a register of class CLASS.
1438 1.1.1.1.4.2 yamt ARM regs are UNITS_PER_WORD bits while FPA regs can hold any FP mode */
1439 1.1.1.1.4.2 yamt #define CLASS_MAX_NREGS(CLASS, MODE) \
1440 1.1.1.1.4.2 yamt (((CLASS) == FPA_REGS || (CLASS) == CIRRUS_REGS) ? 1 : ARM_NUM_REGS (MODE))
1441 1.1.1.1.4.2 yamt
1442 1.1.1.1.4.2 yamt /* If defined, gives a class of registers that cannot be used as the
1443 1.1.1.1.4.2 yamt operand of a SUBREG that changes the mode of the object illegally. */
1444 1.1.1.1.4.2 yamt
1445 1.1.1.1.4.2 yamt /* Moves between FPA_REGS and GENERAL_REGS are two memory insns.
1446 1.1.1.1.4.2 yamt Moves between VFP_REGS and GENERAL_REGS are a single insn, but
1447 1.1.1.1.4.2 yamt it is typically more expensive than a single memory access. We set
1448 1.1.1.1.4.2 yamt the cost to less than two memory accesses so that floating
1449 1.1.1.1.4.2 yamt point to integer conversion does not go through memory. */
1450 1.1.1.1.4.2 yamt #define REGISTER_MOVE_COST(MODE, FROM, TO) \
1451 1.1.1.1.4.2 yamt (TARGET_32BIT ? \
1452 1.1.1.1.4.2 yamt ((FROM) == FPA_REGS && (TO) != FPA_REGS ? 20 : \
1453 1.1.1.1.4.2 yamt (FROM) != FPA_REGS && (TO) == FPA_REGS ? 20 : \
1454 1.1.1.1.4.2 yamt IS_VFP_CLASS (FROM) && !IS_VFP_CLASS (TO) ? 15 : \
1455 1.1.1.1.4.2 yamt !IS_VFP_CLASS (FROM) && IS_VFP_CLASS (TO) ? 15 : \
1456 1.1.1.1.4.2 yamt (FROM) == IWMMXT_REGS && (TO) != IWMMXT_REGS ? 4 : \
1457 1.1.1.1.4.2 yamt (FROM) != IWMMXT_REGS && (TO) == IWMMXT_REGS ? 4 : \
1458 1.1.1.1.4.2 yamt (FROM) == IWMMXT_GR_REGS || (TO) == IWMMXT_GR_REGS ? 20 : \
1459 1.1.1.1.4.2 yamt (FROM) == CIRRUS_REGS && (TO) != CIRRUS_REGS ? 20 : \
1460 1.1.1.1.4.2 yamt (FROM) != CIRRUS_REGS && (TO) == CIRRUS_REGS ? 20 : \
1461 1.1.1.1.4.2 yamt 2) \
1462 1.1.1.1.4.2 yamt : \
1463 1.1.1.1.4.2 yamt ((FROM) == HI_REGS || (TO) == HI_REGS) ? 4 : 2)
1464 1.1.1.1.4.2 yamt
1465 1.1.1.1.4.2 yamt /* Stack layout; function entry, exit and calling. */
1467 1.1.1.1.4.2 yamt
1468 1.1.1.1.4.2 yamt /* Define this if pushing a word on the stack
1469 1.1.1.1.4.2 yamt makes the stack pointer a smaller address. */
1470 1.1.1.1.4.2 yamt #define STACK_GROWS_DOWNWARD 1
1471 1.1.1.1.4.2 yamt
1472 1.1.1.1.4.2 yamt /* Define this to nonzero if the nominal address of the stack frame
1473 1.1.1.1.4.2 yamt is at the high-address end of the local variables;
1474 1.1.1.1.4.2 yamt that is, each additional local variable allocated
1475 1.1.1.1.4.2 yamt goes at a more negative offset in the frame. */
1476 1.1.1.1.4.2 yamt #define FRAME_GROWS_DOWNWARD 1
1477 1.1.1.1.4.2 yamt
1478 1.1.1.1.4.2 yamt /* The amount of scratch space needed by _interwork_{r7,r11}_call_via_rN().
1479 1.1.1.1.4.2 yamt When present, it is one word in size, and sits at the top of the frame,
1480 1.1.1.1.4.2 yamt between the soft frame pointer and either r7 or r11.
1481 1.1.1.1.4.2 yamt
1482 1.1.1.1.4.2 yamt We only need _interwork_rM_call_via_rN() for -mcaller-super-interworking,
1483 1.1.1.1.4.2 yamt and only then if some outgoing arguments are passed on the stack. It would
1484 1.1.1.1.4.2 yamt be tempting to also check whether the stack arguments are passed by indirect
1485 1.1.1.1.4.2 yamt calls, but there seems to be no reason in principle why a post-reload pass
1486 1.1.1.1.4.2 yamt couldn't convert a direct call into an indirect one. */
1487 1.1.1.1.4.2 yamt #define CALLER_INTERWORKING_SLOT_SIZE \
1488 1.1.1.1.4.2 yamt (TARGET_CALLER_INTERWORKING \
1489 1.1.1.1.4.2 yamt && crtl->outgoing_args_size != 0 \
1490 1.1.1.1.4.2 yamt ? UNITS_PER_WORD : 0)
1491 1.1.1.1.4.2 yamt
1492 1.1.1.1.4.2 yamt /* Offset within stack frame to start allocating local variables at.
1493 1.1.1.1.4.2 yamt If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
1494 1.1.1.1.4.2 yamt first local allocated. Otherwise, it is the offset to the BEGINNING
1495 1.1.1.1.4.2 yamt of the first local allocated. */
1496 1.1.1.1.4.2 yamt #define STARTING_FRAME_OFFSET 0
1497 1.1.1.1.4.2 yamt
1498 1.1.1.1.4.2 yamt /* If we generate an insn to push BYTES bytes,
1499 1.1.1.1.4.2 yamt this says how many the stack pointer really advances by. */
1500 1.1.1.1.4.2 yamt /* The push insns do not do this rounding implicitly.
1501 1.1.1.1.4.2 yamt So don't define this. */
1502 1.1.1.1.4.2 yamt /* #define PUSH_ROUNDING(NPUSHED) ROUND_UP_WORD (NPUSHED) */
1503 1.1.1.1.4.2 yamt
1504 1.1.1.1.4.2 yamt /* Define this if the maximum size of all the outgoing args is to be
1505 1.1.1.1.4.2 yamt accumulated and pushed during the prologue. The amount can be
1506 1.1.1.1.4.2 yamt found in the variable crtl->outgoing_args_size. */
1507 1.1.1.1.4.2 yamt #define ACCUMULATE_OUTGOING_ARGS 1
1508 1.1.1.1.4.2 yamt
1509 1.1.1.1.4.2 yamt /* Offset of first parameter from the argument pointer register value. */
1510 1.1.1.1.4.2 yamt #define FIRST_PARM_OFFSET(FNDECL) (TARGET_ARM ? 4 : 0)
1511 1.1.1.1.4.2 yamt
1512 1.1.1.1.4.2 yamt /* Value is the number of byte of arguments automatically
1513 1.1.1.1.4.2 yamt popped when returning from a subroutine call.
1514 1.1.1.1.4.2 yamt FUNDECL is the declaration node of the function (as a tree),
1515 1.1.1.1.4.2 yamt FUNTYPE is the data type of the function (as a tree),
1516 1.1.1.1.4.2 yamt or for a library call it is an identifier node for the subroutine name.
1517 1.1.1.1.4.2 yamt SIZE is the number of bytes of arguments passed on the stack.
1518 1.1.1.1.4.2 yamt
1519 1.1.1.1.4.2 yamt On the ARM, the caller does not pop any of its arguments that were passed
1520 1.1.1.1.4.2 yamt on the stack. */
1521 1.1.1.1.4.2 yamt #define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, SIZE) 0
1522 1.1.1.1.4.2 yamt
1523 1.1.1.1.4.2 yamt /* Define how to find the value returned by a library function
1524 1.1.1.1.4.2 yamt assuming the value has mode MODE. */
1525 1.1.1.1.4.2 yamt #define LIBCALL_VALUE(MODE) \
1526 1.1.1.1.4.2 yamt (TARGET_AAPCS_BASED ? aapcs_libcall_value (MODE) \
1527 1.1.1.1.4.2 yamt : (TARGET_32BIT && TARGET_HARD_FLOAT_ABI && TARGET_FPA \
1528 1.1.1.1.4.2 yamt && GET_MODE_CLASS (MODE) == MODE_FLOAT) \
1529 1.1.1.1.4.2 yamt ? gen_rtx_REG (MODE, FIRST_FPA_REGNUM) \
1530 1.1.1.1.4.2 yamt : TARGET_32BIT && TARGET_HARD_FLOAT_ABI && TARGET_MAVERICK \
1531 1.1.1.1.4.2 yamt && GET_MODE_CLASS (MODE) == MODE_FLOAT \
1532 1.1.1.1.4.2 yamt ? gen_rtx_REG (MODE, FIRST_CIRRUS_FP_REGNUM) \
1533 1.1.1.1.4.2 yamt : TARGET_IWMMXT_ABI && arm_vector_mode_supported_p (MODE) \
1534 1.1.1.1.4.2 yamt ? gen_rtx_REG (MODE, FIRST_IWMMXT_REGNUM) \
1535 1.1.1.1.4.2 yamt : gen_rtx_REG (MODE, ARG_REGISTER (1)))
1536 1.1.1.1.4.2 yamt
1537 1.1.1.1.4.2 yamt /* 1 if REGNO is a possible register number for a function value. */
1538 1.1.1.1.4.2 yamt #define FUNCTION_VALUE_REGNO_P(REGNO) \
1539 1.1.1.1.4.2 yamt ((REGNO) == ARG_REGISTER (1) \
1540 1.1.1.1.4.2 yamt || (TARGET_AAPCS_BASED && TARGET_32BIT \
1541 1.1.1.1.4.2 yamt && TARGET_VFP && TARGET_HARD_FLOAT \
1542 1.1.1.1.4.2 yamt && (REGNO) == FIRST_VFP_REGNUM) \
1543 1.1.1.1.4.2 yamt || (TARGET_32BIT && ((REGNO) == FIRST_CIRRUS_FP_REGNUM) \
1544 1.1.1.1.4.2 yamt && TARGET_HARD_FLOAT_ABI && TARGET_MAVERICK) \
1545 1.1.1.1.4.2 yamt || ((REGNO) == FIRST_IWMMXT_REGNUM && TARGET_IWMMXT_ABI) \
1546 1.1.1.1.4.2 yamt || (TARGET_32BIT && ((REGNO) == FIRST_FPA_REGNUM) \
1547 1.1.1.1.4.2 yamt && TARGET_HARD_FLOAT_ABI && TARGET_FPA))
1548 1.1.1.1.4.2 yamt
1549 1.1.1.1.4.2 yamt /* Amount of memory needed for an untyped call to save all possible return
1550 1.1.1.1.4.2 yamt registers. */
1551 1.1.1.1.4.2 yamt #define APPLY_RESULT_SIZE arm_apply_result_size()
1552 1.1.1.1.4.2 yamt
1553 1.1.1.1.4.2 yamt /* Define DEFAULT_PCC_STRUCT_RETURN to 1 if all structure and union return
1554 1.1.1.1.4.2 yamt values must be in memory. On the ARM, they need only do so if larger
1555 1.1.1.1.4.2 yamt than a word, or if they contain elements offset from zero in the struct. */
1556 1.1.1.1.4.2 yamt #define DEFAULT_PCC_STRUCT_RETURN 0
1557 1.1.1.1.4.2 yamt
1558 1.1.1.1.4.2 yamt /* These bits describe the different types of function supported
1559 1.1.1.1.4.2 yamt by the ARM backend. They are exclusive. i.e. a function cannot be both a
1560 1.1.1.1.4.2 yamt normal function and an interworked function, for example. Knowing the
1561 1.1.1.1.4.2 yamt type of a function is important for determining its prologue and
1562 1.1.1.1.4.2 yamt epilogue sequences.
1563 1.1.1.1.4.2 yamt Note value 7 is currently unassigned. Also note that the interrupt
1564 1.1.1.1.4.2 yamt function types all have bit 2 set, so that they can be tested for easily.
1565 1.1.1.1.4.2 yamt Note that 0 is deliberately chosen for ARM_FT_UNKNOWN so that when the
1566 1.1.1.1.4.2 yamt machine_function structure is initialized (to zero) func_type will
1567 1.1.1.1.4.2 yamt default to unknown. This will force the first use of arm_current_func_type
1568 1.1.1.1.4.2 yamt to call arm_compute_func_type. */
1569 1.1.1.1.4.2 yamt #define ARM_FT_UNKNOWN 0 /* Type has not yet been determined. */
1570 1.1.1.1.4.2 yamt #define ARM_FT_NORMAL 1 /* Your normal, straightforward function. */
1571 1.1.1.1.4.2 yamt #define ARM_FT_INTERWORKED 2 /* A function that supports interworking. */
1572 1.1.1.1.4.2 yamt #define ARM_FT_ISR 4 /* An interrupt service routine. */
1573 1.1.1.1.4.2 yamt #define ARM_FT_FIQ 5 /* A fast interrupt service routine. */
1574 1.1.1.1.4.2 yamt #define ARM_FT_EXCEPTION 6 /* An ARM exception handler (subcase of ISR). */
1575 1.1.1.1.4.2 yamt
1576 1.1.1.1.4.2 yamt #define ARM_FT_TYPE_MASK ((1 << 3) - 1)
1577 1.1.1.1.4.2 yamt
1578 1.1.1.1.4.2 yamt /* In addition functions can have several type modifiers,
1579 1.1.1.1.4.2 yamt outlined by these bit masks: */
1580 1.1.1.1.4.2 yamt #define ARM_FT_INTERRUPT (1 << 2) /* Note overlap with FT_ISR and above. */
1581 1.1.1.1.4.2 yamt #define ARM_FT_NAKED (1 << 3) /* No prologue or epilogue. */
1582 1.1.1.1.4.2 yamt #define ARM_FT_VOLATILE (1 << 4) /* Does not return. */
1583 1.1.1.1.4.2 yamt #define ARM_FT_NESTED (1 << 5) /* Embedded inside another func. */
1584 1.1.1.1.4.2 yamt #define ARM_FT_STACKALIGN (1 << 6) /* Called with misaligned stack. */
1585 1.1.1.1.4.2 yamt
1586 1.1.1.1.4.2 yamt /* Some macros to test these flags. */
1587 1.1.1.1.4.2 yamt #define ARM_FUNC_TYPE(t) (t & ARM_FT_TYPE_MASK)
1588 1.1.1.1.4.2 yamt #define IS_INTERRUPT(t) (t & ARM_FT_INTERRUPT)
1589 1.1.1.1.4.2 yamt #define IS_VOLATILE(t) (t & ARM_FT_VOLATILE)
1590 1.1.1.1.4.2 yamt #define IS_NAKED(t) (t & ARM_FT_NAKED)
1591 1.1.1.1.4.2 yamt #define IS_NESTED(t) (t & ARM_FT_NESTED)
1592 1.1.1.1.4.2 yamt #define IS_STACKALIGN(t) (t & ARM_FT_STACKALIGN)
1593 1.1.1.1.4.2 yamt
1594 1.1.1.1.4.2 yamt
1595 1.1.1.1.4.2 yamt /* Structure used to hold the function stack frame layout. Offsets are
1596 1.1.1.1.4.2 yamt relative to the stack pointer on function entry. Positive offsets are
1597 1.1.1.1.4.2 yamt in the direction of stack growth.
1598 1.1.1.1.4.2 yamt Only soft_frame is used in thumb mode. */
1599 1.1.1.1.4.2 yamt
1600 1.1.1.1.4.2 yamt typedef struct GTY(()) arm_stack_offsets
1601 1.1.1.1.4.2 yamt {
1602 1.1.1.1.4.2 yamt int saved_args; /* ARG_POINTER_REGNUM. */
1603 1.1.1.1.4.2 yamt int frame; /* ARM_HARD_FRAME_POINTER_REGNUM. */
1604 1.1.1.1.4.2 yamt int saved_regs;
1605 1.1.1.1.4.2 yamt int soft_frame; /* FRAME_POINTER_REGNUM. */
1606 1.1.1.1.4.2 yamt int locals_base; /* THUMB_HARD_FRAME_POINTER_REGNUM. */
1607 1.1.1.1.4.2 yamt int outgoing_args; /* STACK_POINTER_REGNUM. */
1608 1.1.1.1.4.2 yamt unsigned int saved_regs_mask;
1609 1.1.1.1.4.2 yamt }
1610 1.1.1.1.4.2 yamt arm_stack_offsets;
1611 1.1.1.1.4.2 yamt
1612 1.1.1.1.4.2 yamt /* A C structure for machine-specific, per-function data.
1613 1.1.1.1.4.2 yamt This is added to the cfun structure. */
1614 1.1.1.1.4.2 yamt typedef struct GTY(()) machine_function
1615 1.1.1.1.4.2 yamt {
1616 1.1.1.1.4.2 yamt /* Additional stack adjustment in __builtin_eh_throw. */
1617 1.1.1.1.4.2 yamt rtx eh_epilogue_sp_ofs;
1618 1.1.1.1.4.2 yamt /* Records if LR has to be saved for far jumps. */
1619 1.1.1.1.4.2 yamt int far_jump_used;
1620 1.1.1.1.4.2 yamt /* Records if ARG_POINTER was ever live. */
1621 1.1.1.1.4.2 yamt int arg_pointer_live;
1622 1.1.1.1.4.2 yamt /* Records if the save of LR has been eliminated. */
1623 1.1.1.1.4.2 yamt int lr_save_eliminated;
1624 1.1.1.1.4.2 yamt /* The size of the stack frame. Only valid after reload. */
1625 1.1.1.1.4.2 yamt arm_stack_offsets stack_offsets;
1626 1.1.1.1.4.2 yamt /* Records the type of the current function. */
1627 1.1.1.1.4.2 yamt unsigned long func_type;
1628 1.1.1.1.4.2 yamt /* Record if the function has a variable argument list. */
1629 1.1.1.1.4.2 yamt int uses_anonymous_args;
1630 1.1.1.1.4.2 yamt /* Records if sibcalls are blocked because an argument
1631 1.1.1.1.4.2 yamt register is needed to preserve stack alignment. */
1632 1.1.1.1.4.2 yamt int sibcall_blocked;
1633 1.1.1.1.4.2 yamt /* The PIC register for this function. This might be a pseudo. */
1634 1.1.1.1.4.2 yamt rtx pic_reg;
1635 1.1.1.1.4.2 yamt /* Labels for per-function Thumb call-via stubs. One per potential calling
1636 1.1.1.1.4.2 yamt register. We can never call via LR or PC. We can call via SP if a
1637 1.1.1.1.4.2 yamt trampoline happens to be on the top of the stack. */
1638 1.1.1.1.4.2 yamt rtx call_via[14];
1639 1.1.1.1.4.2 yamt /* Set to 1 when a return insn is output, this means that the epilogue
1640 1.1.1.1.4.2 yamt is not needed. */
1641 1.1.1.1.4.2 yamt int return_used_this_function;
1642 1.1.1.1.4.2 yamt }
1643 1.1.1.1.4.2 yamt machine_function;
1644 1.1.1.1.4.2 yamt
1645 1.1.1.1.4.2 yamt /* As in the machine_function, a global set of call-via labels, for code
1646 1.1.1.1.4.2 yamt that is in text_section. */
1647 1.1.1.1.4.2 yamt extern GTY(()) rtx thumb_call_via_label[14];
1648 1.1.1.1.4.2 yamt
1649 1.1.1.1.4.2 yamt /* The number of potential ways of assigning to a co-processor. */
1650 1.1.1.1.4.2 yamt #define ARM_NUM_COPROC_SLOTS 1
1651 1.1.1.1.4.2 yamt
1652 1.1.1.1.4.2 yamt /* Enumeration of procedure calling standard variants. We don't really
1653 1.1.1.1.4.2 yamt support all of these yet. */
1654 1.1.1.1.4.2 yamt enum arm_pcs
1655 1.1.1.1.4.2 yamt {
1656 1.1.1.1.4.2 yamt ARM_PCS_AAPCS, /* Base standard AAPCS. */
1657 1.1.1.1.4.2 yamt ARM_PCS_AAPCS_VFP, /* Use VFP registers for floating point values. */
1658 1.1.1.1.4.2 yamt ARM_PCS_AAPCS_IWMMXT, /* Use iWMMXT registers for vectors. */
1659 1.1.1.1.4.2 yamt /* This must be the last AAPCS variant. */
1660 1.1.1.1.4.2 yamt ARM_PCS_AAPCS_LOCAL, /* Private call within this compilation unit. */
1661 1.1.1.1.4.2 yamt ARM_PCS_ATPCS, /* ATPCS. */
1662 1.1.1.1.4.2 yamt ARM_PCS_APCS, /* APCS (legacy Linux etc). */
1663 1.1.1.1.4.2 yamt ARM_PCS_UNKNOWN
1664 1.1.1.1.4.2 yamt };
1665 1.1.1.1.4.2 yamt
1666 1.1.1.1.4.2 yamt /* A C type for declaring a variable that is used as the first argument of
1667 1.1.1.1.4.2 yamt `FUNCTION_ARG' and other related values. */
1668 1.1.1.1.4.2 yamt typedef struct
1669 1.1.1.1.4.2 yamt {
1670 1.1.1.1.4.2 yamt /* This is the number of registers of arguments scanned so far. */
1671 1.1.1.1.4.2 yamt int nregs;
1672 1.1.1.1.4.2 yamt /* This is the number of iWMMXt register arguments scanned so far. */
1673 1.1.1.1.4.2 yamt int iwmmxt_nregs;
1674 1.1.1.1.4.2 yamt int named_count;
1675 1.1.1.1.4.2 yamt int nargs;
1676 1.1.1.1.4.2 yamt /* Which procedure call variant to use for this call. */
1677 1.1.1.1.4.2 yamt enum arm_pcs pcs_variant;
1678 1.1.1.1.4.2 yamt
1679 1.1.1.1.4.2 yamt /* AAPCS related state tracking. */
1680 1.1.1.1.4.2 yamt int aapcs_arg_processed; /* No need to lay out this argument again. */
1681 1.1.1.1.4.2 yamt int aapcs_cprc_slot; /* Index of co-processor rules to handle
1682 1.1.1.1.4.2 yamt this argument, or -1 if using core
1683 1.1.1.1.4.2 yamt registers. */
1684 1.1.1.1.4.2 yamt int aapcs_ncrn;
1685 1.1.1.1.4.2 yamt int aapcs_next_ncrn;
1686 1.1.1.1.4.2 yamt rtx aapcs_reg; /* Register assigned to this argument. */
1687 1.1.1.1.4.2 yamt int aapcs_partial; /* How many bytes are passed in regs (if
1688 1.1.1.1.4.2 yamt split between core regs and stack.
1689 1.1.1.1.4.2 yamt Zero otherwise. */
1690 1.1.1.1.4.2 yamt int aapcs_cprc_failed[ARM_NUM_COPROC_SLOTS];
1691 1.1.1.1.4.2 yamt int can_split; /* Argument can be split between core regs
1692 1.1.1.1.4.2 yamt and the stack. */
1693 1.1.1.1.4.2 yamt /* Private data for tracking VFP register allocation */
1694 1.1.1.1.4.2 yamt unsigned aapcs_vfp_regs_free;
1695 1.1.1.1.4.2 yamt unsigned aapcs_vfp_reg_alloc;
1696 1.1.1.1.4.2 yamt int aapcs_vfp_rcount;
1697 1.1.1.1.4.2 yamt MACHMODE aapcs_vfp_rmode;
1698 1.1.1.1.4.2 yamt } CUMULATIVE_ARGS;
1699 1.1.1.1.4.2 yamt
1700 1.1.1.1.4.2 yamt /* Define where to put the arguments to a function.
1701 1.1.1.1.4.2 yamt Value is zero to push the argument on the stack,
1702 1.1.1.1.4.2 yamt or a hard register in which to store the argument.
1703 1.1.1.1.4.2 yamt
1704 1.1.1.1.4.2 yamt MODE is the argument's machine mode.
1705 1.1.1.1.4.2 yamt TYPE is the data type of the argument (as a tree).
1706 1.1.1.1.4.2 yamt This is null for libcalls where that information may
1707 1.1.1.1.4.2 yamt not be available.
1708 1.1.1.1.4.2 yamt CUM is a variable of type CUMULATIVE_ARGS which gives info about
1709 1.1.1.1.4.2 yamt the preceding args and about the function being called.
1710 1.1.1.1.4.2 yamt NAMED is nonzero if this argument is a named parameter
1711 1.1.1.1.4.2 yamt (otherwise it is an extra parameter matching an ellipsis).
1712 1.1.1.1.4.2 yamt
1713 1.1.1.1.4.2 yamt On the ARM, normally the first 16 bytes are passed in registers r0-r3; all
1714 1.1.1.1.4.2 yamt other arguments are passed on the stack. If (NAMED == 0) (which happens
1715 1.1.1.1.4.2 yamt only in assign_parms, since TARGET_SETUP_INCOMING_VARARGS is
1716 1.1.1.1.4.2 yamt defined), say it is passed in the stack (function_prologue will
1717 1.1.1.1.4.2 yamt indeed make it pass in the stack if necessary). */
1718 1.1.1.1.4.2 yamt #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
1719 1.1.1.1.4.2 yamt arm_function_arg (&(CUM), (MODE), (TYPE), (NAMED))
1720 1.1.1.1.4.2 yamt
1721 1.1.1.1.4.2 yamt #define FUNCTION_ARG_PADDING(MODE, TYPE) \
1722 1.1.1.1.4.2 yamt (arm_pad_arg_upward (MODE, TYPE) ? upward : downward)
1723 1.1.1.1.4.2 yamt
1724 1.1.1.1.4.2 yamt #define BLOCK_REG_PADDING(MODE, TYPE, FIRST) \
1725 1.1.1.1.4.2 yamt (arm_pad_reg_upward (MODE, TYPE, FIRST) ? upward : downward)
1726 1.1.1.1.4.2 yamt
1727 1.1.1.1.4.2 yamt /* For AAPCS, padding should never be below the argument. For other ABIs,
1728 1.1.1.1.4.2 yamt * mimic the default. */
1729 1.1.1.1.4.2 yamt #define PAD_VARARGS_DOWN \
1730 1.1.1.1.4.2 yamt ((TARGET_AAPCS_BASED) ? 0 : BYTES_BIG_ENDIAN)
1731 1.1.1.1.4.2 yamt
1732 1.1.1.1.4.2 yamt /* Initialize a variable CUM of type CUMULATIVE_ARGS
1733 1.1.1.1.4.2 yamt for a call to a function whose data type is FNTYPE.
1734 1.1.1.1.4.2 yamt For a library call, FNTYPE is 0.
1735 1.1.1.1.4.2 yamt On the ARM, the offset starts at 0. */
1736 1.1.1.1.4.2 yamt #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, FNDECL, N_NAMED_ARGS) \
1737 1.1.1.1.4.2 yamt arm_init_cumulative_args (&(CUM), (FNTYPE), (LIBNAME), (FNDECL))
1738 1.1.1.1.4.2 yamt
1739 1.1.1.1.4.2 yamt /* Update the data in CUM to advance over an argument
1740 1.1.1.1.4.2 yamt of mode MODE and data type TYPE.
1741 1.1.1.1.4.2 yamt (TYPE is null for libcalls where that information may not be available.) */
1742 1.1.1.1.4.2 yamt #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
1743 1.1.1.1.4.2 yamt arm_function_arg_advance (&(CUM), (MODE), (TYPE), (NAMED))
1744 1.1.1.1.4.2 yamt
1745 1.1.1.1.4.2 yamt /* If defined, a C expression that gives the alignment boundary, in bits, of an
1746 1.1.1.1.4.2 yamt argument with the specified mode and type. If it is not defined,
1747 1.1.1.1.4.2 yamt `PARM_BOUNDARY' is used for all arguments. */
1748 1.1.1.1.4.2 yamt #define FUNCTION_ARG_BOUNDARY(MODE,TYPE) \
1749 1.1.1.1.4.2 yamt ((ARM_DOUBLEWORD_ALIGN && arm_needs_doubleword_align (MODE, TYPE)) \
1750 1.1.1.1.4.2 yamt ? DOUBLEWORD_ALIGNMENT \
1751 1.1.1.1.4.2 yamt : PARM_BOUNDARY )
1752 1.1.1.1.4.2 yamt
1753 1.1.1.1.4.2 yamt /* 1 if N is a possible register number for function argument passing.
1754 1.1.1.1.4.2 yamt On the ARM, r0-r3 are used to pass args. */
1755 1.1.1.1.4.2 yamt #define FUNCTION_ARG_REGNO_P(REGNO) \
1756 1.1.1.1.4.2 yamt (IN_RANGE ((REGNO), 0, 3) \
1757 1.1.1.1.4.2 yamt || (TARGET_AAPCS_BASED && TARGET_VFP && TARGET_HARD_FLOAT \
1758 1.1.1.1.4.2 yamt && IN_RANGE ((REGNO), FIRST_VFP_REGNUM, FIRST_VFP_REGNUM + 15)) \
1759 1.1.1.1.4.2 yamt || (TARGET_IWMMXT_ABI \
1760 1.1.1.1.4.2 yamt && IN_RANGE ((REGNO), FIRST_IWMMXT_REGNUM, FIRST_IWMMXT_REGNUM + 9)))
1761 1.1.1.1.4.2 yamt
1762 1.1.1.1.4.2 yamt
1763 1.1.1.1.4.2 yamt /* If your target environment doesn't prefix user functions with an
1765 1.1.1.1.4.2 yamt underscore, you may wish to re-define this to prevent any conflicts. */
1766 1.1.1.1.4.2 yamt #ifndef ARM_MCOUNT_NAME
1767 1.1.1.1.4.2 yamt #define ARM_MCOUNT_NAME "*mcount"
1768 1.1.1.1.4.2 yamt #endif
1769 1.1.1.1.4.2 yamt
1770 1.1.1.1.4.2 yamt /* Call the function profiler with a given profile label. The Acorn
1771 1.1.1.1.4.2 yamt compiler puts this BEFORE the prolog but gcc puts it afterwards.
1772 1.1.1.1.4.2 yamt On the ARM the full profile code will look like:
1773 1.1.1.1.4.2 yamt .data
1774 1.1.1.1.4.2 yamt LP1
1775 1.1.1.1.4.2 yamt .word 0
1776 1.1.1.1.4.2 yamt .text
1777 1.1.1.1.4.2 yamt mov ip, lr
1778 1.1.1.1.4.2 yamt bl mcount
1779 1.1.1.1.4.2 yamt .word LP1
1780 1.1.1.1.4.2 yamt
1781 1.1.1.1.4.2 yamt profile_function() in final.c outputs the .data section, FUNCTION_PROFILER
1782 1.1.1.1.4.2 yamt will output the .text section.
1783 1.1.1.1.4.2 yamt
1784 1.1.1.1.4.2 yamt The ``mov ip,lr'' seems like a good idea to stick with cc convention.
1785 1.1.1.1.4.2 yamt ``prof'' doesn't seem to mind about this!
1786 1.1.1.1.4.2 yamt
1787 1.1.1.1.4.2 yamt Note - this version of the code is designed to work in both ARM and
1788 1.1.1.1.4.2 yamt Thumb modes. */
1789 1.1.1.1.4.2 yamt #ifndef ARM_FUNCTION_PROFILER
1790 1.1.1.1.4.2 yamt #define ARM_FUNCTION_PROFILER(STREAM, LABELNO) \
1791 1.1.1.1.4.2 yamt { \
1792 1.1.1.1.4.2 yamt char temp[20]; \
1793 1.1.1.1.4.2 yamt rtx sym; \
1794 1.1.1.1.4.2 yamt \
1795 1.1.1.1.4.2 yamt asm_fprintf (STREAM, "\tmov\t%r, %r\n\tbl\t", \
1796 1.1.1.1.4.2 yamt IP_REGNUM, LR_REGNUM); \
1797 1.1.1.1.4.2 yamt assemble_name (STREAM, ARM_MCOUNT_NAME); \
1798 1.1.1.1.4.2 yamt fputc ('\n', STREAM); \
1799 1.1.1.1.4.2 yamt ASM_GENERATE_INTERNAL_LABEL (temp, "LP", LABELNO); \
1800 1.1.1.1.4.2 yamt sym = gen_rtx_SYMBOL_REF (Pmode, temp); \
1801 1.1.1.1.4.2 yamt assemble_aligned_integer (UNITS_PER_WORD, sym); \
1802 1.1.1.1.4.2 yamt }
1803 1.1.1.1.4.2 yamt #endif
1804 1.1.1.1.4.2 yamt
1805 1.1.1.1.4.2 yamt #ifdef THUMB_FUNCTION_PROFILER
1806 1.1.1.1.4.2 yamt #define FUNCTION_PROFILER(STREAM, LABELNO) \
1807 1.1.1.1.4.2 yamt if (TARGET_ARM) \
1808 1.1.1.1.4.2 yamt ARM_FUNCTION_PROFILER (STREAM, LABELNO) \
1809 1.1.1.1.4.2 yamt else \
1810 1.1.1.1.4.2 yamt THUMB_FUNCTION_PROFILER (STREAM, LABELNO)
1811 1.1.1.1.4.2 yamt #else
1812 1.1.1.1.4.2 yamt #define FUNCTION_PROFILER(STREAM, LABELNO) \
1813 1.1.1.1.4.2 yamt ARM_FUNCTION_PROFILER (STREAM, LABELNO)
1814 1.1.1.1.4.2 yamt #endif
1815 1.1.1.1.4.2 yamt
1816 1.1.1.1.4.2 yamt /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
1817 1.1.1.1.4.2 yamt the stack pointer does not matter. The value is tested only in
1818 1.1.1.1.4.2 yamt functions that have frame pointers.
1819 1.1.1.1.4.2 yamt No definition is equivalent to always zero.
1820 1.1.1.1.4.2 yamt
1821 1.1.1.1.4.2 yamt On the ARM, the function epilogue recovers the stack pointer from the
1822 1.1.1.1.4.2 yamt frame. */
1823 1.1.1.1.4.2 yamt #define EXIT_IGNORE_STACK 1
1824 1.1.1.1.4.2 yamt
1825 1.1.1.1.4.2 yamt #define EPILOGUE_USES(REGNO) ((REGNO) == LR_REGNUM)
1826 1.1.1.1.4.2 yamt
1827 1.1.1.1.4.2 yamt /* Determine if the epilogue should be output as RTL.
1828 1.1.1.1.4.2 yamt You should override this if you define FUNCTION_EXTRA_EPILOGUE. */
1829 1.1.1.1.4.2 yamt /* This is disabled for Thumb-2 because it will confuse the
1830 1.1.1.1.4.2 yamt conditional insn counter. */
1831 1.1.1.1.4.2 yamt #define USE_RETURN_INSN(ISCOND) \
1832 1.1.1.1.4.2 yamt (TARGET_ARM ? use_return_insn (ISCOND, NULL) : 0)
1833 1.1.1.1.4.2 yamt
1834 1.1.1.1.4.2 yamt /* Definitions for register eliminations.
1835 1.1.1.1.4.2 yamt
1836 1.1.1.1.4.2 yamt This is an array of structures. Each structure initializes one pair
1837 1.1.1.1.4.2 yamt of eliminable registers. The "from" register number is given first,
1838 1.1.1.1.4.2 yamt followed by "to". Eliminations of the same "from" register are listed
1839 1.1.1.1.4.2 yamt in order of preference.
1840 1.1.1.1.4.2 yamt
1841 1.1.1.1.4.2 yamt We have two registers that can be eliminated on the ARM. First, the
1842 1.1.1.1.4.2 yamt arg pointer register can often be eliminated in favor of the stack
1843 1.1.1.1.4.2 yamt pointer register. Secondly, the pseudo frame pointer register can always
1844 1.1.1.1.4.2 yamt be eliminated; it is replaced with either the stack or the real frame
1845 1.1.1.1.4.2 yamt pointer. Note we have to use {ARM|THUMB}_HARD_FRAME_POINTER_REGNUM
1846 1.1.1.1.4.2 yamt because the definition of HARD_FRAME_POINTER_REGNUM is not a constant. */
1847 1.1.1.1.4.2 yamt
1848 1.1.1.1.4.2 yamt #define ELIMINABLE_REGS \
1849 1.1.1.1.4.2 yamt {{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM },\
1850 1.1.1.1.4.2 yamt { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM },\
1851 1.1.1.1.4.2 yamt { ARG_POINTER_REGNUM, ARM_HARD_FRAME_POINTER_REGNUM },\
1852 1.1.1.1.4.2 yamt { ARG_POINTER_REGNUM, THUMB_HARD_FRAME_POINTER_REGNUM },\
1853 1.1.1.1.4.2 yamt { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM },\
1854 1.1.1.1.4.2 yamt { FRAME_POINTER_REGNUM, ARM_HARD_FRAME_POINTER_REGNUM },\
1855 1.1.1.1.4.2 yamt { FRAME_POINTER_REGNUM, THUMB_HARD_FRAME_POINTER_REGNUM }}
1856 1.1.1.1.4.2 yamt
1857 1.1.1.1.4.2 yamt /* Define the offset between two registers, one to be eliminated, and the
1858 1.1.1.1.4.2 yamt other its replacement, at the start of a routine. */
1859 1.1.1.1.4.2 yamt #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
1860 1.1.1.1.4.2 yamt if (TARGET_ARM) \
1861 1.1.1.1.4.2 yamt (OFFSET) = arm_compute_initial_elimination_offset (FROM, TO); \
1862 1.1.1.1.4.2 yamt else \
1863 1.1.1.1.4.2 yamt (OFFSET) = thumb_compute_initial_elimination_offset (FROM, TO)
1864 1.1.1.1.4.2 yamt
1865 1.1.1.1.4.2 yamt /* Special case handling of the location of arguments passed on the stack. */
1866 1.1.1.1.4.2 yamt #define DEBUGGER_ARG_OFFSET(value, addr) value ? value : arm_debugger_arg_offset (value, addr)
1867 1.1.1.1.4.2 yamt
1868 1.1.1.1.4.2 yamt /* Initialize data used by insn expanders. This is called from insn_emit,
1869 1.1.1.1.4.2 yamt once for every function before code is generated. */
1870 1.1.1.1.4.2 yamt #define INIT_EXPANDERS arm_init_expanders ()
1871 1.1.1.1.4.2 yamt
1872 1.1.1.1.4.2 yamt /* Length in units of the trampoline for entering a nested function. */
1873 1.1.1.1.4.2 yamt #define TRAMPOLINE_SIZE (TARGET_32BIT ? 16 : 20)
1874 1.1.1.1.4.2 yamt
1875 1.1.1.1.4.2 yamt /* Alignment required for a trampoline in bits. */
1876 1.1.1.1.4.2 yamt #define TRAMPOLINE_ALIGNMENT 32
1877 1.1.1.1.4.2 yamt
1878 1.1.1.1.4.2 yamt /* Addressing modes, and classification of registers for them. */
1880 1.1.1.1.4.2 yamt #define HAVE_POST_INCREMENT 1
1881 1.1.1.1.4.2 yamt #define HAVE_PRE_INCREMENT TARGET_32BIT
1882 1.1.1.1.4.2 yamt #define HAVE_POST_DECREMENT TARGET_32BIT
1883 1.1.1.1.4.2 yamt #define HAVE_PRE_DECREMENT TARGET_32BIT
1884 1.1.1.1.4.2 yamt #define HAVE_PRE_MODIFY_DISP TARGET_32BIT
1885 1.1.1.1.4.2 yamt #define HAVE_POST_MODIFY_DISP TARGET_32BIT
1886 1.1.1.1.4.2 yamt #define HAVE_PRE_MODIFY_REG TARGET_32BIT
1887 1.1.1.1.4.2 yamt #define HAVE_POST_MODIFY_REG TARGET_32BIT
1888 1.1.1.1.4.2 yamt
1889 1.1.1.1.4.2 yamt /* Macros to check register numbers against specific register classes. */
1890 1.1.1.1.4.2 yamt
1891 1.1.1.1.4.2 yamt /* These assume that REGNO is a hard or pseudo reg number.
1892 1.1.1.1.4.2 yamt They give nonzero only if REGNO is a hard reg of the suitable class
1893 1.1.1.1.4.2 yamt or a pseudo reg currently allocated to a suitable hard reg.
1894 1.1.1.1.4.2 yamt Since they use reg_renumber, they are safe only once reg_renumber
1895 1.1.1.1.4.2 yamt has been allocated, which happens in local-alloc.c. */
1896 1.1.1.1.4.2 yamt #define TEST_REGNO(R, TEST, VALUE) \
1897 1.1.1.1.4.2 yamt ((R TEST VALUE) || ((unsigned) reg_renumber[R] TEST VALUE))
1898 1.1.1.1.4.2 yamt
1899 1.1.1.1.4.2 yamt /* Don't allow the pc to be used. */
1900 1.1.1.1.4.2 yamt #define ARM_REGNO_OK_FOR_BASE_P(REGNO) \
1901 1.1.1.1.4.2 yamt (TEST_REGNO (REGNO, <, PC_REGNUM) \
1902 1.1.1.1.4.2 yamt || TEST_REGNO (REGNO, ==, FRAME_POINTER_REGNUM) \
1903 1.1.1.1.4.2 yamt || TEST_REGNO (REGNO, ==, ARG_POINTER_REGNUM))
1904 1.1.1.1.4.2 yamt
1905 1.1.1.1.4.2 yamt #define THUMB1_REGNO_MODE_OK_FOR_BASE_P(REGNO, MODE) \
1906 1.1.1.1.4.2 yamt (TEST_REGNO (REGNO, <=, LAST_LO_REGNUM) \
1907 1.1.1.1.4.2 yamt || (GET_MODE_SIZE (MODE) >= 4 \
1908 1.1.1.1.4.2 yamt && TEST_REGNO (REGNO, ==, STACK_POINTER_REGNUM)))
1909 1.1.1.1.4.2 yamt
1910 1.1.1.1.4.2 yamt #define REGNO_MODE_OK_FOR_BASE_P(REGNO, MODE) \
1911 1.1.1.1.4.2 yamt (TARGET_THUMB1 \
1912 1.1.1.1.4.2 yamt ? THUMB1_REGNO_MODE_OK_FOR_BASE_P (REGNO, MODE) \
1913 1.1.1.1.4.2 yamt : ARM_REGNO_OK_FOR_BASE_P (REGNO))
1914 1.1.1.1.4.2 yamt
1915 1.1.1.1.4.2 yamt /* Nonzero if X can be the base register in a reg+reg addressing mode.
1916 1.1.1.1.4.2 yamt For Thumb, we can not use SP + reg, so reject SP. */
1917 1.1.1.1.4.2 yamt #define REGNO_MODE_OK_FOR_REG_BASE_P(X, MODE) \
1918 1.1.1.1.4.2 yamt REGNO_MODE_OK_FOR_BASE_P (X, QImode)
1919 1.1.1.1.4.2 yamt
1920 1.1.1.1.4.2 yamt /* For ARM code, we don't care about the mode, but for Thumb, the index
1921 1.1.1.1.4.2 yamt must be suitable for use in a QImode load. */
1922 1.1.1.1.4.2 yamt #define REGNO_OK_FOR_INDEX_P(REGNO) \
1923 1.1.1.1.4.2 yamt (REGNO_MODE_OK_FOR_BASE_P (REGNO, QImode) \
1924 1.1.1.1.4.2 yamt && !TEST_REGNO (REGNO, ==, STACK_POINTER_REGNUM))
1925 1.1.1.1.4.2 yamt
1926 1.1.1.1.4.2 yamt /* Maximum number of registers that can appear in a valid memory address.
1927 1.1.1.1.4.2 yamt Shifts in addresses can't be by a register. */
1928 1.1.1.1.4.2 yamt #define MAX_REGS_PER_ADDRESS 2
1929 1.1.1.1.4.2 yamt
1930 1.1.1.1.4.2 yamt /* Recognize any constant value that is a valid address. */
1931 1.1.1.1.4.2 yamt /* XXX We can address any constant, eventually... */
1932 1.1.1.1.4.2 yamt /* ??? Should the TARGET_ARM here also apply to thumb2? */
1933 1.1.1.1.4.2 yamt #define CONSTANT_ADDRESS_P(X) \
1934 1.1.1.1.4.2 yamt (GET_CODE (X) == SYMBOL_REF \
1935 1.1.1.1.4.2 yamt && (CONSTANT_POOL_ADDRESS_P (X) \
1936 1.1.1.1.4.2 yamt || (TARGET_ARM && optimize > 0 && SYMBOL_REF_FLAG (X))))
1937 1.1.1.1.4.2 yamt
1938 1.1.1.1.4.2 yamt /* True if SYMBOL + OFFSET constants must refer to something within
1939 1.1.1.1.4.2 yamt SYMBOL's section. */
1940 1.1.1.1.4.2 yamt #define ARM_OFFSETS_MUST_BE_WITHIN_SECTIONS_P 0
1941 1.1.1.1.4.2 yamt
1942 1.1.1.1.4.2 yamt /* Nonzero if all target requires all absolute relocations be R_ARM_ABS32. */
1943 1.1.1.1.4.2 yamt #ifndef TARGET_DEFAULT_WORD_RELOCATIONS
1944 1.1.1.1.4.2 yamt #define TARGET_DEFAULT_WORD_RELOCATIONS 0
1945 1.1.1.1.4.2 yamt #endif
1946 1.1.1.1.4.2 yamt
1947 1.1.1.1.4.2 yamt /* Nonzero if the constant value X is a legitimate general operand.
1948 1.1.1.1.4.2 yamt It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE.
1949 1.1.1.1.4.2 yamt
1950 1.1.1.1.4.2 yamt On the ARM, allow any integer (invalid ones are removed later by insn
1951 1.1.1.1.4.2 yamt patterns), nice doubles and symbol_refs which refer to the function's
1952 1.1.1.1.4.2 yamt constant pool XXX.
1953 1.1.1.1.4.2 yamt
1954 1.1.1.1.4.2 yamt When generating pic allow anything. */
1955 1.1.1.1.4.2 yamt #define ARM_LEGITIMATE_CONSTANT_P(X) (flag_pic || ! label_mentioned_p (X))
1956 1.1.1.1.4.2 yamt
1957 1.1.1.1.4.2 yamt #define THUMB_LEGITIMATE_CONSTANT_P(X) \
1958 1.1.1.1.4.2 yamt ( GET_CODE (X) == CONST_INT \
1959 1.1.1.1.4.2 yamt || GET_CODE (X) == CONST_DOUBLE \
1960 1.1.1.1.4.2 yamt || CONSTANT_ADDRESS_P (X) \
1961 1.1.1.1.4.2 yamt || flag_pic)
1962 1.1.1.1.4.2 yamt
1963 1.1.1.1.4.2 yamt #define LEGITIMATE_CONSTANT_P(X) \
1964 1.1.1.1.4.2 yamt (!arm_cannot_force_const_mem (X) \
1965 1.1.1.1.4.2 yamt && (TARGET_32BIT ? ARM_LEGITIMATE_CONSTANT_P (X) \
1966 1.1.1.1.4.2 yamt : THUMB_LEGITIMATE_CONSTANT_P (X)))
1967 1.1.1.1.4.2 yamt
1968 1.1.1.1.4.2 yamt #ifndef SUBTARGET_NAME_ENCODING_LENGTHS
1969 1.1.1.1.4.2 yamt #define SUBTARGET_NAME_ENCODING_LENGTHS
1970 1.1.1.1.4.2 yamt #endif
1971 1.1.1.1.4.2 yamt
1972 1.1.1.1.4.2 yamt /* This is a C fragment for the inside of a switch statement.
1973 1.1.1.1.4.2 yamt Each case label should return the number of characters to
1974 1.1.1.1.4.2 yamt be stripped from the start of a function's name, if that
1975 1.1.1.1.4.2 yamt name starts with the indicated character. */
1976 1.1.1.1.4.2 yamt #define ARM_NAME_ENCODING_LENGTHS \
1977 1.1.1.1.4.2 yamt case '*': return 1; \
1978 1.1.1.1.4.2 yamt SUBTARGET_NAME_ENCODING_LENGTHS
1979 1.1.1.1.4.2 yamt
1980 1.1.1.1.4.2 yamt /* This is how to output a reference to a user-level label named NAME.
1981 1.1.1.1.4.2 yamt `assemble_name' uses this. */
1982 1.1.1.1.4.2 yamt #undef ASM_OUTPUT_LABELREF
1983 1.1.1.1.4.2 yamt #define ASM_OUTPUT_LABELREF(FILE, NAME) \
1984 1.1.1.1.4.2 yamt arm_asm_output_labelref (FILE, NAME)
1985 1.1.1.1.4.2 yamt
1986 1.1.1.1.4.2 yamt /* Output IT instructions for conditionally executed Thumb-2 instructions. */
1987 1.1.1.1.4.2 yamt #define ASM_OUTPUT_OPCODE(STREAM, PTR) \
1988 1.1.1.1.4.2 yamt if (TARGET_THUMB2) \
1989 1.1.1.1.4.2 yamt thumb2_asm_output_opcode (STREAM);
1990 1.1.1.1.4.2 yamt
1991 1.1.1.1.4.2 yamt /* The EABI specifies that constructors should go in .init_array.
1992 1.1.1.1.4.2 yamt Other targets use .ctors for compatibility. */
1993 1.1.1.1.4.2 yamt #ifndef ARM_EABI_CTORS_SECTION_OP
1994 1.1.1.1.4.2 yamt #define ARM_EABI_CTORS_SECTION_OP \
1995 1.1.1.1.4.2 yamt "\t.section\t.init_array,\"aw\",%init_array"
1996 1.1.1.1.4.2 yamt #endif
1997 1.1.1.1.4.2 yamt #ifndef ARM_EABI_DTORS_SECTION_OP
1998 1.1.1.1.4.2 yamt #define ARM_EABI_DTORS_SECTION_OP \
1999 1.1.1.1.4.2 yamt "\t.section\t.fini_array,\"aw\",%fini_array"
2000 1.1.1.1.4.2 yamt #endif
2001 1.1.1.1.4.2 yamt #define ARM_CTORS_SECTION_OP \
2002 1.1.1.1.4.2 yamt "\t.section\t.ctors,\"aw\",%progbits"
2003 1.1.1.1.4.2 yamt #define ARM_DTORS_SECTION_OP \
2004 1.1.1.1.4.2 yamt "\t.section\t.dtors,\"aw\",%progbits"
2005 1.1.1.1.4.2 yamt
2006 1.1.1.1.4.2 yamt /* Define CTORS_SECTION_ASM_OP. */
2007 1.1.1.1.4.2 yamt #undef CTORS_SECTION_ASM_OP
2008 1.1.1.1.4.2 yamt #undef DTORS_SECTION_ASM_OP
2009 1.1.1.1.4.2 yamt #ifndef IN_LIBGCC2
2010 1.1.1.1.4.2 yamt # define CTORS_SECTION_ASM_OP \
2011 1.1.1.1.4.2 yamt (TARGET_AAPCS_BASED ? ARM_EABI_CTORS_SECTION_OP : ARM_CTORS_SECTION_OP)
2012 1.1.1.1.4.2 yamt # define DTORS_SECTION_ASM_OP \
2013 1.1.1.1.4.2 yamt (TARGET_AAPCS_BASED ? ARM_EABI_DTORS_SECTION_OP : ARM_DTORS_SECTION_OP)
2014 1.1.1.1.4.2 yamt #else /* !defined (IN_LIBGCC2) */
2015 1.1.1.1.4.2 yamt /* In libgcc, CTORS_SECTION_ASM_OP must be a compile-time constant,
2016 1.1.1.1.4.2 yamt so we cannot use the definition above. */
2017 1.1.1.1.4.2 yamt # ifdef __ARM_EABI__
2018 1.1.1.1.4.2 yamt /* The .ctors section is not part of the EABI, so we do not define
2019 1.1.1.1.4.2 yamt CTORS_SECTION_ASM_OP when in libgcc; that prevents crtstuff
2020 1.1.1.1.4.2 yamt from trying to use it. We do define it when doing normal
2021 1.1.1.1.4.2 yamt compilation, as .init_array can be used instead of .ctors. */
2022 1.1.1.1.4.2 yamt /* There is no need to emit begin or end markers when using
2023 1.1.1.1.4.2 yamt init_array; the dynamic linker will compute the size of the
2024 1.1.1.1.4.2 yamt array itself based on special symbols created by the static
2025 1.1.1.1.4.2 yamt linker. However, we do need to arrange to set up
2026 1.1.1.1.4.2 yamt exception-handling here. */
2027 1.1.1.1.4.2 yamt # define CTOR_LIST_BEGIN asm (ARM_EABI_CTORS_SECTION_OP)
2028 1.1.1.1.4.2 yamt # define CTOR_LIST_END /* empty */
2029 1.1.1.1.4.2 yamt # define DTOR_LIST_BEGIN asm (ARM_EABI_DTORS_SECTION_OP)
2030 1.1.1.1.4.2 yamt # define DTOR_LIST_END /* empty */
2031 1.1.1.1.4.2 yamt # else /* !defined (__ARM_EABI__) */
2032 1.1.1.1.4.2 yamt # define CTORS_SECTION_ASM_OP ARM_CTORS_SECTION_OP
2033 1.1.1.1.4.2 yamt # define DTORS_SECTION_ASM_OP ARM_DTORS_SECTION_OP
2034 1.1.1.1.4.2 yamt # endif /* !defined (__ARM_EABI__) */
2035 1.1.1.1.4.2 yamt #endif /* !defined (IN_LIBCC2) */
2036 1.1.1.1.4.2 yamt
2037 1.1.1.1.4.2 yamt /* True if the operating system can merge entities with vague linkage
2038 1.1.1.1.4.2 yamt (e.g., symbols in COMDAT group) during dynamic linking. */
2039 1.1.1.1.4.2 yamt #ifndef TARGET_ARM_DYNAMIC_VAGUE_LINKAGE_P
2040 1.1.1.1.4.2 yamt #define TARGET_ARM_DYNAMIC_VAGUE_LINKAGE_P true
2041 1.1.1.1.4.2 yamt #endif
2042 1.1.1.1.4.2 yamt
2043 1.1.1.1.4.2 yamt #define ARM_OUTPUT_FN_UNWIND(F, PROLOGUE) arm_output_fn_unwind (F, PROLOGUE)
2044 1.1.1.1.4.2 yamt
2045 1.1.1.1.4.2 yamt #ifdef TARGET_UNWIND_INFO
2046 1.1.1.1.4.2 yamt #define ARM_EABI_UNWIND_TABLES \
2047 1.1.1.1.4.2 yamt ((!USING_SJLJ_EXCEPTIONS && flag_exceptions) || flag_unwind_tables)
2048 1.1.1.1.4.2 yamt #else
2049 1.1.1.1.4.2 yamt #define ARM_EABI_UNWIND_TABLES 0
2050 1.1.1.1.4.2 yamt #endif
2051 1.1.1.1.4.2 yamt
2052 1.1.1.1.4.2 yamt /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
2053 1.1.1.1.4.2 yamt and check its validity for a certain class.
2054 1.1.1.1.4.2 yamt We have two alternate definitions for each of them.
2055 1.1.1.1.4.2 yamt The usual definition accepts all pseudo regs; the other rejects
2056 1.1.1.1.4.2 yamt them unless they have been allocated suitable hard regs.
2057 1.1.1.1.4.2 yamt The symbol REG_OK_STRICT causes the latter definition to be used.
2058 1.1.1.1.4.2 yamt Thumb-2 has the same restrictions as arm. */
2059 1.1.1.1.4.2 yamt #ifndef REG_OK_STRICT
2060 1.1.1.1.4.2 yamt
2061 1.1.1.1.4.2 yamt #define ARM_REG_OK_FOR_BASE_P(X) \
2062 1.1.1.1.4.2 yamt (REGNO (X) <= LAST_ARM_REGNUM \
2063 1.1.1.1.4.2 yamt || REGNO (X) >= FIRST_PSEUDO_REGISTER \
2064 1.1.1.1.4.2 yamt || REGNO (X) == FRAME_POINTER_REGNUM \
2065 1.1.1.1.4.2 yamt || REGNO (X) == ARG_POINTER_REGNUM)
2066 1.1.1.1.4.2 yamt
2067 1.1.1.1.4.2 yamt #define ARM_REG_OK_FOR_INDEX_P(X) \
2068 1.1.1.1.4.2 yamt ((REGNO (X) <= LAST_ARM_REGNUM \
2069 1.1.1.1.4.2 yamt && REGNO (X) != STACK_POINTER_REGNUM) \
2070 1.1.1.1.4.2 yamt || REGNO (X) >= FIRST_PSEUDO_REGISTER \
2071 1.1.1.1.4.2 yamt || REGNO (X) == FRAME_POINTER_REGNUM \
2072 1.1.1.1.4.2 yamt || REGNO (X) == ARG_POINTER_REGNUM)
2073 1.1.1.1.4.2 yamt
2074 1.1.1.1.4.2 yamt #define THUMB1_REG_MODE_OK_FOR_BASE_P(X, MODE) \
2075 1.1.1.1.4.2 yamt (REGNO (X) <= LAST_LO_REGNUM \
2076 1.1.1.1.4.2 yamt || REGNO (X) >= FIRST_PSEUDO_REGISTER \
2077 1.1.1.1.4.2 yamt || (GET_MODE_SIZE (MODE) >= 4 \
2078 1.1.1.1.4.2 yamt && (REGNO (X) == STACK_POINTER_REGNUM \
2079 1.1.1.1.4.2 yamt || (X) == hard_frame_pointer_rtx \
2080 1.1.1.1.4.2 yamt || (X) == arg_pointer_rtx)))
2081 1.1.1.1.4.2 yamt
2082 1.1.1.1.4.2 yamt #define REG_STRICT_P 0
2083 1.1.1.1.4.2 yamt
2084 1.1.1.1.4.2 yamt #else /* REG_OK_STRICT */
2085 1.1.1.1.4.2 yamt
2086 1.1.1.1.4.2 yamt #define ARM_REG_OK_FOR_BASE_P(X) \
2087 1.1.1.1.4.2 yamt ARM_REGNO_OK_FOR_BASE_P (REGNO (X))
2088 1.1.1.1.4.2 yamt
2089 1.1.1.1.4.2 yamt #define ARM_REG_OK_FOR_INDEX_P(X) \
2090 1.1.1.1.4.2 yamt ARM_REGNO_OK_FOR_INDEX_P (REGNO (X))
2091 1.1.1.1.4.2 yamt
2092 1.1.1.1.4.2 yamt #define THUMB1_REG_MODE_OK_FOR_BASE_P(X, MODE) \
2093 1.1.1.1.4.2 yamt THUMB1_REGNO_MODE_OK_FOR_BASE_P (REGNO (X), MODE)
2094 1.1.1.1.4.2 yamt
2095 1.1.1.1.4.2 yamt #define REG_STRICT_P 1
2096 1.1.1.1.4.2 yamt
2097 1.1.1.1.4.2 yamt #endif /* REG_OK_STRICT */
2098 1.1.1.1.4.2 yamt
2099 1.1.1.1.4.2 yamt /* Now define some helpers in terms of the above. */
2100 1.1.1.1.4.2 yamt
2101 1.1.1.1.4.2 yamt #define REG_MODE_OK_FOR_BASE_P(X, MODE) \
2102 1.1.1.1.4.2 yamt (TARGET_THUMB1 \
2103 1.1.1.1.4.2 yamt ? THUMB1_REG_MODE_OK_FOR_BASE_P (X, MODE) \
2104 1.1.1.1.4.2 yamt : ARM_REG_OK_FOR_BASE_P (X))
2105 1.1.1.1.4.2 yamt
2106 1.1.1.1.4.2 yamt /* For 16-bit Thumb, a valid index register is anything that can be used in
2107 1.1.1.1.4.2 yamt a byte load instruction. */
2108 1.1.1.1.4.2 yamt #define THUMB1_REG_OK_FOR_INDEX_P(X) \
2109 1.1.1.1.4.2 yamt THUMB1_REG_MODE_OK_FOR_BASE_P (X, QImode)
2110 1.1.1.1.4.2 yamt
2111 1.1.1.1.4.2 yamt /* Nonzero if X is a hard reg that can be used as an index
2112 1.1.1.1.4.2 yamt or if it is a pseudo reg. On the Thumb, the stack pointer
2113 1.1.1.1.4.2 yamt is not suitable. */
2114 1.1.1.1.4.2 yamt #define REG_OK_FOR_INDEX_P(X) \
2115 1.1.1.1.4.2 yamt (TARGET_THUMB1 \
2116 1.1.1.1.4.2 yamt ? THUMB1_REG_OK_FOR_INDEX_P (X) \
2117 1.1.1.1.4.2 yamt : ARM_REG_OK_FOR_INDEX_P (X))
2118 1.1.1.1.4.2 yamt
2119 1.1.1.1.4.2 yamt /* Nonzero if X can be the base register in a reg+reg addressing mode.
2120 1.1.1.1.4.2 yamt For Thumb, we can not use SP + reg, so reject SP. */
2121 1.1.1.1.4.2 yamt #define REG_MODE_OK_FOR_REG_BASE_P(X, MODE) \
2122 1.1.1.1.4.2 yamt REG_OK_FOR_INDEX_P (X)
2123 1.1.1.1.4.2 yamt
2124 1.1.1.1.4.2 yamt #define ARM_BASE_REGISTER_RTX_P(X) \
2126 1.1.1.1.4.2 yamt (GET_CODE (X) == REG && ARM_REG_OK_FOR_BASE_P (X))
2127 1.1.1.1.4.2 yamt
2128 1.1.1.1.4.2 yamt #define ARM_INDEX_REGISTER_RTX_P(X) \
2129 1.1.1.1.4.2 yamt (GET_CODE (X) == REG && ARM_REG_OK_FOR_INDEX_P (X))
2130 1.1.1.1.4.2 yamt
2131 1.1.1.1.4.2 yamt /* Define this for compatibility reasons. */
2133 1.1.1.1.4.2 yamt #define HANDLE_PRAGMA_PACK_PUSH_POP 1
2134 1.1.1.1.4.2 yamt
2135 1.1.1.1.4.2 yamt /* Specify the machine mode that this machine uses
2136 1.1.1.1.4.2 yamt for the index in the tablejump instruction. */
2137 1.1.1.1.4.2 yamt #define CASE_VECTOR_MODE Pmode
2138 1.1.1.1.4.2 yamt
2139 1.1.1.1.4.2 yamt #define CASE_VECTOR_PC_RELATIVE (TARGET_THUMB2 \
2140 1.1.1.1.4.2 yamt || (TARGET_THUMB1 \
2141 1.1.1.1.4.2 yamt && (optimize_size || flag_pic)))
2142 1.1.1.1.4.2 yamt
2143 1.1.1.1.4.2 yamt #define CASE_VECTOR_SHORTEN_MODE(min, max, body) \
2144 1.1.1.1.4.2 yamt (TARGET_THUMB1 \
2145 1.1.1.1.4.2 yamt ? (min >= 0 && max < 512 \
2146 1.1.1.1.4.2 yamt ? (ADDR_DIFF_VEC_FLAGS (body).offset_unsigned = 1, QImode) \
2147 1.1.1.1.4.2 yamt : min >= -256 && max < 256 \
2148 1.1.1.1.4.2 yamt ? (ADDR_DIFF_VEC_FLAGS (body).offset_unsigned = 0, QImode) \
2149 1.1.1.1.4.2 yamt : min >= 0 && max < 8192 \
2150 1.1.1.1.4.2 yamt ? (ADDR_DIFF_VEC_FLAGS (body).offset_unsigned = 1, HImode) \
2151 1.1.1.1.4.2 yamt : min >= -4096 && max < 4096 \
2152 1.1.1.1.4.2 yamt ? (ADDR_DIFF_VEC_FLAGS (body).offset_unsigned = 0, HImode) \
2153 1.1.1.1.4.2 yamt : SImode) \
2154 1.1.1.1.4.2 yamt : ((min < 0 || max >= 0x2000 || !TARGET_THUMB2) ? SImode \
2155 1.1.1.1.4.2 yamt : (max >= 0x200) ? HImode \
2156 1.1.1.1.4.2 yamt : QImode))
2157 1.1.1.1.4.2 yamt
2158 1.1.1.1.4.2 yamt /* signed 'char' is most compatible, but RISC OS wants it unsigned.
2159 1.1.1.1.4.2 yamt unsigned is probably best, but may break some code. */
2160 1.1.1.1.4.2 yamt #ifndef DEFAULT_SIGNED_CHAR
2161 1.1.1.1.4.2 yamt #define DEFAULT_SIGNED_CHAR 0
2162 1.1.1.1.4.2 yamt #endif
2163 1.1.1.1.4.2 yamt
2164 1.1.1.1.4.2 yamt /* Max number of bytes we can move from memory to memory
2165 1.1.1.1.4.2 yamt in one reasonably fast instruction. */
2166 1.1.1.1.4.2 yamt #define MOVE_MAX 4
2167 1.1.1.1.4.2 yamt
2168 1.1.1.1.4.2 yamt #undef MOVE_RATIO
2169 1.1.1.1.4.2 yamt #define MOVE_RATIO(speed) (arm_tune_xscale ? 4 : 2)
2170 1.1.1.1.4.2 yamt
2171 1.1.1.1.4.2 yamt /* Define if operations between registers always perform the operation
2172 1.1.1.1.4.2 yamt on the full register even if a narrower mode is specified. */
2173 1.1.1.1.4.2 yamt #define WORD_REGISTER_OPERATIONS
2174 1.1.1.1.4.2 yamt
2175 1.1.1.1.4.2 yamt /* Define if loading in MODE, an integral mode narrower than BITS_PER_WORD
2176 1.1.1.1.4.2 yamt will either zero-extend or sign-extend. The value of this macro should
2177 1.1.1.1.4.2 yamt be the code that says which one of the two operations is implicitly
2178 1.1.1.1.4.2 yamt done, UNKNOWN if none. */
2179 1.1.1.1.4.2 yamt #define LOAD_EXTEND_OP(MODE) \
2180 1.1.1.1.4.2 yamt (TARGET_THUMB ? ZERO_EXTEND : \
2181 1.1.1.1.4.2 yamt ((arm_arch4 || (MODE) == QImode) ? ZERO_EXTEND \
2182 1.1.1.1.4.2 yamt : ((BYTES_BIG_ENDIAN && (MODE) == HImode) ? SIGN_EXTEND : UNKNOWN)))
2183 1.1.1.1.4.2 yamt
2184 1.1.1.1.4.2 yamt /* Nonzero if access to memory by bytes is slow and undesirable. */
2185 1.1.1.1.4.2 yamt #define SLOW_BYTE_ACCESS 0
2186 1.1.1.1.4.2 yamt
2187 1.1.1.1.4.2 yamt #define SLOW_UNALIGNED_ACCESS(MODE, ALIGN) 1
2188 1.1.1.1.4.2 yamt
2189 1.1.1.1.4.2 yamt /* Immediate shift counts are truncated by the output routines (or was it
2190 1.1.1.1.4.2 yamt the assembler?). Shift counts in a register are truncated by ARM. Note
2191 1.1.1.1.4.2 yamt that the native compiler puts too large (> 32) immediate shift counts
2192 1.1.1.1.4.2 yamt into a register and shifts by the register, letting the ARM decide what
2193 1.1.1.1.4.2 yamt to do instead of doing that itself. */
2194 1.1.1.1.4.2 yamt /* This is all wrong. Defining SHIFT_COUNT_TRUNCATED tells combine that
2195 1.1.1.1.4.2 yamt code like (X << (Y % 32)) for register X, Y is equivalent to (X << Y).
2196 1.1.1.1.4.2 yamt On the arm, Y in a register is used modulo 256 for the shift. Only for
2197 1.1.1.1.4.2 yamt rotates is modulo 32 used. */
2198 1.1.1.1.4.2 yamt /* #define SHIFT_COUNT_TRUNCATED 1 */
2199 1.1.1.1.4.2 yamt
2200 1.1.1.1.4.2 yamt /* All integers have the same format so truncation is easy. */
2201 1.1.1.1.4.2 yamt #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
2202 1.1.1.1.4.2 yamt
2203 1.1.1.1.4.2 yamt /* Calling from registers is a massive pain. */
2204 1.1.1.1.4.2 yamt #define NO_FUNCTION_CSE 1
2205 1.1.1.1.4.2 yamt
2206 1.1.1.1.4.2 yamt /* The machine modes of pointers and functions */
2207 1.1.1.1.4.2 yamt #define Pmode SImode
2208 1.1.1.1.4.2 yamt #define FUNCTION_MODE Pmode
2209 1.1.1.1.4.2 yamt
2210 1.1.1.1.4.2 yamt #define ARM_FRAME_RTX(X) \
2211 1.1.1.1.4.2 yamt ( (X) == frame_pointer_rtx || (X) == stack_pointer_rtx \
2212 1.1.1.1.4.2 yamt || (X) == arg_pointer_rtx)
2213 1.1.1.1.4.2 yamt
2214 1.1.1.1.4.2 yamt /* Moves to and from memory are quite expensive */
2215 1.1.1.1.4.2 yamt #define MEMORY_MOVE_COST(M, CLASS, IN) \
2216 1.1.1.1.4.2 yamt (TARGET_32BIT ? 10 : \
2217 1.1.1.1.4.2 yamt ((GET_MODE_SIZE (M) < 4 ? 8 : 2 * GET_MODE_SIZE (M)) \
2218 1.1.1.1.4.2 yamt * (CLASS == LO_REGS ? 1 : 2)))
2219 1.1.1.1.4.2 yamt
2220 1.1.1.1.4.2 yamt /* Try to generate sequences that don't involve branches, we can then use
2221 1.1.1.1.4.2 yamt conditional instructions */
2222 1.1.1.1.4.2 yamt #define BRANCH_COST(speed_p, predictable_p) \
2223 1.1.1.1.4.2 yamt (TARGET_32BIT ? 4 : (optimize > 0 ? 2 : 0))
2224 1.1.1.1.4.2 yamt
2225 1.1.1.1.4.2 yamt /* Position Independent Code. */
2227 1.1.1.1.4.2 yamt /* We decide which register to use based on the compilation options and
2228 1.1.1.1.4.2 yamt the assembler in use; this is more general than the APCS restriction of
2229 1.1.1.1.4.2 yamt using sb (r9) all the time. */
2230 1.1.1.1.4.2 yamt extern unsigned arm_pic_register;
2231 1.1.1.1.4.2 yamt
2232 1.1.1.1.4.2 yamt /* The register number of the register used to address a table of static
2233 1.1.1.1.4.2 yamt data addresses in memory. */
2234 1.1.1.1.4.2 yamt #define PIC_OFFSET_TABLE_REGNUM arm_pic_register
2235 1.1.1.1.4.2 yamt
2236 1.1.1.1.4.2 yamt /* We can't directly access anything that contains a symbol,
2237 1.1.1.1.4.2 yamt nor can we indirect via the constant pool. One exception is
2238 1.1.1.1.4.2 yamt UNSPEC_TLS, which is always PIC. */
2239 1.1.1.1.4.2 yamt #define LEGITIMATE_PIC_OPERAND_P(X) \
2240 1.1.1.1.4.2 yamt (!(symbol_mentioned_p (X) \
2241 1.1.1.1.4.2 yamt || label_mentioned_p (X) \
2242 1.1.1.1.4.2 yamt || (GET_CODE (X) == SYMBOL_REF \
2243 1.1.1.1.4.2 yamt && CONSTANT_POOL_ADDRESS_P (X) \
2244 1.1.1.1.4.2 yamt && (symbol_mentioned_p (get_pool_constant (X)) \
2245 1.1.1.1.4.2 yamt || label_mentioned_p (get_pool_constant (X))))) \
2246 1.1.1.1.4.2 yamt || tls_mentioned_p (X))
2247 1.1.1.1.4.2 yamt
2248 1.1.1.1.4.2 yamt /* We need to know when we are making a constant pool; this determines
2249 1.1.1.1.4.2 yamt whether data needs to be in the GOT or can be referenced via a GOT
2250 1.1.1.1.4.2 yamt offset. */
2251 1.1.1.1.4.2 yamt extern int making_const_table;
2252 1.1.1.1.4.2 yamt
2253 1.1.1.1.4.2 yamt /* Handle pragmas for compatibility with Intel's compilers. */
2255 1.1.1.1.4.2 yamt /* Also abuse this to register additional C specific EABI attributes. */
2256 1.1.1.1.4.2 yamt #define REGISTER_TARGET_PRAGMAS() do { \
2257 1.1.1.1.4.2 yamt c_register_pragma (0, "long_calls", arm_pr_long_calls); \
2258 1.1.1.1.4.2 yamt c_register_pragma (0, "no_long_calls", arm_pr_no_long_calls); \
2259 1.1.1.1.4.2 yamt c_register_pragma (0, "long_calls_off", arm_pr_long_calls_off); \
2260 1.1.1.1.4.2 yamt arm_lang_object_attributes_init(); \
2261 1.1.1.1.4.2 yamt } while (0)
2262 1.1.1.1.4.2 yamt
2263 1.1.1.1.4.2 yamt /* Condition code information. */
2264 1.1.1.1.4.2 yamt /* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
2265 1.1.1.1.4.2 yamt return the mode to be used for the comparison. */
2266 1.1.1.1.4.2 yamt
2267 1.1.1.1.4.2 yamt #define SELECT_CC_MODE(OP, X, Y) arm_select_cc_mode (OP, X, Y)
2268 1.1.1.1.4.2 yamt
2269 1.1.1.1.4.2 yamt #define REVERSIBLE_CC_MODE(MODE) 1
2270 1.1.1.1.4.2 yamt
2271 1.1.1.1.4.2 yamt #define REVERSE_CONDITION(CODE,MODE) \
2272 1.1.1.1.4.2 yamt (((MODE) == CCFPmode || (MODE) == CCFPEmode) \
2273 1.1.1.1.4.2 yamt ? reverse_condition_maybe_unordered (code) \
2274 1.1.1.1.4.2 yamt : reverse_condition (code))
2275 1.1.1.1.4.2 yamt
2276 1.1.1.1.4.2 yamt #define CANONICALIZE_COMPARISON(CODE, OP0, OP1) \
2277 1.1.1.1.4.2 yamt do \
2278 1.1.1.1.4.2 yamt { \
2279 1.1.1.1.4.2 yamt if (GET_CODE (OP1) == CONST_INT \
2280 1.1.1.1.4.2 yamt && ! (const_ok_for_arm (INTVAL (OP1)) \
2281 1.1.1.1.4.2 yamt || (const_ok_for_arm (- INTVAL (OP1))))) \
2282 1.1.1.1.4.2 yamt { \
2283 1.1.1.1.4.2 yamt rtx const_op = OP1; \
2284 1.1.1.1.4.2 yamt CODE = arm_canonicalize_comparison ((CODE), GET_MODE (OP0), \
2285 1.1.1.1.4.2 yamt &const_op); \
2286 1.1.1.1.4.2 yamt OP1 = const_op; \
2287 1.1.1.1.4.2 yamt } \
2288 1.1.1.1.4.2 yamt } \
2289 1.1.1.1.4.2 yamt while (0)
2290 1.1.1.1.4.2 yamt
2291 1.1.1.1.4.2 yamt /* The arm5 clz instruction returns 32. */
2292 1.1.1.1.4.2 yamt #define CLZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) ((VALUE) = 32, 1)
2293 1.1.1.1.4.2 yamt #define CTZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) ((VALUE) = 32, 1)
2294 1.1.1.1.4.2 yamt
2295 1.1.1.1.4.2 yamt #undef ASM_APP_OFF
2297 1.1.1.1.4.2 yamt #define ASM_APP_OFF (TARGET_THUMB1 ? "\t.code\t16\n" : \
2298 1.1.1.1.4.2 yamt TARGET_THUMB2 ? "\t.thumb\n" : "")
2299 1.1.1.1.4.2 yamt
2300 1.1.1.1.4.2 yamt /* Output a push or a pop instruction (only used when profiling).
2301 1.1.1.1.4.2 yamt We can't push STATIC_CHAIN_REGNUM (r12) directly with Thumb-1. We know
2302 1.1.1.1.4.2 yamt that ASM_OUTPUT_REG_PUSH will be matched with ASM_OUTPUT_REG_POP, and
2303 1.1.1.1.4.2 yamt that r7 isn't used by the function profiler, so we can use it as a
2304 1.1.1.1.4.2 yamt scratch reg. WARNING: This isn't safe in the general case! It may be
2305 1.1.1.1.4.2 yamt sensitive to future changes in final.c:profile_function. */
2306 1.1.1.1.4.2 yamt #define ASM_OUTPUT_REG_PUSH(STREAM, REGNO) \
2307 1.1.1.1.4.2 yamt do \
2308 1.1.1.1.4.2 yamt { \
2309 1.1.1.1.4.2 yamt if (TARGET_ARM) \
2310 1.1.1.1.4.2 yamt asm_fprintf (STREAM,"\tstmfd\t%r!,{%r}\n", \
2311 1.1.1.1.4.2 yamt STACK_POINTER_REGNUM, REGNO); \
2312 1.1.1.1.4.2 yamt else if (TARGET_THUMB1 \
2313 1.1.1.1.4.2 yamt && (REGNO) == STATIC_CHAIN_REGNUM) \
2314 1.1.1.1.4.2 yamt { \
2315 1.1.1.1.4.2 yamt asm_fprintf (STREAM, "\tpush\t{r7}\n"); \
2316 1.1.1.1.4.2 yamt asm_fprintf (STREAM, "\tmov\tr7, %r\n", REGNO);\
2317 1.1.1.1.4.2 yamt asm_fprintf (STREAM, "\tpush\t{r7}\n"); \
2318 1.1.1.1.4.2 yamt } \
2319 1.1.1.1.4.2 yamt else \
2320 1.1.1.1.4.2 yamt asm_fprintf (STREAM, "\tpush {%r}\n", REGNO); \
2321 1.1.1.1.4.2 yamt } while (0)
2322 1.1.1.1.4.2 yamt
2323 1.1.1.1.4.2 yamt
2324 1.1.1.1.4.2 yamt /* See comment for ASM_OUTPUT_REG_PUSH concerning Thumb-1 issue. */
2325 1.1.1.1.4.2 yamt #define ASM_OUTPUT_REG_POP(STREAM, REGNO) \
2326 1.1.1.1.4.2 yamt do \
2327 1.1.1.1.4.2 yamt { \
2328 1.1.1.1.4.2 yamt if (TARGET_ARM) \
2329 1.1.1.1.4.2 yamt asm_fprintf (STREAM, "\tldmfd\t%r!,{%r}\n", \
2330 1.1.1.1.4.2 yamt STACK_POINTER_REGNUM, REGNO); \
2331 1.1.1.1.4.2 yamt else if (TARGET_THUMB1 \
2332 1.1.1.1.4.2 yamt && (REGNO) == STATIC_CHAIN_REGNUM) \
2333 1.1.1.1.4.2 yamt { \
2334 1.1.1.1.4.2 yamt asm_fprintf (STREAM, "\tpop\t{r7}\n"); \
2335 1.1.1.1.4.2 yamt asm_fprintf (STREAM, "\tmov\t%r, r7\n", REGNO);\
2336 1.1.1.1.4.2 yamt asm_fprintf (STREAM, "\tpop\t{r7}\n"); \
2337 1.1.1.1.4.2 yamt } \
2338 1.1.1.1.4.2 yamt else \
2339 1.1.1.1.4.2 yamt asm_fprintf (STREAM, "\tpop {%r}\n", REGNO); \
2340 1.1.1.1.4.2 yamt } while (0)
2341 1.1.1.1.4.2 yamt
2342 1.1.1.1.4.2 yamt /* Jump table alignment is explicit in ASM_OUTPUT_CASE_LABEL. */
2343 1.1.1.1.4.2 yamt #define ADDR_VEC_ALIGN(JUMPTABLE) 0
2344 1.1.1.1.4.2 yamt
2345 1.1.1.1.4.2 yamt /* This is how to output a label which precedes a jumptable. Since
2346 1.1.1.1.4.2 yamt Thumb instructions are 2 bytes, we may need explicit alignment here. */
2347 1.1.1.1.4.2 yamt #undef ASM_OUTPUT_CASE_LABEL
2348 1.1.1.1.4.2 yamt #define ASM_OUTPUT_CASE_LABEL(FILE, PREFIX, NUM, JUMPTABLE) \
2349 1.1.1.1.4.2 yamt do \
2350 1.1.1.1.4.2 yamt { \
2351 1.1.1.1.4.2 yamt if (TARGET_THUMB && GET_MODE (PATTERN (JUMPTABLE)) == SImode) \
2352 1.1.1.1.4.2 yamt ASM_OUTPUT_ALIGN (FILE, 2); \
2353 1.1.1.1.4.2 yamt (*targetm.asm_out.internal_label) (FILE, PREFIX, NUM); \
2354 1.1.1.1.4.2 yamt } \
2355 1.1.1.1.4.2 yamt while (0)
2356 1.1.1.1.4.2 yamt
2357 1.1.1.1.4.2 yamt /* Make sure subsequent insns are aligned after a TBB. */
2358 1.1.1.1.4.2 yamt #define ASM_OUTPUT_CASE_END(FILE, NUM, JUMPTABLE) \
2359 1.1.1.1.4.2 yamt do \
2360 1.1.1.1.4.2 yamt { \
2361 1.1.1.1.4.2 yamt if (GET_MODE (PATTERN (JUMPTABLE)) == QImode) \
2362 1.1.1.1.4.2 yamt ASM_OUTPUT_ALIGN (FILE, 1); \
2363 1.1.1.1.4.2 yamt } \
2364 1.1.1.1.4.2 yamt while (0)
2365 1.1.1.1.4.2 yamt
2366 1.1.1.1.4.2 yamt #define ARM_DECLARE_FUNCTION_NAME(STREAM, NAME, DECL) \
2367 1.1.1.1.4.2 yamt do \
2368 1.1.1.1.4.2 yamt { \
2369 1.1.1.1.4.2 yamt if (TARGET_THUMB) \
2370 1.1.1.1.4.2 yamt { \
2371 1.1.1.1.4.2 yamt if (is_called_in_ARM_mode (DECL) \
2372 1.1.1.1.4.2 yamt || (TARGET_THUMB1 && !TARGET_THUMB1_ONLY \
2373 1.1.1.1.4.2 yamt && cfun->is_thunk)) \
2374 1.1.1.1.4.2 yamt fprintf (STREAM, "\t.code 32\n") ; \
2375 1.1.1.1.4.2 yamt else if (TARGET_THUMB1) \
2376 1.1.1.1.4.2 yamt fprintf (STREAM, "\t.code\t16\n\t.thumb_func\n") ; \
2377 1.1.1.1.4.2 yamt else \
2378 1.1.1.1.4.2 yamt fprintf (STREAM, "\t.thumb\n\t.thumb_func\n") ; \
2379 1.1.1.1.4.2 yamt } \
2380 1.1.1.1.4.2 yamt if (TARGET_POKE_FUNCTION_NAME) \
2381 1.1.1.1.4.2 yamt arm_poke_function_name (STREAM, (const char *) NAME); \
2382 1.1.1.1.4.2 yamt } \
2383 1.1.1.1.4.2 yamt while (0)
2384 1.1.1.1.4.2 yamt
2385 1.1.1.1.4.2 yamt /* For aliases of functions we use .thumb_set instead. */
2386 1.1.1.1.4.2 yamt #define ASM_OUTPUT_DEF_FROM_DECLS(FILE, DECL1, DECL2) \
2387 1.1.1.1.4.2 yamt do \
2388 1.1.1.1.4.2 yamt { \
2389 1.1.1.1.4.2 yamt const char *const LABEL1 = XSTR (XEXP (DECL_RTL (decl), 0), 0); \
2390 1.1.1.1.4.2 yamt const char *const LABEL2 = IDENTIFIER_POINTER (DECL2); \
2391 1.1.1.1.4.2 yamt \
2392 1.1.1.1.4.2 yamt if (TARGET_THUMB && TREE_CODE (DECL1) == FUNCTION_DECL) \
2393 1.1.1.1.4.2 yamt { \
2394 1.1.1.1.4.2 yamt fprintf (FILE, "\t.thumb_set "); \
2395 1.1.1.1.4.2 yamt assemble_name (FILE, LABEL1); \
2396 1.1.1.1.4.2 yamt fprintf (FILE, ","); \
2397 1.1.1.1.4.2 yamt assemble_name (FILE, LABEL2); \
2398 1.1.1.1.4.2 yamt fprintf (FILE, "\n"); \
2399 1.1.1.1.4.2 yamt } \
2400 1.1.1.1.4.2 yamt else \
2401 1.1.1.1.4.2 yamt ASM_OUTPUT_DEF (FILE, LABEL1, LABEL2); \
2402 1.1.1.1.4.2 yamt } \
2403 1.1.1.1.4.2 yamt while (0)
2404 1.1.1.1.4.2 yamt
2405 1.1.1.1.4.2 yamt #ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
2406 1.1.1.1.4.2 yamt /* To support -falign-* switches we need to use .p2align so
2407 1.1.1.1.4.2 yamt that alignment directives in code sections will be padded
2408 1.1.1.1.4.2 yamt with no-op instructions, rather than zeroes. */
2409 1.1.1.1.4.2 yamt #define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE, LOG, MAX_SKIP) \
2410 1.1.1.1.4.2 yamt if ((LOG) != 0) \
2411 1.1.1.1.4.2 yamt { \
2412 1.1.1.1.4.2 yamt if ((MAX_SKIP) == 0) \
2413 1.1.1.1.4.2 yamt fprintf ((FILE), "\t.p2align %d\n", (int) (LOG)); \
2414 1.1.1.1.4.2 yamt else \
2415 1.1.1.1.4.2 yamt fprintf ((FILE), "\t.p2align %d,,%d\n", \
2416 1.1.1.1.4.2 yamt (int) (LOG), (int) (MAX_SKIP)); \
2417 1.1.1.1.4.2 yamt }
2418 1.1.1.1.4.2 yamt #endif
2419 1.1.1.1.4.2 yamt
2420 1.1.1.1.4.2 yamt /* Add two bytes to the length of conditionally executed Thumb-2
2422 1.1.1.1.4.2 yamt instructions for the IT instruction. */
2423 1.1.1.1.4.2 yamt #define ADJUST_INSN_LENGTH(insn, length) \
2424 1.1.1.1.4.2 yamt if (TARGET_THUMB2 && GET_CODE (PATTERN (insn)) == COND_EXEC) \
2425 1.1.1.1.4.2 yamt length += 2;
2426 1.1.1.1.4.2 yamt
2427 1.1.1.1.4.2 yamt /* Only perform branch elimination (by making instructions conditional) if
2428 1.1.1.1.4.2 yamt we're optimizing. For Thumb-2 check if any IT instructions need
2429 1.1.1.1.4.2 yamt outputting. */
2430 1.1.1.1.4.2 yamt #define FINAL_PRESCAN_INSN(INSN, OPVEC, NOPERANDS) \
2431 1.1.1.1.4.2 yamt if (TARGET_ARM && optimize) \
2432 1.1.1.1.4.2 yamt arm_final_prescan_insn (INSN); \
2433 1.1.1.1.4.2 yamt else if (TARGET_THUMB2) \
2434 1.1.1.1.4.2 yamt thumb2_final_prescan_insn (INSN); \
2435 1.1.1.1.4.2 yamt else if (TARGET_THUMB1) \
2436 1.1.1.1.4.2 yamt thumb1_final_prescan_insn (INSN)
2437 1.1.1.1.4.2 yamt
2438 1.1.1.1.4.2 yamt #define PRINT_OPERAND_PUNCT_VALID_P(CODE) \
2439 1.1.1.1.4.2 yamt (CODE == '@' || CODE == '|' || CODE == '.' \
2440 1.1.1.1.4.2 yamt || CODE == '(' || CODE == ')' || CODE == '#' \
2441 1.1.1.1.4.2 yamt || (TARGET_32BIT && (CODE == '?')) \
2442 1.1.1.1.4.2 yamt || (TARGET_THUMB2 && (CODE == '!')) \
2443 1.1.1.1.4.2 yamt || (TARGET_THUMB && (CODE == '_')))
2444 1.1.1.1.4.2 yamt
2445 1.1.1.1.4.2 yamt /* Output an operand of an instruction. */
2446 1.1.1.1.4.2 yamt #define PRINT_OPERAND(STREAM, X, CODE) \
2447 1.1.1.1.4.2 yamt arm_print_operand (STREAM, X, CODE)
2448 1.1.1.1.4.2 yamt
2449 1.1.1.1.4.2 yamt #define ARM_SIGN_EXTEND(x) ((HOST_WIDE_INT) \
2450 1.1.1.1.4.2 yamt (HOST_BITS_PER_WIDE_INT <= 32 ? (unsigned HOST_WIDE_INT) (x) \
2451 1.1.1.1.4.2 yamt : ((((unsigned HOST_WIDE_INT)(x)) & (unsigned HOST_WIDE_INT) 0xffffffff) |\
2452 1.1.1.1.4.2 yamt ((((unsigned HOST_WIDE_INT)(x)) & (unsigned HOST_WIDE_INT) 0x80000000) \
2453 1.1.1.1.4.2 yamt ? ((~ (unsigned HOST_WIDE_INT) 0) \
2454 1.1.1.1.4.2 yamt & ~ (unsigned HOST_WIDE_INT) 0xffffffff) \
2455 1.1.1.1.4.2 yamt : 0))))
2456 1.1.1.1.4.2 yamt
2457 1.1.1.1.4.2 yamt /* Output the address of an operand. */
2458 1.1.1.1.4.2 yamt #define ARM_PRINT_OPERAND_ADDRESS(STREAM, X) \
2459 1.1.1.1.4.2 yamt { \
2460 1.1.1.1.4.2 yamt int is_minus = GET_CODE (X) == MINUS; \
2461 1.1.1.1.4.2 yamt \
2462 1.1.1.1.4.2 yamt if (GET_CODE (X) == REG) \
2463 1.1.1.1.4.2 yamt asm_fprintf (STREAM, "[%r, #0]", REGNO (X)); \
2464 1.1.1.1.4.2 yamt else if (GET_CODE (X) == PLUS || is_minus) \
2465 1.1.1.1.4.2 yamt { \
2466 1.1.1.1.4.2 yamt rtx base = XEXP (X, 0); \
2467 1.1.1.1.4.2 yamt rtx index = XEXP (X, 1); \
2468 1.1.1.1.4.2 yamt HOST_WIDE_INT offset = 0; \
2469 1.1.1.1.4.2 yamt if (GET_CODE (base) != REG \
2470 1.1.1.1.4.2 yamt || (GET_CODE (index) == REG && REGNO (index) == SP_REGNUM)) \
2471 1.1.1.1.4.2 yamt { \
2472 1.1.1.1.4.2 yamt /* Ensure that BASE is a register. */ \
2473 1.1.1.1.4.2 yamt /* (one of them must be). */ \
2474 1.1.1.1.4.2 yamt /* Also ensure the SP is not used as in index register. */ \
2475 1.1.1.1.4.2 yamt rtx temp = base; \
2476 1.1.1.1.4.2 yamt base = index; \
2477 1.1.1.1.4.2 yamt index = temp; \
2478 1.1.1.1.4.2 yamt } \
2479 1.1.1.1.4.2 yamt switch (GET_CODE (index)) \
2480 1.1.1.1.4.2 yamt { \
2481 1.1.1.1.4.2 yamt case CONST_INT: \
2482 1.1.1.1.4.2 yamt offset = INTVAL (index); \
2483 1.1.1.1.4.2 yamt if (is_minus) \
2484 1.1.1.1.4.2 yamt offset = -offset; \
2485 1.1.1.1.4.2 yamt asm_fprintf (STREAM, "[%r, #%wd]", \
2486 1.1.1.1.4.2 yamt REGNO (base), offset); \
2487 1.1.1.1.4.2 yamt break; \
2488 1.1.1.1.4.2 yamt \
2489 1.1.1.1.4.2 yamt case REG: \
2490 1.1.1.1.4.2 yamt asm_fprintf (STREAM, "[%r, %s%r]", \
2491 1.1.1.1.4.2 yamt REGNO (base), is_minus ? "-" : "", \
2492 1.1.1.1.4.2 yamt REGNO (index)); \
2493 1.1.1.1.4.2 yamt break; \
2494 1.1.1.1.4.2 yamt \
2495 1.1.1.1.4.2 yamt case MULT: \
2496 1.1.1.1.4.2 yamt case ASHIFTRT: \
2497 1.1.1.1.4.2 yamt case LSHIFTRT: \
2498 1.1.1.1.4.2 yamt case ASHIFT: \
2499 1.1.1.1.4.2 yamt case ROTATERT: \
2500 1.1.1.1.4.2 yamt { \
2501 1.1.1.1.4.2 yamt asm_fprintf (STREAM, "[%r, %s%r", \
2502 1.1.1.1.4.2 yamt REGNO (base), is_minus ? "-" : "", \
2503 1.1.1.1.4.2 yamt REGNO (XEXP (index, 0))); \
2504 1.1.1.1.4.2 yamt arm_print_operand (STREAM, index, 'S'); \
2505 1.1.1.1.4.2 yamt fputs ("]", STREAM); \
2506 1.1.1.1.4.2 yamt break; \
2507 1.1.1.1.4.2 yamt } \
2508 1.1.1.1.4.2 yamt \
2509 1.1.1.1.4.2 yamt default: \
2510 1.1.1.1.4.2 yamt gcc_unreachable (); \
2511 1.1.1.1.4.2 yamt } \
2512 1.1.1.1.4.2 yamt } \
2513 1.1.1.1.4.2 yamt else if (GET_CODE (X) == PRE_INC || GET_CODE (X) == POST_INC \
2514 1.1.1.1.4.2 yamt || GET_CODE (X) == PRE_DEC || GET_CODE (X) == POST_DEC) \
2515 1.1.1.1.4.2 yamt { \
2516 1.1.1.1.4.2 yamt extern enum machine_mode output_memory_reference_mode; \
2517 1.1.1.1.4.2 yamt \
2518 1.1.1.1.4.2 yamt gcc_assert (GET_CODE (XEXP (X, 0)) == REG); \
2519 1.1.1.1.4.2 yamt \
2520 1.1.1.1.4.2 yamt if (GET_CODE (X) == PRE_DEC || GET_CODE (X) == PRE_INC) \
2521 1.1.1.1.4.2 yamt asm_fprintf (STREAM, "[%r, #%s%d]!", \
2522 1.1.1.1.4.2 yamt REGNO (XEXP (X, 0)), \
2523 1.1.1.1.4.2 yamt GET_CODE (X) == PRE_DEC ? "-" : "", \
2524 1.1.1.1.4.2 yamt GET_MODE_SIZE (output_memory_reference_mode)); \
2525 1.1.1.1.4.2 yamt else \
2526 1.1.1.1.4.2 yamt asm_fprintf (STREAM, "[%r], #%s%d", \
2527 1.1.1.1.4.2 yamt REGNO (XEXP (X, 0)), \
2528 1.1.1.1.4.2 yamt GET_CODE (X) == POST_DEC ? "-" : "", \
2529 1.1.1.1.4.2 yamt GET_MODE_SIZE (output_memory_reference_mode)); \
2530 1.1.1.1.4.2 yamt } \
2531 1.1.1.1.4.2 yamt else if (GET_CODE (X) == PRE_MODIFY) \
2532 1.1.1.1.4.2 yamt { \
2533 1.1.1.1.4.2 yamt asm_fprintf (STREAM, "[%r, ", REGNO (XEXP (X, 0))); \
2534 1.1.1.1.4.2 yamt if (GET_CODE (XEXP (XEXP (X, 1), 1)) == CONST_INT) \
2535 1.1.1.1.4.2 yamt asm_fprintf (STREAM, "#%wd]!", \
2536 1.1.1.1.4.2 yamt INTVAL (XEXP (XEXP (X, 1), 1))); \
2537 1.1.1.1.4.2 yamt else \
2538 1.1.1.1.4.2 yamt asm_fprintf (STREAM, "%r]!", \
2539 1.1.1.1.4.2 yamt REGNO (XEXP (XEXP (X, 1), 1))); \
2540 1.1.1.1.4.2 yamt } \
2541 1.1.1.1.4.2 yamt else if (GET_CODE (X) == POST_MODIFY) \
2542 1.1.1.1.4.2 yamt { \
2543 1.1.1.1.4.2 yamt asm_fprintf (STREAM, "[%r], ", REGNO (XEXP (X, 0))); \
2544 1.1.1.1.4.2 yamt if (GET_CODE (XEXP (XEXP (X, 1), 1)) == CONST_INT) \
2545 1.1.1.1.4.2 yamt asm_fprintf (STREAM, "#%wd", \
2546 1.1.1.1.4.2 yamt INTVAL (XEXP (XEXP (X, 1), 1))); \
2547 1.1.1.1.4.2 yamt else \
2548 1.1.1.1.4.2 yamt asm_fprintf (STREAM, "%r", \
2549 1.1.1.1.4.2 yamt REGNO (XEXP (XEXP (X, 1), 1))); \
2550 1.1.1.1.4.2 yamt } \
2551 1.1.1.1.4.2 yamt else output_addr_const (STREAM, X); \
2552 1.1.1.1.4.2 yamt }
2553 1.1.1.1.4.2 yamt
2554 1.1.1.1.4.2 yamt #define THUMB_PRINT_OPERAND_ADDRESS(STREAM, X) \
2555 1.1.1.1.4.2 yamt { \
2556 1.1.1.1.4.2 yamt if (GET_CODE (X) == REG) \
2557 1.1.1.1.4.2 yamt asm_fprintf (STREAM, "[%r]", REGNO (X)); \
2558 1.1.1.1.4.2 yamt else if (GET_CODE (X) == POST_INC) \
2559 1.1.1.1.4.2 yamt asm_fprintf (STREAM, "%r!", REGNO (XEXP (X, 0))); \
2560 1.1.1.1.4.2 yamt else if (GET_CODE (X) == PLUS) \
2561 1.1.1.1.4.2 yamt { \
2562 1.1.1.1.4.2 yamt gcc_assert (GET_CODE (XEXP (X, 0)) == REG); \
2563 1.1.1.1.4.2 yamt if (GET_CODE (XEXP (X, 1)) == CONST_INT) \
2564 1.1.1.1.4.2 yamt asm_fprintf (STREAM, "[%r, #%wd]", \
2565 1.1.1.1.4.2 yamt REGNO (XEXP (X, 0)), \
2566 1.1.1.1.4.2 yamt INTVAL (XEXP (X, 1))); \
2567 1.1.1.1.4.2 yamt else \
2568 1.1.1.1.4.2 yamt asm_fprintf (STREAM, "[%r, %r]", \
2569 1.1.1.1.4.2 yamt REGNO (XEXP (X, 0)), \
2570 1.1.1.1.4.2 yamt REGNO (XEXP (X, 1))); \
2571 1.1.1.1.4.2 yamt } \
2572 1.1.1.1.4.2 yamt else \
2573 1.1.1.1.4.2 yamt output_addr_const (STREAM, X); \
2574 1.1.1.1.4.2 yamt }
2575 1.1.1.1.4.2 yamt
2576 1.1.1.1.4.2 yamt #define PRINT_OPERAND_ADDRESS(STREAM, X) \
2577 1.1.1.1.4.2 yamt if (TARGET_32BIT) \
2578 1.1.1.1.4.2 yamt ARM_PRINT_OPERAND_ADDRESS (STREAM, X) \
2579 1.1.1.1.4.2 yamt else \
2580 1.1.1.1.4.2 yamt THUMB_PRINT_OPERAND_ADDRESS (STREAM, X)
2581 1.1.1.1.4.2 yamt
2582 1.1.1.1.4.2 yamt #define OUTPUT_ADDR_CONST_EXTRA(file, x, fail) \
2583 1.1.1.1.4.2 yamt if (arm_output_addr_const_extra (file, x) == FALSE) \
2584 1.1.1.1.4.2 yamt goto fail
2585 1.1.1.1.4.2 yamt
2586 1.1.1.1.4.2 yamt /* A C expression whose value is RTL representing the value of the return
2587 1.1.1.1.4.2 yamt address for the frame COUNT steps up from the current frame. */
2588 1.1.1.1.4.2 yamt
2589 1.1.1.1.4.2 yamt #define RETURN_ADDR_RTX(COUNT, FRAME) \
2590 1.1.1.1.4.2 yamt arm_return_addr (COUNT, FRAME)
2591 1.1.1.1.4.2 yamt
2592 1.1.1.1.4.2 yamt /* Mask of the bits in the PC that contain the real return address
2593 1.1.1.1.4.2 yamt when running in 26-bit mode. */
2594 1.1.1.1.4.2 yamt #define RETURN_ADDR_MASK26 (0x03fffffc)
2595 1.1.1.1.4.2 yamt
2596 1.1.1.1.4.2 yamt /* Pick up the return address upon entry to a procedure. Used for
2597 1.1.1.1.4.2 yamt dwarf2 unwind information. This also enables the table driven
2598 1.1.1.1.4.2 yamt mechanism. */
2599 1.1.1.1.4.2 yamt #define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (Pmode, LR_REGNUM)
2600 1.1.1.1.4.2 yamt #define DWARF_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (LR_REGNUM)
2601 1.1.1.1.4.2 yamt
2602 1.1.1.1.4.2 yamt /* Used to mask out junk bits from the return address, such as
2603 1.1.1.1.4.2 yamt processor state, interrupt status, condition codes and the like. */
2604 1.1.1.1.4.2 yamt #define MASK_RETURN_ADDR \
2605 1.1.1.1.4.2 yamt /* If we are generating code for an ARM2/ARM3 machine or for an ARM6 \
2606 1.1.1.1.4.2 yamt in 26 bit mode, the condition codes must be masked out of the \
2607 1.1.1.1.4.2 yamt return address. This does not apply to ARM6 and later processors \
2608 1.1.1.1.4.2 yamt when running in 32 bit mode. */ \
2609 1.1.1.1.4.2 yamt ((arm_arch4 || TARGET_THUMB) \
2610 1.1.1.1.4.2 yamt ? (gen_int_mode ((unsigned long)0xffffffff, Pmode)) \
2611 1.1.1.1.4.2 yamt : arm_gen_return_addr_mask ())
2612 1.1.1.1.4.2 yamt
2613 1.1.1.1.4.2 yamt
2614 1.1.1.1.4.2 yamt /* Neon defines builtins from ARM_BUILTIN_MAX upwards, though they don't have
2616 1.1.1.1.4.2 yamt symbolic names defined here (which would require too much duplication).
2617 1.1.1.1.4.2 yamt FIXME? */
2618 1.1.1.1.4.2 yamt enum arm_builtins
2619 1.1.1.1.4.2 yamt {
2620 1.1.1.1.4.2 yamt ARM_BUILTIN_GETWCX,
2621 1.1.1.1.4.2 yamt ARM_BUILTIN_SETWCX,
2622 1.1.1.1.4.2 yamt
2623 1.1.1.1.4.2 yamt ARM_BUILTIN_WZERO,
2624 1.1.1.1.4.2 yamt
2625 1.1.1.1.4.2 yamt ARM_BUILTIN_WAVG2BR,
2626 1.1.1.1.4.2 yamt ARM_BUILTIN_WAVG2HR,
2627 1.1.1.1.4.2 yamt ARM_BUILTIN_WAVG2B,
2628 1.1.1.1.4.2 yamt ARM_BUILTIN_WAVG2H,
2629 1.1.1.1.4.2 yamt
2630 1.1.1.1.4.2 yamt ARM_BUILTIN_WACCB,
2631 1.1.1.1.4.2 yamt ARM_BUILTIN_WACCH,
2632 1.1.1.1.4.2 yamt ARM_BUILTIN_WACCW,
2633 1.1.1.1.4.2 yamt
2634 1.1.1.1.4.2 yamt ARM_BUILTIN_WMACS,
2635 1.1.1.1.4.2 yamt ARM_BUILTIN_WMACSZ,
2636 1.1.1.1.4.2 yamt ARM_BUILTIN_WMACU,
2637 1.1.1.1.4.2 yamt ARM_BUILTIN_WMACUZ,
2638 1.1.1.1.4.2 yamt
2639 1.1.1.1.4.2 yamt ARM_BUILTIN_WSADB,
2640 1.1.1.1.4.2 yamt ARM_BUILTIN_WSADBZ,
2641 1.1.1.1.4.2 yamt ARM_BUILTIN_WSADH,
2642 1.1.1.1.4.2 yamt ARM_BUILTIN_WSADHZ,
2643 1.1.1.1.4.2 yamt
2644 1.1.1.1.4.2 yamt ARM_BUILTIN_WALIGN,
2645 1.1.1.1.4.2 yamt
2646 1.1.1.1.4.2 yamt ARM_BUILTIN_TMIA,
2647 1.1.1.1.4.2 yamt ARM_BUILTIN_TMIAPH,
2648 1.1.1.1.4.2 yamt ARM_BUILTIN_TMIABB,
2649 1.1.1.1.4.2 yamt ARM_BUILTIN_TMIABT,
2650 1.1.1.1.4.2 yamt ARM_BUILTIN_TMIATB,
2651 1.1.1.1.4.2 yamt ARM_BUILTIN_TMIATT,
2652 1.1.1.1.4.2 yamt
2653 1.1.1.1.4.2 yamt ARM_BUILTIN_TMOVMSKB,
2654 1.1.1.1.4.2 yamt ARM_BUILTIN_TMOVMSKH,
2655 1.1.1.1.4.2 yamt ARM_BUILTIN_TMOVMSKW,
2656 1.1.1.1.4.2 yamt
2657 1.1.1.1.4.2 yamt ARM_BUILTIN_TBCSTB,
2658 1.1.1.1.4.2 yamt ARM_BUILTIN_TBCSTH,
2659 1.1.1.1.4.2 yamt ARM_BUILTIN_TBCSTW,
2660 1.1.1.1.4.2 yamt
2661 1.1.1.1.4.2 yamt ARM_BUILTIN_WMADDS,
2662 1.1.1.1.4.2 yamt ARM_BUILTIN_WMADDU,
2663 1.1.1.1.4.2 yamt
2664 1.1.1.1.4.2 yamt ARM_BUILTIN_WPACKHSS,
2665 1.1.1.1.4.2 yamt ARM_BUILTIN_WPACKWSS,
2666 1.1.1.1.4.2 yamt ARM_BUILTIN_WPACKDSS,
2667 1.1.1.1.4.2 yamt ARM_BUILTIN_WPACKHUS,
2668 1.1.1.1.4.2 yamt ARM_BUILTIN_WPACKWUS,
2669 1.1.1.1.4.2 yamt ARM_BUILTIN_WPACKDUS,
2670 1.1.1.1.4.2 yamt
2671 1.1.1.1.4.2 yamt ARM_BUILTIN_WADDB,
2672 1.1.1.1.4.2 yamt ARM_BUILTIN_WADDH,
2673 1.1.1.1.4.2 yamt ARM_BUILTIN_WADDW,
2674 1.1.1.1.4.2 yamt ARM_BUILTIN_WADDSSB,
2675 1.1.1.1.4.2 yamt ARM_BUILTIN_WADDSSH,
2676 1.1.1.1.4.2 yamt ARM_BUILTIN_WADDSSW,
2677 1.1.1.1.4.2 yamt ARM_BUILTIN_WADDUSB,
2678 1.1.1.1.4.2 yamt ARM_BUILTIN_WADDUSH,
2679 1.1.1.1.4.2 yamt ARM_BUILTIN_WADDUSW,
2680 1.1.1.1.4.2 yamt ARM_BUILTIN_WSUBB,
2681 1.1.1.1.4.2 yamt ARM_BUILTIN_WSUBH,
2682 1.1.1.1.4.2 yamt ARM_BUILTIN_WSUBW,
2683 1.1.1.1.4.2 yamt ARM_BUILTIN_WSUBSSB,
2684 1.1.1.1.4.2 yamt ARM_BUILTIN_WSUBSSH,
2685 1.1.1.1.4.2 yamt ARM_BUILTIN_WSUBSSW,
2686 1.1.1.1.4.2 yamt ARM_BUILTIN_WSUBUSB,
2687 1.1.1.1.4.2 yamt ARM_BUILTIN_WSUBUSH,
2688 1.1.1.1.4.2 yamt ARM_BUILTIN_WSUBUSW,
2689 1.1.1.1.4.2 yamt
2690 1.1.1.1.4.2 yamt ARM_BUILTIN_WAND,
2691 1.1.1.1.4.2 yamt ARM_BUILTIN_WANDN,
2692 1.1.1.1.4.2 yamt ARM_BUILTIN_WOR,
2693 1.1.1.1.4.2 yamt ARM_BUILTIN_WXOR,
2694 1.1.1.1.4.2 yamt
2695 1.1.1.1.4.2 yamt ARM_BUILTIN_WCMPEQB,
2696 1.1.1.1.4.2 yamt ARM_BUILTIN_WCMPEQH,
2697 1.1.1.1.4.2 yamt ARM_BUILTIN_WCMPEQW,
2698 1.1.1.1.4.2 yamt ARM_BUILTIN_WCMPGTUB,
2699 1.1.1.1.4.2 yamt ARM_BUILTIN_WCMPGTUH,
2700 1.1.1.1.4.2 yamt ARM_BUILTIN_WCMPGTUW,
2701 1.1.1.1.4.2 yamt ARM_BUILTIN_WCMPGTSB,
2702 1.1.1.1.4.2 yamt ARM_BUILTIN_WCMPGTSH,
2703 1.1.1.1.4.2 yamt ARM_BUILTIN_WCMPGTSW,
2704 1.1.1.1.4.2 yamt
2705 1.1.1.1.4.2 yamt ARM_BUILTIN_TEXTRMSB,
2706 1.1.1.1.4.2 yamt ARM_BUILTIN_TEXTRMSH,
2707 1.1.1.1.4.2 yamt ARM_BUILTIN_TEXTRMSW,
2708 1.1.1.1.4.2 yamt ARM_BUILTIN_TEXTRMUB,
2709 1.1.1.1.4.2 yamt ARM_BUILTIN_TEXTRMUH,
2710 1.1.1.1.4.2 yamt ARM_BUILTIN_TEXTRMUW,
2711 1.1.1.1.4.2 yamt ARM_BUILTIN_TINSRB,
2712 1.1.1.1.4.2 yamt ARM_BUILTIN_TINSRH,
2713 1.1.1.1.4.2 yamt ARM_BUILTIN_TINSRW,
2714 1.1.1.1.4.2 yamt
2715 1.1.1.1.4.2 yamt ARM_BUILTIN_WMAXSW,
2716 1.1.1.1.4.2 yamt ARM_BUILTIN_WMAXSH,
2717 1.1.1.1.4.2 yamt ARM_BUILTIN_WMAXSB,
2718 1.1.1.1.4.2 yamt ARM_BUILTIN_WMAXUW,
2719 1.1.1.1.4.2 yamt ARM_BUILTIN_WMAXUH,
2720 1.1.1.1.4.2 yamt ARM_BUILTIN_WMAXUB,
2721 1.1.1.1.4.2 yamt ARM_BUILTIN_WMINSW,
2722 1.1.1.1.4.2 yamt ARM_BUILTIN_WMINSH,
2723 1.1.1.1.4.2 yamt ARM_BUILTIN_WMINSB,
2724 1.1.1.1.4.2 yamt ARM_BUILTIN_WMINUW,
2725 1.1.1.1.4.2 yamt ARM_BUILTIN_WMINUH,
2726 1.1.1.1.4.2 yamt ARM_BUILTIN_WMINUB,
2727 1.1.1.1.4.2 yamt
2728 1.1.1.1.4.2 yamt ARM_BUILTIN_WMULUM,
2729 1.1.1.1.4.2 yamt ARM_BUILTIN_WMULSM,
2730 1.1.1.1.4.2 yamt ARM_BUILTIN_WMULUL,
2731 1.1.1.1.4.2 yamt
2732 1.1.1.1.4.2 yamt ARM_BUILTIN_PSADBH,
2733 1.1.1.1.4.2 yamt ARM_BUILTIN_WSHUFH,
2734 1.1.1.1.4.2 yamt
2735 1.1.1.1.4.2 yamt ARM_BUILTIN_WSLLH,
2736 1.1.1.1.4.2 yamt ARM_BUILTIN_WSLLW,
2737 1.1.1.1.4.2 yamt ARM_BUILTIN_WSLLD,
2738 1.1.1.1.4.2 yamt ARM_BUILTIN_WSRAH,
2739 1.1.1.1.4.2 yamt ARM_BUILTIN_WSRAW,
2740 1.1.1.1.4.2 yamt ARM_BUILTIN_WSRAD,
2741 1.1.1.1.4.2 yamt ARM_BUILTIN_WSRLH,
2742 1.1.1.1.4.2 yamt ARM_BUILTIN_WSRLW,
2743 1.1.1.1.4.2 yamt ARM_BUILTIN_WSRLD,
2744 1.1.1.1.4.2 yamt ARM_BUILTIN_WRORH,
2745 1.1.1.1.4.2 yamt ARM_BUILTIN_WRORW,
2746 1.1.1.1.4.2 yamt ARM_BUILTIN_WRORD,
2747 1.1.1.1.4.2 yamt ARM_BUILTIN_WSLLHI,
2748 1.1.1.1.4.2 yamt ARM_BUILTIN_WSLLWI,
2749 1.1.1.1.4.2 yamt ARM_BUILTIN_WSLLDI,
2750 1.1.1.1.4.2 yamt ARM_BUILTIN_WSRAHI,
2751 1.1.1.1.4.2 yamt ARM_BUILTIN_WSRAWI,
2752 1.1.1.1.4.2 yamt ARM_BUILTIN_WSRADI,
2753 1.1.1.1.4.2 yamt ARM_BUILTIN_WSRLHI,
2754 1.1.1.1.4.2 yamt ARM_BUILTIN_WSRLWI,
2755 1.1.1.1.4.2 yamt ARM_BUILTIN_WSRLDI,
2756 1.1.1.1.4.2 yamt ARM_BUILTIN_WRORHI,
2757 1.1.1.1.4.2 yamt ARM_BUILTIN_WRORWI,
2758 1.1.1.1.4.2 yamt ARM_BUILTIN_WRORDI,
2759 1.1.1.1.4.2 yamt
2760 1.1.1.1.4.2 yamt ARM_BUILTIN_WUNPCKIHB,
2761 1.1.1.1.4.2 yamt ARM_BUILTIN_WUNPCKIHH,
2762 1.1.1.1.4.2 yamt ARM_BUILTIN_WUNPCKIHW,
2763 1.1.1.1.4.2 yamt ARM_BUILTIN_WUNPCKILB,
2764 1.1.1.1.4.2 yamt ARM_BUILTIN_WUNPCKILH,
2765 1.1.1.1.4.2 yamt ARM_BUILTIN_WUNPCKILW,
2766 1.1.1.1.4.2 yamt
2767 1.1.1.1.4.2 yamt ARM_BUILTIN_WUNPCKEHSB,
2768 1.1.1.1.4.2 yamt ARM_BUILTIN_WUNPCKEHSH,
2769 1.1.1.1.4.2 yamt ARM_BUILTIN_WUNPCKEHSW,
2770 1.1.1.1.4.2 yamt ARM_BUILTIN_WUNPCKEHUB,
2771 1.1.1.1.4.2 yamt ARM_BUILTIN_WUNPCKEHUH,
2772 1.1.1.1.4.2 yamt ARM_BUILTIN_WUNPCKEHUW,
2773 1.1.1.1.4.2 yamt ARM_BUILTIN_WUNPCKELSB,
2774 1.1.1.1.4.2 yamt ARM_BUILTIN_WUNPCKELSH,
2775 1.1.1.1.4.2 yamt ARM_BUILTIN_WUNPCKELSW,
2776 1.1.1.1.4.2 yamt ARM_BUILTIN_WUNPCKELUB,
2777 1.1.1.1.4.2 yamt ARM_BUILTIN_WUNPCKELUH,
2778 ARM_BUILTIN_WUNPCKELUW,
2779
2780 ARM_BUILTIN_THREAD_POINTER,
2781
2782 ARM_BUILTIN_NEON_BASE,
2783
2784 ARM_BUILTIN_MAX = ARM_BUILTIN_NEON_BASE /* FIXME: Wrong! */
2785 };
2786
2787 /* Do not emit .note.GNU-stack by default. */
2788 #ifndef NEED_INDICATE_EXEC_STACK
2789 #define NEED_INDICATE_EXEC_STACK 0
2790 #endif
2791
2792 #endif /* ! GCC_ARM_H */
2793