ia64.c (ia64_promote_function_mode): Remove.
[platform/upstream/gcc.git] / gcc / config / iq2000 / iq2000.h
index 41abc9b..130acc9 100644 (file)
@@ -1,12 +1,13 @@
 /* Definitions of target machine for GNU compiler.  
    Vitesse IQ2000 processors
-   Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+   Free Software Foundation, Inc.
 
    This file is part of GCC.
 
    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 2, or (at your
+   by the Free Software Foundation; either version 3, or (at your
    option) any later version.
 
    GCC is distributed in the hope that it will be useful, but WITHOUT
    License for more details.
 
    You should have received a copy of the GNU General Public License
-   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.  */
+   along with GCC; see the file COPYING3.  If not see
+   <http://www.gnu.org/licenses/>.  */
 
 /* Driver configuration.  */
 
-#undef  SWITCH_TAKES_ARG
-#define SWITCH_TAKES_ARG(CHAR)                                         \
-  (DEFAULT_SWITCH_TAKES_ARG (CHAR) || (CHAR) == 'G')
-
-/* The svr4.h LIB_SPEC with -leval and --*group tacked on */
+/* A generic LIB_SPEC with -leval and --*group tacked on.  */
 #undef  LIB_SPEC
 #define LIB_SPEC "%{!shared:%{!symbolic:--start-group -lc -leval -lgcc --end-group}}"
 
 #undef STARTFILE_SPEC
 #undef ENDFILE_SPEC
 
+#undef  LINK_SPEC
+#define LINK_SPEC "%{h*} %{v:-V} \
+                  %{static:-Bstatic} %{shared:-shared} %{symbolic:-Bsymbolic}"
+
 \f
 /* Run-time target specifications.  */
 
     }                                           \
   while (0)
 
-extern int     target_flags;
-
-#define MASK_GPOPT         0x00000008   /* Optimize for global pointer.  */
-#define MASK_EMBEDDED_DATA 0x00008000   /* Reduce RAM usage, not fast code.  */
-#define MASK_UNINIT_CONST_IN_RODATA \
-                           0x00800000   /* Store uninitialized
-                                           consts in rodata.  */
-
 /* Macros used in the machine description to test the flags.  */
 
 #define TARGET_STATS           0
 
-/* For embedded systems, optimize for reduced RAM space instead of for
-   fastest code.  */
-#define TARGET_EMBEDDED_DATA   (target_flags & MASK_EMBEDDED_DATA)
-
-#define TARGET_DEBUG_MODE      (target_flags & 0)
-#define TARGET_DEBUG_A_MODE    (target_flags & 0)
-#define TARGET_DEBUG_B_MODE    (target_flags & 0)
-#define TARGET_DEBUG_C_MODE    (target_flags & 0)
-#define TARGET_DEBUG_D_MODE    (target_flags & 0)
-
-#define TARGET_SWITCHES                                                        \
-{                                                                      \
-  {"no-crt0",          0,                                               \
-     N_("No default crt0.o") },                                                \
-  {"gpopt",              MASK_GPOPT,                                   \
-     N_("Use GP relative sdata/sbss sections")},                       \
-  {"no-gpopt",          -MASK_GPOPT,                                   \
-     N_("Don't use GP relative sdata/sbss sections")},                 \
-  {"embedded-data",      MASK_EMBEDDED_DATA,                           \
-     N_("Use ROM instead of RAM")},                                    \
-  {"no-embedded-data",  -MASK_EMBEDDED_DATA,                           \
-     N_("Don't use ROM instead of RAM")},                              \
-  {"uninit-const-in-rodata", MASK_UNINIT_CONST_IN_RODATA,              \
-     N_("Put uninitialized constants in ROM (needs -membedded-data)")},        \
-  {"no-uninit-const-in-rodata", -MASK_UNINIT_CONST_IN_RODATA,          \
-     N_("Don't put uninitialized constants in ROM")},                  \
-  {"",                   (TARGET_DEFAULT                               \
-                          | TARGET_CPU_DEFAULT),                       \
-     NULL},                                                            \
-}
-
-/* Default target_flags if no switches are specified.  */
-
-#define TARGET_DEFAULT 0
-
-#ifndef TARGET_CPU_DEFAULT
-#define TARGET_CPU_DEFAULT 0
-#endif
+#define TARGET_DEBUG_MODE      0
+#define TARGET_DEBUG_A_MODE    0
+#define TARGET_DEBUG_B_MODE    0
+#define TARGET_DEBUG_C_MODE    0
+#define TARGET_DEBUG_D_MODE    0
 
 #ifndef IQ2000_ISA_DEFAULT
 #define IQ2000_ISA_DEFAULT 1
 #endif
-
-#define TARGET_OPTIONS                                                 \
-{                                                                      \
-  SUBTARGET_TARGET_OPTIONS                                             \
-  { "cpu=",    & iq2000_cpu_string,                                    \
-      N_("Specify CPU for scheduling purposes")},                      \
-  { "arch=",    & iq2000_arch_string,                                   \
-      N_("Specify CPU for code generation purposes")},                  \
-}
-
-/* This is meant to be redefined in the host dependent files.  */
-#define SUBTARGET_TARGET_OPTIONS
-
-#define IQ2000_VERSION "[1.0]"
-
-#ifndef MACHINE_TYPE
-#define MACHINE_TYPE "IQ2000"
-#endif
-
-#ifndef TARGET_VERSION_INTERNAL
-#define TARGET_VERSION_INTERNAL(STREAM)                                        \
-  fprintf (STREAM, " %s %s", IQ2000_VERSION, MACHINE_TYPE)
-#endif
-
-#ifndef TARGET_VERSION
-#define TARGET_VERSION TARGET_VERSION_INTERNAL (stderr)
-#endif
-
-#define OVERRIDE_OPTIONS override_options ()
-
-#define CAN_DEBUG_WITHOUT_FP
 \f
 /* Storage Layout.  */
 
 #define BITS_BIG_ENDIAN                0
 #define BYTES_BIG_ENDIAN               1 
 #define WORDS_BIG_ENDIAN               1
-#define LIBGCC2_WORDS_BIG_ENDIAN       1
 #define BITS_PER_WORD                  32
 #define MAX_BITS_PER_WORD              64
 #define UNITS_PER_WORD                         4
@@ -182,8 +109,6 @@ extern int  target_flags;
 
 #define PCC_BITFIELD_TYPE_MATTERS 1
 
-#define TARGET_FLOAT_FORMAT IEEE_FLOAT_FORMAT
-
 \f
 /* Layout of Source Language Data Types.  */
 
@@ -197,6 +122,18 @@ extern int target_flags;
 #define LONG_DOUBLE_TYPE_SIZE  64
 #define DEFAULT_SIGNED_CHAR    1
 
+#undef  SIZE_TYPE
+#define SIZE_TYPE "unsigned int"
+
+#undef  PTRDIFF_TYPE
+#define PTRDIFF_TYPE "int"
+
+#undef  WCHAR_TYPE
+#define WCHAR_TYPE "long int"
+
+#undef  WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE BITS_PER_WORD
+
 \f
 /* Register Basics.  */
 
@@ -278,12 +215,6 @@ enum reg_class
 
 #define INDEX_REG_CLASS NO_REGS
 
-#define REG_CLASS_FROM_LETTER(C) \
-  ((C) == 'd' ? GR_REGS :        \
-   (C) == 'b' ? ALL_REGS :       \
-   (C) == 'y' ? GR_REGS :        \
-   NO_REGS)
-
 #define REGNO_OK_FOR_INDEX_P(regno)    0
 
 #define PREFERRED_RELOAD_CLASS(X,CLASS)                                \
@@ -297,67 +228,15 @@ enum reg_class
         ? (GR_REGS)                                            \
         : (CLASS))))
 
-#define SMALL_REGISTER_CLASSES 0
-
-#define CLASS_MAX_NREGS(CLASS, MODE)    \
-  ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-
-/* For IQ2000:
-
-   `I' is used for the range of constants an arithmetic insn can
-       actually contain (16 bits signed integers).
-
-   `J' is used for the range which is just zero (i.e., $r0).
-
-   `K' is used for the range of constants a logical insn can actually
-       contain (16 bit zero-extended integers).
-
-   `L' is used for the range of constants that be loaded with lui
-       (i.e., the bottom 16 bits are zero).
-
-   `M' is used for the range of constants that take two words to load
-       (i.e., not matched by `I', `K', and `L').
-
-   `N' is used for constants 0xffffnnnn or 0xnnnnffff
-
-   `O' is a 5 bit zero-extended integer.  */
-
-#define CONST_OK_FOR_LETTER_P(VALUE, C)                                        \
-  ((C) == 'I' ? ((unsigned HOST_WIDE_INT) ((VALUE) + 0x8000) < 0x10000)        \
-   : (C) == 'J' ? ((VALUE) == 0)                                       \
-   : (C) == 'K' ? ((unsigned HOST_WIDE_INT) (VALUE) < 0x10000)         \
-   : (C) == 'L' ? (((VALUE) & 0x0000ffff) == 0                         \
-                  && (((VALUE) & ~2147483647) == 0                     \
-                      || ((VALUE) & ~2147483647) == ~2147483647))      \
-   : (C) == 'M' ? ((((VALUE) & ~0x0000ffff) != 0)                      \
-                  && (((VALUE) & ~0x0000ffff) != ~0x0000ffff)          \
-                  && (((VALUE) & 0x0000ffff) != 0                      \
-                      || (((VALUE) & ~2147483647) != 0                 \
-                          && ((VALUE) & ~2147483647) != ~2147483647))) \
-   : (C) == 'N' ? ((((VALUE) & 0xffff) == 0xffff)                      \
-                  || (((VALUE) & 0xffff0000) == 0xffff0000))           \
-   : (C) == 'O' ? ((unsigned HOST_WIDE_INT) ((VALUE) + 0x20) < 0x40)   \
-   : 0)
-
-#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C)                         \
-  ((C) == 'G'                                                          \
-   && (VALUE) == CONST0_RTX (GET_MODE (VALUE)))
-
-/* `R' is for memory references which take 1 word for the instruction.  */
-
-#define EXTRA_CONSTRAINT(OP,CODE)                                      \
-  (((CODE) == 'R')       ? simple_memory_operand (OP, GET_MODE (OP))   \
-   : FALSE)
-
 \f
 /* Basic Stack Layout.  */
 
 #define STACK_GROWS_DOWNWARD
 
-/* #define FRAME_GROWS_DOWNWARD */
+#define FRAME_GROWS_DOWNWARD 0
 
 #define STARTING_FRAME_OFFSET                                          \
-  (current_function_outgoing_args_size)
+  (crtl->outgoing_args_size)
 
 /* Use the default value zero.  */
 /* #define STACK_POINTER_OFFSET 0 */
@@ -395,8 +274,6 @@ enum reg_class
 \f
 /* Eliminating the Frame Pointer and the Arg Pointer.  */
 
-#define FRAME_POINTER_REQUIRED 0
-
 #define ELIMINABLE_REGS                                                        \
 {{ ARG_POINTER_REGNUM,   STACK_POINTER_REGNUM},                                \
  { ARG_POINTER_REGNUM,   HARD_FRAME_POINTER_REGNUM},                   \
@@ -406,17 +283,6 @@ enum reg_class
  { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM},                                \
  { FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}}
 
-
-/* We can always eliminate to the frame pointer.  We can eliminate to the 
-   stack pointer unless a frame pointer is needed.  */
-
-#define CAN_ELIMINATE(FROM, TO)                                                \
-  (((FROM) == RETURN_ADDRESS_POINTER_REGNUM && (! leaf_function_p ()   \
-   || (TO == GP_REG_FIRST + 31 && leaf_function_p)))                           \
-  || ((FROM) != RETURN_ADDRESS_POINTER_REGNUM                          \
-   && ((TO) == HARD_FRAME_POINTER_REGNUM                               \
-   || ((TO) == STACK_POINTER_REGNUM && ! frame_pointer_needed))))
-
 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET)                    \
         (OFFSET) = iq2000_initial_elimination_offset ((FROM), (TO))
 \f
@@ -428,19 +294,11 @@ enum reg_class
 
 #define REG_PARM_STACK_SPACE(FNDECL) 0
 
-#define OUTGOING_REG_PARM_STACK_SPACE
-
-#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0
+#define OUTGOING_REG_PARM_STACK_SPACE(FNTYPE) 1
 
 \f
 /* Function Arguments in Registers.  */
 
-#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
-  function_arg (& CUM, MODE, TYPE, NAMED)
-
-#define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
-  function_arg_partial_nregs (& CUM, MODE, TYPE, NAMED)
-
 #define MAX_ARGS_IN_REGISTERS 8
 
 typedef struct iq2000_args
@@ -453,7 +311,7 @@ typedef struct iq2000_args
   int fp_code;                 /* Mode of FP arguments.  */
   unsigned int num_adjusts;    /* Number of adjustments made.  */
                                /* Adjustments made to args pass in regs.  */
-  struct rtx_def * adjust[MAX_ARGS_IN_REGISTERS * 2];
+  rtx adjust[MAX_ARGS_IN_REGISTERS * 2];
 } CUMULATIVE_ARGS;
 
 /* Initialize a variable CUM of type CUMULATIVE_ARGS
@@ -462,9 +320,6 @@ typedef struct iq2000_args
 #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
   init_cumulative_args (& CUM, FNTYPE, LIBNAME)                                \
 
-#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED)                   \
-  function_arg_advance (& CUM, MODE, TYPE, NAMED)
-
 #define FUNCTION_ARG_PADDING(MODE, TYPE)                               \
   (! BYTES_BIG_ENDIAN                                                  \
    ? upward                                                            \
@@ -475,33 +330,13 @@ typedef struct iq2000_args
          && (GET_MODE_CLASS (MODE) == MODE_INT)))                      \
       ? downward : upward))
 
-#define FUNCTION_ARG_BOUNDARY(MODE, TYPE)                              \
-  (((TYPE) != 0)                                                       \
-       ? ((TYPE_ALIGN(TYPE) <= PARM_BOUNDARY)                          \
-               ? PARM_BOUNDARY                                         \
-               : TYPE_ALIGN(TYPE))                                     \
-       : ((GET_MODE_ALIGNMENT(MODE) <= PARM_BOUNDARY)                  \
-               ? PARM_BOUNDARY                                         \
-               : GET_MODE_ALIGNMENT(MODE)))
-
 #define FUNCTION_ARG_REGNO_P(N)                                                \
   (((N) >= GP_ARG_FIRST && (N) <= GP_ARG_LAST))                        
 
 \f
-/* How Scalar Function Values are Returned.  */
-
-#define FUNCTION_VALUE(VALTYPE, FUNC)  iq2000_function_value (VALTYPE, FUNC)
-
-#define LIBCALL_VALUE(MODE)                            \
-  gen_rtx_REG (((GET_MODE_CLASS (MODE) != MODE_INT     \
-                || GET_MODE_SIZE (MODE) >= 4)          \
-               ? (MODE)                                \
-               : SImode),                              \
-              GP_RETURN)
-
 /* On the IQ2000, R2 and R3 are the only register thus used.  */
 
-#define FUNCTION_VALUE_REGNO_P(N) ((N) == GP_RETURN)
+#define FUNCTION_VALUE_REGNO_P(N) iq2000_function_value_regno_p (N)
 
 \f
 /* How Large Values are Returned.  */
@@ -533,51 +368,11 @@ typedef struct iq2000_args
 }
 
 \f
-/* Implementing the Varargs Macros.  */
-
-#define EXPAND_BUILTIN_VA_START(valist, nextarg) \
-  iq2000_va_start (valist, nextarg)
-
-\f
 /* Trampolines for Nested Functions.  */
 
-/* A C statement to output, on the stream FILE, assembler code for a
-   block of data that contains the constant parts of a trampoline.
-   This code should not include a label--the label is taken care of
-   automatically.  */
-
-#define TRAMPOLINE_TEMPLATE(STREAM)                                     \
-{                                                                       \
-  fprintf (STREAM, "\t.word\t0x03e00821\t\t# move   $1,$31\n");                \
-  fprintf (STREAM, "\t.word\t0x04110001\t\t# bgezal $0,.+8\n");                \
-  fprintf (STREAM, "\t.word\t0x00000000\t\t# nop\n");                  \
-  if (Pmode == DImode)                                                 \
-    {                                                                  \
-      fprintf (STREAM, "\t.word\t0xdfe30014\t\t# ld     $3,20($31)\n");        \
-      fprintf (STREAM, "\t.word\t0xdfe2001c\t\t# ld     $2,28($31)\n");        \
-    }                                                                  \
-  else                                                                 \
-    {                                                                  \
-      fprintf (STREAM, "\t.word\t0x8fe30014\t\t# lw     $3,20($31)\n");        \
-      fprintf (STREAM, "\t.word\t0x8fe20018\t\t# lw     $2,24($31)\n");        \
-    }                                                                  \
-  fprintf (STREAM, "\t.word\t0x0060c821\t\t# move   $25,$3 (abicalls)\n"); \
-  fprintf (STREAM, "\t.word\t0x00600008\t\t# jr     $3\n");            \
-  fprintf (STREAM, "\t.word\t0x0020f821\t\t# move   $31,$1\n");                \
-  fprintf (STREAM, "\t.word\t0x00000000\t\t# <function address>\n"); \
-  fprintf (STREAM, "\t.word\t0x00000000\t\t# <static chain value>\n"); \
-}
-
-#define TRAMPOLINE_SIZE (40)
-
-#define TRAMPOLINE_ALIGNMENT 32
-
-#define INITIALIZE_TRAMPOLINE(ADDR, FUNC, CHAIN)                           \
-{                                                                          \
-  rtx addr = ADDR;                                                         \
-    emit_move_insn (gen_rtx_MEM (SImode, plus_constant (addr, 32)), FUNC); \
-    emit_move_insn (gen_rtx_MEM (SImode, plus_constant (addr, 36)), CHAIN);\
-}
+#define TRAMPOLINE_CODE_SIZE  (8*4)
+#define TRAMPOLINE_SIZE       (TRAMPOLINE_CODE_SIZE + 2*GET_MODE_SIZE (Pmode))
+#define TRAMPOLINE_ALIGNMENT  GET_MODE_ALIGNMENT (Pmode)
 
 \f
 /* Addressing Modes.  */
@@ -589,92 +384,8 @@ typedef struct iq2000_args
 
 #define MAX_REGS_PER_ADDRESS 1
 
-#ifdef REG_OK_STRICT
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)                \
-  {                                                    \
-    if (iq2000_legitimate_address_p (MODE, X, 1))      \
-      goto ADDR;                                       \
-  }
-#else
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)                \
-  {                                                    \
-    if (iq2000_legitimate_address_p (MODE, X, 0))      \
-      goto ADDR;                                       \
-  }
-#endif
-
 #define REG_OK_FOR_INDEX_P(X) 0
 
-
-/* For the IQ2000, transform:
-
-       memory(X + <large int>)
-   into:
-       Y = <large int> & ~0x7fff;
-       Z = X + Y
-       memory (Z + (<large int> & 0x7fff));
-*/
-
-#define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN)                            \
-{                                                                      \
-  rtx xinsn = (X);                                                     \
-                                                                       \
-  if (TARGET_DEBUG_B_MODE)                                             \
-    {                                                                  \
-      GO_PRINTF ("\n========== LEGITIMIZE_ADDRESS\n");                 \
-      GO_DEBUG_RTX (xinsn);                                            \
-    }                                                                  \
-                                                                       \
-  if (iq2000_check_split (X, MODE))            \
-    {                                                                  \
-      X = gen_rtx_LO_SUM (Pmode,                                       \
-                         copy_to_mode_reg (Pmode,                      \
-                                           gen_rtx_HIGH (Pmode, X)),   \
-                         X);                                           \
-      goto WIN;                                                                \
-    }                                                                  \
-                                                                       \
-  if (GET_CODE (xinsn) == PLUS)                                                \
-    {                                                                  \
-      rtx xplus0 = XEXP (xinsn, 0);                                    \
-      rtx xplus1 = XEXP (xinsn, 1);                                    \
-      enum rtx_code code0 = GET_CODE (xplus0);                         \
-      enum rtx_code code1 = GET_CODE (xplus1);                         \
-                                                                       \
-      if (code0 != REG && code1 == REG)                                        \
-       {                                                               \
-         xplus0 = XEXP (xinsn, 1);                                     \
-         xplus1 = XEXP (xinsn, 0);                                     \
-         code0 = GET_CODE (xplus0);                                    \
-         code1 = GET_CODE (xplus1);                                    \
-       }                                                               \
-                                                                       \
-      if (code0 == REG && REG_MODE_OK_FOR_BASE_P (xplus0, MODE)                \
-         && code1 == CONST_INT && !SMALL_INT (xplus1))                 \
-       {                                                               \
-         rtx int_reg = gen_reg_rtx (Pmode);                            \
-         rtx ptr_reg = gen_reg_rtx (Pmode);                            \
-                                                                       \
-         emit_move_insn (int_reg,                                      \
-                         GEN_INT (INTVAL (xplus1) & ~ 0x7fff));        \
-                                                                       \
-         emit_insn (gen_rtx_SET (VOIDmode,                             \
-                                 ptr_reg,                              \
-                                 gen_rtx_PLUS (Pmode, xplus0, int_reg))); \
-                                                                       \
-         X = plus_constant (ptr_reg, INTVAL (xplus1) & 0x7fff);        \
-         goto WIN;                                                     \
-       }                                                               \
-    }                                                                  \
-                                                                       \
-  if (TARGET_DEBUG_B_MODE)                                             \
-    GO_PRINTF ("LEGITIMIZE_ADDRESS could not fix.\n");                 \
-}
-
-#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) {}
-
-#define LEGITIMATE_CONSTANT_P(X) (1)
-
 \f
 /* Describing Relative Costs of Operations.  */
 
@@ -683,7 +394,7 @@ typedef struct iq2000_args
 #define MEMORY_MOVE_COST(MODE,CLASS,TO_P)      \
   (TO_P ? 2 : 16)
 
-#define BRANCH_COST 2
+#define BRANCH_COST(speed_p, predictable_p) 2
 
 #define SLOW_BYTE_ACCESS 1
 
@@ -727,7 +438,7 @@ typedef struct iq2000_args
  "%8",   "%9",   "%10",  "%11",  "%12",  "%13",  "%14",  "%15",                \
  "%16",  "%17",  "%18",  "%19",  "%20",  "%21",  "%22",  "%23",                \
  "%24",  "%25",  "%26",  "%27",  "%28",  "%29",  "%30",  "%31",  "%rap"        \
-};
+}
 
 #define ADDITIONAL_REGISTER_NAMES                                      \
 {                                                                      \
@@ -772,13 +483,6 @@ typedef struct iq2000_args
 #define FINAL_PRESCAN_INSN(INSN, OPVEC, NOPERANDS)                     \
   final_prescan_insn (INSN, OPVEC, NOPERANDS)
 
-/* See iq2000.c for the IQ2000 specific codes.  */
-#define PRINT_OPERAND(FILE, X, CODE) print_operand (FILE, X, CODE)
-
-#define PRINT_OPERAND_PUNCT_VALID_P(CODE) iq2000_print_operand_punct[CODE]
-
-#define PRINT_OPERAND_ADDRESS(FILE, ADDR) print_operand_address (FILE, ADDR)
-
 #define DBR_OUTPUT_SEQEND(STREAM)                                      \
 do                                                                     \
   {                                                                    \
@@ -813,7 +517,8 @@ while (0)
 
 #undef ASM_OUTPUT_SKIP
 #define ASM_OUTPUT_SKIP(STREAM,SIZE)                                   \
-  fprintf (STREAM, "\t.space\t%u\n", (SIZE))
+  fprintf (STREAM, "\t.space\t" HOST_WIDE_INT_PRINT_UNSIGNED "\n",     \
+           (unsigned HOST_WIDE_INT)(SIZE))
 
 #define ASM_OUTPUT_ALIGN(STREAM,LOG)                                   \
   if ((LOG) != 0)                                                      \
@@ -835,23 +540,6 @@ while (0)
 \f
 /* Miscellaneous Parameters.  */
 
-#define PREDICATE_CODES                                                        \
-  {"uns_arith_operand",                { REG, CONST_INT, SUBREG }},            \
-  {"arith_operand",            { REG, CONST_INT, SUBREG }},            \
-  {"small_int",                        { CONST_INT }},                         \
-  {"large_int",                        { CONST_INT }},                         \
-  {"reg_or_0_operand",         { REG, CONST_INT, CONST_DOUBLE, SUBREG }}, \
-  {"simple_memory_operand",    { MEM, SUBREG }},                       \
-  {"equality_op",              { EQ, NE }},                            \
-  {"cmp_op",                   { EQ, NE, GT, GE, GTU, GEU, LT, LE,     \
-                                 LTU, LEU }},                          \
-  {"pc_or_label_operand",      { PC, LABEL_REF }},                     \
-  {"call_insn_operand",                { CONST_INT, CONST, SYMBOL_REF, REG}},  \
-  {"move_operand",             { CONST_INT, CONST_DOUBLE, CONST,       \
-                                 SYMBOL_REF, LABEL_REF, SUBREG,        \
-                                 REG, MEM}},                           \
-  {"power_of_2_operand",       { CONST_INT }},
-
 #define CASE_VECTOR_MODE SImode
 
 #define WORD_REGISTER_OPERATIONS
@@ -896,23 +584,9 @@ enum delay_type
   DELAY_FCMP                           /* Delay after doing c.<xx>.{d,s}.  */
 };
 
-/* Which processor to schedule for.  */
-
-enum processor_type
-{
-  PROCESSOR_DEFAULT,
-  PROCESSOR_IQ2000,
-  PROCESSOR_IQ10
-};
-
 /* Recast the cpu class to be the cpu attribute.  */
 #define iq2000_cpu_attr ((enum attr_cpu) iq2000_tune)
 
-/* Functions to change what output section we are using.  */
-extern void            rdata_section (void);
-extern void            sdata_section (void);
-extern void            sbss_section  (void);
-
 #define BITMASK_UPPER16        ((unsigned long) 0xffff << 16)  /* 0xffff0000 */
 #define BITMASK_LOWER16        ((unsigned long) 0xffff)        /* 0x0000ffff */
 
@@ -929,17 +603,13 @@ extern void               sbss_section  (void);
 
 \f
 #undef ASM_SPEC
-#define ASM_SPEC "%{march=iq2000: -m2000} %{march=iq10: -m10} %{!march=*: -m2000}"
 
 \f
-/* The mapping from gcc register number to DWARF 2 CFA column number.
-   This mapping does not allow for tracking register 0, since
-   register 0 is fixed.  */
-#define DWARF_FRAME_REGNUM(REG)                                \
-  (REG == GP_REG_FIRST + 31 ? DWARF_FRAME_RETURN_COLUMN : REG)
+/* The mapping from gcc register number to DWARF 2 CFA column number.  */
+#define DWARF_FRAME_REGNUM(REG)        (REG)
 
 /* The DWARF 2 CFA column which tracks the return address.  */
-#define DWARF_FRAME_RETURN_COLUMN ( GP_REG_FIRST + 26)
+#define DWARF_FRAME_RETURN_COLUMN (GP_REG_FIRST + 31)
 
 /* Describe how we implement __builtin_eh_return.  */
 #define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + GP_ARG_FIRST : INVALID_REGNUM)
@@ -1056,9 +726,9 @@ extern void                sbss_section  (void);
 /* Tell prologue and epilogue if register REGNO should be saved / restored.  */
 
 #define MUST_SAVE_REGISTER(regno) \
((regs_ever_live[regno] && !call_used_regs[regno])                    \
 ((df_regs_ever_live_p (regno) && !call_used_regs[regno])             \
   || (regno == HARD_FRAME_POINTER_REGNUM && frame_pointer_needed)      \
-  || (regno == (GP_REG_FIRST + 31) && regs_ever_live[GP_REG_FIRST + 31]))
+   || (regno == (GP_REG_FIRST + 31) && df_regs_ever_live_p (GP_REG_FIRST + 31)))
 
 /* ALIGN FRAMES on double word boundaries */
 #ifndef IQ2000_STACK_ALIGN
@@ -1082,7 +752,7 @@ extern void                sbss_section  (void);
   (((regno) >= FIRST_PSEUDO_REGISTER) || (BASE_REG_P ((regno), (mode))))
 
 #define REGNO_MODE_OK_FOR_BASE_P(regno, mode) \
-  GP_REG_OR_PSEUDO_STRICT_P ((regno), (mode))
+  GP_REG_OR_PSEUDO_STRICT_P ((int) (regno), (mode))
 
 /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
    and check its validity for a certain class.
@@ -1122,13 +792,6 @@ extern void               sbss_section  (void);
   ((LENGTH) = iq2000_adjust_insn_length ((INSN), (LENGTH)))
 
 \f
-/* A list of predicates that do special things with modes, and so
-   should not elicit warnings for VOIDmode match_operand.  */
-
-#define SPECIAL_MODE_PREDICATES \
-  "pc_or_label_operand",
-
-\f
 
 
 /* How to tell the debugger about changes of source files.  */
@@ -1153,33 +816,9 @@ extern void               sbss_section  (void);
 #define SDATA_SECTION_ASM_OP   "\t.sdata"      /* Small data.  */
 
 \f
-/* See iq2000_expand_prologue's use of loadgp for when this should be
-   true.  */
-
-#define DONT_ACCESS_GBLS_AFTER_EPILOGUE 0
-\f
-/* List of all IQ2000 punctuation characters used by print_operand.  */
-extern char iq2000_print_operand_punct[256];
-
-/* The target cpu for optimization and scheduling.  */
-extern enum processor_type iq2000_tune;
-
 /* Which instruction set architecture to use.  */
 extern int iq2000_isa;
 
-/* Cached operands, and operator to compare for use in set/branch/trap
-   on condition codes.  */
-extern rtx branch_cmp[2];
-
-/* What type of branch to use.  */
-extern enum cmp_type branch_type;
-
-/* Strings to hold which cpu and instruction set architecture to use.  */
-extern const char * iq2000_cpu_string;   /* For -mcpu=<xxx>.  */
-extern const char * iq2000_arch_string;   /* For -march=<xxx>.  */
-
-
-
 enum iq2000_builtins
 {
   IQ2000_BUILTIN_ADO16,