OSDN Git Service

PR c++/17413
[pf3gnuchains/gcc-fork.git] / gcc / config / dsp16xx / dsp16xx.h
index 74f7722..472ba1f 100644 (file)
@@ -1,83 +1,59 @@
 /* Definitions of target machine for GNU compiler.  AT&T DSP1600.
-   Copyright (C) 1994 Free Software Foundation, Inc.
-   Contributed by Michael Collison (collison@world.std.com).
+   Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003
+   Free Software Foundation, Inc.
+   Contributed by Michael Collison (collison@isisinc.net).
 
-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
+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 1, or (at your option)
+the Free Software Foundation; either version 2, or (at your option)
 any later version.
 
-GNU CC is distributed in the hope that it will be useful,
+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, 675 Mass Ave, Cambridge, MA 02139, USA.  */
-
-extern char *low_reg_names[];
-extern char *text_seg_name;
-extern char *rsect_text;
-extern char *data_seg_name;
-extern char *rsect_data;
-extern char *bss_seg_name;
-extern char *rsect_bss;
-extern char *const_seg_name;
-extern char *rsect_const;
-extern char *chip_name;
-extern char *save_chip_name;
-extern struct rtx_def *dsp16xx_compare_op0, *dsp16xx_compare_op1;
-extern struct rtx_def *(*dsp16xx_compare_gen)();
-extern struct rtx_def *gen_compare_reg();
-extern struct rtx_def *dsp16xx_addhf3_libcall;
-extern struct rtx_def *dsp16xx_subhf3_libcall;
-extern struct rtx_def *dsp16xx_mulhf3_libcall;
-extern struct rtx_def *dsp16xx_divhf3_libcall;
-extern struct rtx_def *dsp16xx_cmphf3_libcall;
-extern struct rtx_def *dsp16xx_fixhfhi2_libcall;
-extern struct rtx_def *dsp16xx_floathihf2_libcall;
-extern struct rtx_def *dsp16xx_neghf2_libcall;
-extern struct rtx_def *dsp16xx_umulhi3_libcall;
-extern struct rtx_def *dsp16xx_mulhi3_libcall;
-extern struct rtx_def *dsp16xx_udivqi3_libcall;
-extern struct rtx_def *dsp16xx_udivhi3_libcall;
-extern struct rtx_def *dsp16xx_divqi3_libcall;
-extern struct rtx_def *dsp16xx_divhi3_libcall;
-extern struct rtx_def *dsp16xx_modqi3_libcall;
-extern struct rtx_def *dsp16xx_modhi3_libcall;
-extern struct rtx_def *dsp16xx_umodqi3_libcall;
-extern struct rtx_def *dsp16xx_umodhi3_libcall;
-
-extern struct rtx_def *dsp16xx_ashrhi3_libcall;
-extern struct rtx_def *dsp16xx_ashlhi3_libcall;
-extern struct rtx_def *dsp16xx_lshrhi3_libcall;
-
-
-extern int hard_regno_mode_ok ();
-extern enum reg_class dsp16xx_reg_class_from_letter ();
-extern enum reg_class dsp16xx_limit_reload_class ();
-extern int hard_regno_nregs ();
-extern int regno_reg_class ();
-extern int move_operand ();
-extern int symbolic_address_p ();
-extern int Y_address ();
-extern int call_address_operand ();
-extern void notice_update_cc();
-extern void function_prologue ();
-extern void function_epilogue ();
-extern int  dsp1600_comparison_reverse ();
-extern void double_reg_from_memory ();
-extern void double_reg_to_memory ();
-extern void bss_section ();
-extern struct rtx_def *dsp16xx_function_arg ();
-extern void dsp16xx_function_arg_advance ();
-extern enum rtx_code next_cc_user_code ();
-extern enum rtx_code save_next_cc_user_code;
-extern struct rtx_def *gen_tst_reg ();
-extern char *output_block_move();
+along with GCC; see the file COPYING.  If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+extern const char *low_reg_names[];
+extern const char *text_seg_name;
+extern const char *rsect_text;
+extern const char *data_seg_name;
+extern const char *rsect_data;
+extern const char *bss_seg_name;
+extern const char *rsect_bss;
+extern const char *const_seg_name;
+extern const char *rsect_const;
+extern const char *chip_name;
+extern const char *save_chip_name;
+extern GTY(()) rtx dsp16xx_compare_op0;
+extern GTY(()) rtx dsp16xx_compare_op1;
+extern GTY(()) rtx dsp16xx_addhf3_libcall;
+extern GTY(()) rtx dsp16xx_subhf3_libcall;
+extern GTY(()) rtx dsp16xx_mulhf3_libcall;
+extern GTY(()) rtx dsp16xx_divhf3_libcall;
+extern GTY(()) rtx dsp16xx_cmphf3_libcall;
+extern GTY(()) rtx dsp16xx_fixhfhi2_libcall;
+extern GTY(()) rtx dsp16xx_floathihf2_libcall;
+extern GTY(()) rtx dsp16xx_neghf2_libcall;
+extern GTY(()) rtx dsp16xx_mulhi3_libcall;
+extern GTY(()) rtx dsp16xx_udivqi3_libcall;
+extern GTY(()) rtx dsp16xx_udivhi3_libcall;
+extern GTY(()) rtx dsp16xx_divqi3_libcall;
+extern GTY(()) rtx dsp16xx_divhi3_libcall;
+extern GTY(()) rtx dsp16xx_modqi3_libcall;
+extern GTY(()) rtx dsp16xx_modhi3_libcall;
+extern GTY(()) rtx dsp16xx_umodqi3_libcall;
+extern GTY(()) rtx dsp16xx_umodhi3_libcall;
+
+extern GTY(()) rtx dsp16xx_ashrhi3_libcall;
+extern GTY(()) rtx dsp16xx_ashlhi3_libcall;
+extern GTY(()) rtx dsp16xx_lshrhi3_libcall;
 
 /* RUN-TIME TARGET SPECIFICATION */
 #define DSP16XX   1
@@ -95,10 +71,8 @@ extern char *output_block_move();
   (!strcmp (STR, "ifile") ? 1 :                 \
    0)
 
-#ifdef  CC1_SPEC
 #undef  CC1_SPEC
-#endif
-#define CC1_SPEC       ""
+#define CC1_SPEC       "%{!O*:-O}"
 
 /* Define this as a spec to call the AT&T assembler */
 
@@ -108,20 +82,21 @@ extern char *output_block_move();
 
 #define CROSS_LINK_SPEC  "%{!c:%{!M:%{!MM:%{!E:%{!S:ld1600 %l %X %{o*} %{m} \
                        %{r} %{s} %{t} %{u*} %{x}\
-                       %{!A:%{!nostdlib:%S}} %{static:}\
-                       %{L*} %D %o %{!nostdlib:-le1600 %L -le1600 %{!A:%E}}\n }}}}}"
+                       %{!A:%{!nostdlib:%{!nostartfiles:%S}}} %{static:}\
+                       %{L*} %D %o %{!nostdlib:-le1600 %L -le1600}\
+                       %{!A:%{!nostdlib:%{!nostartfiles:%E}}}\n }}}}}"
 
 /* Nothing complicated here, just link with libc.a under normal
    circumstances */
 #define LIB_SPEC "-lc"
 
-/* Specify the startup file to link with. */
+/* Specify the startup file to link with.  */
 #define STARTFILE_SPEC "%{mmap1:m1_crt0.o%s}  \
 %{mmap2:m2_crt0.o%s}                          \
 %{mmap3:m3_crt0.o%s}                          \
 %{mmap4:m4_crt0.o%s}                          \
 %{!mmap*: %{!ifile*: m4_crt0.o%s} %{ifile*:     \
-%eA -ifile option requires a -map option}}"
+%ea -ifile option requires a -map option}}"
 
 /* Specify the end file to link with */
 
@@ -130,32 +105,58 @@ extern char *output_block_move();
 %{mmap3:m3_crtn.o%s}                          \
 %{mmap4:m4_crtn.o%s}                          \
 %{!mmap*: %{!ifile*: m4_crtn.o%s} %{ifile*:     \
-%eA -ifile option requires a -map option}}"
+%ea -ifile option requires a -map option}}"
 
 
 /* Tell gcc where to look for the startfile */
-#define STANDARD_STARTFILE_PREFIX   "/d1600/lib"
+/*#define STANDARD_STARTFILE_PREFIX   "/d1600/lib"*/
 
 /* Tell gcc where to look for it's executables */
-#define STANDARD_EXEC_PREFIX  "/d1600/bin"
+/*#define STANDARD_EXEC_PREFIX  "/d1600/bin"*/
 
 /* Command line options to the AT&T assembler */
 #define ASM_SPEC  "%{V} %{v:%{!V:-V}} %{g*:-g}"
 
 /* Command line options for the AT&T linker */
+
 #define LINK_SPEC "%{V} %{v:%{!V:-V}} %{minit:-i}  \
-%{!ifile*:%{mmap1:-ifile m1_deflt.if%s}         \
-          %{mmap2:-ifile m2_deflt.if%s}         \
-          %{mmap3:-ifile m3_deflt.if%s}         \
-          %{mmap4:-ifile m4_deflt.if%s}         \
-          %{!mmap*:-ifile m4_deflt.if%s}}       \
-%{ifile*} %{!r:-a}"
+%{!ifile*:%{mmap1:m1_deflt.if%s}         \
+          %{mmap2:m2_deflt.if%s}         \
+          %{mmap3:m3_deflt.if%s}         \
+          %{mmap4:m4_deflt.if%s}         \
+          %{!mmap*:m4_deflt.if%s}}       \
+%{ifile*:%*} %{r}"
+
+/* Include path is determined from the environment variable */
+#define INCLUDE_DEFAULTS     \
+{                            \
+  { 0, 0, 0, 0, 0 }          \
+}
 
 /* Names to predefine in the preprocessor for this target machine.  */
+#define TARGET_CPU_CPP_BUILTINS()              \
+  do                                           \
+    {                                          \
+      builtin_define_std ("dsp1600");          \
+      builtin_define_std ("DSP1600");          \
+    }                                          \
+  while (0)
+
 #ifdef __MSDOS__
-#define CPP_PREDEFINES "-Ddsp1600 -DDSP1600 -DMSDOS"
+# define TARGET_OS_CPP_BUILTINS()              \
+  do                                           \
+    {                                          \
+      builtin_define_std ("MSDOS");            \
+    }                                          \
+  while (0)
 #else
-#define CPP_PREDEFINES "-Ddsp1600 -DDSP1600 -Ddsp1610 -DDSP1610"
+# define TARGET_OS_CPP_BUILTINS()              \
+  do                                           \
+    {                                          \
+      builtin_define_std ("dsp1610");          \
+      builtin_define_std ("DSP1610");          \
+    }                                          \
+  while (0)
 #endif
 
 /* Run-time compilation parameters selecting different hardware subsets.  */
@@ -168,8 +169,6 @@ extern int target_flags;
 #define MASK_NEAR_CALL       0x00000002    /* The call is on the same 4k page */
 #define MASK_NEAR_JUMP       0x00000004    /* The jump is on the same 4k page */
 #define MASK_BMU             0x00000008    /* Use the 'bmu' shift instructions */
-#define MASK_OPTIMIZE_MEMORY 0x00000010    /* Optimize to conserve memory */
-#define MASK_OPTIMIZE_SPEED  0x00000020    /* Optimize for speed */
 #define MASK_MAP1            0x00000040    /* Link with map1 */
 #define MASK_MAP2            0x00000080    /* Link with map2 */
 #define MASK_MAP3            0x00000100    /* Link with map3 */
@@ -177,8 +176,9 @@ extern int target_flags;
 #define MASK_YBASE_HIGH      0x00000400    /* The ybase register window starts high */
 #define MASK_INIT           0x00000800    /* Have the linker generate tables to
                                              initialize data at startup */
-#define MASK_INLINE_MULT     0x00001000    /* Inline 32 bit multiplies */
 #define MASK_RESERVE_YBASE   0x00002000    /* Reserved the ybase registers */
+#define MASK_DEBUG           0x00004000           /* Debugging turned on*/
+#define MASK_SAVE_TEMPS      0x00008000    /* Save temps. option seen */
 
 /* Compile passing first two args in regs 0 and 1.
    This exists only to test compiler features that will
@@ -197,15 +197,9 @@ extern int target_flags;
 #define TARGET_NEAR_JUMP (target_flags & MASK_NEAR_JUMP)
 
 /* Generate shift instructions to use the 1610 Bit Manipulation
-   Unit. */
+   Unit.  */
 #define TARGET_BMU (target_flags & MASK_BMU)
 
-/* Optimize to conseverve memory */
-#define TARGET_OPTIMIZE_MEMORY (target_flags & MASK_OPTIMIZE_MEMORY)
-
-/* Optimize for maximum speed */
-#define TARGET_OPTIMIZE_SPEED   (target_flags & MASK_OPTIMIZE_SPEED)
-
 #define TARGET_YBASE_HIGH (target_flags & MASK_YBASE_HIGH)
 
 /* Direct the linker to output extra info for initialized data */
@@ -216,6 +210,13 @@ extern int target_flags;
 /* Reserve the ybase registers *(0) - *(31) */
 #define TARGET_RESERVE_YBASE (target_flags & MASK_RESERVE_YBASE)
 
+/* We turn this option on internally after seeing "-g" */
+#define TARGET_DEBUG            (target_flags & MASK_DEBUG)
+
+/* We turn this option on internally after seeing "-save-temps */
+#define TARGET_SAVE_TEMPS       (target_flags & MASK_SAVE_TEMPS)
+
+
 /* Macro to define tables used to set the flags.
    This is a list in braces of pairs in braces,
    each pair being { "NAME", VALUE }
@@ -223,132 +224,112 @@ extern int target_flags;
    An empty string NAME is used to identify the default VALUE.  */
 
 
-#define TARGET_SWITCHES                        \
-  {                                           \
-    { "regparm",       MASK_REGPARM},         \
-    { "no-regparm",   -MASK_REGPARM},         \
-    { "no-near-call", -MASK_NEAR_CALL},        \
-    { "near-jump",     MASK_NEAR_JUMP},        \
-    { "no-near-jump", -MASK_NEAR_JUMP},        \
-    { "bmu",           MASK_BMU},              \
-    { "no-bmu",       -MASK_BMU},              \
-    { "Om",            MASK_OPTIMIZE_MEMORY},  \
-    { "Os",            MASK_OPTIMIZE_SPEED},   \
-    { "map1",          MASK_MAP1},             \
-    { "map2",          MASK_MAP2},             \
-    { "map3",          MASK_MAP3},             \
-    { "map4",          MASK_MAP4},             \
-    { "ybase-high",    MASK_YBASE_HIGH},       \
-    { "init",          MASK_INIT},             \
-    { "inline-mult",   MASK_INLINE_MULT},      \
-    { "reserve-ybase", MASK_RESERVE_YBASE},    \
-    { "",              TARGET_DEFAULT}         \
+#define TARGET_SWITCHES                                           \
+  {                                                              \
+    { "regparm",       MASK_REGPARM,                              \
+      N_("Pass parameters in registers (default)") },             \
+    { "no-regparm",   -MASK_REGPARM,                             \
+      N_("Don't pass parameters in registers") },                 \
+    { "near-call",     MASK_NEAR_JUMP,                            \
+      N_("Generate code for near calls") },                       \
+    { "no-near-call", -MASK_NEAR_CALL,                            \
+      N_("Don't generate code for near calls") },                 \
+    { "near-jump",     MASK_NEAR_JUMP,                            \
+      N_("Generate code for near jumps") },                       \
+    { "no-near-jump", -MASK_NEAR_JUMP,                            \
+      N_("Don't generate code for near jumps") },                 \
+    { "bmu",           MASK_BMU,                                  \
+      N_("Generate code for a bit-manipulation unit") },          \
+    { "no-bmu",       -MASK_BMU,                                  \
+      N_("Don't generate code for a bit-manipulation unit") },    \
+    { "map1",          MASK_MAP1,                                 \
+      N_("Generate code for memory map1") },                      \
+    { "map2",          MASK_MAP2,                                 \
+      N_("Generate code for memory map2") },                      \
+    { "map3",          MASK_MAP3,                                 \
+      N_("Generate code for memory map3") },                      \
+    { "map4",          MASK_MAP4,                                 \
+      N_("Generate code for memory map4") },                      \
+    { "init",          MASK_INIT,                                 \
+      N_("Ouput extra code for initialized data") },              \
+    { "reserve-ybase", MASK_RESERVE_YBASE,                        \
+      N_("Don't let reg. allocator use ybase registers") },       \
+    { "debug",         MASK_DEBUG,                                \
+      N_("Output extra debug info in Luxworks environment") },    \
+    { "save-temporaries",    MASK_SAVE_TEMPS,                     \
+      N_("Save temp. files in Luxworks environment") },           \
+    { "",              TARGET_DEFAULT, ""}                        \
   }
 
 /* Default target_flags if no switches are specified */
 #ifndef TARGET_DEFAULT
-#define TARGET_DEFAULT  MASK_OPTIMIZE_MEMORY|MASK_REGPARM|MASK_YBASE_HIGH
+#define TARGET_DEFAULT  MASK_REGPARM|MASK_YBASE_HIGH
 #endif
 
-/* This macro is similar to `TARGET_SWITCHES' but defines names of
-   command options that have values.  Its definition is an
-   initializer with a subgrouping for each command option.
-
-   Each subgrouping contains a string constant, that defines the
-   fixed part of the option name, and the address of a variable. 
-   The variable, type `char *', is set to the variable part of the
-   given option if the fixed part matches.  The actual option name
-   is made by appending `-m' to the specified name.
-
-   Here is an example which defines `-mshort-data-NUMBER'.  If the
-   given option is `-mshort-data-512', the variable `m88k_short_data'
-   will be set to the string `"512"'.
-
-       extern char *m88k_short_data;
-       #define TARGET_OPTIONS { { "short-data-", &m88k_short_data } }  */
-
 #define TARGET_OPTIONS                                         \
 {                                                              \
-  { "text=",   &text_seg_name  },                              \
-  { "data=",   &data_seg_name  },                              \
-  { "bss=",    &bss_seg_name   },                              \
-  { "const=",   &const_seg_name },                              \
-  { "chip=",    &chip_name      }                               \
+  { "text=",   &text_seg_name,                                 \
+    N_("Specify alternate name for text section"), 0},          \
+  { "data=",   &data_seg_name,                                 \
+    N_("Specify alternate name for data section"), 0},          \
+  { "bss=",    &bss_seg_name,                                  \
+    N_("Specify alternate name for bss section"), 0},           \
+  { "const=",   &const_seg_name,                                \
+    N_("Specify alternate name for constant section"), 0},      \
+  { "chip=",    &chip_name,                                     \
+    N_("Specify alternate name for dsp16xx chip"), 0},          \
 }
 
 /* Sometimes certain combinations of command options do not make sense
    on a particular target machine.  You can define a macro
    `OVERRIDE_OPTIONS' to take account of this.  This macro, if
    defined, is executed once just after all the command options have
-   been parsed. */
+   been parsed.
+  
+   Don't use this macro to turn on various extra optimizations for
+   `-O'.  That is what `OPTIMIZATION_OPTIONS' is for.  */
 
 #define OVERRIDE_OPTIONS override_options ()
 
-#define OPTIMIZATION_OPTIONS(LEVEL)                   \
+#define OPTIMIZATION_OPTIONS(LEVEL,SIZE)              \
 {                                                     \
-    flag_gnu_linker             = FALSE;              \
-                                                      \
-    if (LEVEL)                                        \
-    {                                                 \
-       flag_omit_frame_pointer = TRUE;               \
-       flag_thread_jumps       = TRUE;               \
-    }                                                 \
-                                                      \
     if (LEVEL >= 2)                                   \
     {                                                 \
-       flag_strength_reduce         = TRUE;          \
-       flag_cse_follow_jumps        = TRUE;          \
-       flag_cse_skip_blocks         = TRUE;          \
-       flag_expensive_optimizations = TRUE;          \
-       flag_rerun_cse_after_loop    = TRUE;          \
-    }                                                 \
-                                                      \
-    if (LEVEL >= 3)                                   \
-    {                                                 \
-       flag_inline_functions = 1;                     \
+        /* The dsp16xx family has so few registers    \
+         * that running the first instruction         \
+         * scheduling is bad for reg. allocation      \
+         * since it increases lifetimes of pseudos.   \
+         * So turn of first scheduling pass.          \
+         */                                           \
+        flag_schedule_insns          = FALSE;         \
     }                                                 \
 }
 \f
 /* STORAGE LAYOUT */
 
-/* Define if you don't want extended real, but do want to use the
-   software floating point emulator for REAL_ARITHMETIC and
-   decimal <-> binary conversion. */
-#define REAL_ARITHMETIC
-
 /* Define this if most significant bit is lowest numbered
    in instructions that operate on numbered bit-fields.
  */
-#define BITS_BIG_ENDIAN  1
+#define BITS_BIG_ENDIAN  0
 
 /* Define this if most significant byte of a word is the lowest numbered.
    We define big-endian, but since the 1600 series cannot address bytes
-   it does not matter. */
+   it does not matter.  */
 #define BYTES_BIG_ENDIAN 1
 
 /* Define this if most significant word of a multiword number is numbered.
-   For the 1600 we can decide arbitrarily since there are no machine instructions for them. */
+   For the 1600 we can decide arbitrarily since there are no machine instructions for them.  */
 #define WORDS_BIG_ENDIAN 1
 
-/* number of bits in an addressible storage unit */
+/* number of bits in an addressable storage unit */
 #define BITS_PER_UNIT 16
 
-/* 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 16
-
-/* Maximum number of bits in a word. */
+/* Maximum number of bits in a word.  */
 #define MAX_BITS_PER_WORD 16
 
 /* Width of a word, in units (bytes).  */
 #define UNITS_PER_WORD 1
 
-/* Width in bits of a pointer.
-   See also the macro `Pmode' defined below.  */
-#define POINTER_SIZE 16
-
 /* Allocation boundary (in *bits*) for storing pointers in memory.  */
 #define POINTER_BOUNDARY 16
 
@@ -380,12 +361,11 @@ extern int target_flags;
 
 /* An integer expression for the size in bits of the largest integer machine mode that
    should actually be used. All integer machine modes of this size or smaller can be
-   used for structures and unions with the appropriate sizes. */
+   used for structures and unions with the appropriate sizes.  */
 #define MAX_FIXED_MODE_SIZE 32
 \f
 /* LAYOUT OF SOURCE LANGUAGE DATA TYPES */
 
-#define CHAR_TYPE_SIZE         16
 #define SHORT_TYPE_SIZE        16
 #define INT_TYPE_SIZE          16
 #define LONG_TYPE_SIZE         32
@@ -395,34 +375,26 @@ extern int target_flags;
 #define LONG_DOUBLE_TYPE_SIZE  32
 
 /* An expression whose value is 1 or 0, according to whether the type char should be
-   signed or unsigned by default. */
+   signed or unsigned by default.  */
 
 #define DEFAULT_SIGNED_CHAR 1
 
 /* A C expression to determine whether to give an enum type only as many bytes
    as it takes to represent the range of possible values of that type. A nonzero
    value means to do that; a zero value means all enum types should be allocated
-   like int. */
+   like int.  */
 
 #define DEFAULT_SHORT_ENUMS 0
 
 /* A C expression for a string describing the name of the data type to use for
-   size values. */
+   size values.  */
 
-#define SIZE_TYPE    "long unsigned int"
+#define SIZE_TYPE    "unsigned int"
 
-/* A C expression for a string describing the name of the datat type to use for the
+/* A C expression for a string describing the name of the data type to use for the
    result of subtracting two pointers */
 
-#define PTRDIFF_TYPE "long int"
-
-#define TARGET_BELL     '\a'
-#define TARGET_BS       '\b'
-#define TARGET_TAB      '\t'
-#define TARGET_NEWLINE  '\n'
-#define TARGET_VT       '\v'
-#define TARGET_FF       '\f'
-#define TARGET_CR       '\r'
+#define PTRDIFF_TYPE "int"
 
 \f
 /* REGISTER USAGE.  */
@@ -433,12 +405,12 @@ extern int target_flags;
    The hardware registers are assigned numbers for the compiler
    from 0 to FIRST_PSEUDO_REGISTER-1 */
 
-#define FIRST_PSEUDO_REGISTER REG_YBASE31 + 1
+#define FIRST_PSEUDO_REGISTER (REG_YBASE31 + 1)
 
 /* 1 for registers that have pervasive standard uses
    and are not available for the register allocator.
 
-   The registers are layed out as follows:
+   The registers are laid out as follows:
 
    {a0,a0l,a1,a1l,x,y,yl,p,pl} - Data Arithmetic Unit
    {r0,r1,r2,r3,j,k,ybase} - Y Space Address Arithmetic Unit
@@ -448,7 +420,7 @@ extern int target_flags;
 
    We reserve r2 for the Stack Pointer.
    We specify r3 for the Frame Pointer but allow the compiler
-   to omit it when possible since we have so few pointer registers. */
+   to omit it when possible since we have so few pointer registers.  */
 
 #define REG_A0     0
 #define REG_A0L    1
@@ -509,13 +481,17 @@ extern int target_flags;
 #define REG_YBASE30 56
 #define REG_YBASE31 57
 
-/* Do we have a accumulator register? */
-#define IS_ACCUM_REG(REGNO) ((REGNO) >= REG_A0 && (REGNO) <= REG_A1L)
+/* Do we have an accumulator register? */
+#define IS_ACCUM_REG(REGNO) IN_RANGE ((REGNO), REG_A0, REG_A1L)
 #define IS_ACCUM_LOW_REG(REGNO) ((REGNO) == REG_A0L || (REGNO) == REG_A1L)
 
 /* Do we have a virtual ybase register */
 #define IS_YBASE_REGISTER_WINDOW(REGNO) ((REGNO) >= REG_YBASE0 && (REGNO) <= REG_YBASE31)
 
+#define IS_YBASE_ELIGIBLE_REG(REGNO) (IS_ACCUM_REG (REGNO) || IS_ADDRESS_REGISTER(REGNO) \
+                                      || REGNO == REG_X || REGNO == REG_Y || REGNO == REG_YL \
+                                      || REGNO == REG_PROD || REGNO == REG_PRODL)
+
 #define IS_ADDRESS_REGISTER(REGNO) ((REGNO) >= REG_R0 && (REGNO) <= REG_R3)
 
 #define FIXED_REGISTERS     \
@@ -524,7 +500,7 @@ extern int target_flags;
  1,                         \
  0, 0, 0, 0,                \
  1, 1, 1,                   \
0, 0,                      \
1, 0,                      \
  0, 0, 0, 0, 0, 0, 0, 0,    \
  0, 0, 0, 0, 0, 0, 0, 0,    \
  0, 0, 0, 0, 0, 0, 0, 0,    \
@@ -542,17 +518,17 @@ extern int target_flags;
    bit manipulation registers.  */
 
 
-#define CALL_USED_REGISTERS   \
-{1, 1, 1, 1, 0, 1, 1, 1, 1,   \
- 1, 0, 0, 1, 1, 1, 1,         \
- 1,                           \
- 0, 0, 1, 1,                  \
- 1, 1, 1,                     \
0, 1,                        \
- 0, 0, 0, 0, 0, 0, 0, 0,      \
- 0, 0, 0, 0, 0, 0, 0, 0,      \
- 0, 0, 0, 0, 0, 0, 0, 0,      \
- 0, 0, 0, 0, 0, 0, 0, 0}
+#define CALL_USED_REGISTERS                    \
+{1, 1, 1, 1, 0, 1, 1, 1, 1,    /* 0-8 */       \
+ 1, 0, 0, 1, 1, 1, 1,          /* 9-15 */      \
+ 1,                             /* 16 */       \
+ 0, 0, 1, 1,                   /* 17-20 */     \
+ 1, 1, 1,                      /* 21-23 */     \
1, 1,                         /* 24-25 */     \
+ 0, 0, 0, 0, 0, 0, 0, 0,       /* 26-33 */     \
+ 0, 0, 0, 0, 0, 0, 0, 0,       /* 34-41 */     \
+ 0, 0, 0, 0, 0, 0, 0, 0,       /* 42-49 */     \
+ 0, 0, 0, 0, 0, 0, 0, 0}       /* 50-57 */
 
 /* List the order in which to allocate registers.  Each register must be
    listed once, even those in FIXED_REGISTERS.
@@ -560,6 +536,7 @@ extern int target_flags;
    We allocate in the following order:
  */
 
+#if 0
 #define REG_ALLOC_ORDER                                        \
 { REG_R0, REG_R1, REG_R2, REG_PROD, REG_Y, REG_X,       \
   REG_PRODL, REG_YL, REG_AR0, REG_AR1,                  \
@@ -575,7 +552,24 @@ extern int target_flags;
   REG_YBASE20, REG_YBASE21, REG_YBASE22, REG_YBASE23,   \
   REG_YBASE24, REG_YBASE25, REG_YBASE26, REG_YBASE27,   \
   REG_YBASE28, REG_YBASE29, REG_YBASE30, REG_YBASE31 }
-
+#else
+#define REG_ALLOC_ORDER                                 \
+{                                                       \
+  REG_A0, REG_A0L, REG_A1, REG_A1L, REG_Y, REG_YL,      \
+  REG_PROD,                                             \
+  REG_PRODL, REG_R0, REG_J, REG_K, REG_AR2, REG_AR3,    \
+  REG_X, REG_R1, REG_R2, REG_RB, REG_AR0, REG_AR1,      \
+  REG_YBASE0, REG_YBASE1, REG_YBASE2, REG_YBASE3,       \
+  REG_YBASE4, REG_YBASE5, REG_YBASE6, REG_YBASE7,       \
+  REG_YBASE8, REG_YBASE9, REG_YBASE10, REG_YBASE11,     \
+  REG_YBASE12, REG_YBASE13, REG_YBASE14, REG_YBASE15,   \
+  REG_YBASE16, REG_YBASE17, REG_YBASE18, REG_YBASE19,   \
+  REG_YBASE20, REG_YBASE21, REG_YBASE22, REG_YBASE23,   \
+  REG_YBASE24, REG_YBASE25, REG_YBASE26, REG_YBASE27,   \
+  REG_YBASE28, REG_YBASE29, REG_YBASE30, REG_YBASE31,   \
+  REG_R3, REG_YBASE, REG_PT, REG_C0, REG_C1, REG_C2,    \
+  REG_PR }
+#endif
 /* Zero or more C statements that may conditionally modify two
    variables `fixed_regs' and `call_used_regs' (both of type `char
    []') after they have been initialized from the two preceding
@@ -598,7 +592,7 @@ extern int target_flags;
    controlled by target switches, then GCC will automatically avoid
    using these registers when the target switches are opposed to
    them.)  If the user tells us there is no BMU, we can't use
-   ar0-ar3 for regsiter allocation */
+   ar0-ar3 for register allocation */
 
 #define CONDITIONAL_REGISTER_USAGE                                     \
 do                                                                     \
@@ -630,12 +624,12 @@ while (0)
 /* Return number of consecutive hard regs needed starting at reg REGNO
    to hold something of mode MODE.
    This is ordinarily the length in words of a value of mode MODE
-   but can be less for certain modes in special long registers. */
+   but can be less for certain modes in special long registers.  */
 
 #define HARD_REGNO_NREGS(REGNO, MODE)                                 \
   (GET_MODE_SIZE(MODE))
 
-/* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. */
+/* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.  */
 
 #define HARD_REGNO_MODE_OK(REGNO, MODE) hard_regno_mode_ok(REGNO, MODE)
 
@@ -775,7 +769,7 @@ enum reg_class
 
 #define N_REG_CLASSES (int) LIM_REG_CLASSES
 
-/* Give names of register classes as strings for dump file.   */
+/* Give names of register classes as strings for dump file.  */
 
 #define REG_CLASS_NAMES        \
 {                              \
@@ -932,7 +926,7 @@ enum reg_class
 #define INDEX_REG_CLASS NO_REGS
 #define BASE_REG_CLASS  Y_ADDR_REGS
 
-/* Get reg_class from a letter such as appears in the machine description. */
+/* Get reg_class from a letter such as appears in the machine description.  */
 
 #define REG_CLASS_FROM_LETTER(C) \
   dsp16xx_reg_class_from_letter(C)
@@ -942,9 +936,9 @@ enum reg_class
 
 /* When defined, the compiler allows registers explicitly used in the
    rtl to be used as spill registers but prevents the compiler from
-   extending the lifetime of these registers. */
+   extending the lifetime of these registers.  */
 
-#define SMALL_REGISTER_CLASSES
+#define SMALL_REGISTER_CLASSES 1
 
 /* Macros to check register numbers against specific register classes.  */
 
@@ -998,14 +992,14 @@ enum reg_class
      smaller class.
 
      Don't define this macro unless the target machine has limitations
-     which require the macro to do something nontrivial. */
+     which require the macro to do something nontrivial.  */
 
 #if 0
 #define LIMIT_RELOAD_CLASS(MODE, CLASS) dsp16xx_limit_reload_class (MODE, CLASS)
 #endif
 
 /* A C expression for the maximum number of consecutive registers of class CLASS
-   needed to hold a vlaue of mode MODE */
+   needed to hold a value of mode MODE */
 #define CLASS_MAX_NREGS(CLASS, MODE)                                \
     class_max_nregs(CLASS, MODE)
 
@@ -1019,23 +1013,32 @@ enum reg_class
    'I' requires a non-negative 16-bit value.
    'J' requires a non-negative 9-bit value
    'K' requires a constant 0 operand.
-   'L' requires 16-bit value
+   'L' constant for use in add or sub from low 16-bits
    'M' 32-bit value -- low 16-bits zero
+   'N' constant for use incrementing or decrementing an address register
+   'O' constant for use with and'ing only high 16-bit
+   'P' constant for use with and'ing only low 16-bit
  */
 
 #define SMALL_INT(X) (SMALL_INTVAL (INTVAL (X)))
 #define SMALL_INTVAL(I) ((unsigned) (I) < 0x10000)
 #define SHORT_IMMEDIATE(X)  (SHORT_INTVAL (INTVAL(X)))
 #define SHORT_INTVAL(I)     ((unsigned) (I) < 0x100)
+#define ADD_LOW_16(I)       ((I) >= 0 && (I) <= 32767)
+#define ADD_HIGH_16(I)      (((I) & 0x0000ffff) == 0)
+#define AND_LOW_16(I)       ((I) >= 0 && (I) <= 32767)
+#define AND_HIGH_16(I)      (((I) & 0x0000ffff) == 0)
 
 #define CONST_OK_FOR_LETTER_P(VALUE, C)                           \
    ((C) == 'I' ? (SMALL_INTVAL(VALUE))                            \
     : (C) == 'J' ? (SHORT_INTVAL(VALUE))                          \
     : (C) == 'K' ? ((VALUE) == 0)                                 \
-    : (C) == 'L' ? ! ((VALUE) & ~0x0000ffff)                     \
-    : (C) == 'M' ? ! ((VALUE) & ~0xffff0000)                     \
-    : (C) == 'N' ? ((VALUE) == -1 || (VALUE) == 1 ||              \
-                    (VALUE) == -2 || (VALUE) == 2)                \
+    : (C) == 'L' ? ((VALUE) >= 0 && (VALUE) <= 32767)             \
+    : (C) == 'M' ? (((VALUE) & 0x0000ffff) == 0)                  \
+    : (C) == 'N' ? ((VALUE) == -1 || (VALUE) == 1                 \
+                    || (VALUE) == -2 || (VALUE) == 2)             \
+    : (C) == 'O' ? (((VALUE) & 0xffff0000) == 0xffff0000)         \
+    : (C) == 'P' ? (((VALUE) & 0x0000ffff) == 0xffff)             \
     : 0)
 
 #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C)   1
@@ -1062,7 +1065,7 @@ enum reg_class
 /* We use post decrement on the 1600 because there isn't
    a pre-decrement addressing mode. This means that we
    assume the stack pointer always points at the next
-   FREE location on the stack. */
+   FREE location on the stack.  */
 #define STACK_PUSH_CODE POST_INC
 
 /* Offset within stack frame to start allocating local variables at.
@@ -1072,7 +1075,7 @@ enum reg_class
 #define STARTING_FRAME_OFFSET  0
 
 /* Offset from the stack pointer register to the first
-   location at which outgoing arguments are placed. */
+   location at which outgoing arguments are placed.  */
 #define STACK_POINTER_OFFSET (0)
 
 struct dsp16xx_frame_info
@@ -1084,6 +1087,7 @@ struct dsp16xx_frame_info
   unsigned int  reg_size;      /* # bytes needed to store regs */
   long         fp_save_offset; /* offset from vfp to store registers */
   unsigned long sp_save_offset;        /* offset from new sp to store registers */
+  int          pr_save_offset; /* offset to saved PR */
   int          initialized;    /* != 0 if frame size already calculated */
   int          num_regs;       /* number of registers saved */
   int           function_makes_calls;  /* Does the function make calls */
@@ -1091,8 +1095,10 @@ struct dsp16xx_frame_info
 
 extern struct dsp16xx_frame_info current_frame_info;
 
+#define RETURN_ADDR_OFF current_frame_info.pr_save_offset
+
 /* If we generate an insn to push BYTES bytes,
-   this says how many the stack pointer really advances by. */
+   this says how many the stack pointer really advances by.  */
 /* #define PUSH_ROUNDING(BYTES) ((BYTES)) */
 
 /* If defined, the maximum amount of space required for outgoing
@@ -1102,38 +1108,39 @@ extern struct dsp16xx_frame_info current_frame_info;
    increase the stack frame size by this amount.
 
    It is not proper to define both 'PUSH_ROUNDING' and
-   'ACCUMULATE_OUTGOING_ARGS'. */
-#define ACCUMULATE_OUTGOING_ARGS
+   'ACCUMULATE_OUTGOING_ARGS'.  */
+#define ACCUMULATE_OUTGOING_ARGS 1
 
 /* Offset of first parameter from the argument pointer
-   register value. */
+   register value.  */
 
 #define FIRST_PARM_OFFSET(FNDECL)   (0)
 
 /* Value is 1 if returning from a function call automatically
    pops the arguments described by the number-of-args field in the call.
+   FUNDECL is the declaration node of the function (as a tree),
    FUNTYPE is the data type of the function (as a tree),
-   or for a library call it is an identifier node for the subroutine name. */
+   or for a library call it is an identifier node for the subroutine name.  */
 
-#define RETURN_POPS_ARGS(FUNTYPE, STACK_SIZE) 0
+#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0
 
 /* Define how to find the value returned by a function.
    VALTYPE is the data type of the value (as a tree).
    If the precise function being called is known, FUNC is its FUNCTION_DECL;
    otherwise, FUNC is 0. On the 1610 all function return their values
    in a0 (i.e. the upper 16 bits). If the return value is 32-bits the
-   entire register is significant. */
+   entire register is significant.  */
 
 #define VALUE_REGNO(MODE)  (REG_Y)
 
 #define FUNCTION_VALUE(VALTYPE, FUNC)  \
-  gen_rtx (REG, TYPE_MODE (VALTYPE), VALUE_REGNO(TYPE_MODE(VALTYPE)))
+  gen_rtx_REG (TYPE_MODE (VALTYPE), VALUE_REGNO(TYPE_MODE(VALTYPE)))
 
 /* 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, VALUE_REGNO(MODE))
+#define LIBCALL_VALUE(MODE)  gen_rtx_REG (MODE, VALUE_REGNO(MODE))
 
-/* 1 if N is a possible register number for a function value. */
+/* 1 if N is a possible register number for a function value.  */
 #define FUNCTION_VALUE_REGNO_P(N) ((N) == REG_Y)
 \f
 
@@ -1151,17 +1158,17 @@ extern struct dsp16xx_frame_info current_frame_info;
     (otherwise it is an extra parameter matching an ellipsis).  */
 
 /* On the 1610 all args are pushed, except if -mregparm is specified
-   then the first two words of arguments are passed in a0, a1. */
+   then the first two words of arguments are passed in a0, a1.  */
 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
   dsp16xx_function_arg (CUM, MODE, TYPE, NAMED)
 
 /* Define the first register to be used for argument passing */
 #define FIRST_REG_FOR_FUNCTION_ARG REG_Y
 
-/* Define the profitablity of saving registers around calls.
-   NOTE: For now we turin this off because of a bug in the
+/* Define the profitability of saving registers around calls.
+   NOTE: For now we turn this off because of a bug in the
    caller-saves code and also because i'm not sure it is helpful
-   on the 1610. */
+   on the 1610.  */
 
 #define CALLER_SAVE_PROFITABLE(REFS,CALLS) 0
 
@@ -1183,13 +1190,14 @@ extern struct dsp16xx_frame_info current_frame_info;
    during the scan of that argument list.  This data type should
    hold all necessary information about the function itself
    and about the args processed so far, enough to enable macros
-   such as FUNCTION_ARG to determine where the next arg should go. */
+   such as FUNCTION_ARG to determine where the next arg should go.  */
 #define CUMULATIVE_ARGS int
 
 /* Initialize a variable CUM of type CUMULATIVE_ARGS
    for a call to a function whose data type is FNTYPE.
-   For a library call, FNTYPE is 0. */
-#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME)  ((CUM) = 0)
+   For a library call, FNTYPE is 0.  */
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
+  ((CUM) = 0)
 
 /* Update the data in CUM to advance over an argument
    of mode MODE and data type TYPE.
@@ -1198,33 +1206,15 @@ extern struct dsp16xx_frame_info current_frame_info;
 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED)   \
   dsp16xx_function_arg_advance (&CUM, MODE,TYPE, NAMED)
 
-/* 1 if N is a possible register number for function argument passing. */
+/* 1 if N is a possible register number for function argument passing.  */
 #define FUNCTION_ARG_REGNO_P(N)   \
   ((N) == REG_Y || (N) == REG_YL || (N) == REG_PROD || (N) == REG_PRODL)
 
-/* This macro generates the assembly code for function entry.
-   FILE is a stdio stream to output the code to.
-   SIZE is an int: how many units of temporary storage to allocate.
-   Refer to the array `regs_ever_live' to determine which registers
-   to save; `regs_ever_live[I]' is nonzero if register number I
-   is ever used in the function.  This macro is responsible for
-   knowing which registers should not be saved even if used. */
-
-#define FUNCTION_PROLOGUE(FILE, SIZE)     function_prologue(FILE, SIZE)
-
 /* Output assembler code to FILE to increment profiler label # LABELNO
-   for profiling a function entry. */
-
-#define FUNCTION_PROFILER(FILE, LABELNO)        fatal("Profiling not implemented yet.")
-
-/* Output assembler code to FILE to initialize this source file's
-   basic block profiling info, if that has not already been done. */
-#define FUNCTION_BLOCK_PROFILER(FILE, LABELNO)  fatal("Profiling not implemented yet.")
-
-/* Output assembler code to FILE to increment the entry-count for
-   the BLOCKNO'th basic block in this source file. */
-#define BLOCK_PROFILER(FILE, BLOCKNO)          fatal("Profiling not implemented yet.")
+   for profiling a function entry.  */
 
+#define FUNCTION_PROFILER(FILE, LABELNO)        \
+  internal_error ("profiling not implemented yet")
 
 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
    the stack pointer does not matter.  The value is tested only in
@@ -1233,7 +1223,8 @@ extern struct dsp16xx_frame_info current_frame_info;
 
 #define EXIT_IGNORE_STACK  (0)
 
-#define TRAMPOLINE_TEMPLATE(FILE) fatal ("Trampolines not yet implemented");
+#define TRAMPOLINE_TEMPLATE(FILE) \
+  internal_error ("trampolines not yet implemented");
 
 /* Length in units of the trampoline for entering a nested function.
    This is a dummy value  */
@@ -1242,31 +1233,19 @@ extern struct dsp16xx_frame_info current_frame_info;
 
 /* Emit RTL insns to initialize the variable parts of a trampoline.
    FNADDR is an RTX for the address of the function's pure code.
-   CXT is an RTX for the static chain value for the function. */
+   CXT is an RTX for the static chain value for the function.  */
 
 #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT)                      \
-  fatal ("Trampolines not yet implemented");
-
-/* This macro generates the assembly code for function exit,
-   on machines that need it.  If FUNCTION_EPILOGUE is not defined
-   then individual return instructions are generated for each
-   return statement.  Args are same as for FUNCTION_PROLOGUE.
-
-   The function epilogue should not depend on the current stack pointer!
-   It should use the frame pointer only.  This is mandatory because
-   of alloca; we also take advantage of it to omit stack adjustments
-   before returning. */
-
-#define FUNCTION_EPILOGUE(FILE, SIZE)   function_epilogue(FILE, SIZE)
+  internal_error ("trampolines not yet implemented");
 
 /* A C expression which is nonzero if a function must have and use a
    frame pointer. If its value is nonzero the functions will have a
-   frame pointer. */
+   frame pointer.  */
 #define FRAME_POINTER_REQUIRED  (current_function_calls_alloca)
 
 /* A C statement to store in the variable 'DEPTH' the difference
    between the frame pointer and the stack pointer values immediately
-   after the function prologue. */
+   after the function prologue.  */
 #define INITIAL_FRAME_POINTER_OFFSET(DEPTH)                     \
 {  (DEPTH) = initial_frame_pointer_offset();                   \
 }
@@ -1298,18 +1277,15 @@ extern struct dsp16xx_frame_info current_frame_info;
 #define LSHLHI3_LIBCALL     "__Emulate_lshlhi3"   /* NOT USED */
 
 /* Define this macro if calls to the ANSI C library functions memcpy and
-   memset should be generated instead of the BSD function bcopy & bzero. */
+   memset should be generated instead of the BSD function bcopy & bzero.  */
 #define TARGET_MEM_FUNCTIONS
 
 \f
 /* ADDRESSING MODES */
 
 /* The 1610 has post-increment and decrement, but no pre-modify */
-#define HAVE_POST_INCREMENT
-#define HAVE_POST_DECREMENT
-
-/* #define HAVE_PRE_DECREMENT */
-/* #define HAVE_PRE_INCREMENT */
+#define HAVE_POST_INCREMENT 1
+#define HAVE_POST_DECREMENT 1
 
 /* Recognize any constant value that is a valid address.  */
 #define CONSTANT_ADDRESS_P(X)  CONSTANT_P (X)
@@ -1447,141 +1423,44 @@ extern struct dsp16xx_frame_info current_frame_info;
 /* Store in cc_status the expressions
    that the condition codes will describe
    after execution of an instruction whose pattern is EXP.
-   Do not alter them if the instruction would not alter the cc's. */
+   Do not alter them if the instruction would not alter the cc's.  */
 
 #define NOTICE_UPDATE_CC(EXP, INSN) \
    notice_update_cc( (EXP) )
 \f
 /* DESCRIBING RELATIVE COSTS OF OPERATIONS */
 
-/* Compute the cost of computing a constant rtl expression RTX
-   whose rtx-code is CODE.  The body of this macro is a portion
-   of a switch statement.  If the code is computed here,
-   return it with a return statement. */
-#define CONST_COSTS(RTX,CODE,OUTER_CODE)                                \
-  case CONST_INT:                                                      \
-    return 0;                                                           \
-  case LABEL_REF:                                                      \
-  case SYMBOL_REF:                                                     \
-  case CONST:                                                          \
-    return COSTS_N_INSNS (1);                                          \
-                                                                        \
-  case CONST_DOUBLE:                                                   \
-    return COSTS_N_INSNS (2);
-
-/* Like CONST_COSTS but applies to nonsonstant RTL expressions.
-   This can be used, for example to indicate how costly a multiply
-   instruction is. */
-#define RTX_COSTS(X,CODE,OUTER_CODE)                            \
-  case MEM:                                                     \
-    return GET_MODE (X) == QImode ? COSTS_N_INSNS (2) :         \
-                                    COSTS_N_INSNS (4);          \
-  case DIV:                                                     \
-  case MOD:                                                     \
-    return COSTS_N_INSNS (38);                                  \
-  case MULT:                                                    \
-    if (GET_MODE (X) == QImode)                                 \
-        return COSTS_N_INSNS (2);                               \
-    else                                                        \
-        return COSTS_N_INSNS (38);                              \
-  case PLUS:                                                    \
-    if (GET_MODE_CLASS (GET_MODE (X)) == MODE_INT)              \
-    {                                                           \
-        if (GET_CODE (XEXP (X,1)) == CONST_INT)                 \
-        {                                                       \
-            int number = INTVAL(XEXP (X,1));                    \
-            if (number == 1)                                    \
-               return COSTS_N_INSNS (1);                        \
-            if (INT_FITS_16_BITS(number))                       \
-                return COSTS_N_INSNS (2);                       \
-            else                                                \
-                return COSTS_N_INSNS (4);                       \
-        }                                                       \
-        return COSTS_N_INSNS (1);                               \
-    }                                                           \
-    else                                                        \
-        return COSTS_N_INSNS (38);                              \
-  case MINUS:                                                   \
-    if (GET_MODE_CLASS (GET_MODE (X)) == MODE_INT)              \
-    {                                                           \
-        if (GET_CODE (XEXP (X,1)) == CONST_INT)                 \
-        {                                                       \
-            if (INT_FITS_16_BITS(INTVAL(XEXP(X,1))))            \
-                return COSTS_N_INSNS (2);                       \
-            else                                                \
-                return COSTS_N_INSNS (4);                       \
-        }                                                       \
-        return COSTS_N_INSNS (1);                               \
-    }                                                           \
-    else                                                        \
-        return COSTS_N_INSNS (38);                              \
-  case AND: case IOR: case XOR:                                 \
-    if (GET_CODE (XEXP (X,1)) == CONST_INT)                     \
-      {                                                         \
-        if (INT_FITS_16_BITS(INTVAL(XEXP(X,1))))                \
-            return COSTS_N_INSNS (2);                           \
-        else                                                    \
-            return COSTS_N_INSNS (4);                           \
-      }                                                         \
-    return COSTS_N_INSNS (1);                                   \
-  case NEG: case NOT:                                           \
-    return COSTS_N_INSNS (1);                                   \
-  case ASHIFT:                                                  \
-  case ASHIFTRT:                                                \
-  case LSHIFTRT:                                                \
-    if (GET_CODE (XEXP (X,1)) == CONST_INT)                     \
-      {                                                         \
-        int number = INTVAL(XEXP (X,1));                        \
-        if (number == 1 || number == 4 || number == 8 ||        \
-            number == 16)                                       \
-            return COSTS_N_INSNS (1);                           \
-        else                                                    \
-            return COSTS_N_INSNS (2);                           \
-      }                                                         \
-    return COSTS_N_INSNS (1);
-
-/* An expression giving the cost of an addressing mode that contains
-   address. */
-#define ADDRESS_COST(ADDR)  dsp16xx_address_cost (ADDR)
-
 /* A c expression for the cost of moving data from a register in
    class FROM to one in class TO. The classes are expressed using
    the enumeration values such as GENERAL_REGS. A value of 2 is
-   the default. */
-#define REGISTER_MOVE_COST(FROM,TO)  dsp16xx_register_move_cost (FROM, TO)
+   the default.  */
+#define REGISTER_MOVE_COST(MODE,FROM,TO)  dsp16xx_register_move_cost (FROM, TO)
 
 /* A C expression for the cost of moving data of mode MODE between
-   a register and memory. A value of 2 is the default. */
-#define MEMORY_MOVE_COST(MODE)                                  \
+   a register and memory. A value of 2 is the default.  */
+#define MEMORY_MOVE_COST(MODE,CLASS,IN)                          \
   (GET_MODE_CLASS(MODE) == MODE_INT && MODE == QImode ? 12       \
    : 16)
 
 /* A C expression for the cost of a branch instruction. A value of
    1 is the default; */
-#define BRANCH_COST 2
+#define BRANCH_COST 1
 \f
 
 /* Define this because otherwise gcc will try to put the function address
-   in any old pseudo register. We can only use pt. */
+   in any old pseudo register. We can only use pt.  */
 #define NO_FUNCTION_CSE
 
 /* Define this macro as a C expression which is nonzero if accessing less
    than a word of memory (i.e a char or short) is no faster than accessing
    a word of memory, i.e if such access require more than one instruction
-   or if ther is no difference in cost between byte and (aligned) word
-   loads. */
+   or if there is no difference in cost between byte and (aligned) word
+   loads.  */
 #define SLOW_BYTE_ACCESS 1
 
-/* Define this macro if zero-extension (of a char or short to an int) can
-   be done faster if the destination is a register that is know to be zero. */
-/* #define SLOW_ZERO_EXTEND */
-
 /* Define this macro if unaligned accesses have a cost many times greater than
    aligned accesses, for example if they are emulated in a trap handler */
-/* define SLOW_UNALIGNED_ACCESS */
-
-/* Define this macro to inhibit strength reduction of memory addresses */
-/* #define DONT_REDUCE_ADDR */
+/* define SLOW_UNALIGNED_ACCESS(MODE, ALIGN) */
 
 \f
 /* DIVIDING THE OUTPUT IN SECTIONS */
@@ -1592,8 +1471,7 @@ extern struct dsp16xx_frame_info current_frame_info;
 
 /* Output before constants and strings */
 #define DEFAULT_CONST_SEG_NAME  ".const"
-#define READONLY_SECTION_ASM_OP rsect_const
-#define READONLY_DATA_SECTION   const_section
+#define READONLY_DATA_SECTION_ASM_OP rsect_const
 
 /* Output before writable data.  */
 #define DEFAULT_DATA_SEG_NAME ".data"
@@ -1603,44 +1481,15 @@ extern struct dsp16xx_frame_info current_frame_info;
 #define BSS_SECTION_ASM_OP rsect_bss
 
 /* We will default to using 1610 if the user doesn't
-   specify it. */
+   specify it.  */
 #define DEFAULT_CHIP_NAME "1610"
-
-/* A list of names for sections other than the standard two, which are
-   'in_text' and 'in_data'. */
-#define EXTRA_SECTIONS in_bss, in_const
-
-#define EXTRA_SECTION_FUNCTIONS  \
-void                                                               \
-const_section ()                                                   \
-{                                                                  \
-    if (in_section != in_const)                                    \
-    {                                                              \
-        fprintf (asm_out_file, "%s\n", READONLY_SECTION_ASM_OP);   \
-       in_section = in_const;                                     \
-    }                                                              \
-}                                                                  \
-void                                                              \
-bss_section ()                                                    \
-{                                                                 \
-    if (in_section != in_bss) {                                           \
-       fprintf (asm_out_file, "%s\n", BSS_SECTION_ASM_OP);        \
-       in_section = in_bss;                                       \
-    }                                                             \
-}
-
 \f
 /* THE OVERALL FRAMEWORK OF AN ASSEMBLER FILE */
 
-/* Output at beginning of assembler file.  */
-#define ASM_FILE_START(FILE) dsp16xx_file_start () 
-
-/* Prevent output of .gcc_compiled */
-#define ASM_IDENTIFY_GCC(FILE)   
-
 /* A C string constant describing how to begin a comment in the target
-   assembler language. */
-/* define ASM_COMMENT_START */
+   assembler language.  */
+#define ASM_COMMENT_START ""
+#define ASM_COMMENT_END ""
 
 /* Output to assembler file text saying following lines
    may contain character constants, extra white space, comments, etc.  */
@@ -1652,31 +1501,6 @@ bss_section ()                                                      \
 \f
 /* OUTPUT OF DATA */
 
-/* This is how to output an assembler line defining a `double' constant.  */
-#define ASM_OUTPUT_DOUBLE(FILE,VALUE)  asm_output_float (FILE,VALUE)
-
-/* This is how to output an assembler line defining a `float' constant.  */
-#define ASM_OUTPUT_FLOAT(FILE,VALUE)  asm_output_float (FILE, VALUE)
-
-/* This is how to output and assembler line defininf a 'float' constant of
-   size HFmode. */
-#define ASM_OUTPUT_SHORT_FLOAT(FILE,VALUE)  asm_output_float (FILE, VALUE)
-
-/* This is how to output an assembler line defining an `char' constant.  */
-#define ASM_OUTPUT_CHAR(FILE,VALUE)              \
-( fprintf (FILE, "\tint "),                    \
-  output_addr_const (FILE, (VALUE)),           \
-  fprintf (FILE, "\n"))
-
-/* This is how to output an assembler line defining an `short' constant.  */
-#define ASM_OUTPUT_SHORT(FILE,EXP)   asm_output_long(FILE,INTVAL(EXP))
-
-/* This is how to output an assembler line defining a 'int' constant. */
-#define ASM_OUTPUT_INT(FILE, EXP)    asm_output_long(FILE,INTVAL(EXP))
-
-/* This is how to output an assembler line for a numeric constant byte.  */
-#define ASM_OUTPUT_BYTE(FILE,VALUE)    ASM_OUTPUT_CHAR(FILE,VALUE)
-
 /* This is how we output a 'c' character string. For the 16xx
    assembler we have to do it one letter at a time */
 
@@ -1685,11 +1509,11 @@ bss_section ()                                                     \
 #define ASM_OUTPUT_ASCII(MYFILE, MYSTRING, MYLENGTH) \
   do {                                                                       \
     FILE *_hide_asm_out_file = (MYFILE);                                     \
-    unsigned char *_hide_p = (unsigned char *) (MYSTRING);                   \
+    const unsigned char *_hide_p = (const unsigned char *) (MYSTRING);       \
     int _hide_thissize = (MYLENGTH);                                         \
     {                                                                        \
       FILE *asm_out_file = _hide_asm_out_file;                               \
-      unsigned char *p = _hide_p;                                            \
+      const unsigned char *p = _hide_p;                                              \
       int thissize = _hide_thissize;                                         \
       int i;                                                                 \
                                                                              \
@@ -1711,11 +1535,10 @@ bss_section ()                                                     \
              fprintf (asm_out_file, "%d", c);                                \
              /* After an octal-escape, if a digit follows,                   \
                 terminate one string constant and start another.             \
-                The Vax assembler fails to stop reading the escape           \
+                The VAX assembler fails to stop reading the escape           \
                 after three digits, so this is the only way we               \
                 can get it to parse the data properly.                       \
-             if (i < thissize - 1                                            \
-                 && p[i + 1] >= '0' && p[i + 1] <= '9')                      \
+             if (i < thissize - 1 && ISDIGIT (p[i + 1]))                     \
                fprintf (asm_out_file, "\'\n\tint \'");                       \
                */ \
          }                                                                   \
@@ -1735,26 +1558,7 @@ bss_section ()                                                      \
   }                                                                          \
   while (0)
 
-/* Store in OUTPUT a string (made with alloca) containing
-   an assembler-name for a local static variable or function
-   named NAME. LABELNO is an integer which is different for
-   each call. */
-
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO)                 \
-  do {                                                                 \
-    int len = strlen (NAME);                                           \
-    char *temp = (char *) alloca (len + 3);                            \
-    temp[0] = 'L';                                                     \
-    strcpy (&temp[1], (NAME));                                         \
-    temp[len + 1] = '_';                                               \
-    temp[len + 2] = 0;                                                 \
-    (OUTPUT) = (char *) alloca (strlen (NAME) + 11);                   \
-    ASM_GENERATE_INTERNAL_LABEL (OUTPUT, temp, LABELNO);               \
-  } while (0)
-
-#define ASM_OPEN_PAREN "("
-#define ASM_CLOSE_PAREN ")"
-
+#define ASM_PN_FORMAT "*L%s_%lu"
 \f
 /* OUTPUT OF UNINITIALIZED VARIABLES */
 
@@ -1772,20 +1576,12 @@ bss_section ()                                                     \
 \f
 /* OUTPUT AND GENERATION OF LABELS */
 
-/* This is how to output the definition of a user-level label named NAME,
-   such as the label on a static function or variable NAME.  */
-#define ASM_OUTPUT_LABEL(FILE,NAME)    \
-  do { assemble_name (FILE, NAME); fputs (":\n", FILE); } while (0)
-
-/* This is how to output a command to make the user-level label named NAME
-   defined for reference from other files.  */
-
-#define ASM_GLOBALIZE_LABEL(FILE,NAME) \
-  do { fputs (".global ", FILE); assemble_name (FILE, NAME); fputs ("\n", FILE);} while (0)
+/* Globalizing directive for a label.  */
+#define GLOBAL_ASM_OP ".global "
 
 /* A C statement to output to the stdio stream any text necessary
    for declaring the name of an external symbol named name which
-   is referenced in this compilation but not defined. */
+   is referenced in this compilation but not defined.  */
 
 #define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME)   \
 {                                      \
@@ -1794,7 +1590,7 @@ bss_section ()                                                       \
        fprintf (FILE, "\n");           \
 }
 /* A C statement to output on stream an assembler pseudo-op to
-   declare a library function named external. */
+   declare a library function named external.  */
 
 #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN)    \
 {                                              \
@@ -1802,22 +1598,17 @@ bss_section ()                                                     \
        assemble_name (FILE, XSTR (FUN, 0));    \
        fprintf (FILE, "\n");                   \
 }
-/* This is how to output a reference to a user-level label named NAME.
-   `assemble_name' uses this.  */
-#define ASM_OUTPUT_LABELREF(FILE,NAME) \
-  fprintf (FILE, "_%s", NAME)
 
-/* This is how to output an internal numbered label where
-   PREFIX is the class of label and NUM is the number within the class.  */
-#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM)     \
-  fprintf (FILE, "%s%d:\n", PREFIX, NUM)
+/* The prefix to add to user-visible assembler symbols.  */
+
+#define USER_LABEL_PREFIX "_"
 
 /* This is how to store into the string LABEL
    the symbol_ref name of an internal numbered label where
    PREFIX is the class of label and NUM is the number within the class.
    This is suitable for output with `assemble_name'.  */
 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM)  \
-  sprintf (LABEL, "*%s%d", PREFIX, NUM)
+  sprintf (LABEL, "*%s%lu", PREFIX, (unsigned long)(NUM))
 
 \f
 /* OUTPUT OF ASSEMBLER INSTRUCTIONS */
@@ -1867,27 +1658,29 @@ bss_section ()                                                     \
 #define PRINT_OPERAND(FILE, X, CODE) print_operand(FILE, X, CODE)
 
 
-/* Print a memory address as an operand to reference that memory location. */
+/* Print a memory address as an operand to reference that memory location.  */
 
 #define PRINT_OPERAND_ADDRESS(FILE, ADDR)  print_operand_address (FILE, ADDR)
 
 /* This is how to output an insn to push a register on the stack.
    It need not be very fast code since it is used only for profiling  */
-#define ASM_OUTPUT_REG_PUSH(FILE,REGNO)    fatal("Profiling not implemented yet.");
+#define ASM_OUTPUT_REG_PUSH(FILE,REGNO)    \
+  internal_error ("profiling not implemented yet");
 
 /* This is how to output an insn to pop a register from the stack.
    It need not be very fast code since it is used only for profiling  */
-#define ASM_OUTPUT_REG_POP(FILE,REGNO)     fatal("Profiling not implemented yet."); 
+#define ASM_OUTPUT_REG_POP(FILE,REGNO)     \
+  internal_error ("profiling not implemented yet"); 
 \f
 /* OUTPUT OF DISPATCH TABLES */
 
 /* This macro should be provided on machines where the addresses in a dispatch
-   table are relative to the table's own address. */
-#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL)  \
+   table are relative to the table's own address.  */
+#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL)  \
   fprintf (FILE, "\tint L%d-L%d\n", VALUE, REL)
 
 /* This macro should be provided on machines where the addresses in a dispatch
-   table are absolute. */
+   table are absolute.  */
 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE)  \
   fprintf (FILE, "\tint L%d\n", VALUE)
 
@@ -1895,29 +1688,29 @@ bss_section ()                                                     \
 
 /* This is how to output an assembler line that says to advance 
    the location counter to a multiple of 2**LOG bytes. We should
-   not have to do any alignemnt since the 1610 is a word machine. */
+   not have to do any alignment since the 1610 is a word machine.  */
 #define ASM_OUTPUT_ALIGN(FILE,LOG)
 
 /* Define this macro if ASM_OUTPUT_SKIP should not be used in the text section
-   because it fails to put zero1 in the bytes that are skipped. */
+   because it fails to put zero1 in the bytes that are skipped.  */
 #define ASM_NO_SKIP_IN_TEXT 1
 
 #define ASM_OUTPUT_SKIP(FILE,SIZE)  \
-  fprintf (FILE, "\t%d * int 0\n", (SIZE))
+  fprintf (FILE, "\t%d * int 0\n", (int)(SIZE))
 
 /* CONTROLLING DEBUGGING INFORMATION FORMAT */
 
-/* Define this macro if GCC should produce COFF-style debugging output
-   for SDB in response to the '-g' option */
-#define SDB_DEBUGGING_INFO
+#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
 
-/* Support generating stabs for the listing file generator */
-#define DBX_DEBUGGING_INFO
+#define ASM_OUTPUT_DEF(asm_out_file, LABEL1, LABEL2) \
+         do {                                          \
+        fprintf (asm_out_file, ".alias " ); \
+         ASM_OUTPUT_LABELREF(asm_out_file, LABEL1);  \
+        fprintf (asm_out_file, "=" ); \
+         ASM_OUTPUT_LABELREF(asm_out_file, LABEL2); \
+        fprintf (asm_out_file, "\n" );                 \
+        } while (0)
 
-/* The default format when -g is given is still COFF debug info */
-#define PREFERRED_DEBUGGING_TYPE SDB_DEBUG
-
-#define DBX_REGISTER_NUMBER(REGNO)   (REGNO)
 \f
 /* MISCELLANEOUS PARAMETERS */
 
@@ -1925,19 +1718,11 @@ bss_section ()                                                     \
    for the index in the tablejump instruction.  */
 #define CASE_VECTOR_MODE QImode
 
-/* Define this if the tablejump instruction expects the table
-   to contain offsets from the address of the table.
+/* Define as C expression which evaluates to nonzero if the tablejump
+   instruction expects the table to contain offsets from the address of the
+   table.
    Do not define this if the table should contain absolute addresses.  */
-/* #define CASE_VECTOR_PC_RELATIVE  */
-
-/* Specify the tree operation to be used to convert reals to integers.  */
-#define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR
-
-/* This is the kind of divide that is easiest to do in the general case.  */
-#define EASY_DIV_EXPR TRUNC_DIV_EXPR
-
-/* Define this if the library function 'vprintf' is available on your system. */
-#define HAVE_VPRINTF
+/* #define CASE_VECTOR_PC_RELATIVE 1 */
 
 /* Max number of bytes we can move from memory to memory
    in one reasonably fast instruction.  */
@@ -1946,8 +1731,8 @@ bss_section ()                                                       \
 /* Defining this macro causes the compiler to omit a sign-extend, zero-extend,
    or bitwise 'and' instruction that truncates the count of a shift operation
    to a width equal to the number of bits needed to represent the size of the
-   object being shifted. Do not define this macro unless the trucation applies
-   to both shoft operations and bit-field operations (if any). */
+   object being shifted. Do not define this macro unless the truncation applies
+   to both shift operations and bit-field operations (if any).  */
 /* #define SHIFT_COUNT_TRUNCATED */
 
 /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
@@ -1955,7 +1740,7 @@ bss_section ()                                                       \
 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
 
 /* When a prototype says `char' or `short', really pass an `int'.  */
-#define PROMOTE_PROTOTYPES
+#define PROMOTE_PROTOTYPES 1
 
 /* An alias for the machine mode used for pointers */
 #define Pmode  QImode
@@ -1971,17 +1756,13 @@ bss_section ()                                                     \
 #define TARGET_VERSION fprintf (stderr, " (%s, %s)", VERSION_INFO1, __DATE__)
 #endif
 
-#define VERSION_INFO1 "AT&T DSP16xx C Cross Compiler, version 1.2.0"
+#define VERSION_INFO1 "Lucent DSP16xx C Cross Compiler, version 1.3.0b"
 
 
 /* Define this as 1 if `char' should by default be signed; else as 0.  */
 #define DEFAULT_SIGNED_CHAR 1
 
-/* If this macro is defined, GNU CC gathers statistics about the number and
-   kind of tree node it allocates during each run. The option '-fstats' will
-   tell the compiler to print these statistics about the sizes of it obstacks. */
-#define GATHER_STATISTICS
-
 /* Define this so gcc does not output a call to __main, since we
-   are not currently supporting c++. */
+   are not currently supporting c++.  */
 #define INIT_SECTION_ASM_OP  1
+