OSDN Git Service

* config/stormy16/stormy16.h (LINK_SPEC, WCHAR_TYPE): Define.
[pf3gnuchains/gcc-fork.git] / gcc / config / stormy16 / stormy16.h
index fa97e8b..f255ac9 100644 (file)
@@ -1,71 +1,64 @@
 /* Xstormy16 cpu description.
    Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2007,
-   2008, 2009  Free Software Foundation, Inc.
+   2008, 2009, 2010  Free Software Foundation, Inc.
    Contributed by Red Hat, Inc.
 
-This file is part of GCC.
+   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 3, or (at your option)
-any later version.
+   GCC is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
 
-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.
+   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 GCC; see the file COPYING3.  If not see
-<http://www.gnu.org/licenses/>.  */
+   You should have received a copy of the GNU General Public License
+   along with GCC; see the file COPYING3.  If not see
+   <http://www.gnu.org/licenses/>.  */
 
 \f
-/* Driver configuration */
+/* Driver configuration */
 
-/* Defined in svr4.h.  */
-#undef ASM_SPEC
+#undef  ASM_SPEC
 #define ASM_SPEC ""
 
+#undef  LINK_SPEC
+#define LINK_SPEC "%{h*} %{v:-V} \
+                  %{static:-Bstatic} %{shared:-shared} %{symbolic:-Bsymbolic}"
+
 /* For xstormy16:
    - If -msim is specified, everything is built and linked as for the sim.
    - If -T is specified, that linker script is used, and it should provide
      appropriate libraries.
    - If neither is specified, everything is built as for the sim, but no
-     I/O support is assumed.
-
-*/
-#undef LIB_SPEC
+     I/O support is assumed.  */
+#undef  LIB_SPEC
 #define LIB_SPEC "-( -lc %{msim:-lsim}%{!msim:%{!T*:-lnosys}} -)"
 
-/* Defined in svr4.h.  */
-#undef STARTFILE_SPEC
+#undef  STARTFILE_SPEC
 #define STARTFILE_SPEC "crt0.o%s crti.o%s crtbegin.o%s"
 
-/* Defined in svr4.h.  */
-#undef ENDFILE_SPEC
+#undef  ENDFILE_SPEC
 #define ENDFILE_SPEC "crtend.o%s crtn.o%s"
 
-/* Defined in svr4.h for host compilers.  */
-/* #define MD_EXEC_PREFIX "" */
-
-/* Defined in svr4.h for host compilers.  */
-/* #define MD_STARTFILE_PREFIX "" */
-
 \f
-/* Run-time target specifications */
+/* Run-time target specifications */
 
-#define TARGET_CPU_CPP_BUILTINS() do { \
-  builtin_define_std ("xstormy16");    \
-  builtin_assert ("machine=xstormy16");        \
-  builtin_assert ("cpu=xstormy16");     \
-} while (0)
+#define TARGET_CPU_CPP_BUILTINS()              \
+  do                                           \
+    {                                          \
+      builtin_define_std ("xstormy16");                \
+      builtin_assert ("machine=xstormy16");    \
+      builtin_assert ("cpu=xstormy16");                \
+    }                                          \
+  while (0)
 
 #define TARGET_VERSION fprintf (stderr, " (xstormy16 cpu core)");
-
-#define CAN_DEBUG_WITHOUT_FP
-
 \f
-/* Storage Layout */
+/* Storage Layout */
 
 #define BITS_BIG_ENDIAN 1
 
@@ -75,12 +68,14 @@ along with GCC; see the file COPYING3.  If not see
 
 #define UNITS_PER_WORD 2
 
-#define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE)                              \
-do {                                                                   \
-  if (GET_MODE_CLASS (MODE) == MODE_INT                                        \
-      && GET_MODE_SIZE (MODE) < 2)                                     \
-    (MODE) = HImode;                                                   \
-} while (0)
+#define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE)      \
+  do                                           \
+    {                                          \
+      if (GET_MODE_CLASS (MODE) == MODE_INT    \
+         && GET_MODE_SIZE (MODE) < 2)          \
+       (MODE) = HImode;                        \
+    }                                          \
+  while (0)
 
 #define PARM_BOUNDARY 16
 
@@ -90,9 +85,6 @@ do {                                                                  \
 
 #define BIGGEST_ALIGNMENT 16
 
-/* Defined in svr4.h.  */
-/* #define MAX_OFILE_ALIGNMENT */
-
 #define DATA_ALIGNMENT(TYPE, ALIGN)            \
   (TREE_CODE (TYPE) == ARRAY_TYPE              \
    && TYPE_MODE (TREE_TYPE (TYPE)) == QImode   \
@@ -104,10 +96,9 @@ do {                                                                        \
 
 #define STRICT_ALIGNMENT 1
 
-/* Defined in svr4.h.  */
 #define PCC_BITFIELD_TYPE_MATTERS 1
 \f
-/* Layout of Source Language Data Types */
+/* Layout of Source Language Data Types */
 
 #define INT_TYPE_SIZE 16
 
@@ -125,27 +116,18 @@ do {                                                                      \
 
 #define DEFAULT_SIGNED_CHAR 0
 
-/* Defined in svr4.h.  */
 #define SIZE_TYPE "unsigned int"
 
-/* Defined in svr4.h.  */
 #define PTRDIFF_TYPE "int"
 
-/* Defined in svr4.h, to "long int".  */
-/* #define WCHAR_TYPE "long int" */
+#undef  WCHAR_TYPE
+#define WCHAR_TYPE "long int"
 
-/* Defined in svr4.h.  */
-#undef WCHAR_TYPE_SIZE
+#undef  WCHAR_TYPE_SIZE
 #define WCHAR_TYPE_SIZE 32
 
-/* Define this macro if the type of Objective-C selectors should be `int'.
-
-   If this macro is not defined, then selectors should have the type `struct
-   objc_selector *'.  */
-/* #define OBJC_INT_SELECTORS */
-
 \f
-/* Register Basics */
+/* Register Basics */
 
 #define FIRST_PSEUDO_REGISTER 19
 
@@ -156,12 +138,12 @@ do {                                                                      \
   { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1 }
 
 \f
-/* Order of allocation of registers */
+/* Order of allocation of registers */
 
 #define REG_ALLOC_ORDER { 7, 6, 5, 4, 3, 2, 1, 0, 9, 8, 10, 11, 12, 13, 14, 15, 16 }
 
 \f
-/* How Values Fit in Registers */
+/* How Values Fit in Registers */
 
 #define HARD_REGNO_NREGS(REGNO, MODE)                          \
   ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
@@ -178,7 +160,7 @@ do {                                                                        \
 #define MODES_TIEABLE_P(MODE1, MODE2) ((MODE1) != BImode && (MODE2) != BImode)
 
 \f
-/* Register Classes */
+/* Register Classes */
 
 enum reg_class
 {
@@ -199,7 +181,7 @@ enum reg_class
 
 #define IRA_COVER_CLASSES                      \
 {                                              \
-  GENERAL_REGS, LIM_REG_CLASSES        \
+  GENERAL_REGS, LIM_REG_CLASSES                        \
 }
 
 #define REG_CLASS_NAMES                                \
@@ -251,7 +233,7 @@ enum reg_class
        'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P'
        'Q', 'R', 'S', 'T', 'U'
        'V', 'X'
-       'g', 'i', 'm', 'n', 'o', 'p', 'r', 's' */
+       'g', 'i', 'm', 'n', 'o', 'p', 'r', 's' */
 
 #define REG_CLASS_FROM_LETTER(CHAR)            \
  (  (CHAR) == 'a' ? R0_REGS                    \
@@ -267,7 +249,6 @@ enum reg_class
 
 #define REGNO_OK_FOR_INDEX_P(NUM) REGNO_OK_FOR_BASE_P (NUM)
 
-/* This declaration must be present.  */
 #define PREFERRED_RELOAD_CLASS(X, CLASS) \
   xstormy16_preferred_reload_class (X, CLASS)
 
@@ -279,40 +260,9 @@ enum reg_class
 #define SECONDARY_RELOAD_CLASS(CLASS, MODE, X)                 \
   xstormy16_secondary_reload_class (CLASS, MODE, X)
 
-/* Normally the compiler avoids choosing registers that have been explicitly
-   mentioned in the rtl as spill registers (these registers are normally those
-   used to pass parameters and return values).  However, some machines have so
-   few registers of certain classes that there would not be enough registers to
-   use as spill registers if this were done.
-
-   Define `SMALL_REGISTER_CLASSES' to be an expression with a nonzero value on
-   these machines.  When this macro has a nonzero value, the compiler allows
-   registers explicitly used in the rtl to be used as spill registers but
-   avoids extending the lifetime of these registers.
-
-   It is always safe to define this macro with a nonzero value, but if you
-   unnecessarily define it, you will reduce the amount of optimizations that
-   can be performed in some cases.  If you do not define this macro with a
-   nonzero value when it is required, the compiler will run out of spill
-   registers and print a fatal error message.  For most machines, you should
-   not define this macro at all.  */
-/* #define SMALL_REGISTER_CLASSES */
-
-/* This declaration is required.  */
 #define CLASS_MAX_NREGS(CLASS, MODE) \
   ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
 
-/* If defined, a C expression for a class that contains registers which the
-   compiler must always access in a mode that is the same size as the mode in
-   which it loaded the register.
-
-   For the example, loading 32-bit integer or floating-point objects into
-   floating-point registers on the Alpha extends them to 64-bits.  Therefore
-   loading a 64-bit object and then storing it as a 32-bit object does not
-   store the low-order 32-bits, as would be the case for a normal register.
-   Therefore, `alpha.h' defines this macro as `FLOAT_REGS'.  */
-/* #define CLASS_CANNOT_CHANGE_SIZE */
-
 #define CONST_OK_FOR_LETTER_P(VALUE, C)                        \
   (  (C) == 'I' ? (VALUE) >= 0 && (VALUE) <= 3         \
    : (C) == 'J' ? exact_log2 (VALUE) != -1             \
@@ -330,7 +280,7 @@ enum reg_class
   xstormy16_extra_constraint_p (VALUE, C)
 
 \f
-/* Basic Stack Layout */
+/* Basic Stack Layout */
 
 /* We want to use post-increment instructions to push things on the stack,
    because we don't have any pre-increment ones.  */
@@ -365,7 +315,7 @@ enum reg_class
 #define ARG_POINTER_REGNUM     18
 
 \f
-/* Eliminating the Frame Pointer and the Arg Pointer */
+/* Eliminating the Frame Pointer and the Arg Pointer */
 
 #define ELIMINABLE_REGS                                        \
 {                                                      \
@@ -379,16 +329,14 @@ enum reg_class
   (OFFSET) = xstormy16_initial_elimination_offset (FROM, TO)
 
 \f
-/* Passing Function Arguments on the Stack */
+/* Passing Function Arguments on the Stack */
 
 #define PUSH_ROUNDING(BYTES) (((BYTES) + 1) & ~1)
 
-#define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACK_SIZE) 0
-
 \f
-/* Function Arguments in Registers */
+/* Function Arguments in Registers */
 
-#define NUM_ARGUMENT_REGISTERS 6
+#define NUM_ARGUMENT_REGISTERS  6
 #define FIRST_ARGUMENT_REGISTER 2
 
 #define XSTORMY16_WORD_SIZE(TYPE, MODE)                                \
@@ -396,9 +344,6 @@ enum reg_class
     + 1)                                                       \
    / 2)
 
-#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
-       xstormy16_function_arg (CUM, MODE, TYPE, NAMED)
-
 /* For this platform, the value of CUMULATIVE_ARGS is the number of words
    of arguments that have been passed in registers so far.  */
 #define CUMULATIVE_ARGS int
@@ -406,15 +351,12 @@ enum reg_class
 #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
   (CUM) = 0
 
-#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED)                   \
-  ((CUM) = xstormy16_function_arg_advance (CUM, MODE, TYPE, NAMED))
-
 #define FUNCTION_ARG_REGNO_P(REGNO)                                    \
   ((REGNO) >= FIRST_ARGUMENT_REGISTER                                  \
    && (REGNO) < FIRST_ARGUMENT_REGISTER + NUM_ARGUMENT_REGISTERS)
 
 \f
-/* How Scalar Function Values are Returned */
+/* How Scalar Function Values are Returned */
 
 /* The number of the hard register that is used to return a scalar value from a
    function call.  */
@@ -428,7 +370,7 @@ enum reg_class
 #define FUNCTION_VALUE_REGNO_P(REGNO) ((REGNO) == RETURN_VALUE_REGNUM)
 
 \f
-/* Function Entry and Exit */
+/* Function Entry and Exit */
 
 #define EPILOGUE_USES(REGNO) \
   xstormy16_epilogue_uses (REGNO)
@@ -442,81 +384,13 @@ enum reg_class
 #define FUNCTION_PROFILER(FILE, LABELNO) xstormy16_function_profiler ()
 
 \f
-/* If the target has particular reasons why a function cannot be inlined,
-   it may define the TARGET_CANNOT_INLINE_P.  This macro takes one argument,
-   the DECL describing the function.  The function should NULL if the function
-   *can* be inlined.  Otherwise it should return a pointer to a string containing
-   a message describing why the function could not be inlined.  The message will
-   displayed if the '-Winline' command line switch has been given.  If the message
-   contains a '%s' sequence, this will be replaced by the name of the function.  */
-/* #define TARGET_CANNOT_INLINE_P(FN_DECL) xstormy16_cannot_inline_p (FN_DECL) */
-\f
 /* Trampolines for Nested Functions.  */
 
 #define TRAMPOLINE_SIZE 8
 #define TRAMPOLINE_ALIGNMENT 16
 \f
-/* Define this macro to override the type used by the library routines to pick
-   up arguments of type `float'.  (By default, they use a union of `float' and
-   `int'.)
-
-   The obvious choice would be `float'--but that won't work with traditional C
-   compilers that expect all arguments declared as `float' to arrive as
-   `double'.  To avoid this conversion, the library routines ask for the value
-   as some other type and then treat it as a `float'.  */
-/* #define FLOAT_ARG_TYPE */
-
-/* Define this macro to override the way library routines redesignate a `float'
-   argument as a `float' instead of the type it was passed as.  The default is
-   an expression which takes the `float' field of the union.  */
-/* #define FLOATIFY(PASSED_VALUE) */
-
-/* Define this macro to override the type used by the library routines to
-   return values that ought to have type `float'.  (By default, they use
-   `int'.)
-
-   The obvious choice would be `float'--but that won't work with traditional C
-   compilers gratuitously convert values declared as `float' into `double'.  */
-/* #define FLOAT_VALUE_TYPE */
-
-/* Define this macro to override the way the value of a `float'-returning
-   library routine should be packaged in order to return it.  These functions
-   are actually declared to return type `FLOAT_VALUE_TYPE' (normally `int').
 
-   These values can't be returned as type `float' because traditional C
-   compilers would gratuitously convert the value to a `double'.
-
-   A local variable named `intify' is always available when the macro `INTIFY'
-   is used.  It is a union of a `float' field named `f' and a field named `i'
-   whose type is `FLOAT_VALUE_TYPE' or `int'.
-
-   If you don't define this macro, the default definition works by copying the
-   value through that union.  */
-/* #define INTIFY(FLOAT_VALUE) */
-
-/* Define this macro as the name of the data type corresponding to `SImode' in
-   the system's own C compiler.
-
-   You need not define this macro if that type is `long int', as it usually is.  */
-/* #define nongcc_SI_type */
-
-/* Define this macro as the name of the data type corresponding to the
-   word_mode in the system's own C compiler.
-
-   You need not define this macro if that type is `long int', as it usually is.  */
-/* #define nongcc_word_type */
-
-/* Define these macros to supply explicit C statements to carry out various
-   arithmetic operations on types `float' and `double' in the library routines
-   in `libgcc1.c'.  See that file for a full list of these macros and their
-   arguments.
-
-   On most machines, you don't need to define any of these macros, because the
-   C compiler that comes with the system takes care of doing them.  */
-/* #define perform_...  */
-
-\f
-/* Addressing Modes */
+/* Addressing Modes.  */
 
 #define HAVE_POST_INCREMENT 1
 
@@ -536,16 +410,15 @@ enum reg_class
 /* On this chip, this is true if the address is valid with an offset
    of 0 but not of 6, because in that case it cannot be used as an
    address for DImode or DFmode, or if the address is a post-increment
-   or pre-decrement address.
-*/
+   or pre-decrement address.  */
 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL)                       \
-  if (xstormy16_mode_dependent_address_p (ADDR))                               \
+  if (xstormy16_mode_dependent_address_p (ADDR))                       \
     goto LABEL
 
 #define LEGITIMATE_CONSTANT_P(X) 1
 
 \f
-/* Describing Relative Costs of Operations */
+/* Describing Relative Costs of Operations */
 
 #define REGISTER_MOVE_COST(MODE, FROM, TO) 2
 
@@ -602,64 +475,31 @@ enum reg_class
 /* Output and Generation of Labels.  */
 #define SYMBOL_FLAG_XSTORMY16_BELOW100 (SYMBOL_FLAG_MACH_DEP << 0)
 
-#define ASM_OUTPUT_SYMBOL_REF(STREAM, SYMBOL)                          \
-  do {                                                                 \
-    const char *rn = XSTR (SYMBOL, 0);                                 \
-    if (SYMBOL_REF_FUNCTION_P (SYMBOL))                                        \
-      ASM_OUTPUT_LABEL_REF ((STREAM), rn);                             \
-    else                                                               \
-      assemble_name (STREAM, rn);                                      \
-  } while (0)
+#define ASM_OUTPUT_SYMBOL_REF(STREAM, SYMBOL)  \
+  do                                           \
+    {                                          \
+      const char *rn = XSTR (SYMBOL, 0);       \
+                                               \
+      if (SYMBOL_REF_FUNCTION_P (SYMBOL))      \
+       ASM_OUTPUT_LABEL_REF ((STREAM), rn);    \
+      else                                     \
+       assemble_name (STREAM, rn);             \
+    }                                          \
+  while (0)
 
 #define ASM_OUTPUT_LABEL_REF(STREAM, NAME)     \
-do  {                                          \
-  fputs ("@fptr(", STREAM);                    \
-  assemble_name (STREAM, NAME);                        \
-  fputc (')', STREAM);                         \
-} while (0)
+  do                                           \
+    {                                          \
+      fputs ("@fptr(", STREAM);                        \
+      assemble_name (STREAM, NAME);            \
+      fputc (')', STREAM);                     \
+    }                                          \
+  while (0)
 
 /* Globalizing directive for a label.  */
 #define GLOBAL_ASM_OP "\t.globl "
 
 \f
-/* Macros Controlling Initialization Routines.  */
-
-/* When you are using special sections for
-   initialization and termination functions, this macro also controls how
-   `crtstuff.c' and `libgcc2.c' arrange to run the initialization functions.
-
-   Defined in svr4.h.  */
-/* #define INIT_SECTION_ASM_OP */
-
-/* Define this macro as a C statement to output on the stream STREAM the
-   assembler code to arrange to call the function named NAME at initialization
-   time.
-
-   Assume that NAME is the name of a C function generated automatically by the
-   compiler.  This function takes no arguments.  Use the function
-   `assemble_name' to output the name NAME; this performs any system-specific
-   syntactic transformations such as adding an underscore.
-
-   If you don't define this macro, nothing special is output to arrange to call
-   the function.  This is correct when the function will be called in some
-   other manner--for example, by means of the `collect2' program, which looks
-   through the symbol table to find these functions by their names.
-
-   Defined in svr4.h.  */
-/* #define ASM_OUTPUT_CONSTRUCTOR(STREAM, NAME) */
-
-/* This is like `ASM_OUTPUT_CONSTRUCTOR' but used for termination functions
-   rather than initialization functions.
-
-   Defined in svr4.h.  */
-/* #define ASM_OUTPUT_DESTRUCTOR(STREAM, NAME) */
-
-/* Define this macro if the system uses ELF format object files.
-
-   Defined in svr4.h.  */
-/* #define OBJECT_FORMAT_ELF */
-
-\f
 /* Output of Assembler Instructions.  */
 
 #define REGISTER_NAMES                                                 \
@@ -705,9 +545,7 @@ do  {                                               \
 #define DWARF2_UNWIND_INFO             0
 #define DWARF_CIE_DATA_ALIGNMENT       1
 
-/* Don't use __builtin_setjmp for unwinding, since it's tricky to get
-   at the high 16 bits of an address.  */
-#define DONT_USE_BUILTIN_SETJMP
+#undef  DONT_USE_BUILTIN_SETJMP
 #define JMP_BUF_SIZE  8
 \f
 /* Assembler Commands for Alignment.  */
@@ -719,7 +557,7 @@ do  {                                               \
 /* Macros Affecting all Debug Formats.  */
 
 /* Defined in svr4.h.  */
-#undef PREFERRED_DEBUGGING_TYPE
+#undef  PREFERRED_DEBUGGING_TYPE
 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
 
 \f
@@ -756,23 +594,3 @@ do  {                                              \
 #define FUNCTION_MODE HImode
 
 #define NO_IMPLICIT_EXTERN_C
-
-/* Defined in svr4.h.  */
-#define HANDLE_SYSV_PRAGMA 1
-
-/* Define this if the target system supports the function `atexit' from the
-   ANSI C standard.  If this is not defined, and `INIT_SECTION_ASM_OP' is not
-   defined, a default `exit' function will be provided to support C++.
-
-   Defined by svr4.h */
-/* #define HAVE_ATEXIT */
-
-/* A C statement which is executed by the Haifa scheduler after it has scheduled
-   an insn from the ready list.  FILE is either a null pointer, or a stdio stream
-   to write any debug output to.  VERBOSE is the verbose level provided by
-   -fsched-verbose-<n>.  INSN is the instruction that was scheduled.  MORE is the
-   number of instructions that can be issued in the current cycle.  This macro
-   is responsible for updating the value of MORE (typically by (MORE)--).  */
-/* #define MD_SCHED_VARIABLE_ISSUE (FILE, VERBOSE, INSN, MORE) */
-
-/* End of xstormy16.h */