OSDN Git Service

* 1750a.h (datalbl, jmplbl): Declare array size explicitly.
[pf3gnuchains/gcc-fork.git] / gcc / config / ns32k / ns32k.h
index 854c794..62be8cb 100644 (file)
@@ -1,5 +1,6 @@
 /* Definitions of target machine for GNU compiler.  NS32000 version.
-   Copyright (C) 1988, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
+   Copyright (C) 1988, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+   2001 Free Software Foundation, Inc.
    Contributed by Michael Tiemann (tiemann@cygnus.com)
 
 This file is part of GNU CC.
@@ -23,11 +24,9 @@ Boston, MA 02111-1307, USA.  */
 /* Note that some other tm.h files include this one and then override
    many of the definitions that relate to assembler syntax.  */
 
-extern enum reg_class secondary_reload_class();
-
 /* Names to predefine in the preprocessor for this target machine.  */
 
-#define CPP_PREDEFINES "-Dns32000 -Dunix -Asystem(unix) -Acpu(ns32k) -Amachine(ns32k)"
+#define CPP_PREDEFINES "-Dns32000 -Dunix -Asystem=unix -Acpu=ns32k -Amachine=ns32k"
 
 /* Print subsidiary information on the compiler version in use.  */
 #define TARGET_VERSION fprintf (stderr, " (32000, GAS syntax)");
@@ -66,6 +65,13 @@ extern int target_flags;
 
 /* Compile 32081 insns for floating point (not library calls). */
 #define TARGET_32081 (target_flags & 1)
+#define TARGET_32381 (target_flags & 256)
+
+/* The use of multiply-add instructions is optional because there may
+ * be cases where it produces worse code.
+ */
+
+#define TARGET_MULT_ADD (target_flags & 512)
 
 /* Compile using rtd insn calling sequence.
    This will not work unless you use prototypes at least
@@ -93,34 +99,87 @@ extern int target_flags;
    where VALUE is the bits to set or minus the bits to clear.
    An empty string NAME is used to identify the default VALUE.  */
 
-#define TARGET_SWITCHES  \
-  { { "32081", 1},                             \
-    { "soft-float", -1},                       \
-    { "rtd", 2},                               \
-    { "nortd", -2},                            \
-    { "regparm", 4},                           \
-    { "noregparm", -4},                                \
-    { "32532", 24},                            \
-    { "32332", -8},                            \
-    { "32332", 16},                            \
-    { "32032", -24},                           \
-    { "sb", -32},                              \
-    { "nosb", 32},                             \
-    { "bitfield", -64},                                \
-    { "nobitfield", 64},                       \
-    { "himem", 128},                           \
-    { "nohimem", -128},                                \
-    { "", TARGET_DEFAULT}}
+#define TARGET_SWITCHES                                                        \
+  { { "32081", 1, N_("Use hardware fp")},                              \
+    { "soft-float", -257, N_("Don't use hardware fp")},                        \
+    { "rtd", 2, N_("Alternative calling convention")},                 \
+    { "nortd", -2, N_("Use normal calling convention")},               \
+    { "regparm", 4, N_("Pass some arguments in registers")},           \
+    { "noregparm", -4, N_("Pass all arguments on stack")},             \
+    { "32532", 24, N_("Optimize for 32532 cpu")},                      \
+    { "32332", 16, N_("Optimize for 32332 cpu")},                      \
+    { "32332", -8, 0},                                                 \
+    { "32032", -24, N_("Optimize for 32032")},                         \
+    { "sb", -32,                                                       \
+      N_("Register sb is zero. Use for absolute addressing")},         \
+    { "nosb", 32, N_("Do not use register sb")},                       \
+    { "bitfield", -64, N_("Do not use bit-field instructions")},       \
+    { "nobitfield", 64, N_("Use bit-field instructions")},             \
+    { "himem", 128, N_("Generate code for high memory")},              \
+    { "nohimem", -128, N_("Generate code for low memory")},            \
+    { "32381", 256, N_("32381 fpu")},                                  \
+    { "mult-add", 512, N_("Use multiply-accumulate fp instructions")}, \
+    { "nomult-add", -512,                                              \
+      N_("Do not use multiply-accumulate fp instructions") },          \
+    { "src", 1024, N_("\"Small register classes\" kludge")},           \
+    { "nosrc", -1024, N_("No \"Small register classes\" kludge")},     \
+    { "", TARGET_DEFAULT, 0}}
+
 /* TARGET_DEFAULT is defined in encore.h, pc532.h, etc.  */
 
 /* When we are generating PIC, the sb is used as a pointer
-   to the GOT.  */
+   to the GOT. 32381 is a superset of 32081  */
 
-#define OVERRIDE_OPTIONS               \
-{                                      \
+#define OVERRIDE_OPTIONS                               \
+{                                                      \
   if (flag_pic || TARGET_HIMEM) target_flags |= 32;    \
+  if (TARGET_32381) target_flags |= 1;                 \
+  else target_flags &= ~512;                           \
 }
 
+/* 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
+   macros.
+
+   This is necessary in case the fixed or call-clobbered registers
+   depend on target flags.
+
+   You need not define this macro if it has no work to do.
+
+   If the usage of an entire class of registers depends on the target
+   flags, you may indicate this to GCC by using this macro to modify
+   `fixed_regs' and `call_used_regs' to 1 for each of the registers in
+   the classes which should not be used by GCC.  Also define the macro
+   `REG_CLASS_FROM_LETTER' to return `NO_REGS' if it is called with a
+   letter for a class that shouldn't be used.
+
+   (However, if this class is not included in `GENERAL_REGS' and all
+   of the insn patterns whose constraints permit this class are
+   controlled by target switches, then GCC will automatically avoid
+   using these registers when the target switches are opposed to
+   them.)  */
+
+#define CONDITIONAL_REGISTER_USAGE                                     \
+do                                                                     \
+  {                                                                    \
+    if (!TARGET_32081)                                         \
+      {                                                                        \
+       int regno;                                                      \
+                                                                       \
+       for (regno = F0_REGNUM; regno <= F0_REGNUM + 8; regno++)        \
+         fixed_regs[regno] = call_used_regs[regno] = 1;                \
+      }                                                                        \
+    if (!TARGET_32381)                                         \
+      {                                                                        \
+       int regno;                                                      \
+                                                                       \
+       for (regno = L1_REGNUM; regno <= L1_REGNUM + 8; regno++)        \
+         fixed_regs[regno] = call_used_regs[regno] = 1;                \
+      }                                                                        \
+  }                                                                    \
+while (0)
+
 \f
 /* target machine storage layout */
 
@@ -177,7 +236,7 @@ extern int target_flags;
    crossing a page boundary cause unpredictable results.  */
 #define STRICT_ALIGNMENT 1
 
-/* If bit field type is int, dont let it cross an int,
+/* If bit field type is int, don't let it cross an int,
    and give entire struct the alignment of an int.  */
 /* Required on the 386 since it doesn't have a full set of bitfield insns.
    (There is no signed extv insn.)  */
@@ -190,13 +249,14 @@ extern int target_flags;
    from 0 to just below FIRST_PSEUDO_REGISTER.
    All registers that the compiler knows about must be given numbers,
    even those that are not normally considered general registers.  */
-#define FIRST_PSEUDO_REGISTER 18
+#define FIRST_PSEUDO_REGISTER 26
 
 /* 1 for registers that have pervasive standard uses
    and are not available for the register allocator.
    On the ns32k, these are the FP, SP, (SB and PC are not included here).  */
 #define FIXED_REGISTERS {0, 0, 0, 0, 0, 0, 0, 0, \
                         0, 0, 0, 0, 0, 0, 0, 0, \
+                         0, 0, 0, 0, 0, 0, 0, 0, \
                         1, 1}
 
 /* 1 for registers not available across function calls.
@@ -207,13 +267,75 @@ extern int target_flags;
    Aside from that, you can include as many other registers as you like.  */
 #define CALL_USED_REGISTERS {1, 1, 1, 0, 0, 0, 0, 0, \
                             1, 1, 1, 1, 0, 0, 0, 0, \
+                            1, 1, 0, 0, 0, 0, 0, 0, \
                             1, 1}
 
+/* How to refer to registers in assembler output.
+   This sequence is indexed by compiler's hard-register-number (see above).  */
+
+#define REGISTER_NAMES \
+{"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
+ "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \
+ "l1", "l1h","l3", "l3h","l5", "l5h","l7", "l7h", \
+ "fp", "sp"}
+
+
+#define ADDITIONAL_REGISTER_NAMES \
+{{"l0", 8}, {"l2", 10}, {"l4", 12}, {"l6", 14}}
+
+/* l0-7 are not recognized by the assembler. These are the names to use,
+ * but we don't want ambiguous names in REGISTER_NAMES
+ */
+#define OUTPUT_REGISTER_NAMES \
+{"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
+ "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \
+ "f1", "l1h","f3", "l3h","f5", "l5h","f7", "f7h", \
+ "fp", "sp"}
+
+#define REG_ALLOC_ORDER \
+{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 16, 10, 11, 18, 12, 13, 20, 14, 15, 22, 24, 25, 17, 19, 23}
+
+/* How to renumber registers for dbx and gdb.
+   NS32000 may need more change in the numeration. XXX */
+
+#define DBX_REGISTER_NUMBER(REGNO) \
+  ((REGNO) < L1_REGNUM? (REGNO) \
+   : (REGNO) < FRAME_POINTER_REGNUM? (REGNO) - L1_REGNUM + 22 \
+   : (REGNO) == FRAME_POINTER_REGNUM? 17 \
+   : 16)
+
+/* dwarf2out.c can't understand the funny DBX register numbering.
+ * We use dwarf2out.c for exception handling even though we use DBX
+ * for debugging
+ */
+#define DWARF_FRAME_REGNUM(REGNO) (REGNO)
+
+
+
+#define R0_REGNUM 0
+#define F0_REGNUM 8
+#define L1_REGNUM 16
+
+/* Specify the registers used for certain standard purposes.
+   The values of these macros are register numbers.  */
+
+/* NS32000 pc is not overloaded on a register.  */
+/* #define PC_REGNUM */
+
+/* Register to use for pushing function arguments. */
+#define STACK_POINTER_REGNUM 25
+
+/* Base register for access to local variables of the function. */
+#define FRAME_POINTER_REGNUM 24
+
+
 /* 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.
-   On the ns32k, all registers are 32 bits long.  */
+   On the ns32k, all registers are 32 bits long except for the 32381 "long"
+   registers but we treat those as pairs  */
+#define LONG_FP_REGS_P(REGNO) ((REGNO) >= L1_REGNUM && (REGNO) < L1_REGNUM + 8)
 #define HARD_REGNO_NREGS(REGNO, MODE)   \
  ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
 
@@ -223,22 +345,19 @@ extern int target_flags;
 /* Value is 1 if it is a good idea to tie two pseudo registers
    when one has mode MODE1 and one has mode MODE2.
    If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
-   for any hard reg, then this must be 0 for correct output.  */
-#define MODES_TIEABLE_P(MODE1, MODE2) \
-  (((MODE1) == DFmode || (MODE1) == DCmode || (MODE1) == DImode) ==    \
-   ((MODE2) == DFmode || (MODE2) == DCmode || (MODE2) == DImode))
-
-/* Specify the registers used for certain standard purposes.
-   The values of these macros are register numbers.  */
+   for any hard reg, then this must be 0 for correct output.
 
-/* NS32000 pc is not overloaded on a register.  */
-/* #define PC_REGNUM */
+   Early documentation says SI and DI are not tieable if some reg can
+   be OK for SI but not for DI. However other ports (mips, i860, mvs
+   and tahoe) don't meet the above criterion. Evidently the real
+   requirement is somewhat laxer. Documentation was changed for gcc
+   2.8 but was not picked up by egcs (at least egcs 1.0). Having all
+   integer modes tieable definitely generates faster code. */
 
-/* Register to use for pushing function arguments. */
-#define STACK_POINTER_REGNUM 17
-
-/* Base register for access to local variables of the function. */
-#define FRAME_POINTER_REGNUM 16
+#define MODES_TIEABLE_P(MODE1, MODE2)                                  \
+  ((FLOAT_MODE_P(MODE1) && FLOAT_MODE_P(MODE2)                         \
+    && (GET_MODE_UNIT_SIZE(MODE1) == GET_MODE_UNIT_SIZE(MODE2)))       \
+   || (!FLOAT_MODE_P(MODE1) && !FLOAT_MODE_P(MODE2)))
 
 /* Value should be nonzero if functions must have frame pointers.
    Zero means the frame pointer need not be set up (and parms
@@ -247,7 +366,7 @@ extern int target_flags;
 #define FRAME_POINTER_REQUIRED 0
 
 /* Base register for access to arguments of the function.  */
-#define ARG_POINTER_REGNUM 16
+#define ARG_POINTER_REGNUM 24
 
 /* Register in which static-chain is passed to a function.  */
 #define STATIC_CHAIN_REGNUM 1
@@ -275,37 +394,49 @@ extern int target_flags;
 
    For any two classes, it is very desirable that there be another
    class that represents their union.  */
-   
-enum reg_class { NO_REGS, GENERAL_REGS, FLOAT_REGS, GEN_AND_FP_REGS,
-                FRAME_POINTER_REG, STACK_POINTER_REG, 
-                 GEN_AND_MEM_REGS, ALL_REGS, LIM_REG_CLASSES };
+
+enum reg_class
+{ NO_REGS, GENERAL_REGS, FLOAT_REG0, LONG_FLOAT_REG0, FLOAT_REGS,
+  FP_REGS, GEN_AND_FP_REGS, FRAME_POINTER_REG, STACK_POINTER_REG,
+  GEN_AND_MEM_REGS, ALL_REGS, LIM_REG_CLASSES };
 
 #define N_REG_CLASSES (int) LIM_REG_CLASSES
 
 /* Give names of register classes as strings for dump file.   */
 
 #define REG_CLASS_NAMES \
- {"NO_REGS", "GENERAL_REGS", "FLOAT_REGS", "GEN_AND_FP_REGS",  \
-  "FRAME_POINTER_REG", "STACK_POINTER_REG", "GEN_AND_MEM_REGS", "ALL_REGS" }
+ {"NO_REGS", "GENERAL_REGS", "FLOAT_REG0", "LONG_FLOAT_REG0", "FLOAT_REGS", \
+  "FP_REGS", "GEN_AND_FP_REGS", "FRAME_POINTER_REG", "STACK_POINTER_REG", \
+  "GEN_AND_MEM_REGS", "ALL_REGS" }
 
 /* Define which registers fit in which classes.
    This is an initializer for a vector of HARD_REG_SET
    of length N_REG_CLASSES.  */
 
-#define REG_CLASS_CONTENTS {0, 0x00ff, 0xff00, 0xffff, \
-                           0x10000, 0x20000, 0x300ff, 0x3ffff }
+#define REG_CLASS_CONTENTS                             \
+       {{0},                   /* NO_REGS */           \
+        {0x00ff},              /* GENERAL_REGS */      \
+        {0x100},               /* FLOAT_REG0 */        \
+        {0x300},               /* LONG_FLOAT_REG0 */   \
+        {0xff00},              /* FLOAT_REGS */        \
+         {0xffff00},           /* FP_REGS */           \
+         {0xffffff},           /* GEN_AND_FP_REGS */   \
+         {0x1000000},          /* FRAME_POINTER_REG */ \
+         {0x2000000},          /* STACK_POINTER_REG */ \
+         {0x30000ff},          /* GEN_AND_MEM_REGS */  \
+        {0x3ffffff}            /* ALL_REGS */          \
+       }
+
+#define SUBSET_P(CLASS1, CLASS2)                       \
+   ((ns32k_reg_class_contents[CLASS1][0]               \
+     & ~ns32k_reg_class_contents[CLASS2][0]) == 0)
 
 /* The same information, inverted:
    Return the class number of the smallest class containing
    reg number REGNO.  This could be a conditional expression
    or could index an array.  */
 
-#define REGNO_REG_CLASS(REGNO) \
-  ((REGNO) < 8 ? GENERAL_REGS          \
-   : (REGNO) < 16 ? FLOAT_REGS         \
-   : (REGNO) == 16 ? FRAME_POINTER_REG \
-   : (REGNO) == 17 ? STACK_POINTER_REG \
-   : NO_REGS)
+#define REGNO_REG_CLASS(REGNO)  (regclass_map[REGNO])
 
 /* The class value for index registers, and the one for base regs.  */
 
@@ -314,10 +445,13 @@ enum reg_class { NO_REGS, GENERAL_REGS, FLOAT_REGS, GEN_AND_FP_REGS,
 
 /* Get reg_class from a letter such as appears in the machine description.  */
 
-#define REG_CLASS_FROM_LETTER(C)       \
- ((C) == 'f' ? FLOAT_REGS              \
-  : (C) == 'x' ? FRAME_POINTER_REG     \
-  : (C) == 'y' ? STACK_POINTER_REG      \
+#define REG_CLASS_FROM_LETTER(C)               \
+ ((C) == 'u' ? FLOAT_REG0                      \
+  : (C) == 'v' ? LONG_FLOAT_REG0               \
+  : (C) == 'f' ? FLOAT_REGS                    \
+  : (C) == 'l' ? FP_REGS                       \
+  : (C) == 'x' ? FRAME_POINTER_REG             \
+  : (C) == 'y' ? STACK_POINTER_REG             \
   : NO_REGS)
 
 /* The letters I, J, K, L and M in a register constraint string
@@ -353,13 +487,15 @@ enum reg_class { NO_REGS, GENERAL_REGS, FLOAT_REGS, GEN_AND_FP_REGS,
 
 /* We return GENERAL_REGS instead of GEN_AND_MEM_REGS.
    The latter offers no real additional possibilities
-   and can cause spurious secondary reloading.  */ 
+   and can cause spurious secondary reloading.  */
+
 #define PREFERRED_RELOAD_CLASS(X,CLASS) \
  ((CLASS) == GEN_AND_MEM_REGS ? GENERAL_REGS : (CLASS))
 
 /* Return the maximum number of consecutive registers
    needed to represent mode MODE in a register of class CLASS.  */
 /* On the 32000, this is the size of MODE in words */
+
 #define CLASS_MAX_NREGS(CLASS, MODE) \
   ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
 \f
@@ -381,6 +517,43 @@ enum reg_class { NO_REGS, GENERAL_REGS, FLOAT_REGS, GEN_AND_FP_REGS,
    of the first local allocated.  */
 #define STARTING_FRAME_OFFSET 0
 
+/* A C expression whose value is RTL representing the location of the
+   incoming return address at the beginning of any function, before
+   the prologue.  This RTL is either a `REG', indicating that the
+   return value is saved in `REG', or a `MEM' representing a location
+   in the stack.
+
+   You only need to define this macro if you want to support call
+   frame debugging information like that provided by DWARF 2.
+
+   Before the prologue, RA is at 0(sp).  */
+
+#define INCOMING_RETURN_ADDR_RTX \
+  gen_rtx (MEM, VOIDmode, gen_rtx (REG, VOIDmode, STACK_POINTER_REGNUM))
+
+/* A C expression whose value is RTL representing the value of the
+   return address for the frame COUNT steps up from the current frame,
+   after the prologue.  FRAMEADDR is the frame pointer of the COUNT
+   frame, or the frame pointer of the COUNT - 1 frame if
+   `RETURN_ADDR_IN_PREVIOUS_FRAME' is defined.
+
+   After the prologue, RA is at 4(fp) in the current frame.  */
+
+#define RETURN_ADDR_RTX(COUNT, FRAME)                                  \
+  (gen_rtx (MEM, Pmode, gen_rtx (PLUS, Pmode, (FRAME), GEN_INT(4))))
+
+/* A C expression whose value is an integer giving the offset, in
+   bytes, from the value of the stack pointer register to the top of
+   the stack frame at the beginning of any function, before the
+   prologue.  The top of the frame is defined to be the value of the
+   stack pointer in the previous frame, just before the call
+   instruction.
+
+   You only need to define this macro if you want to support call
+   frame debugging information like that provided by DWARF 2. */
+
+#define INCOMING_FRAME_SP_OFFSET 4
+
 /* If we generate an insn to push BYTES bytes,
    this says how many the stack pointer really advances by.
    On the 32000, sp@- in a byte insn really pushes a BYTE.  */
@@ -402,14 +575,12 @@ enum reg_class { NO_REGS, GENERAL_REGS, FLOAT_REGS, GEN_AND_FP_REGS,
      because the library is compiled with the Unix compiler.
    Use of RET is a selectable option, since it is incompatible with
    standard Unix calling sequences.  If the option is not selected,
-   the caller must always pop the args.  */
+   the caller must always pop the args.
 
-#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE)   \
-  ((TARGET_RTD && TREE_CODE (FUNDECL) != IDENTIFIER_NODE       \
-    && (TYPE_ARG_TYPES (FUNTYPE) == 0                          \
-       || (TREE_VALUE (tree_last (TYPE_ARG_TYPES (FUNTYPE)))   \
-           == void_type_node)))                                \
-   ? (SIZE) : 0)
+   The attribute stdcall is equivalent to RTD on a per module basis.  */
+
+#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \
+  (ns32k_return_pops_args (FUNDECL, FUNTYPE, SIZE))
 
 /* Define how to find the value returned by a function.
    VALTYPE is the data type of the value (as a tree).
@@ -417,23 +588,19 @@ enum reg_class { NO_REGS, GENERAL_REGS, FLOAT_REGS, GEN_AND_FP_REGS,
    otherwise, FUNC is 0.  */
 
 /* On the 32000 the return value is in R0,
-   or perhaps in F0 is there is fp support.  */   
+   or perhaps in F0 if there is fp support.  */
 
-#define FUNCTION_VALUE(VALTYPE, FUNC)  \
-  (TREE_CODE (VALTYPE) == REAL_TYPE && TARGET_32081 \
-   ? gen_rtx (REG, TYPE_MODE (VALTYPE), 8) \
-   : gen_rtx (REG, TYPE_MODE (VALTYPE), 0))
+#define FUNCTION_VALUE(VALTYPE, FUNC) LIBCALL_VALUE(TYPE_MODE (VALTYPE))
 
 /* Define how to find the value returned by a library function
    assuming the value has mode MODE.  */
 
 /* On the 32000 the return value is in R0,
-   or perhaps F0 is there is fp support.  */   
+   or perhaps F0 is there is fp support.  */
 
 #define LIBCALL_VALUE(MODE)  \
-  (((MODE) == DFmode || (MODE) == SFmode) && TARGET_32081 \
-   ? gen_rtx (REG, MODE, 8) \
-   : gen_rtx (REG, MODE, 0))
+  gen_rtx_REG (MODE,                             \
+              FLOAT_MODE_P(MODE) && TARGET_32081 ? F0_REGNUM: R0_REGNUM)
 
 /* Define this if PCC uses the nonreentrant convention for returning
    structure and union values.  */
@@ -498,7 +665,7 @@ enum reg_class { NO_REGS, GENERAL_REGS, FLOAT_REGS, GEN_AND_FP_REGS,
    It exists only to test register calling conventions.  */
 
 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
-((TARGET_REGPARM && (CUM) < 8) ? gen_rtx (REG, (MODE), (CUM) / 4) : 0)
+((TARGET_REGPARM && (CUM) < 8) ? gen_rtx_REG ((MODE), (CUM) / 4) : 0)
 
 /* For an arg passed partly in registers and partly in memory,
    this is the number of registers used.
@@ -511,119 +678,6 @@ enum reg_class { NO_REGS, GENERAL_REGS, FLOAT_REGS, GEN_AND_FP_REGS,
                      : GET_MODE_SIZE (MODE))))                 \
  ? 2 - (CUM) / 4 : 0)
 
-#ifndef MAIN_FUNCTION_PROLOGUE
-#define MAIN_FUNCTION_PROLOGUE
-#endif
-
-/*
- * The function prologue for the ns32k is fairly simple.
- * If a frame pointer is needed (decided in reload.c ?) then
- * we need assembler of the form
- *
- *  # Save the oldframe pointer, set the new frame pointer, make space
- *  # on the stack and save any general purpose registers necessary
- *
- *  enter [<general purpose regs to save>], <local stack space>
- *
- *  movf  fn, tos    # Save any floating point registers necessary
- *  .
- *  .
- *
- * If a frame pointer is not needed we need assembler of the form
- *
- *  # Make space on the stack
- *
- *  adjspd <local stack space + 4>
- *
- *  # Save any general purpose registers necessary
- *
- *  save [<general purpose regs to save>]
- *
- *  movf  fn, tos    # Save any floating point registers necessary
- *  .
- *  .
- */
-#if defined(IMMEDIATE_PREFIX) && IMMEDIATE_PREFIX
-#define ADJSP(FILE, n) \
-        fprintf (FILE, "\tadjspd %c%d\n", IMMEDIATE_PREFIX, (n))
-#else
-#define ADJSP(FILE, n) \
-        fprintf (FILE, "\tadjspd %d\n", (n))
-#endif
-
-#define FUNCTION_PROLOGUE(FILE, SIZE)     \
-{ register int regno, g_regs_used = 0;                         \
-  int used_regs_buf[8], *bufp = used_regs_buf;                 \
-  int used_fregs_buf[8], *fbufp = used_fregs_buf;              \
-  extern char call_used_regs[];                                        \
-  extern int current_function_uses_pic_offset_table, flag_pic; \
-  MAIN_FUNCTION_PROLOGUE;                                      \
-  for (regno = 0; regno < 8; regno++)                          \
-    if (regs_ever_live[regno]                                  \
-       && ! call_used_regs[regno])                             \
-      {                                                                \
-        *bufp++ = regno; g_regs_used++;                                \
-      }                                                                \
-  *bufp = -1;                                                  \
-  for (; regno < 16; regno++)                                  \
-    if (regs_ever_live[regno] && !call_used_regs[regno])       \
-      {                                                                \
-        *fbufp++ = regno;                                      \
-      }                                                                \
-  *fbufp = -1;                                                 \
-  bufp = used_regs_buf;                                                \
-  if (frame_pointer_needed)                                    \
-    fprintf (FILE, "\tenter [");                               \
-  else                                                         \
-    {                                                          \
-      if (SIZE)                                                        \
-        ADJSP (FILE, SIZE + 4);                                        \
-      if (g_regs_used && g_regs_used > 4)                      \
-        fprintf (FILE, "\tsave [");                            \
-      else                                                     \
-       {                                                       \
-         while (*bufp >= 0)                                    \
-            fprintf (FILE, "\tmovd r%d,tos\n", *bufp++);       \
-         g_regs_used = 0;                                      \
-       }                                                       \
-    }                                                          \
-  while (*bufp >= 0)                                           \
-    {                                                          \
-      fprintf (FILE, "r%d", *bufp++);                          \
-      if (*bufp >= 0)                                          \
-       fputc (',', FILE);                                      \
-    }                                                          \
-  if (frame_pointer_needed)                                    \
-    fprintf (FILE, "],%d\n", SIZE);                            \
-  else if (g_regs_used)                                                \
-    fprintf (FILE, "]\n");                                     \
-  fbufp = used_fregs_buf;                                      \
-  while (*fbufp >= 0)                                          \
-    {                                                          \
-      if ((*fbufp & 1) || (fbufp[0] != fbufp[1] - 1))          \
-       fprintf (FILE, "\tmovf f%d,tos\n", *fbufp++ - 8);       \
-      else                                                     \
-       {                                                       \
-         fprintf (FILE, "\tmovl f%d,tos\n", fbufp[0] - 8);     \
-         fbufp += 2;                                           \
-       }                                                       \
-    }                                                          \
-  if (flag_pic && current_function_uses_pic_offset_table)      \
-    {                                                          \
-      fprintf (FILE, "\tsprd sb,tos\n");                       \
-      if (TARGET_REGPARM)                                      \
-       {                                                       \
-         fprintf (FILE, "\taddr __GLOBAL_OFFSET_TABLE_(pc),tos\n"); \
-         fprintf (FILE, "\tlprd sb,tos\n");                    \
-       }                                                       \
-      else                                                     \
-       {                                                       \
-         fprintf (FILE, "\taddr __GLOBAL_OFFSET_TABLE_(pc),r0\n"); \
-         fprintf (FILE, "\tlprd sb,r0\n");                     \
-       }                                                       \
-    }                                                          \
-}
-
 /* Output assembler code to FILE to increment profiler label # LABELNO
    for profiling a function entry.
 
@@ -637,101 +691,11 @@ enum reg_class { NO_REGS, GENERAL_REGS, FLOAT_REGS, GEN_AND_FP_REGS,
    functions that have frame pointers.
    No definition is equivalent to always zero.
 
-   We use 0, because using 1 requires hair in FUNCTION_EPILOGUE
+   We use 0, because using 1 requires hair in output_function_epilogue()
    that is worse than the stack adjust we could save.  */
 
 /* #define EXIT_IGNORE_STACK 1 */
 
-/* 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,
-   if EXIT_IGNORE_STACK is nonzero.  That doesn't apply here.
-
-   If a frame pointer is needed (decided in reload.c ?) then
-   we need assembler of the form
-
-    movf  tos, fn      # Restore any saved floating point registers
-    .
-    .
-
-    # Restore any saved general purpose registers, restore the stack
-    # pointer from the frame pointer, restore the old frame pointer.
-    exit [<general purpose regs to save>]
-
-   If a frame pointer is not needed we need assembler of the form
-    # Restore any general purpose registers saved
-
-    movf  tos, fn      # Restore any saved floating point registers
-    .
-    .
-    .
-    restore [<general purpose regs to save>]
-
-    # reclaim space allocated on stack
-
-    adjspd <-(local stack space + 4)> */
-
-
-#define FUNCTION_EPILOGUE(FILE, SIZE) \
-{ register int regno, g_regs_used = 0, f_regs_used = 0;                \
-  int used_regs_buf[8], *bufp = used_regs_buf;                 \
-  int used_fregs_buf[8], *fbufp = used_fregs_buf;              \
-  extern char call_used_regs[];                                        \
-  extern int current_function_uses_pic_offset_table, flag_pic; \
-  if (flag_pic && current_function_uses_pic_offset_table)      \
-    fprintf (FILE, "\tlprd sb,tos\n");                         \
-  *fbufp++ = -2;                                               \
-  for (regno = 8; regno < 16; regno++)                         \
-    if (regs_ever_live[regno] && !call_used_regs[regno])       \
-      {                                                                \
-       *fbufp++ = regno; f_regs_used++;                                \
-      }                                                                \
-  fbufp--;                                                     \
-  for (regno = 0; regno < 8; regno++)                          \
-    if (regs_ever_live[regno]                                  \
-       && ! call_used_regs[regno])                             \
-      {                                                                \
-        *bufp++ = regno; g_regs_used++;                                \
-      }                                                                \
-  while (fbufp > used_fregs_buf)                               \
-    {                                                          \
-      if ((*fbufp & 1) && fbufp[0] == fbufp[-1] + 1)           \
-       {                                                       \
-         fprintf (FILE, "\tmovl tos,f%d\n", fbufp[-1] - 8);    \
-         fbufp -= 2;                                           \
-       }                                                       \
-      else fprintf (FILE, "\tmovf tos,f%d\n", *fbufp-- - 8);   \
-    }                                                          \
-  if (frame_pointer_needed)                                    \
-    fprintf (FILE, "\texit [");                                        \
-  else                                                         \
-    {                                                          \
-      if (g_regs_used && g_regs_used > 4)                      \
-        fprintf (FILE, "\trestore [");                         \
-      else                                                     \
-        {                                                      \
-         while (bufp > used_regs_buf)                          \
-            fprintf (FILE, "\tmovd tos,r%d\n", *--bufp);       \
-         g_regs_used = 0;                                      \
-        }                                                      \
-    }                                                          \
-  while (bufp > used_regs_buf)                                 \
-    {                                                          \
-      fprintf (FILE, "r%d", *--bufp);                          \
-      if (bufp > used_regs_buf)                                        \
-       fputc (',', FILE);                                      \
-    }                                                          \
-  if (g_regs_used || frame_pointer_needed)                     \
-    fprintf (FILE, "]\n");                                     \
-  if (SIZE && !frame_pointer_needed)                           \
-    ADJSP (FILE, -(SIZE + 4));                                 \
-  if (current_function_pops_args)                              \
-    fprintf (FILE, "\tret %d\n", current_function_pops_args);  \
-  else fprintf (FILE, "\tret 0\n"); }
-
 /* Store in the variable DEPTH the initial difference between the
    frame pointer reg contents and the stack pointer reg contents,
    as of the start of the function body.  This depends on the layout
@@ -741,10 +705,12 @@ enum reg_class { NO_REGS, GENERAL_REGS, FLOAT_REGS, GEN_AND_FP_REGS,
 {                                                              \
   int regno;                                                   \
   int offset = -4;                                             \
-  extern int current_function_uses_pic_offset_table, flag_pic; \
-  for (regno = 0; regno < 16; regno++)                         \
+  for (regno = 0; regno < L1_REGNUM; regno++)                  \
     if (regs_ever_live[regno] && ! call_used_regs[regno])      \
       offset += 4;                                             \
+  for (; regno < FRAME_POINTER_REGNUM; regno++)                        \
+    if (regs_ever_live[regno] && ! call_used_regs[regno])      \
+      offset += 8;                                             \
   if (flag_pic && current_function_uses_pic_offset_table)      \
     offset += 4;                                               \
   (DEPTH) = (offset + get_frame_size ()                                \
@@ -770,8 +736,8 @@ operands on the 32k are stored).  */
   fprintf (FILE, "\tjump " );                                          \
   PUT_ABSOLUTE_PREFIX (FILE);                                          \
   fprintf (FILE, "__trampoline\n" );                                   \
-  ASM_OUTPUT_INT (FILE, const0_rtx);                                   \
-  ASM_OUTPUT_INT (FILE, const0_rtx);                                   \
+  assemble_aligned_integer (UNITS_PER_WORD, const0_rtx);               \
+  assemble_aligned_integer (UNITS_PER_WORD, const0_rtx);               \
 }
 
 /* Length in units of the trampoline for entering a nested function.  */
@@ -784,8 +750,8 @@ operands on the 32k are stored).  */
 
 #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT)                           \
 {                                                                           \
-  emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 12)), CXT);    \
-  emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 16)), FNADDR); \
+  emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 12)), CXT);    \
+  emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 16)), FNADDR); \
 }
 
 /* This is the library routine that is used
@@ -808,11 +774,11 @@ __transfer_from_trampoline ()             \
 \f
 /* Addressing modes, and classification of registers for them.  */
 
-/* #define HAVE_POST_INCREMENT */
-/* #define HAVE_POST_DECREMENT */
+/* #define HAVE_POST_INCREMENT */
+/* #define HAVE_POST_DECREMENT */
 
-/* #define HAVE_PRE_DECREMENT */
-/* #define HAVE_PRE_INCREMENT */
+/* #define HAVE_PRE_DECREMENT */
+/* #define HAVE_PRE_INCREMENT */
 
 /* Macros to check register numbers against specific register classes.  */
 
@@ -824,12 +790,13 @@ __transfer_from_trampoline ()             \
 
 /* note that FP and SP cannot be used as an index. What about PC? */
 #define REGNO_OK_FOR_INDEX_P(REGNO)  \
-((REGNO) < 8 || (unsigned)reg_renumber[REGNO] < 8)
+((REGNO) < F0_REGNUM || (unsigned)reg_renumber[REGNO] < F0_REGNUM)
 #define REGNO_OK_FOR_BASE_P(REGNO)   \
-((REGNO) < 8 || (unsigned)reg_renumber[REGNO] < 8 \
+((REGNO) < F0_REGNUM || (unsigned)reg_renumber[REGNO] < F0_REGNUM \
  || (REGNO) == FRAME_POINTER_REGNUM || (REGNO) == STACK_POINTER_REGNUM)
 
-#define FP_REG_P(X)  (GET_CODE (X) == REG && REGNO (X) > 7 && REGNO (X) < 16)
+#define FP_REG_P(X) \
+ (GET_CODE (X) == REG && REGNO (X) >= F0_REGNUM && REGNO (X) < FRAME_POINTER_REGNUM)
 \f
 /* Maximum number of registers that can appear in a valid memory address.  */
 
@@ -838,19 +805,18 @@ __transfer_from_trampoline ()             \
 /* Recognize any constant value that is a valid address.
    This might not work on future ns32k processors as negative
    displacements are not officially allowed but a mode reserved
-   to National.  This works on processors up to 32532, though. */
+   to National.  This works on processors up to 32532, though,
+   and we don't expect any new ones in the series ;-( */
 
 #define CONSTANT_ADDRESS_P(X)   \
   (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF             \
    || GET_CODE (X) == CONST                                            \
    || (GET_CODE (X) == CONST_INT                                       \
-       && ((unsigned)INTVAL (X) >= 0xe0000000                          \
-          || (unsigned)INTVAL (X) < 0x20000000)))
+       && NS32K_DISPLACEMENT_P (INTVAL (X))))
 
 #define CONSTANT_ADDRESS_NO_LABEL_P(X)   \
   (GET_CODE (X) == CONST_INT                                           \
-   && ((unsigned)INTVAL (X) >= 0xe0000000                              \
-       || (unsigned)INTVAL (X) < 0x20000000))
+   && NS32K_DISPLACEMENT_P (INTVAL (X)))
 
 /* Return the register class of a scratch register needed to copy IN into
    or out of a register in CLASS in MODE.  If it can be done directly,
@@ -859,6 +825,42 @@ __transfer_from_trampoline ()              \
 #define SECONDARY_RELOAD_CLASS(CLASS,MODE,IN) \
   secondary_reload_class (CLASS, MODE, IN)
 
+/*  Certain machines have the property that some registers cannot be
+    copied to some other registers without using memory.  Define this
+    macro on those machines to be a C expression that is non-zero if
+    objects of mode M in registers of CLASS1 can only be copied to
+    registers of class CLASS2 by storing a register of CLASS1 into
+    memory and loading that memory location into a register of CLASS2.
+
+    On the ns32k, floating point regs can only be loaded through memory
+
+    The movdf and movsf insns in ns32k.md copy between general and
+    floating registers using the stack. In principle, we could get
+    better code not allowing that case in the constraints and defining
+    SECONDARY_MEMORY_NEEDED in practice, though the stack slots used
+    are not available for optimization.  */
+
+#if 0
+#define SECONDARY_MEMORY_NEEDED(CLASS1, CLASS2, M)                     \
+     secondary_memory_needed(CLASS1, CLASS2, M)
+#endif
+
+/* SMALL_REGISTER_CLASSES is a run time option. This should no longer
+   be necessay and should go when we have confidence that we won't run
+   out of spill registers */
+#define SMALL_REGISTER_CLASSES (target_flags & 1024)
+
+/* A C expression whose value is nonzero if pseudos that have been
+   assigned to registers of class CLASS would likely be spilled
+   because registers of CLASS are needed for spill registers.
+
+   The default definition won't do because class LONG_FLOAT_REG0 has two
+   registers which are always accessed as a pair */
+
+#define CLASS_LIKELY_SPILLED_P(CLASS) \
+  (reg_class_size[(int) (CLASS)] == 1 || (CLASS) == LONG_FLOAT_REG0)
+
+
 /* Nonzero if the constant value X is a legitimate general operand.
    It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE.  */
 
@@ -882,10 +884,10 @@ __transfer_from_trampoline ()             \
 /* 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) < 8 || REGNO (X) >= FIRST_PSEUDO_REGISTER)
+  (REGNO (X) < F0_REGNUM || REGNO (X) >= FIRST_PSEUDO_REGISTER)
 /* Nonzero if X is a hard reg that can be used as a base reg
    of if it is a pseudo reg.  */
-#define REG_OK_FOR_BASE_P(X) (REGNO (X) < 8 || REGNO (X) >= FRAME_POINTER_REGNUM)
+#define REG_OK_FOR_BASE_P(X) (REGNO (X) < F0_REGNUM || REGNO (X) >= FRAME_POINTER_REGNUM)
 /* Nonzero if X is a floating point reg or a pseudo reg.  */
 
 #else
@@ -936,7 +938,8 @@ __transfer_from_trampoline ()               \
 
 /* Check for frame pointer or stack pointer.  */
 #define MEM_REG(X) \
-  (GET_CODE (X) == REG && (REGNO (X) ^ 16) < 2)
+  (GET_CODE (X) == REG && (REGNO (X) == FRAME_POINTER_REGNUM  \
+                          || REGNO(X) == STACK_POINTER_REGNUM))
 
 /* A memory ref whose address is the FP or SP, with optional integer offset,
    or (on certain machines) a constant address.  */
@@ -950,14 +953,14 @@ __transfer_from_trampoline ()             \
 
 /* Go to ADDR if X is a valid address not using indexing.
    (This much is the easy part.)  */
-#define GO_IF_NONINDEXED_ADDRESS(X, ADDR)  \
-{ register rtx xfoob = (X);                                            \
-  if (INDIRECTABLE_1_ADDRESS_P (X)) goto ADDR;                         \
-  if (INDIRECTABLE_2_ADDRESS_P (X)) goto ADDR;                         \
-  if (GET_CODE (X) == PLUS)                                            \
-    if (CONSTANT_ADDRESS_NO_LABEL_P (XEXP (X, 1)))                     \
-      if (INDIRECTABLE_2_ADDRESS_P (XEXP (X, 0)))                      \
-       goto ADDR;                                                      \
+#define GO_IF_NONINDEXED_ADDRESS(X, ADDR)              \
+{                                                      \
+  if (INDIRECTABLE_1_ADDRESS_P (X)) goto ADDR;         \
+  if (INDIRECTABLE_2_ADDRESS_P (X)) goto ADDR;         \
+  if (GET_CODE (X) == PLUS)                            \
+    if (CONSTANT_ADDRESS_NO_LABEL_P (XEXP (X, 1)))     \
+      if (INDIRECTABLE_2_ADDRESS_P (XEXP (X, 0)))      \
+       goto ADDR;                                      \
 }
 
 /* Go to ADDR if X is a valid address not using indexing.
@@ -996,12 +999,11 @@ __transfer_from_trampoline ()             \
    ((xfoo2 < 4 && xfoo2 != 2) || xfoo2 == 7))
 
 /* Note that xfoo0, xfoo1, xfoo2 are used in some of the submacros above.  */
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
+#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)                                \
 { register rtx xfooy, xfoo0, xfoo1;                                    \
   unsigned xfoo2;                                                      \
-  extern int current_function_uses_pic_offset_table, flag_pic;         \
   xfooy = X;                                                           \
-  if (flag_pic && ! current_function_uses_pic_offset_table             \
+  if (flag_pic && cfun && ! current_function_uses_pic_offset_table     \
       && global_symbolic_reference_mentioned_p (X, 1))                 \
     current_function_uses_pic_offset_table = 1;                                \
   GO_IF_NONINDEXED_ADDRESS (xfooy, ADDR);                              \
@@ -1018,8 +1020,10 @@ __transfer_from_trampoline ()            \
   else if (INDEX_TERM_P (xfooy, MODE))                                 \
     goto ADDR;                                                         \
   else if (GET_CODE (xfooy) == PRE_DEC)                                        \
-    if (REGNO (XEXP (xfooy, 0)) == STACK_POINTER_REGNUM) goto ADDR;    \
-  else abort ();                                                       \
+    {                                                                  \
+      if (REGNO (XEXP (xfooy, 0)) == STACK_POINTER_REGNUM) goto ADDR;  \
+      else abort ();                                                   \
+    }                                                                  \
 }
 
 /* Try machine-dependent ways of modifying an illegitimate address
@@ -1040,15 +1044,20 @@ __transfer_from_trampoline ()           \
 #define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN)   {}
 
 /* Nonzero if the constant value X is a legitimate general operand
-   when generating PIC code.  It is given that flag_pic is on and 
+   when generating PIC code.  It is given that flag_pic is on and
    that X satisfies CONSTANT_P or is a CONST_DOUBLE.  */
 
-extern int current_function_uses_pic_offset_table, flag_pic;
 #define LEGITIMATE_PIC_OPERAND_P(X) \
   (((! current_function_uses_pic_offset_table                  \
-     && global_symbolic_reference_mentioned_p (X, 1))?         \
+     && symbolic_reference_mentioned_p (X))?                   \
       (current_function_uses_pic_offset_table = 1):0           \
-   ), 1)
+   ), (! SYMBOLIC_CONST (X)                                    \
+   || GET_CODE (X) == SYMBOL_REF || GET_CODE (X) == LABEL_REF))
+
+#define SYMBOLIC_CONST(X)      \
+(GET_CODE (X) == SYMBOL_REF                                            \
+ || GET_CODE (X) == LABEL_REF                                          \
+ || (GET_CODE (X) == CONST && symbolic_reference_mentioned_p (X)))
 
 /* Define this macro if references to a symbol must be treated
    differently depending on something about the variable or
@@ -1088,10 +1097,11 @@ while (0)
    all programs. */
 #define CASE_VECTOR_MODE SImode
 
-/* Define this 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
+/* 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 1
 
 /* Specify the tree operation to be used to convert reals to integers.  */
 #define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR
@@ -1106,6 +1116,12 @@ while (0)
    in one reasonably fast instruction.  */
 #define MOVE_MAX 4
 
+/* The number of scalar move insns which should be generated instead
+   of a string move insn or a library call.
+   
+   We have a smart movstrsi insn */
+#define MOVE_RATIO 0
+
 /* Define this if zero-extension is slow (more than one real instruction).  */
 /* #define SLOW_ZERO_EXTEND */
 
@@ -1225,16 +1241,14 @@ while (0)
 /* Describe the costs of the following register moves which are discouraged:
    1.) Moves between the Floating point registers and the frame pointer and stack pointer
    2.) Moves between the stack pointer and the frame pointer
-   3.) Moves between the floating point and general registers */
+   3.) Moves between the floating point and general registers
 
-#define REGISTER_MOVE_COST(CLASS1, CLASS2)   \
-  ((((CLASS1) == FLOAT_REGS && ((CLASS2) == STACK_POINTER_REG || (CLASS2) == FRAME_POINTER_REG))    \
-   || ((CLASS2) == FLOAT_REGS && ((CLASS1) == STACK_POINTER_REG || (CLASS1) == FRAME_POINTER_REG))  \
-   || ((CLASS1) == STACK_POINTER_REG && (CLASS2) == FRAME_POINTER_REG)                              \
-   || ((CLASS2) == STACK_POINTER_REG && (CLASS1) == FRAME_POINTER_REG)                              \
-   || ((CLASS1) == FLOAT_REGS && (CLASS2) == GENERAL_REGS)                                          \
-   || ((CLASS1) == GENERAL_REGS && (CLASS2) == FLOAT_REGS))                                         \
- ? 4  : 2)
+  These all involve two memory references. This is worse than a memory
+  to memory move (default cost 4)
+ */
+
+#define REGISTER_MOVE_COST(MODE, CLASS1, CLASS2) \
+  register_move_cost (CLASS1, CLASS2)
 
 #define OUTPUT_JUMP(NORMAL, NO_OV)  \
 { if (cc_status.flags & CC_NO_OVERFLOW)                                \
@@ -1245,11 +1259,11 @@ while (0)
 
 /* Output before read-only data.  */
 
-#define TEXT_SECTION_ASM_OP ".text"
+#define TEXT_SECTION_ASM_OP "\t.text"
 
 /* Output before writable data.  */
 
-#define DATA_SECTION_ASM_OP ".data"
+#define DATA_SECTION_ASM_OP "\t.data"
 
 /* Define the output Assembly Language */
 
@@ -1269,49 +1283,11 @@ while (0)
 
 /* Output of Data */
 
-/* This is how to output an assembler line defining a `double' constant.  */
-
-#define ASM_OUTPUT_DOUBLE(FILE,VALUE)  \
-  fprintf (FILE, "\t.double 0d%.20e\n", (VALUE))
-
-/* This is how to output an assembler line defining a `float' constant.  */
-
-#define ASM_OUTPUT_FLOAT(FILE,VALUE)  \
-  fprintf (FILE, "\t.float 0f%.20e\n", (VALUE))
-
-/* 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.word "),                  \
-  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))
-
 /* This is how to output an assembler line defining an external/static
    address which is not in tree format (for collect.c).  */
 
-#define ASM_OUTPUT_LABELREF_AS_INT(STREAM, NAME)                       \
-do {                                                                   \
-  fprintf (STREAM, "\t.long\t");                                       \
-  ASM_OUTPUT_LABELREF (STREAM, NAME);                                  \
-  fprintf (STREAM, "\n");                                              \
-} while (0)
+/* The prefix to add to user-visible assembler symbols. */
+#define USER_LABEL_PREFIX "_"
 
 /* This is how to output an insn to push a register on the stack.
    It need not be very fast code.  */
@@ -1325,19 +1301,6 @@ do {                                                                     \
 #define ASM_OUTPUT_REG_POP(FILE,REGNO)  \
   fprintf (FILE, "\tmovd tos,%s\n", reg_names[REGNO])
 
-/* How to refer to registers in assembler output.
-   This sequence is indexed by compiler's hard-register-number (see above).  */
-
-#define REGISTER_NAMES \
-{"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
- "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \
- "fp", "sp"}
-
-/* How to renumber registers for dbx and gdb.
-   NS32000 may need more change in the numeration.  */
-
-#define DBX_REGISTER_NUMBER(REGNO) ((REGNO < 8) ? (REGNO)+4 : (REGNO))
-
 /* 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.  */
 
@@ -1364,10 +1327,6 @@ do {                                                                     \
 } while (0)
 #endif
 
-/* The prefix to add to user-visible assembler symbols. */
-
-#define USER_LABEL_PREFIX "_"
-
 /* This is how to output an internal numbered label where
    PREFIX is the class of label and NUM is the number within the class.  */
 
@@ -1380,13 +1339,11 @@ do {                                                                    \
    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%ld", PREFIX, (long) NUM)
 
-/* This is how to align the code that follows an unconditional branch.
-   Note that 0xa2 is a no-op.  */
+/* This is how to align the code that follows an unconditional branch.  */
 
-#define ASM_OUTPUT_ALIGN_CODE(FILE)    \
-  fprintf (FILE, "\t.align 2,0xa2\n")
+#define LABEL_ALIGN_AFTER_BARRIER(LABEL) (2)
 
 /* This is how to output an element of a case-vector that is absolute.
    (The ns32k does not use such vectors,
@@ -1397,7 +1354,7 @@ do {                                                                      \
 
 /* This is how to output an element of a case-vector that is relative.  */
 /* ** Notice that the second element is LI format! */
-#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL)  \
+#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL)  \
   fprintf (FILE, "\t.long L%d-LI%d\n", VALUE, REL)
 
 /* This is how to output an assembler line
@@ -1434,21 +1391,6 @@ do {                                                                     \
 ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10),   \
   sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
 
-/* Define the parentheses used to group arithmetic operations
-   in assembler code.  */
-
-#define ASM_OPEN_PAREN "("
-#define ASM_CLOSE_PAREN ")"
-
-/* 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
-
 /* Print an instruction operand X on file FILE.
    CODE is the code from the %-spec that requested printing this operand;
    if `%z3' was used to print operand 3, then CODE is 'z'. */
@@ -1464,11 +1406,8 @@ do {                                                                     \
 
 #define PRINT_OPERAND_ADDRESS(FILE, ADDR) print_operand_address(FILE, ADDR)
 
-/* Define functions in ns32k.c and used in insn-output.c.  */
-
-extern char *output_move_double ();
-extern char *output_shift_insn ();
-extern char *output_move_dconst ();
+extern unsigned int ns32k_reg_class_contents[N_REG_CLASSES][1];
+extern enum reg_class regclass_map[FIRST_PSEUDO_REGISTER]; /* smallest class containing REGNO */
 
 /*
 Local variables: