OSDN Git Service

* Makefile.in (INCLUDES): Remove -I$(srcdir)/config.
[pf3gnuchains/gcc-fork.git] / gcc / config / frv / frv.h
index b52a454..feadc79 100644 (file)
@@ -1,5 +1,5 @@
 /* Target macros for the FRV port of GCC.
-   Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
    Contributed by Red Hat Inc.
 
    This file is part of GCC.
 #ifndef __FRV_H__
 #define __FRV_H__
 
-/* Set up System V.4 (aka ELF) defaults.  */
-#include "svr4.h"
-
-\f
 /* Frv general purpose macros.  */
 /* Align an address.  */
 #define ADDR_ALIGN(addr,align) (((addr) + (align) - 1) & ~((align) - 1))
@@ -86,7 +82,7 @@
     %{mmedia} %{mno-media} \
     %{mmuladd} %{mno-muladd} \
     %{mpack} %{mno-pack} \
-    %{fpic: -mpic} %{fPIC: -mPIC} %{mlibrary-pic}}"
+    %{fpic|fpie: -mpic} %{fPIC|fPIE: -mPIC} %{mlibrary-pic}}"
 
 /* Another C string constant used much like `LINK_SPEC'.  The difference
    between the two is that `STARTFILE_SPEC' is used at the very beginning of
 
 /* Run-time target specifications */
 
-/* Define this to be a string constant containing `-D' options to define the
-   predefined macros that identify this machine and system.  These macros will
-   be predefined unless the `-ansi' option is specified.
-
-   In addition, a parallel set of macros are predefined, whose names are made
-   by appending `__' at the beginning and at the end.  These `__' macros are
-   permitted by the ANSI standard, so they are predefined regardless of whether
-   `-ansi' is specified.  */
-
-#define CPP_PREDEFINES "-D__frv__ -Amachine(frv)"
+#define TARGET_CPU_CPP_BUILTINS()              \
+  do                                           \
+    {                                          \
+      builtin_define ("__frv__");              \
+      builtin_assert ("machine=frv");          \
+    }                                          \
+  while (0)
 
 \f
 /* This declaration should be present.  */
@@ -489,13 +482,13 @@ extern int target_flags;
         "Specify the size of the short data section"  } }
 
    This declaration is optional.  */
-#define TARGET_OPTIONS                                                     \
-{                                                                          \
-  { "cpu=",            &frv_cpu_string,         "Set cpu type" },          \
-  { "branch-cost=",    &frv_branch_cost_string, "Internal debug switch" }, \
-  { "cond-exec-insns=", &frv_condexec_insns_str, "Internal debug switch" }, \
-  { "cond-exec-temps=", &frv_condexec_temps_str, "Internal debug switch" }, \
-  { "sched-lookahead=", &frv_sched_lookahead_str,"Internal debug switch" }, \
+#define TARGET_OPTIONS                                                       \
+{                                                                            \
+  { "cpu=",            &frv_cpu_string,         "Set cpu type", 0},          \
+  { "branch-cost=",    &frv_branch_cost_string, "Internal debug switch", 0}, \
+  { "cond-exec-insns=", &frv_condexec_insns_str, "Internal debug switch", 0}, \
+  { "cond-exec-temps=", &frv_condexec_temps_str, "Internal debug switch", 0}, \
+  { "sched-lookahead=", &frv_sched_lookahead_str,"Internal debug switch", 0}, \
 }
 
 /* This macro is a C statement to print on `stderr' a string describing the
@@ -557,9 +550,6 @@ extern int target_flags;
 #define SDATA_DEFAULT_SIZE 8
 #endif
 
-extern int g_switch_value;        /* value of the -G xx switch */
-extern int g_switch_set;          /* whether -G xx was passed.  */
-
 
 /* Storage Layout */
 
@@ -2643,6 +2633,11 @@ __asm__("\n"                                                             \
 #define INIT_SECTION_ASM_OP    "\t.section .init,\"ax\""
 #define FINI_SECTION_ASM_OP    "\t.section .fini,\"ax\""
 
+#undef CTORS_SECTION_ASM_OP
+#undef DTORS_SECTION_ASM_OP
+#define CTORS_SECTION_ASM_OP   "\t.section\t.ctors,\"a\""
+#define DTORS_SECTION_ASM_OP   "\t.section\t.dtors,\"a\""
+
 /* A C expression whose value is a string containing the assembler operation to
    switch to the fixup section that records all initialized pointers in a -fpic
    program so they can be changed program startup time if the program is loaded
@@ -2661,10 +2656,9 @@ __asm__("\n"                                                             \
    macro if you do not define `EXTRA_SECTIONS'.  */
 #undef  EXTRA_SECTION_FUNCTIONS
 #define EXTRA_SECTION_FUNCTIONS                                         \
-SDATA_SECTION_FUNCTION                                                  \
-SBSS_SECTION_FUNCTION                                                  \
-FIXUP_SECTION_FUNCTION
-
+       SDATA_SECTION_FUNCTION                                          \
+       SBSS_SECTION_FUNCTION                                           \
+       FIXUP_SECTION_FUNCTION
 
 #define SDATA_SECTION_FUNCTION                                         \
 void                                                                   \
@@ -2675,7 +2669,7 @@ sdata_section ()                                                  \
       fprintf (asm_out_file, "%s\n", SDATA_SECTION_ASM_OP);            \
       in_section = in_sdata;                                           \
     }                                                                  \
-}                                                                      \
+}
 
 #define SBSS_SECTION_FUNCTION                                          \
 void                                                                   \
@@ -2686,7 +2680,7 @@ sbss_section ()                                                           \
       fprintf (asm_out_file, "%s\n", SBSS_SECTION_ASM_OP);             \
       in_section = in_sbss;                                            \
     }                                                                  \
-}                                                                      \
+}
 
 #define FIXUP_SECTION_FUNCTION                                         \
 void                                                                   \
@@ -2697,11 +2691,7 @@ fixup_section ()                                                 \
       fprintf (asm_out_file, "%s\n", FIXUP_SECTION_ASM_OP);            \
       in_section = in_fixup;                                           \
     }                                                                  \
-}                                                                      \
-
-#define SDATA_FLAG_CHAR '@'
-
-#define SDATA_NAME_P(NAME) (*(NAME) == SDATA_FLAG_CHAR)
+}
 \f
 /* Position Independent Code.  */
 
@@ -2786,10 +2776,10 @@ extern int size_directive_output;
 #undef ASM_OUTPUT_ALIGNED_DECL_LOCAL
 #define ASM_OUTPUT_ALIGNED_DECL_LOCAL(STREAM, DECL, NAME, SIZE, ALIGN) \
 do {                                                                           \
-  if (SDATA_NAME_P (NAME))                                                     \
+  if ((SIZE) > 0 && (SIZE) <= g_switch_value)                          \
     sbss_section ();                                                   \
   else                                                                         \
-     bss_section ();                                                   \
+    bss_section ();                                                    \
   ASM_OUTPUT_ALIGN (STREAM, floor_log2 ((ALIGN) / BITS_PER_UNIT));             \
   ASM_DECLARE_OBJECT_NAME (STREAM, NAME, DECL);                                \
   ASM_OUTPUT_SKIP (STREAM, (SIZE) ? (SIZE) : 1);                               \
@@ -2812,19 +2802,6 @@ do {                                                                     \
 /* Globalizing directive for a label.  */
 #define GLOBAL_ASM_OP "\t.globl "
 
-/* A C statement (sans semicolon) to output to the stdio stream STREAM a
-   reference in assembler syntax to a label named NAME.  This should add `_' to
-   the front of the name, if that is customary on your operating system, as it
-   is in most Berkeley Unix systems.  This macro is used in `assemble_name'.  */
-#undef ASM_OUTPUT_LABELREF
-#define ASM_OUTPUT_LABELREF(STREAM, NAME)                              \
-do {                                                                   \
-  const char *_name = (NAME);                                          \
-  while (*_name == '*' || *_name == SDATA_FLAG_CHAR)                   \
-    _name++;                                                           \
-  asm_fprintf (STREAM, "%U%s", _name);                                 \
-} while (0)
-
 /* A C statement to store into the string STRING a label whose name is made
    from the string PREFIX and the number NUM.
 
@@ -2863,27 +2840,6 @@ do {                                                                     \
    init section is not actually run automatically, but is still useful for
    collecting the lists of constructors and destructors.  */
 #define INVOKE__main
-
-/* Output appropriate code tp call a static constructor.  */
-#undef  ASM_OUTPUT_CONSTRUCTOR
-#define ASM_OUTPUT_CONSTRUCTOR(STREAM,NAME)                            \
-do {                                                                   \
-  ctors_section ();                                                    \
-  fprintf (STREAM, "\t.picptr\t");                                     \
-  assemble_name (STREAM, NAME);                                                \
-  fprintf (STREAM, "\n");                                                      \
-} while (0)
-
-/* Output appropriate code tp call a static destructor.  */
-#undef  ASM_OUTPUT_DESTRUCTOR
-#define ASM_OUTPUT_DESTRUCTOR(STREAM,NAME)                             \
-do {                                                                   \
-  dtors_section ();                                                    \
-  fprintf (STREAM, "\t.picptr\t");                                     \
-  assemble_name (STREAM, NAME);                                                \
-  fprintf (STREAM, "\n");                                                      \
-} while (0)
-
 \f
 /* Output of Assembler Instructions.  */
 
@@ -2999,7 +2955,7 @@ do {                                                                      \
    * == temporary integer CCR register (cr3)
    & == temporary integer ICC register (icc3)  */
 #define PRINT_OPERAND_PUNCT_VALID_P(CODE)                              \
-((CODE) == '.' || (CODE) == '#' || (CODE) == SDATA_FLAG_CHAR || (CODE) == '~'  \
+((CODE) == '.' || (CODE) == '#' || (CODE) == '@' || (CODE) == '~'      \
  || (CODE) == '*' || (CODE) == '&')
 
 /* A C compound statement to output to stdio stream STREAM the assembler syntax
@@ -3114,7 +3070,7 @@ do {                                                                    \
    Defined in svr4.h.  */
 #undef  ASM_OUTPUT_SKIP
 #define ASM_OUTPUT_SKIP(STREAM, NBYTES) \
-  fprintf (STREAM, "\t.zero\t%u\n", (NBYTES))
+  fprintf (STREAM, "\t.zero\t%u\n", (int)(NBYTES))
 
 /* A C statement to output to the stdio stream STREAM an assembler command to
    advance the location counter to a multiple of 2 to the POWER bytes.  POWER