builtins.c (std_expand_builtin_va_start): Remove unused first argument.
[gcc.git] / gcc / config / mn10300 / mn10300.h
index 403091e8c5f97622f8accc98ecc807cb7a65000a..b8b9f4d7b77c18e59a331a61919cf7dfe702b833 100644 (file)
@@ -1,5 +1,7 @@
-/* Definitions of target machine for GNU compiler. Matsushita MN10300 series
-   Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+/* Definitions of target machine for GNU compiler.
+   Matsushita MN10300 series
+   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
+   Free Software Foundation, Inc.
    Contributed by Jeff Law (law@cygnus.com).
 
 This file is part of GNU CC.
@@ -19,14 +21,15 @@ 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.  */
 
-#include "svr4.h"
 
 #undef ASM_SPEC
 #undef ASM_FINAL_SPEC
 #undef LIB_SPEC
 #undef ENDFILE_SPEC
 #undef LINK_SPEC
+#define LINK_SPEC "%{mrelax:--relax}"
 #undef STARTFILE_SPEC
+#define STARTFILE_SPEC "%{!mno-crt0:%{!shared:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}}}}"
 
 /* Names to predefine in the preprocessor for this target machine.  */
 
@@ -53,11 +56,13 @@ extern int target_flags;
 #define TARGET_AM33                    (target_flags & 0x2)
 
 #define TARGET_SWITCHES  \
-  {{ "mult-bug",       0x1,  "Work around hardware multiply bug"},     \
-   { "no-mult-bug",    -0x1, "Do not work around hardware multiply bug"},\
-   { "am33",           0x2},   \
-   { "am33",           -(0x1)},\
-   { "no-am33",        -0x2},  \
+  {{ "mult-bug",       0x1,  N_("Work around hardware multiply bug")}, \
+   { "no-mult-bug",    -0x1, N_("Do not work around hardware multiply bug")},\
+   { "am33",           0x2,  N_("Target the AM33 processor")}, \
+   { "am33",           -(0x1), ""},\
+   { "no-am33",        -0x2, ""},      \
+   { "no-crt0",                0,    N_("No default crt0.o") }, \
+   { "relax",          0,    N_("Enable linker relaxations") }, \
    { "", TARGET_DEFAULT, NULL}}
 
 #ifndef TARGET_DEFAULT
@@ -85,22 +90,9 @@ extern int target_flags;
    This is not true on the Matsushita MN10300.  */
 #define WORDS_BIG_ENDIAN 0
 
-/* Number of bits in an addressable storage unit */
-#define BITS_PER_UNIT 8
-
-/* Width in bits of a "word", which is the contents of a machine register.
-   Note that this is not necessarily the width of data type `int';
-   if using 16-bit ints on a 68000, this would still be 32.
-   But on a machine with 16-bit registers, this would be 16.  */
-#define BITS_PER_WORD          32
-
 /* Width of a word, in units (bytes).  */
 #define UNITS_PER_WORD         4
 
-/* Width in bits of a pointer.
-   See also the macro `Pmode' defined below.  */
-#define POINTER_SIZE           32
-
 /* Allocation boundary (in *bits*) for storing arguments in argument list.  */
 #define PARM_BOUNDARY          32
 
@@ -124,15 +116,6 @@ extern int target_flags;
 
 /* Define this as 1 if `char' should by default be signed; else as 0.  */
 #define DEFAULT_SIGNED_CHAR 0
-
-/* Define results of standard character escape sequences.  */
-#define TARGET_BELL 007
-#define TARGET_BS 010
-#define TARGET_TAB 011
-#define TARGET_NEWLINE 012
-#define TARGET_VT 013
-#define TARGET_FF 014
-#define TARGET_CR 015
 \f
 /* Standard register usage.  */
 
@@ -145,6 +128,31 @@ extern int target_flags;
 
 #define FIRST_PSEUDO_REGISTER 18
 
+/* Specify machine-specific register numbers.  */
+#define FIRST_DATA_REGNUM 0
+#define LAST_DATA_REGNUM 3
+#define FIRST_ADDRESS_REGNUM 4
+#define LAST_ADDRESS_REGNUM 8
+#define FIRST_EXTENDED_REGNUM 10
+#define LAST_EXTENDED_REGNUM 17
+
+/* Specify the registers used for certain standard purposes.
+   The values of these macros are register numbers.  */
+
+/* Register to use for pushing function arguments.  */
+#define STACK_POINTER_REGNUM (LAST_ADDRESS_REGNUM+1)
+
+/* Base register for access to local variables of the function.  */
+#define FRAME_POINTER_REGNUM (LAST_ADDRESS_REGNUM-1)
+
+/* Base register for access to arguments of the function.  This
+   is a fake register and will be eliminated into either the frame
+   pointer or stack pointer.  */
+#define ARG_POINTER_REGNUM LAST_ADDRESS_REGNUM
+
+/* Register in which static-chain is passed to a function.  */
+#define STATIC_CHAIN_REGNUM (FIRST_ADDRESS_REGNUM+1)
+
 /* 1 for registers that have pervasive standard uses
    and are not available for the register allocator.  */
 
@@ -167,9 +175,12 @@ extern int target_flags;
 
 #define CONDITIONAL_REGISTER_USAGE \
 {                                              \
+  unsigned int i;                              \
+                                               \
   if (!TARGET_AM33)                            \
     {                                          \
-      for (i = 10; i < 18; i++)                \
+      for (i = FIRST_EXTENDED_REGNUM;          \
+          i <= LAST_EXTENDED_REGNUM; i++)      \
        fixed_regs[i] = call_used_regs[i] = 1;  \
     }                                          \
 }
@@ -257,13 +268,13 @@ enum reg_class {
    {0x00200},          /* SP_REGS */           \
    {0x001ff},          /* DATA_OR_ADDRESS_REGS */\
    {0x003f0},          /* SP_OR_ADDRESS_REGS */\
-   {0x2fc00},          /* EXTENDED_REGS */     \
-   {0x2fc0f},          /* DATA_OR_EXTENDED_REGS */     \
-   {0x2fdf0},          /* ADDRESS_OR_EXTENDED_REGS */  \
-   {0x2fe00},          /* SP_OR_EXTENDED_REGS */       \
-   {0x2fff0},          /* SP_OR_ADDRESS_OR_EXTENDED_REGS */    \
-   {0x2fdff},          /* GENERAL_REGS */      \
-   {0x2ffff},          /* ALL_REGS     */      \
+   {0x3fc00},          /* EXTENDED_REGS */     \
+   {0x3fc0f},          /* DATA_OR_EXTENDED_REGS */     \
+   {0x3fdf0},          /* ADDRESS_OR_EXTENDED_REGS */  \
+   {0x3fe00},          /* SP_OR_EXTENDED_REGS */       \
+   {0x3fff0},          /* SP_OR_ADDRESS_OR_EXTENDED_REGS */    \
+   {0x3fdff},          /* GENERAL_REGS */      \
+   {0x3ffff},          /* ALL_REGS     */      \
 }
 
 /* The same information, inverted:
@@ -272,10 +283,11 @@ enum reg_class {
    or could index an array.  */
 
 #define REGNO_REG_CLASS(REGNO) \
-  ((REGNO) < 4 ? DATA_REGS : \
-   (REGNO) < 9 ? ADDRESS_REGS : \
-    (REGNO) == 9 ? SP_REGS : \
-     (REGNO) < 18 ? EXTENDED_REGS : 0)
+  ((REGNO) <= LAST_DATA_REGNUM ? DATA_REGS : \
+   (REGNO) <= LAST_ADDRESS_REGNUM ? ADDRESS_REGS : \
+   (REGNO) == STACK_POINTER_REGNUM ? SP_REGS : \
+   (REGNO) <= LAST_EXTENDED_REGNUM ? EXTENDED_REGS : \
+   NO_REGS)
 
 /* The class value for index registers, and the one for base regs.  */
 #define INDEX_REG_CLASS DATA_OR_EXTENDED_REGS
@@ -286,40 +298,83 @@ enum reg_class {
 #define REG_CLASS_FROM_LETTER(C) \
   ((C) == 'd' ? DATA_REGS : \
    (C) == 'a' ? ADDRESS_REGS : \
+   (C) == 'y' ? SP_REGS : \
+   ! TARGET_AM33 ? NO_REGS : \
    (C) == 'x' ? EXTENDED_REGS : \
-   (C) == 'y' ? SP_REGS : NO_REGS)
+   NO_REGS)
 
 /* Macros to check register numbers against specific register classes.  */
 
+/* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
+   and check its validity for a certain class.
+   We have two alternate definitions for each of them.
+   The usual definition accepts all pseudo regs; the other rejects
+   them unless they have been allocated suitable hard regs.
+   The symbol REG_OK_STRICT causes the latter definition to be used.
+
+   Most source files want to accept pseudo regs in the hope that
+   they will get allocated to the class that the insn wants them to be in.
+   Source files for reload pass need to be strict.
+   After reload, it makes no difference, since pseudo regs have
+   been eliminated by then.  */
+
 /* These assume that REGNO is a hard or pseudo reg number.
    They give nonzero only if REGNO is a hard reg of the suitable class
    or a pseudo reg currently allocated to a suitable hard reg.
    Since they use reg_renumber, they are safe only once reg_renumber
    has been allocated, which happens in local-alloc.c.  */
+
+#ifndef REG_OK_STRICT
+# define REGNO_IN_RANGE_P(regno,min,max) \
+  (IN_RANGE ((regno), (min), (max)) || (regno) >= FIRST_PSEUDO_REGISTER)
+#else
+# define REGNO_IN_RANGE_P(regno,min,max) \
+  (IN_RANGE ((regno), (min), (max)) \
+   || (reg_renumber \
+       && reg_renumber[(regno)] >= (min) && reg_renumber[(regno)] <= (max)))
+#endif
+
+#define REGNO_DATA_P(regno) \
+  REGNO_IN_RANGE_P ((regno), FIRST_DATA_REGNUM, LAST_DATA_REGNUM)
+#define REGNO_ADDRESS_P(regno) \
+  REGNO_IN_RANGE_P ((regno), FIRST_ADDRESS_REGNUM, LAST_ADDRESS_REGNUM)
+#define REGNO_SP_P(regno) \
+  REGNO_IN_RANGE_P ((regno), STACK_POINTER_REGNUM, STACK_POINTER_REGNUM)
+#define REGNO_EXTENDED_P(regno) \
+  REGNO_IN_RANGE_P ((regno), FIRST_EXTENDED_REGNUM, LAST_EXTENDED_REGNUM)
+#define REGNO_AM33_P(regno) \
+  (REGNO_DATA_P ((regno)) || REGNO_ADDRESS_P ((regno)) \
+   || REGNO_EXTENDED_P ((regno)))
+
 #define REGNO_OK_FOR_BASE_P(regno) \
-  (((regno) > 3 && regno < FIRST_PSEUDO_REGISTER)      \
-   || (reg_renumber[regno] > 3 && reg_renumber[regno] < FIRST_PSEUDO_REGISTER))
+  (REGNO_SP_P ((regno)) \
+   || REGNO_ADDRESS_P ((regno)) || REGNO_EXTENDED_P ((regno)))
+#define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
 
 #define REGNO_OK_FOR_BIT_BASE_P(regno) \
-  (((regno) > 3 && regno < 10) \
-   || (reg_renumber[regno] > 3 && reg_renumber[regno] < 10))
+  (REGNO_SP_P ((regno)) || REGNO_ADDRESS_P ((regno)))
+#define REG_OK_FOR_BIT_BASE_P(X) REGNO_OK_FOR_BIT_BASE_P (REGNO (X))
 
 #define REGNO_OK_FOR_INDEX_P(regno) \
-  (((regno) >= 0 && regno < 4) \
-   || ((regno) >= 10 && regno < 18)    \
-   || (reg_renumber[regno] >= 10 && reg_renumber[regno] < 18) \
-   || (reg_renumber[regno] >= 0 && reg_renumber[regno] < 4))
-
+  (REGNO_DATA_P ((regno)) || REGNO_EXTENDED_P ((regno)))
+#define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))
 
 /* Given an rtx X being reloaded into a reg required to be
    in class CLASS, return the class of reg to actually use.
    In general this is just CLASS; but on some machines
    in some cases it is preferable to use a more restrictive class.  */
 
-#define PREFERRED_RELOAD_CLASS(X,CLASS) \
-  (X == stack_pointer_rtx && CLASS != SP_REGS \
-   ? ADDRESS_OR_EXTENDED_REGS : CLASS)
+#define PREFERRED_RELOAD_CLASS(X,CLASS)                                \
+  ((X) == stack_pointer_rtx && (CLASS) != SP_REGS              \
+   ? ADDRESS_OR_EXTENDED_REGS                                  \
+   : (GET_CODE (X) == MEM                                      \
+      || (GET_CODE (X) == REG                                  \
+         && REGNO (X) >= FIRST_PSEUDO_REGISTER)                \
+      || (GET_CODE (X) == SUBREG                               \
+         && GET_CODE (SUBREG_REG (X)) == REG                   \
+         && REGNO (SUBREG_REG (X)) >= FIRST_PSEUDO_REGISTER)   \
+      ? LIMIT_RELOAD_CLASS (GET_MODE (X), CLASS)               \
+      : (CLASS)))
 
 #define PREFERRED_OUTPUT_RELOAD_CLASS(X,CLASS) \
   (X == stack_pointer_rtx && CLASS != SP_REGS \
@@ -399,23 +454,6 @@ enum reg_class {
 
 #define FIRST_PARM_OFFSET(FNDECL) 4
 
-/* Specify the registers used for certain standard purposes.
-   The values of these macros are register numbers.  */
-
-/* Register to use for pushing function arguments.  */
-#define STACK_POINTER_REGNUM 9
-
-/* Base register for access to local variables of the function.  */
-#define FRAME_POINTER_REGNUM 7
-
-/* Base register for access to arguments of the function.  This
-   is a fake register and will be eliminated into either the frame
-   pointer or stack pointer.  */
-#define ARG_POINTER_REGNUM 8
-
-/* Register in which static-chain is passed to a function.  */
-#define STATIC_CHAIN_REGNUM 5
-
 #define ELIMINABLE_REGS                                \
 {{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM},  \
  { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM},  \
@@ -447,7 +485,7 @@ enum reg_class {
    for a register flushback area.  */
 #define REG_PARM_STACK_SPACE(DECL) 8
 #define OUTGOING_REG_PARM_STACK_SPACE
-#define ACCUMULATE_OUTGOING_ARGS
+#define ACCUMULATE_OUTGOING_ARGS 1
 
 /* So we can allocate space for return pointers once for the function
    instead of around every call.  */
@@ -522,16 +560,18 @@ struct cum_arg {int nbytes; };
    otherwise, FUNC is 0.   */
 
 #define FUNCTION_VALUE(VALTYPE, FUNC) \
-  gen_rtx_REG (TYPE_MODE (VALTYPE), POINTER_TYPE_P (VALTYPE) ? 4 : 0)
+  gen_rtx_REG (TYPE_MODE (VALTYPE), POINTER_TYPE_P (VALTYPE) \
+              ? FIRST_ADDRESS_REGNUM : FIRST_DATA_REGNUM)
 
 /* Define how to find the value returned by a library function
    assuming the value has mode MODE.  */
 
-#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, 0)
+#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, FIRST_DATA_REGNUM)
 
 /* 1 if N is a possible register number for a function value.  */
 
-#define FUNCTION_VALUE_REGNO_P(N) ((N) == 0 || (N) == 4)
+#define FUNCTION_VALUE_REGNO_P(N) \
+  ((N) == FIRST_DATA_REGNUM || (N) == FIRST_ADDRESS_REGNUM)
 
 /* Return values > 8 bytes in length in memory.  */
 #define DEFAULT_PCC_STRUCT_RETURN 0
@@ -542,7 +582,7 @@ struct cum_arg {int nbytes; };
    is passed to a function.  On the MN10300 it's passed as
    the first parameter.  */
 
-#define STRUCT_VALUE 0
+#define STRUCT_VALUE FIRST_DATA_REGNUM
 
 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
    the stack pointer does not matter.  The value is tested only in
@@ -608,8 +648,8 @@ struct cum_arg {int nbytes; };
 #define EXPAND_BUILTIN_SAVEREGS() mn10300_builtin_saveregs ()
 
 /* Implement `va_start' for varargs and stdarg.  */
-#define EXPAND_BUILTIN_VA_START(stdarg, valist, nextarg) \
-  mn10300_va_start (stdarg, valist, nextarg)
+#define EXPAND_BUILTIN_VA_START(valist, nextarg) \
+  mn10300_va_start (valist, nextarg)
 
 /* Implement `va_arg'.  */
 #define EXPAND_BUILTIN_VA_ARG(valist, type) \
@@ -639,45 +679,14 @@ struct cum_arg {int nbytes; };
            && INT_8_BITS (INTVAL (XEXP (XEXP (OP, 0), 1))))))
         
 #define EXTRA_CONSTRAINT(OP, C) \
- ((C) == 'R' ? OK_FOR_R (OP) : (C) == 'S' ? GET_CODE (OP) == SYMBOL_REF : 0)
+ ((C) == 'R' ? OK_FOR_R (OP) \
+  : (C) == 'S' ? GET_CODE (OP) == SYMBOL_REF \
+  : 0)
 
 /* Maximum number of registers that can appear in a valid memory address.  */
 
 #define MAX_REGS_PER_ADDRESS 2
 
-/* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
-   and check its validity for a certain class.
-   We have two alternate definitions for each of them.
-   The usual definition accepts all pseudo regs; the other rejects
-   them unless they have been allocated suitable hard regs.
-   The symbol REG_OK_STRICT causes the latter definition to be used.
-
-   Most source files want to accept pseudo regs in the hope that
-   they will get allocated to the class that the insn wants them to be in.
-   Source files for reload pass need to be strict.
-   After reload, it makes no difference, since pseudo regs have
-   been eliminated by then.  */
-
-#ifndef REG_OK_STRICT
-/* Nonzero if X is a hard reg that can be used as an index
-   or if it is a pseudo reg.  */
-#define REG_OK_FOR_INDEX_P(X)  \
-  ((REGNO (X) >= 0 && REGNO(X) <= 3) || REGNO (X) >= 10)
-/* Nonzero if X is a hard reg that can be used as a base reg
-   or if it is a pseudo reg.  */
-#define REG_OK_FOR_BASE_P(X) \
-  ((REGNO (X) >= 4 && REGNO(X) <= 9) || REGNO (X) >= 10)
-#define REG_OK_FOR_BIT_BASE_P(X) \
-  ((REGNO (X) >= 4 && REGNO(X) <= 9))
-#else
-/* Nonzero if X is a hard reg that can be used as an index.  */
-#define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))
-/* Nonzero if X is a hard reg that can be used as a base reg.  */
-#define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
-/* Nonzero if X is a hard reg that can be used as a base reg.  */
-#define REG_OK_FOR_BIT_BASE_P(X) REGNO_OK_FOR_BIT_BASE_P (REGNO (X))
-#endif
-
 \f
 #define HAVE_POST_INCREMENT (TARGET_AM33)
 
@@ -772,7 +781,7 @@ struct cum_arg {int nbytes; };
 /* Tell final.c how to eliminate redundant test instructions.  */
 
 /* Here we define machine-dependent flags and fields in cc_status
-   (see `conditions.h').  No extra ones are needed for the vax.  */
+   (see `conditions.h').  No extra ones are needed for the VAX.  */
 
 /* Store in cc_status the expressions
    that the condition codes will describe
@@ -814,9 +823,19 @@ struct cum_arg {int nbytes; };
   case CONST_DOUBLE:                                                   \
     return 8;
 
-#define REGISTER_MOVE_COST(CLASS1, CLASS2) \
+#define REGISTER_MOVE_COST(MODE, CLASS1, CLASS2) \
   ((CLASS1 == CLASS2 && (CLASS1 == ADDRESS_REGS || CLASS1 == DATA_REGS)) ? 2 :\
-   CLASS1 == CLASS2 && CLASS1 == EXTENDED_REGS ? 6 : 4)
+   ((CLASS1 == ADDRESS_REGS || CLASS1 == DATA_REGS) && \
+    (CLASS2 == ADDRESS_REGS || CLASS2 == DATA_REGS)) ? 4 : \
+   (CLASS1 == SP_REGS && CLASS2 == ADDRESS_REGS) ? 2 : \
+   (CLASS1 == ADDRESS_REGS && CLASS2 == SP_REGS) ? 4 : \
+   ! TARGET_AM33 ? 6 : \
+   (CLASS1 == SP_REGS || CLASS2 == SP_REGS) ? 6 : \
+   (CLASS1 == CLASS2 && CLASS1 == EXTENDED_REGS) ? 6 : \
+   (CLASS1 == EXTENDED_REGS || CLASS2 == EXTENDED_REGS) ? 4 : \
+   4)
+
+#define ADDRESS_COST(X) mn10300_address_cost((X), 0)
 
 /* A crude cut at RTX_COSTS for the MN10300.  */
 
@@ -869,52 +888,6 @@ struct cum_arg {int nbytes; };
 
 #define ASM_APP_OFF "#NO_APP\n"
 
-/* This is how to output an assembler line defining a `double' constant.
-   It is .dfloat or .gfloat, depending.  */
-
-#define ASM_OUTPUT_DOUBLE(FILE, VALUE)                 \
-do { char dstr[30];                                    \
-     REAL_VALUE_TO_DECIMAL ((VALUE), "%.20e", dstr);   \
-     fprintf (FILE, "\t.double %s\n", dstr);           \
-   } while (0)
-
-
-/* This is how to output an assembler line defining a `float' constant.  */
-#define ASM_OUTPUT_FLOAT(FILE, VALUE)                  \
-do { char dstr[30];                                    \
-     REAL_VALUE_TO_DECIMAL ((VALUE), "%.20e", dstr);   \
-     fprintf (FILE, "\t.float %s\n", dstr);            \
-   } while (0)
-
-/* This is how to output an assembler line defining an `int' constant.  */
-
-#define ASM_OUTPUT_INT(FILE, VALUE)            \
-( fprintf (FILE, "\t.long "),                  \
-  output_addr_const (FILE, (VALUE)),           \
-  fprintf (FILE, "\n"))
-
-/* Likewise for `char' and `short' constants.  */
-
-#define ASM_OUTPUT_SHORT(FILE, VALUE)          \
-( fprintf (FILE, "\t.hword "),                 \
-  output_addr_const (FILE, (VALUE)),           \
-  fprintf (FILE, "\n"))
-
-#define ASM_OUTPUT_CHAR(FILE, VALUE)           \
-( fprintf (FILE, "\t.byte "),                  \
-  output_addr_const (FILE, (VALUE)),           \
-  fprintf (FILE, "\n"))
-
-/* This is how to output an assembler line for a numeric constant byte.  */
-#define ASM_OUTPUT_BYTE(FILE, VALUE)  \
-  fprintf (FILE, "\t.byte 0x%x\n", (VALUE))
-
-/* Define the parentheses used to group arithmetic operations
-   in assembler code.  */
-
-#define ASM_OPEN_PAREN "("
-#define ASM_CLOSE_PAREN ")"
-
 /* This says how to output the assembler to define a global
    uninitialized but not common symbol.
    Try to use asm_output_bss to implement this macro.  */
@@ -938,12 +911,8 @@ do { char dstr[30];                                        \
    `assemble_name' uses this.  */
 
 #undef ASM_OUTPUT_LABELREF
-#define ASM_OUTPUT_LABELREF(FILE, NAME)                  \
-  do {                                            \
-  const char* real_name;                          \
-  STRIP_NAME_ENCODING (real_name, (NAME));        \
-  fprintf (FILE, "_%s", real_name);               \
-  } while (0)           
+#define ASM_OUTPUT_LABELREF(FILE, NAME) \
+  fprintf (FILE, "_%s", (*targetm.strip_name_encoding) (NAME))
 
 /* Store in OUTPUT a string (made with alloca) containing
    an assembler-name for a local static variable named NAME.
@@ -967,7 +936,15 @@ do { char dstr[30];                                        \
 
 #define REGISTER_NAMES \
 { "d0", "d1", "d2", "d3", "a0", "a1", "a2", "a3", "ap", "sp", \
-  "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7" }
+  "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7" \
+}
+
+#define ADDITIONAL_REGISTER_NAMES \
+{ {"r8",  4}, {"r9",  5}, {"r10", 6}, {"r11", 7}, \
+  {"r12", 0}, {"r13", 1}, {"r14", 2}, {"r15", 3}, \
+  {"e0", 10}, {"e1", 11}, {"e2", 12}, {"e3", 13}, \
+  {"e4", 14}, {"e5", 15}, {"e6", 16}, {"e7", 17} \
+}
 
 /* Print an instruction operand X on file FILE.
    look in mn10300.c for details */
@@ -999,11 +976,11 @@ do { char dstr[30];                                       \
 /* We don't have to worry about dbx compatibility for the mn10300.  */
 #define DEFAULT_GDB_EXTENSIONS 1
 
-/* Use stabs debugging info by default.  */
+/* Use dwarf2 debugging info by default.  */
 #undef PREFERRED_DEBUGGING_TYPE
-#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
+#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
 
-#define DBX_REGISTER_NUMBER(REGNO) REGNO
+#define DWARF2_ASM_LINE_DEBUG_INFO 1
 
 /* GDB always assumes the current function's frame begins at the value
    of the stack pointer upon entry to the current function.  Accessing
@@ -1028,10 +1005,6 @@ do { char dstr[30];                                      \
     + (frame_pointer_needed \
        ? 0 : -initial_offset (ARG_POINTER_REGNUM, STACK_POINTER_REGNUM)))
 
-/* Define to use software floating point emulator for REAL_ARITHMETIC and
-   decimal <-> binary conversion. */
-#define REAL_ARITHMETIC
-
 /* Specify the machine mode that this machine uses
    for the index in the tablejump instruction.  */
 #define CASE_VECTOR_MODE Pmode
@@ -1042,16 +1015,10 @@ do { char dstr[30];                                     \
 
 #define LOAD_EXTEND_OP(MODE) ZERO_EXTEND
 
-/* Specify the tree operation to be used to convert reals to integers.  */
-#define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR
-
 /* This flag, if defined, says the same insns that convert to a signed fixnum
    also convert validly to an unsigned one.  */
 #define FIXUNS_TRUNC_LIKE_FIX_TRUNC
 
-/* This is the kind of divide that is easiest to do in the general case.  */
-#define EASY_DIV_EXPR TRUNC_DIV_EXPR
-
 /* Max number of bytes we can move from memory to memory
    in one reasonably fast instruction.  */
 #define MOVE_MAX       4