]> oss.titaniummirror.com Git - msp430-gcc.git/blobdiff - gcc/config/arm/aout.h
Imported gcc-4.4.3
[msp430-gcc.git] / gcc / config / arm / aout.h
index 868eee0c7c8657c45d0442e4d06ce5490989d1c0..e9104220febbedb506f27c7632218452dcd1ec1b 100644 (file)
@@ -1,42 +1,23 @@
 /* Definitions of target machine for GNU compiler, for ARM with a.out
-   Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000
+   Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2004, 2007, 2008
    Free Software Foundation, Inc.
    Contributed by Richard Earnshaw (rearnsha@armltd.co.uk).
    
-This file is part of GNU CC.
+   This file is part of GCC.
 
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
+   GCC is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3, or (at your
+   option) any later version.
 
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   GCC is distributed in the hope that it will be useful, but WITHOUT
+   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
+   License for more details.
 
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING.  If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
-
-#ifndef ARM_OS_NAME
-#define ARM_OS_NAME "(generic)"
-#endif
-
-/* The text to go at the start of the assembler file */
-#ifndef ASM_FILE_START
-#define ASM_FILE_START(STREAM)             \
-{                                          \
-  asm_fprintf (STREAM,"%Rrfp\t.req\t%Rr9\n"); \
-  asm_fprintf (STREAM,"%Rsl\t.req\t%Rr10\n"); \
-  asm_fprintf (STREAM,"%Rfp\t.req\t%Rr11\n"); \
-  asm_fprintf (STREAM,"%Rip\t.req\t%Rr12\n"); \
-  asm_fprintf (STREAM,"%Rsp\t.req\t%Rr13\n"); \
-  asm_fprintf (STREAM,"%Rlr\t.req\t%Rr14\n"); \
-  asm_fprintf (STREAM,"%Rpc\t.req\t%Rr15\n"); \
-}
-#endif
+   You should have received a copy of the GNU General Public License
+   along with GCC; see the file COPYING3.  If not see
+   <http://www.gnu.org/licenses/>.  */
 
 #ifndef ASM_APP_ON
 #define ASM_APP_ON             ""
@@ -52,7 +33,7 @@ Boston, MA 02111-1307, USA.  */
 
 /* Note: If USER_LABEL_PREFIX or LOCAL_LABEL_PREFIX are changed,
    make sure that this change is reflected in the function
-   coff_arm_is_local_label_name() in bfd/coff-arm.c  */
+   coff_arm_is_local_label_name() in bfd/coff-arm.c.  */
 #ifndef REGISTER_PREFIX
 #define REGISTER_PREFIX        ""
 #endif
@@ -65,15 +46,35 @@ Boston, MA 02111-1307, USA.  */
 #define LOCAL_LABEL_PREFIX     ""
 #endif
 
-
-/* The assembler's names for the registers.  */
+/* The assembler's names for the registers.  Note that the ?xx registers are
+   there so that VFPv3/NEON registers D16-D31 have the same spacing as D0-D15
+   (each of which is overlaid on two S registers), although there are no
+   actual single-precision registers which correspond to D16-D31.  */
 #ifndef REGISTER_NAMES
-#define REGISTER_NAMES                            \
+#define REGISTER_NAMES                            \
 {                                                 \
   "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",  \
   "r8", "r9", "sl", "fp", "ip", "sp", "lr", "pc",  \
   "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7",  \
-  "cc", "sfp", "afp"                              \
+  "cc", "sfp", "afp",                             \
+  "mv0",   "mv1",   "mv2",   "mv3",               \
+  "mv4",   "mv5",   "mv6",   "mv7",               \
+  "mv8",   "mv9",   "mv10",  "mv11",              \
+  "mv12",  "mv13",  "mv14",  "mv15",              \
+  "wcgr0", "wcgr1", "wcgr2", "wcgr3",             \
+  "wr0",   "wr1",   "wr2",   "wr3",               \
+  "wr4",   "wr5",   "wr6",   "wr7",               \
+  "wr8",   "wr9",   "wr10",  "wr11",              \
+  "wr12",  "wr13",  "wr14",  "wr15",              \
+  "s0",  "s1",  "s2",  "s3",  "s4",  "s5",  "s6",  "s7",  \
+  "s8",  "s9",  "s10", "s11", "s12", "s13", "s14", "s15", \
+  "s16", "s17", "s18", "s19", "s20", "s21", "s22", "s23", \
+  "s24", "s25", "s26", "s27", "s28", "s29", "s30", "s31", \
+  "d16", "?16", "d17", "?17", "d18", "?18", "d19", "?19", \
+  "d20", "?20", "d21", "?21", "d22", "?22", "d23", "?23", \
+  "d24", "?24", "d25", "?25", "d26", "?26", "d27", "?27", \
+  "d28", "?28", "d29", "?29", "d30", "?30", "d31", "?31", \
+  "vfpcc"                                         \
 }
 #endif
 
@@ -98,41 +99,111 @@ Boston, MA 02111-1307, USA.  */
   {"r12", 12}, /* ip */                        \
   {"r13", 13}, /* sp */                        \
   {"r14", 14}, /* lr */                        \
-  {"r15", 15}  /* pc */                        \
+  {"r15", 15}, /* pc */                        \
+  {"mvf0", 27},                                        \
+  {"mvf1", 28},                                        \
+  {"mvf2", 29},                                        \
+  {"mvf3", 30},                                        \
+  {"mvf4", 31},                                        \
+  {"mvf5", 32},                                        \
+  {"mvf6", 33},                                        \
+  {"mvf7", 34},                                        \
+  {"mvf8", 35},                                        \
+  {"mvf9", 36},                                        \
+  {"mvf10", 37},                               \
+  {"mvf11", 38},                               \
+  {"mvf12", 39},                               \
+  {"mvf13", 40},                               \
+  {"mvf14", 41},                               \
+  {"mvf15", 42},                               \
+  {"mvd0", 27},                                        \
+  {"mvd1", 28},                                        \
+  {"mvd2", 29},                                        \
+  {"mvd3", 30},                                        \
+  {"mvd4", 31},                                        \
+  {"mvd5", 32},                                        \
+  {"mvd6", 33},                                        \
+  {"mvd7", 34},                                        \
+  {"mvd8", 35},                                        \
+  {"mvd9", 36},                                        \
+  {"mvd10", 37},                               \
+  {"mvd11", 38},                               \
+  {"mvd12", 39},                               \
+  {"mvd13", 40},                               \
+  {"mvd14", 41},                               \
+  {"mvd15", 42},                               \
+  {"mvfx0", 27},                               \
+  {"mvfx1", 28},                               \
+  {"mvfx2", 29},                               \
+  {"mvfx3", 30},                               \
+  {"mvfx4", 31},                               \
+  {"mvfx5", 32},                               \
+  {"mvfx6", 33},                               \
+  {"mvfx7", 34},                               \
+  {"mvfx8", 35},                               \
+  {"mvfx9", 36},                               \
+  {"mvfx10", 37},                              \
+  {"mvfx11", 38},                              \
+  {"mvfx12", 39},                              \
+  {"mvfx13", 40},                              \
+  {"mvfx14", 41},                              \
+  {"mvfx15", 42},                              \
+  {"mvdx0", 27},                               \
+  {"mvdx1", 28},                               \
+  {"mvdx2", 29},                               \
+  {"mvdx3", 30},                               \
+  {"mvdx4", 31},                               \
+  {"mvdx5", 32},                               \
+  {"mvdx6", 33},                               \
+  {"mvdx7", 34},                               \
+  {"mvdx8", 35},                               \
+  {"mvdx9", 36},                               \
+  {"mvdx10", 37},                              \
+  {"mvdx11", 38},                              \
+  {"mvdx12", 39},                              \
+  {"mvdx13", 40},                              \
+  {"mvdx14", 41},                              \
+  {"mvdx15", 42},                              \
+  {"d0", 63}, {"q0", 63},                      \
+  {"d1", 65},                                  \
+  {"d2", 67}, {"q1", 67},                      \
+  {"d3", 69},                                  \
+  {"d4", 71}, {"q2", 71},                      \
+  {"d5", 73},                                  \
+  {"d6", 75}, {"q3", 75},                      \
+  {"d7", 77},                                  \
+  {"d8", 79}, {"q4", 79},                      \
+  {"d9", 81},                                  \
+  {"d10", 83}, {"q5", 83},                     \
+  {"d11", 85},                                 \
+  {"d12", 87}, {"q6", 87},                     \
+  {"d13", 89},                                 \
+  {"d14", 91}, {"q7", 91},                     \
+  {"d15", 93},                                 \
+  {"q8", 95},                                  \
+  {"q9", 99},                                  \
+  {"q10", 103},                                        \
+  {"q11", 107},                                        \
+  {"q12", 111},                                        \
+  {"q13", 115},                                        \
+  {"q14", 119},                                        \
+  {"q15", 123}                                 \
 }
 #endif
 
-/* Arm Assembler barfs on dollars */
-#define DOLLARS_IN_IDENTIFIERS 0
-
 #ifndef NO_DOLLAR_IN_LABEL
 #define NO_DOLLAR_IN_LABEL 1
 #endif
 
 /* Generate DBX debugging information.  riscix.h will undefine this because
-   the native assembler does not support stabs. */
-#ifndef DBX_DEBUGGING_INFO
-#define DBX_DEBUGGING_INFO  1
-#endif
+   the native assembler does not support stabs.  */
+#define DBX_DEBUGGING_INFO 1
 
 /* Acorn dbx moans about continuation chars, so don't use any.  */
 #ifndef DBX_CONTIN_LENGTH
 #define DBX_CONTIN_LENGTH  0
 #endif
 
-/* Output a source filename for the debugger. RISCiX dbx insists that the
-   ``desc'' field is set to compiler version number >= 315 (sic).  */
-#define DBX_OUTPUT_MAIN_SOURCE_FILENAME(STREAM, NAME)                  \
-  do                                                                   \
-    {                                                                  \
-      fprintf (STREAM, ".stabs ");                                     \
-      output_quoted_string (STREAM, NAME);                             \
-      fprintf (STREAM, ",%d,0,315,%s\n", N_SO, &ltext_label_name[1]);  \
-      text_section ();                                                 \
-      ASM_OUTPUT_INTERNAL_LABEL (STREAM, "Ltext", 0);                  \
-    }                                                                  \
-  while (0)
-  
 /* Output a function label definition.  */
 #ifndef ASM_DECLARE_FUNCTION_NAME
 #define ASM_DECLARE_FUNCTION_NAME(STREAM, NAME, DECL)  \
@@ -144,27 +215,8 @@ Boston, MA 02111-1307, USA.  */
   while (0)
 #endif
 
-#ifndef ASM_OUTPUT_LABEL
-#define ASM_OUTPUT_LABEL(STREAM, NAME)         \
-  do                                           \
-    {                                          \
-      assemble_name (STREAM,NAME);             \
-      fputs (":\n", STREAM);                   \
-    }                                          \
-  while (0)
-#endif
-     
-/* Output a globalising directive for a label.  */
-#ifndef ASM_GLOBALIZE_LABEL
-#define ASM_GLOBALIZE_LABEL(STREAM, NAME)      \
-  do                                           \
-    {                                          \
-      fprintf (STREAM, "\t.global\t");         \
-      assemble_name (STREAM, NAME);            \
-      fputc ('\n',STREAM);                     \
-    }                                          \
-  while (0)
-#endif
+/* Globalizing directive for a label.  */
+#define GLOBAL_ASM_OP "\t.global\t"
 
 /* Make an internal label into a string.  */
 #ifndef ASM_GENERATE_INTERNAL_LABEL
@@ -172,34 +224,60 @@ Boston, MA 02111-1307, USA.  */
   sprintf (STRING, "*%s%s%u", LOCAL_LABEL_PREFIX, PREFIX, (unsigned int)(NUM))
 #endif
      
-/* Construct a private name.  */
-#define ASM_FORMAT_PRIVATE_NAME(OUTVAR, NAME, NUMBER)  \
-  ((OUTVAR) = (char *) alloca (strlen (NAME) + 10),  \
-   sprintf (OUTVAR, "%s.%d", NAME, NUMBER))
-
 /* Output an element of a dispatch table.  */
-#define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE)  \
-  asm_fprintf (STREAM, "\t.word\t%LL%d\n", VALUE)
+#define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE)                 \
+  do                                                           \
+    {                                                          \
+      gcc_assert (!TARGET_THUMB2);                             \
+      asm_fprintf (STREAM, "\t.word\t%LL%d\n", VALUE);         \
+    }                                                          \
+  while (0)
+         
 
+/* Thumb-2 always uses addr_diff_elf so that the Table Branch instructions
+   can be used.  For non-pic code where the offsets do not suitable for
+   TBB/TBH the elements are output as absolute labels.  */
 #define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM, BODY, VALUE, REL)             \
   do                                                                   \
     {                                                                  \
       if (TARGET_ARM)                                                  \
        asm_fprintf (STREAM, "\tb\t%LL%d\n", VALUE);                    \
-      else                                                             \
+      else if (TARGET_THUMB1)                                          \
        asm_fprintf (STREAM, "\t.word\t%LL%d-%LL%d\n", VALUE, REL);     \
+      else /* Thumb-2 */                                               \
+       {                                                               \
+         switch (GET_MODE(body))                                       \
+           {                                                           \
+           case QImode: /* TBB */                                      \
+             asm_fprintf (STREAM, "\t.byte\t(%LL%d-%LL%d)/2\n",        \
+                          VALUE, REL);                                 \
+             break;                                                    \
+           case HImode: /* TBH */                                      \
+             asm_fprintf (STREAM, "\t.2byte\t(%LL%d-%LL%d)/2\n",       \
+                          VALUE, REL);                                 \
+             break;                                                    \
+           case SImode:                                                \
+             if (flag_pic)                                             \
+               asm_fprintf (STREAM, "\t.word\t%LL%d+1-%LL%d\n", VALUE, REL); \
+             else                                                      \
+               asm_fprintf (STREAM, "\t.word\t%LL%d+1\n", VALUE);      \
+             break;                                                    \
+           default:                                                    \
+             gcc_unreachable();                                        \
+           }                                                           \
+       }                                                               \
     }                                                                  \
   while (0)
 
 
 #undef  ASM_OUTPUT_ASCII
 #define ASM_OUTPUT_ASCII(STREAM, PTR, LEN)  \
-  output_ascii_pseudo_op (STREAM, (const unsigned char *)(PTR), LEN)
+  output_ascii_pseudo_op (STREAM, (const unsigned char *) (PTR), LEN)
 
 /* Output a gap.  In fact we fill it with nulls.  */
 #undef  ASM_OUTPUT_SKIP
 #define ASM_OUTPUT_SKIP(STREAM, NBYTES)        \
-  fprintf (STREAM, "\t.space\t%d\n", NBYTES)
+  fprintf (STREAM, "\t.space\t%d\n", (int) (NBYTES))
 
 /* Align output to a power of two.  Horrible /bin/as.  */
 #ifndef ASM_OUTPUT_ALIGN  
@@ -216,7 +294,7 @@ Boston, MA 02111-1307, USA.  */
   while (0)
 #endif
 
-/* Output a common block */
+/* Output a common block */
 #ifndef ASM_OUTPUT_COMMON
 #define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED) \
   do                                                   \
@@ -224,7 +302,7 @@ Boston, MA 02111-1307, USA.  */
       fprintf (STREAM, "\t.comm\t");                   \
       assemble_name (STREAM, NAME);                    \
       asm_fprintf (STREAM, ", %d\t%@ %d\n",            \
-                  ROUNDED, SIZE);                      \
+                  (int)(ROUNDED), (int)(SIZE));        \
     }                                                  \
   while (0)
 #endif
@@ -237,10 +315,10 @@ Boston, MA 02111-1307, USA.  */
 #define ASM_OUTPUT_ALIGNED_LOCAL(STREAM, NAME, SIZE, ALIGN)            \
   do                                                                   \
     {                                                                  \
-      bss_section ();                                                  \
+      switch_to_section (bss_section);                                 \
       ASM_OUTPUT_ALIGN (STREAM, floor_log2 (ALIGN / BITS_PER_UNIT));   \
       ASM_OUTPUT_LABEL (STREAM, NAME);                                 \
-      fprintf (STREAM, "\t.space\t%d\n", SIZE);                                \
+      fprintf (STREAM, "\t.space\t%d\n", (int)(SIZE));                 \
     }                                                                  \
   while (0)
 #endif
@@ -250,9 +328,6 @@ Boston, MA 02111-1307, USA.  */
 #define ASM_OUTPUT_ALIGNED_BSS(STREAM, DECL, NAME, SIZE, ALIGN) \
   asm_output_aligned_bss (STREAM, DECL, NAME, SIZE, ALIGN)
 #endif
-     
-/* Output a source line for the debugger.  */
-/* #define ASM_OUTPUT_SOURCE_LINE(STREAM,LINE) */
 
 /* Output a #ident directive.  */
 #ifndef ASM_OUTPUT_IDENT