OSDN Git Service

GNU CC -> GCC
[pf3gnuchains/gcc-fork.git] / gcc / config / alpha / vms.h
index ba65704..7d10a1b 100644 (file)
@@ -2,20 +2,20 @@
    Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002
    Free Software Foundation, Inc.
 
-This file is part of GNU CC.
+This file is part of GCC.
 
-GNU CC is free software; you can redistribute it and/or modify
+GCC is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2, or (at your option)
 any later version.
 
-GNU CC is distributed in the hope that it will be useful,
+GCC is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING.  If not, write to
+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.  */
 
@@ -29,20 +29,17 @@ Boston, MA 02111-1307, USA.  */
 
 #define NO_EXTERNAL_INDIRECT_ADDRESS
 
-#include "alpha/alpha.h"
-
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES \
-"-D__ALPHA -Dvms -DVMS -D__vms__ -D__VMS__ -Asystem=vms"
-
-#undef CPP_SUBTARGET_SPEC
-#define CPP_SUBTARGET_SPEC "\
-%{mfloat-ieee:-D__IEEE_FLOAT} \
-%{mfloat-vax:-D__G_FLOAT} \
-%{!mfloat-vax:-D__IEEE_FLOAT}"
-
-/* By default, allow $ to be part of an identifier.  */
-#define DOLLARS_IN_IDENTIFIERS 2
+#define TARGET_OS_CPP_BUILTINS()               \
+    do {                                       \
+       builtin_define_std ("vms");             \
+       builtin_define_std ("VMS");             \
+       builtin_define ("__ALPHA");             \
+       builtin_assert ("system=vms");          \
+       if (TARGET_FLOAT_VAX)                   \
+         builtin_define ("__G_FLOAT");         \
+       else                                    \
+         builtin_define ("__IEEE_FLOAT");      \
+    } while (0)
 
 #undef TARGET_DEFAULT
 #define TARGET_DEFAULT (MASK_FP|MASK_FPREGS|MASK_GAS)
@@ -245,42 +242,18 @@ typedef struct {int num_args; enum avms_arg_type atypes[6];} avms_arg_info;
 #undef STACK_CHECK_BUILTIN
 #define STACK_CHECK_BUILTIN 0
 
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE)                                   \
-{                                                              \
-  alpha_write_verstamp (FILE);                                 \
-  fprintf (FILE, "\t.set noreorder\n");                                \
-  fprintf (FILE, "\t.set volatile\n");                         \
-  if (TARGET_BWX | TARGET_MAX | TARGET_FIX | TARGET_CIX)       \
-    {                                                          \
-      fprintf (FILE, "\t.arch %s\n",                           \
-               (TARGET_CPU_EV6 ? "ev6"                         \
-                : TARGET_MAX ? "pca56" : "ev56"));             \
-    }                                                          \
-  ASM_OUTPUT_SOURCE_FILENAME (FILE, main_input_filename);      \
-}
-
 #define LINK_SECTION_ASM_OP "\t.link"
-#define READONLY_SECTION_ASM_OP "\t.rdata"
+#define READONLY_DATA_SECTION_ASM_OP "\t.rdata"
 #define LITERALS_SECTION_ASM_OP "\t.literals"
 #define CTORS_SECTION_ASM_OP "\t.ctors"
 #define DTORS_SECTION_ASM_OP "\t.dtors"
 
 #undef EXTRA_SECTIONS
-#define EXTRA_SECTIONS in_link, in_rdata, in_literals
+#define EXTRA_SECTIONS in_link, in_literals
 
 #undef EXTRA_SECTION_FUNCTIONS
 #define EXTRA_SECTION_FUNCTIONS                                        \
 void                                                           \
-readonly_section ()                                            \
-{                                                              \
-  if (in_section != in_rdata)                          \
-    {                                                          \
-      fprintf (asm_out_file, "%s\n", READONLY_SECTION_ASM_OP); \
-      in_section = in_rdata;                           \
-    }                                                          \
-}                                                              \
-void                                                           \
 link_section ()                                                        \
 {                                                              \
   if (in_section != in_link)                                   \
@@ -299,9 +272,8 @@ literals_section ()                                         \
     }                                                          \
 }
 
-extern void readonly_section   PARAMS ((void));
-extern void link_section       PARAMS ((void));
-extern void literals_section   PARAMS ((void));
+extern void link_section (void);
+extern void literals_section (void);
 
 #undef ASM_OUTPUT_ADDR_DIFF_ELT
 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) abort ()
@@ -310,18 +282,13 @@ extern void literals_section      PARAMS ((void));
 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
   fprintf (FILE, "\t.quad $L%d\n", (VALUE))
 
-#undef READONLY_DATA_SECTION
-#define READONLY_DATA_SECTION readonly_section
-
-#define ASM_FILE_END(FILE) alpha_write_linkage (FILE);
-
 #undef CASE_VECTOR_MODE
 #define CASE_VECTOR_MODE DImode
 #undef CASE_VECTOR_PC_RELATIVE
 
 #undef ASM_OUTPUT_CASE_LABEL
 #define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,TABLEINSN)       \
-{ ASM_OUTPUT_ALIGN (FILE, 3); ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); }
+{ ASM_OUTPUT_ALIGN (FILE, 3); (*targetm.asm_out.internal_label) (FILE, PREFIX, NUM); }
 
 /* This says how to output assembler code to declare an                
    uninitialized external linkage data object.  */ 
@@ -333,7 +300,7 @@ extern void literals_section        PARAMS ((void));
 do {                                                                   \
   fprintf ((FILE), "%s", COMMON_ASM_OP);                               \
   assemble_name ((FILE), (NAME));                                      \
-  fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT);       \
+  fprintf ((FILE), "," HOST_WIDE_INT_PRINT_UNSIGNED ",%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
 } while (0)
 
 \f
@@ -379,8 +346,8 @@ do {                                                                        \
 #undef MIPS_DEBUGGING_INFO
 #undef DBX_DEBUGGING_INFO
 
-#define DWARF2_DEBUGGING_INFO
-#define VMS_DEBUGGING_INFO
+#define DWARF2_DEBUGGING_INFO 1
+#define VMS_DEBUGGING_INFO 1
 
 #define DWARF2_UNWIND_INFO 1
 
@@ -391,22 +358,14 @@ do {                                                                      \
 #define LINK_EH_SPEC "vms-dwarf2eh.o%s "
 
 #ifdef IN_LIBGCC2
-#include <libicb.h>
 #include <pdscdef.h>
 
 #define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS)              \
  do {                                                                  \
-  unsigned long handle;                                                        \
-  PDSCDEF *pv;                                                         \
-  INVO_CONTEXT_BLK invo;                                               \
-                                                                       \
-  memset (&invo, 0, sizeof (INVO_CONTEXT_BLK));                                \
+  PDSCDEF *pv = *((PDSCDEF **) (CONTEXT)->reg [29]);                    \
                                                                        \
-  invo.libicb$q_ireg [29] = *((long long *) (CONTEXT)->reg [29]);      \
-  invo.libicb$q_ireg [30] = (long long) (CONTEXT)->cfa;                        \
-  handle = LIB$GET_INVO_HANDLE (&invo);                                        \
-  LIB$GET_INVO_CONTEXT (handle, &invo);                                        \
-  pv = (PDSCDEF *) invo.libicb$ph_procedure_descriptor;                        \
+  if (pv && ((long) pv & 0x7) == 0) /* low bits 0 means address */      \
+    pv = *(PDSCDEF **) pv;                                              \
                                                                        \
   if (pv && ((pv->pdsc$w_flags & 0xf) == PDSC$K_KIND_FP_STACK))                \
     {                                                                  \
@@ -432,6 +391,19 @@ do {                                                                       \
                                                                        \
       goto SUCCESS;                                                    \
     }                                                                  \
+  else if (pv && ((pv->pdsc$w_flags & 0xf) == PDSC$K_KIND_FP_REGISTER))        \
+    {                                                                  \
+      (FS)->cfa_offset = pv->pdsc$l_size;                              \
+      (FS)->cfa_reg = pv->pdsc$w_flags & PDSC$M_BASE_REG_IS_FP ? 29 : 30; \
+      (FS)->retaddr_column = 26;                                       \
+      (FS)->cfa_how = CFA_REG_OFFSET;                                  \
+      (FS)->regs.reg[26].loc.reg = pv->pdsc$b_save_ra;                 \
+      (FS)->regs.reg[26].how = REG_SAVED_REG;                          \
+      (FS)->regs.reg[29].loc.reg = pv->pdsc$b_save_fp;                 \
+      (FS)->regs.reg[29].how = REG_SAVED_REG;                          \
+                                                                       \
+      goto SUCCESS;                                                    \
+    }                                                                  \
 } while (0)
 #endif
 
@@ -458,13 +430,10 @@ do {                                                                      \
 #undef PREFERRED_DEBUGGING_TYPE
 #define PREFERRED_DEBUGGING_TYPE VMS_AND_DWARF2_DEBUG
 
-#undef ASM_FORMAT_PRIVATE_NAME
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
-( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 12),   \
-  sprintf ((OUTPUT), "%s___%d", (NAME), (LABELNO)))
+#define ASM_PN_FORMAT "%s___%lu"
 
 /* ??? VMS uses different linkage.  */
-#undef ASM_OUTPUT_MI_THUNK
+#undef TARGET_ASM_OUTPUT_MI_THUNK
 
 #undef ASM_SPEC
 #undef ASM_FINAL_SPEC
@@ -514,11 +483,17 @@ do {                                                                      \
 #define NAME__MAIN "__gccmain"
 #define SYMBOL__MAIN __gccmain
 
+#define MD_EXEC_PREFIX "/gnu/lib/gcc-lib/"
+#define MD_STARTFILE_PREFIX "/gnu/lib/gcc-lib/"
+
 /* Specify the list of include file directories.  */
-#define INCLUDE_DEFAULTS               \
-{                                      \
-  { "/gnu_gxx_include", 0, 1, 1 },     \
-  { "/gnu_cc_include", 0, 0, 0 },      \
-  { "/gnu/include", 0, 0, 0 },         \
-  { 0, 0, 0, 0 }                       \
+#define INCLUDE_DEFAULTS                  \
+{                                         \
+  { "/gnu/lib/gcc-lib/include", 0, 0, 0 }, \
+  { "/gnu_gxx_include", 0, 1, 1 },        \
+  { "/gnu_cc_include", 0, 0, 0 },         \
+  { "/gnu/include", 0, 0, 0 },            \
+  { 0, 0, 0, 0 }                          \
 }
+
+#define LONGLONG_STANDALONE 1