1 /* Definitions of target machine for GNU compiler, for ARM with a.out
2 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2004
3 Free Software Foundation, Inc.
4 Contributed by Richard Earnshaw (rearnsha@armltd.co.uk).
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published
10 by the Free Software Foundation; either version 2, or (at your
11 option) any later version.
13 GCC is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
16 License for more details.
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING. If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
27 #define ASM_APP_OFF ""
30 /* Switch to the text or data segment. */
31 #define TEXT_SECTION_ASM_OP "\t.text"
32 #define DATA_SECTION_ASM_OP "\t.data"
33 #define BSS_SECTION_ASM_OP "\t.bss"
35 /* Note: If USER_LABEL_PREFIX or LOCAL_LABEL_PREFIX are changed,
36 make sure that this change is reflected in the function
37 coff_arm_is_local_label_name() in bfd/coff-arm.c. */
38 #ifndef REGISTER_PREFIX
39 #define REGISTER_PREFIX ""
42 #ifndef USER_LABEL_PREFIX
43 #define USER_LABEL_PREFIX "_"
46 #ifndef LOCAL_LABEL_PREFIX
47 #define LOCAL_LABEL_PREFIX ""
50 /* The assembler's names for the registers. */
51 #ifndef REGISTER_NAMES
52 #define REGISTER_NAMES \
54 "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
55 "r8", "r9", "sl", "fp", "ip", "sp", "lr", "pc", \
56 "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \
58 "mv0", "mv1", "mv2", "mv3", \
59 "mv4", "mv5", "mv6", "mv7", \
60 "mv8", "mv9", "mv10", "mv11", \
61 "mv12", "mv13", "mv14", "mv15", \
62 "wcgr0", "wcgr1", "wcgr2", "wcgr3", \
63 "wr0", "wr1", "wr2", "wr3", \
64 "wr4", "wr5", "wr6", "wr7", \
65 "wr8", "wr9", "wr10", "wr11", \
66 "wr12", "wr13", "wr14", "wr15", \
67 "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", \
68 "s8", "s9", "s10", "s11", "s12", "s13", "s14", "s15", \
69 "s16", "s17", "s18", "s19", "s20", "s21", "s22", "s23", \
70 "s24", "s25", "s26", "s27", "s28", "s29", "s30", "s31", \
75 #ifndef ADDITIONAL_REGISTER_NAMES
76 #define ADDITIONAL_REGISTER_NAMES \
88 {"rfp", 9}, /* Gcc used to call it this */ \
91 {"r10", 10}, /* sl */ \
92 {"r11", 11}, /* fp */ \
93 {"r12", 12}, /* ip */ \
94 {"r13", 13}, /* sp */ \
95 {"r14", 14}, /* lr */ \
96 {"r15", 15}, /* pc */ \
180 /* Arm Assembler barfs on dollars. */
181 #define DOLLARS_IN_IDENTIFIERS 0
183 #ifndef NO_DOLLAR_IN_LABEL
184 #define NO_DOLLAR_IN_LABEL 1
187 /* Generate DBX debugging information. riscix.h will undefine this because
188 the native assembler does not support stabs. */
189 #define DBX_DEBUGGING_INFO 1
191 /* Acorn dbx moans about continuation chars, so don't use any. */
192 #ifndef DBX_CONTIN_LENGTH
193 #define DBX_CONTIN_LENGTH 0
196 /* Output a source filename for the debugger. RISCiX dbx insists that the
197 ``desc'' field is set to compiler version number >= 315 (sic). */
198 #define DBX_OUTPUT_MAIN_SOURCE_FILENAME(STREAM, NAME) \
201 fprintf (STREAM, ".stabs "); \
202 output_quoted_string (STREAM, NAME); \
203 fprintf (STREAM, ",%d,0,315,%s\n", N_SO, <ext_label_name[1]); \
205 (*targetm.asm_out.internal_label) (STREAM, "Ltext", 0); \
209 /* Output a function label definition. */
210 #ifndef ASM_DECLARE_FUNCTION_NAME
211 #define ASM_DECLARE_FUNCTION_NAME(STREAM, NAME, DECL) \
214 ARM_DECLARE_FUNCTION_NAME (STREAM, NAME, DECL); \
215 ASM_OUTPUT_LABEL (STREAM, NAME); \
220 /* Globalizing directive for a label. */
221 #define GLOBAL_ASM_OP "\t.global\t"
223 /* Make an internal label into a string. */
224 #ifndef ASM_GENERATE_INTERNAL_LABEL
225 #define ASM_GENERATE_INTERNAL_LABEL(STRING, PREFIX, NUM) \
226 sprintf (STRING, "*%s%s%u", LOCAL_LABEL_PREFIX, PREFIX, (unsigned int)(NUM))
229 /* Output an element of a dispatch table. */
230 #define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE) \
231 asm_fprintf (STREAM, "\t.word\t%LL%d\n", VALUE)
233 #define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM, BODY, VALUE, REL) \
237 asm_fprintf (STREAM, "\tb\t%LL%d\n", VALUE); \
239 asm_fprintf (STREAM, "\t.word\t%LL%d-%LL%d\n", VALUE, REL); \
244 #undef ASM_OUTPUT_ASCII
245 #define ASM_OUTPUT_ASCII(STREAM, PTR, LEN) \
246 output_ascii_pseudo_op (STREAM, (const unsigned char *) (PTR), LEN)
248 /* Output a gap. In fact we fill it with nulls. */
249 #undef ASM_OUTPUT_SKIP
250 #define ASM_OUTPUT_SKIP(STREAM, NBYTES) \
251 fprintf (STREAM, "\t.space\t%d\n", (int) (NBYTES))
253 /* Align output to a power of two. Horrible /bin/as. */
254 #ifndef ASM_OUTPUT_ALIGN
255 #define ASM_OUTPUT_ALIGN(STREAM, POWER) \
258 register int amount = 1 << (POWER); \
261 fprintf (STREAM, "\t.even\n"); \
262 else if (amount != 1) \
263 fprintf (STREAM, "\t.align\t%d\n", amount - 4); \
268 /* Output a common block. */
269 #ifndef ASM_OUTPUT_COMMON
270 #define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED) \
273 fprintf (STREAM, "\t.comm\t"); \
274 assemble_name (STREAM, NAME); \
275 asm_fprintf (STREAM, ", %d\t%@ %d\n", \
276 (int)(ROUNDED), (int)(SIZE)); \
281 /* Output a local common block. /bin/as can't do this, so hack a
282 `.space' into the bss segment. Note that this is *bad* practice,
283 which is guaranteed NOT to work since it doesn't define STATIC
284 COMMON space but merely STATIC BSS space. */
285 #ifndef ASM_OUTPUT_ALIGNED_LOCAL
286 #define ASM_OUTPUT_ALIGNED_LOCAL(STREAM, NAME, SIZE, ALIGN) \
290 ASM_OUTPUT_ALIGN (STREAM, floor_log2 (ALIGN / BITS_PER_UNIT)); \
291 ASM_OUTPUT_LABEL (STREAM, NAME); \
292 fprintf (STREAM, "\t.space\t%d\n", (int)(SIZE)); \
297 /* Output a zero-initialized block. */
298 #ifndef ASM_OUTPUT_ALIGNED_BSS
299 #define ASM_OUTPUT_ALIGNED_BSS(STREAM, DECL, NAME, SIZE, ALIGN) \
300 asm_output_aligned_bss (STREAM, DECL, NAME, SIZE, ALIGN)
303 /* Output a #ident directive. */
304 #ifndef ASM_OUTPUT_IDENT
305 #define ASM_OUTPUT_IDENT(STREAM,STRING) \
306 asm_fprintf (STREAM, "%@ - - - ident %s\n", STRING)
309 #ifndef ASM_COMMENT_START
310 #define ASM_COMMENT_START "@"
313 /* This works for GAS and some other assemblers. */
314 #define SET_ASM_OP "\t.set\t"