1*404b540aSrobert /* Definitions of target machine for GNU compiler, for ARM with a.out 2*404b540aSrobert Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2004 3*404b540aSrobert Free Software Foundation, Inc. 4*404b540aSrobert Contributed by Richard Earnshaw (rearnsha@armltd.co.uk). 5*404b540aSrobert 6*404b540aSrobert This file is part of GCC. 7*404b540aSrobert 8*404b540aSrobert GCC is free software; you can redistribute it and/or modify it 9*404b540aSrobert under the terms of the GNU General Public License as published 10*404b540aSrobert by the Free Software Foundation; either version 2, or (at your 11*404b540aSrobert option) any later version. 12*404b540aSrobert 13*404b540aSrobert GCC is distributed in the hope that it will be useful, but WITHOUT 14*404b540aSrobert ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 15*404b540aSrobert or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 16*404b540aSrobert License for more details. 17*404b540aSrobert 18*404b540aSrobert You should have received a copy of the GNU General Public License 19*404b540aSrobert along with GCC; see the file COPYING. If not, write to 20*404b540aSrobert the Free Software Foundation, 51 Franklin Street, Fifth Floor, 21*404b540aSrobert Boston, MA 02110-1301, USA. */ 22*404b540aSrobert 23*404b540aSrobert #ifndef ASM_APP_ON 24*404b540aSrobert #define ASM_APP_ON "" 25*404b540aSrobert #endif 26*404b540aSrobert #ifndef ASM_APP_OFF 27*404b540aSrobert #define ASM_APP_OFF "" 28*404b540aSrobert #endif 29*404b540aSrobert 30*404b540aSrobert /* Switch to the text or data segment. */ 31*404b540aSrobert #define TEXT_SECTION_ASM_OP "\t.text" 32*404b540aSrobert #define DATA_SECTION_ASM_OP "\t.data" 33*404b540aSrobert #define BSS_SECTION_ASM_OP "\t.bss" 34*404b540aSrobert 35*404b540aSrobert /* Note: If USER_LABEL_PREFIX or LOCAL_LABEL_PREFIX are changed, 36*404b540aSrobert make sure that this change is reflected in the function 37*404b540aSrobert coff_arm_is_local_label_name() in bfd/coff-arm.c. */ 38*404b540aSrobert #ifndef REGISTER_PREFIX 39*404b540aSrobert #define REGISTER_PREFIX "" 40*404b540aSrobert #endif 41*404b540aSrobert 42*404b540aSrobert #ifndef USER_LABEL_PREFIX 43*404b540aSrobert #define USER_LABEL_PREFIX "_" 44*404b540aSrobert #endif 45*404b540aSrobert 46*404b540aSrobert #ifndef LOCAL_LABEL_PREFIX 47*404b540aSrobert #define LOCAL_LABEL_PREFIX "" 48*404b540aSrobert #endif 49*404b540aSrobert 50*404b540aSrobert /* The assembler's names for the registers. */ 51*404b540aSrobert #ifndef REGISTER_NAMES 52*404b540aSrobert #define REGISTER_NAMES \ 53*404b540aSrobert { \ 54*404b540aSrobert "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \ 55*404b540aSrobert "r8", "r9", "sl", "fp", "ip", "sp", "lr", "pc", \ 56*404b540aSrobert "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \ 57*404b540aSrobert "cc", "sfp", "afp", \ 58*404b540aSrobert "mv0", "mv1", "mv2", "mv3", \ 59*404b540aSrobert "mv4", "mv5", "mv6", "mv7", \ 60*404b540aSrobert "mv8", "mv9", "mv10", "mv11", \ 61*404b540aSrobert "mv12", "mv13", "mv14", "mv15", \ 62*404b540aSrobert "wcgr0", "wcgr1", "wcgr2", "wcgr3", \ 63*404b540aSrobert "wr0", "wr1", "wr2", "wr3", \ 64*404b540aSrobert "wr4", "wr5", "wr6", "wr7", \ 65*404b540aSrobert "wr8", "wr9", "wr10", "wr11", \ 66*404b540aSrobert "wr12", "wr13", "wr14", "wr15", \ 67*404b540aSrobert "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", \ 68*404b540aSrobert "s8", "s9", "s10", "s11", "s12", "s13", "s14", "s15", \ 69*404b540aSrobert "s16", "s17", "s18", "s19", "s20", "s21", "s22", "s23", \ 70*404b540aSrobert "s24", "s25", "s26", "s27", "s28", "s29", "s30", "s31", \ 71*404b540aSrobert "vfpcc" \ 72*404b540aSrobert } 73*404b540aSrobert #endif 74*404b540aSrobert 75*404b540aSrobert #ifndef ADDITIONAL_REGISTER_NAMES 76*404b540aSrobert #define ADDITIONAL_REGISTER_NAMES \ 77*404b540aSrobert { \ 78*404b540aSrobert {"a1", 0}, \ 79*404b540aSrobert {"a2", 1}, \ 80*404b540aSrobert {"a3", 2}, \ 81*404b540aSrobert {"a4", 3}, \ 82*404b540aSrobert {"v1", 4}, \ 83*404b540aSrobert {"v2", 5}, \ 84*404b540aSrobert {"v3", 6}, \ 85*404b540aSrobert {"v4", 7}, \ 86*404b540aSrobert {"v5", 8}, \ 87*404b540aSrobert {"v6", 9}, \ 88*404b540aSrobert {"rfp", 9}, /* Gcc used to call it this */ \ 89*404b540aSrobert {"sb", 9}, \ 90*404b540aSrobert {"v7", 10}, \ 91*404b540aSrobert {"r10", 10}, /* sl */ \ 92*404b540aSrobert {"r11", 11}, /* fp */ \ 93*404b540aSrobert {"r12", 12}, /* ip */ \ 94*404b540aSrobert {"r13", 13}, /* sp */ \ 95*404b540aSrobert {"r14", 14}, /* lr */ \ 96*404b540aSrobert {"r15", 15}, /* pc */ \ 97*404b540aSrobert {"mvf0", 27}, \ 98*404b540aSrobert {"mvf1", 28}, \ 99*404b540aSrobert {"mvf2", 29}, \ 100*404b540aSrobert {"mvf3", 30}, \ 101*404b540aSrobert {"mvf4", 31}, \ 102*404b540aSrobert {"mvf5", 32}, \ 103*404b540aSrobert {"mvf6", 33}, \ 104*404b540aSrobert {"mvf7", 34}, \ 105*404b540aSrobert {"mvf8", 35}, \ 106*404b540aSrobert {"mvf9", 36}, \ 107*404b540aSrobert {"mvf10", 37}, \ 108*404b540aSrobert {"mvf11", 38}, \ 109*404b540aSrobert {"mvf12", 39}, \ 110*404b540aSrobert {"mvf13", 40}, \ 111*404b540aSrobert {"mvf14", 41}, \ 112*404b540aSrobert {"mvf15", 42}, \ 113*404b540aSrobert {"mvd0", 27}, \ 114*404b540aSrobert {"mvd1", 28}, \ 115*404b540aSrobert {"mvd2", 29}, \ 116*404b540aSrobert {"mvd3", 30}, \ 117*404b540aSrobert {"mvd4", 31}, \ 118*404b540aSrobert {"mvd5", 32}, \ 119*404b540aSrobert {"mvd6", 33}, \ 120*404b540aSrobert {"mvd7", 34}, \ 121*404b540aSrobert {"mvd8", 35}, \ 122*404b540aSrobert {"mvd9", 36}, \ 123*404b540aSrobert {"mvd10", 37}, \ 124*404b540aSrobert {"mvd11", 38}, \ 125*404b540aSrobert {"mvd12", 39}, \ 126*404b540aSrobert {"mvd13", 40}, \ 127*404b540aSrobert {"mvd14", 41}, \ 128*404b540aSrobert {"mvd15", 42}, \ 129*404b540aSrobert {"mvfx0", 27}, \ 130*404b540aSrobert {"mvfx1", 28}, \ 131*404b540aSrobert {"mvfx2", 29}, \ 132*404b540aSrobert {"mvfx3", 30}, \ 133*404b540aSrobert {"mvfx4", 31}, \ 134*404b540aSrobert {"mvfx5", 32}, \ 135*404b540aSrobert {"mvfx6", 33}, \ 136*404b540aSrobert {"mvfx7", 34}, \ 137*404b540aSrobert {"mvfx8", 35}, \ 138*404b540aSrobert {"mvfx9", 36}, \ 139*404b540aSrobert {"mvfx10", 37}, \ 140*404b540aSrobert {"mvfx11", 38}, \ 141*404b540aSrobert {"mvfx12", 39}, \ 142*404b540aSrobert {"mvfx13", 40}, \ 143*404b540aSrobert {"mvfx14", 41}, \ 144*404b540aSrobert {"mvfx15", 42}, \ 145*404b540aSrobert {"mvdx0", 27}, \ 146*404b540aSrobert {"mvdx1", 28}, \ 147*404b540aSrobert {"mvdx2", 29}, \ 148*404b540aSrobert {"mvdx3", 30}, \ 149*404b540aSrobert {"mvdx4", 31}, \ 150*404b540aSrobert {"mvdx5", 32}, \ 151*404b540aSrobert {"mvdx6", 33}, \ 152*404b540aSrobert {"mvdx7", 34}, \ 153*404b540aSrobert {"mvdx8", 35}, \ 154*404b540aSrobert {"mvdx9", 36}, \ 155*404b540aSrobert {"mvdx10", 37}, \ 156*404b540aSrobert {"mvdx11", 38}, \ 157*404b540aSrobert {"mvdx12", 39}, \ 158*404b540aSrobert {"mvdx13", 40}, \ 159*404b540aSrobert {"mvdx14", 41}, \ 160*404b540aSrobert {"mvdx15", 42}, \ 161*404b540aSrobert {"d0", 63}, \ 162*404b540aSrobert {"d1", 65}, \ 163*404b540aSrobert {"d2", 67}, \ 164*404b540aSrobert {"d3", 69}, \ 165*404b540aSrobert {"d4", 71}, \ 166*404b540aSrobert {"d5", 73}, \ 167*404b540aSrobert {"d6", 75}, \ 168*404b540aSrobert {"d7", 77}, \ 169*404b540aSrobert {"d8", 79}, \ 170*404b540aSrobert {"d9", 81}, \ 171*404b540aSrobert {"d10", 83}, \ 172*404b540aSrobert {"d11", 85}, \ 173*404b540aSrobert {"d12", 87}, \ 174*404b540aSrobert {"d13", 89}, \ 175*404b540aSrobert {"d14", 91}, \ 176*404b540aSrobert {"d15", 93}, \ 177*404b540aSrobert } 178*404b540aSrobert #endif 179*404b540aSrobert 180*404b540aSrobert /* Arm Assembler barfs on dollars. */ 181*404b540aSrobert #define DOLLARS_IN_IDENTIFIERS 0 182*404b540aSrobert 183*404b540aSrobert #ifndef NO_DOLLAR_IN_LABEL 184*404b540aSrobert #define NO_DOLLAR_IN_LABEL 1 185*404b540aSrobert #endif 186*404b540aSrobert 187*404b540aSrobert /* Generate DBX debugging information. riscix.h will undefine this because 188*404b540aSrobert the native assembler does not support stabs. */ 189*404b540aSrobert #define DBX_DEBUGGING_INFO 1 190*404b540aSrobert 191*404b540aSrobert /* Acorn dbx moans about continuation chars, so don't use any. */ 192*404b540aSrobert #ifndef DBX_CONTIN_LENGTH 193*404b540aSrobert #define DBX_CONTIN_LENGTH 0 194*404b540aSrobert #endif 195*404b540aSrobert 196*404b540aSrobert /* Output a function label definition. */ 197*404b540aSrobert #ifndef ASM_DECLARE_FUNCTION_NAME 198*404b540aSrobert #define ASM_DECLARE_FUNCTION_NAME(STREAM, NAME, DECL) \ 199*404b540aSrobert do \ 200*404b540aSrobert { \ 201*404b540aSrobert ARM_DECLARE_FUNCTION_NAME (STREAM, NAME, DECL); \ 202*404b540aSrobert ASM_OUTPUT_LABEL (STREAM, NAME); \ 203*404b540aSrobert } \ 204*404b540aSrobert while (0) 205*404b540aSrobert #endif 206*404b540aSrobert 207*404b540aSrobert /* Globalizing directive for a label. */ 208*404b540aSrobert #define GLOBAL_ASM_OP "\t.global\t" 209*404b540aSrobert 210*404b540aSrobert /* Make an internal label into a string. */ 211*404b540aSrobert #ifndef ASM_GENERATE_INTERNAL_LABEL 212*404b540aSrobert #define ASM_GENERATE_INTERNAL_LABEL(STRING, PREFIX, NUM) \ 213*404b540aSrobert sprintf (STRING, "*%s%s%u", LOCAL_LABEL_PREFIX, PREFIX, (unsigned int)(NUM)) 214*404b540aSrobert #endif 215*404b540aSrobert 216*404b540aSrobert /* Output an element of a dispatch table. */ 217*404b540aSrobert #define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE) \ 218*404b540aSrobert asm_fprintf (STREAM, "\t.word\t%LL%d\n", VALUE) 219*404b540aSrobert 220*404b540aSrobert #define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM, BODY, VALUE, REL) \ 221*404b540aSrobert do \ 222*404b540aSrobert { \ 223*404b540aSrobert if (TARGET_ARM) \ 224*404b540aSrobert asm_fprintf (STREAM, "\tb\t%LL%d\n", VALUE); \ 225*404b540aSrobert else \ 226*404b540aSrobert asm_fprintf (STREAM, "\t.word\t%LL%d-%LL%d\n", VALUE, REL); \ 227*404b540aSrobert } \ 228*404b540aSrobert while (0) 229*404b540aSrobert 230*404b540aSrobert 231*404b540aSrobert #undef ASM_OUTPUT_ASCII 232*404b540aSrobert #define ASM_OUTPUT_ASCII(STREAM, PTR, LEN) \ 233*404b540aSrobert output_ascii_pseudo_op (STREAM, (const unsigned char *) (PTR), LEN) 234*404b540aSrobert 235*404b540aSrobert /* Output a gap. In fact we fill it with nulls. */ 236*404b540aSrobert #undef ASM_OUTPUT_SKIP 237*404b540aSrobert #define ASM_OUTPUT_SKIP(STREAM, NBYTES) \ 238*404b540aSrobert fprintf (STREAM, "\t.space\t%d\n", (int) (NBYTES)) 239*404b540aSrobert 240*404b540aSrobert /* Align output to a power of two. Horrible /bin/as. */ 241*404b540aSrobert #ifndef ASM_OUTPUT_ALIGN 242*404b540aSrobert #define ASM_OUTPUT_ALIGN(STREAM, POWER) \ 243*404b540aSrobert do \ 244*404b540aSrobert { \ 245*404b540aSrobert register int amount = 1 << (POWER); \ 246*404b540aSrobert \ 247*404b540aSrobert if (amount == 2) \ 248*404b540aSrobert fprintf (STREAM, "\t.even\n"); \ 249*404b540aSrobert else if (amount != 1) \ 250*404b540aSrobert fprintf (STREAM, "\t.align\t%d\n", amount - 4); \ 251*404b540aSrobert } \ 252*404b540aSrobert while (0) 253*404b540aSrobert #endif 254*404b540aSrobert 255*404b540aSrobert /* Output a common block. */ 256*404b540aSrobert #ifndef ASM_OUTPUT_COMMON 257*404b540aSrobert #define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED) \ 258*404b540aSrobert do \ 259*404b540aSrobert { \ 260*404b540aSrobert fprintf (STREAM, "\t.comm\t"); \ 261*404b540aSrobert assemble_name (STREAM, NAME); \ 262*404b540aSrobert asm_fprintf (STREAM, ", %d\t%@ %d\n", \ 263*404b540aSrobert (int)(ROUNDED), (int)(SIZE)); \ 264*404b540aSrobert } \ 265*404b540aSrobert while (0) 266*404b540aSrobert #endif 267*404b540aSrobert 268*404b540aSrobert /* Output a local common block. /bin/as can't do this, so hack a 269*404b540aSrobert `.space' into the bss segment. Note that this is *bad* practice, 270*404b540aSrobert which is guaranteed NOT to work since it doesn't define STATIC 271*404b540aSrobert COMMON space but merely STATIC BSS space. */ 272*404b540aSrobert #ifndef ASM_OUTPUT_ALIGNED_LOCAL 273*404b540aSrobert #define ASM_OUTPUT_ALIGNED_LOCAL(STREAM, NAME, SIZE, ALIGN) \ 274*404b540aSrobert do \ 275*404b540aSrobert { \ 276*404b540aSrobert switch_to_section (bss_section); \ 277*404b540aSrobert ASM_OUTPUT_ALIGN (STREAM, floor_log2 (ALIGN / BITS_PER_UNIT)); \ 278*404b540aSrobert ASM_OUTPUT_LABEL (STREAM, NAME); \ 279*404b540aSrobert fprintf (STREAM, "\t.space\t%d\n", (int)(SIZE)); \ 280*404b540aSrobert } \ 281*404b540aSrobert while (0) 282*404b540aSrobert #endif 283*404b540aSrobert 284*404b540aSrobert /* Output a zero-initialized block. */ 285*404b540aSrobert #ifndef ASM_OUTPUT_ALIGNED_BSS 286*404b540aSrobert #define ASM_OUTPUT_ALIGNED_BSS(STREAM, DECL, NAME, SIZE, ALIGN) \ 287*404b540aSrobert asm_output_aligned_bss (STREAM, DECL, NAME, SIZE, ALIGN) 288*404b540aSrobert #endif 289*404b540aSrobert 290*404b540aSrobert /* Output a #ident directive. */ 291*404b540aSrobert #ifndef ASM_OUTPUT_IDENT 292*404b540aSrobert #define ASM_OUTPUT_IDENT(STREAM,STRING) \ 293*404b540aSrobert asm_fprintf (STREAM, "%@ - - - ident %s\n", STRING) 294*404b540aSrobert #endif 295*404b540aSrobert 296*404b540aSrobert #ifndef ASM_COMMENT_START 297*404b540aSrobert #define ASM_COMMENT_START "@" 298*404b540aSrobert #endif 299*404b540aSrobert 300*404b540aSrobert /* This works for GAS and some other assemblers. */ 301*404b540aSrobert #define SET_ASM_OP "\t.set\t" 302