* config/ia64/ia64.c (ia64_vms_init_libfuncs): New function.
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 10 Oct 2003 22:44:41 +0000 (22:44 +0000)
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 10 Oct 2003 22:44:41 +0000 (22:44 +0000)
(ia64_output_function_prologue): Only write .prologue if --with-gnu-as.
(ia64_initialize_trampoline): If not using GAS, declare trampoline
as global.
* config/ia64/ia64.h (ASM_APP_ON, ASM_APP_OFF): Add vers for not GAS.
(ASM_OUTPUT_DEBUG_LABEL): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@72316 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/ia64/ia64.c
gcc/config/ia64/ia64.h

index 5cf9983..cf0a5f8 100644 (file)
        * config/ip2k/ip2k.h, config/iq2000/iq2000.h:
        No need to define BITS_PER_UNIT.
 
+2003-10-10  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
 
+       * config/ia64/ia64.c (ia64_vms_init_libfuncs): New function.
+       (ia64_output_function_prologue): Only write .prologue if --with-gnu-as.
+       (ia64_initialize_trampoline): If not using GAS, declare trampoline
+       as global.
+       * config/ia64/ia64.h (ASM_APP_ON, ASM_APP_OFF): Add vers for not GAS.
+       (ASM_OUTPUT_DEBUG_LABEL): Likewise.
+       
        * stor-layout.c (compute_record_mode): Don't force BLKmode if
        field is zero-length BLKmode.
        * expr.c (expand_expr, case COMPONENT_REF): Handle case of BLKmode
@@ -54,8 +62,6 @@
 
        * combine.c (distribute_links): Properly test for REG being set.
 
-2003-10-10  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
-
        * config/alpha/alpha.c (alpha_expand_block_mode): Don't use
        gen_lowpart and company except for REG.
 
index 75a2cb6..32e3c8b 100644 (file)
@@ -255,6 +255,8 @@ static void ia64_hpux_file_end (void)
      ATTRIBUTE_UNUSED;
 static void ia64_hpux_init_libfuncs (void)
      ATTRIBUTE_UNUSED;
+static void ia64_vms_init_libfuncs (void)
+     ATTRIBUTE_UNUSED;
 
 static tree ia64_handle_model_attribute (tree *, tree, tree, int, bool *);
 static void ia64_encode_section_info (tree, rtx, int);
@@ -3132,7 +3134,7 @@ ia64_output_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
        grsave = current_frame_info.reg_save_pr;
     }
 
-  if (mask)
+  if (mask && TARGET_GNU_AS)
     fprintf (file, "\t.prologue %d, %d\n", mask,
             ia64_dbx_register_number (grsave));
   else
@@ -3215,6 +3217,19 @@ ia64_initialize_trampoline (rtx addr, rtx fnaddr, rtx static_chain)
 {
   rtx addr_reg, eight = GEN_INT (8);
 
+  /* The Intel assembler requires that the global __ia64_trampoline symbol
+     be declared explicitly */
+  if (!TARGET_GNU_AS)
+    {
+      static bool declared_ia64_trampoline = false;
+
+      if (!declared_ia64_trampoline)
+       {
+         declared_ia64_trampoline = true;
+         fputs ("\t.global\t__ia64_trampoline\n", asm_out_file);
+       }
+    }
+
   /* Load up our iterator.  */
   addr_reg = gen_reg_rtx (Pmode);
   emit_move_insn (addr_reg, addr);
@@ -8307,6 +8322,7 @@ ia64_hpux_file_end (void)
 }
 
 /* Rename all the TFmode libfuncs using the HPUX conventions.  */
+
 static void
 ia64_hpux_init_libfuncs (void)
 {
@@ -8339,6 +8355,21 @@ ia64_hpux_init_libfuncs (void)
   set_conv_libfunc (sfloat_optab, TFmode, SImode, "_U_Qfcnvxf_sgl_to_quad");
   set_conv_libfunc (sfloat_optab, TFmode, DImode, "_U_Qfcnvxf_dbl_to_quad");
 }
+
+/* Rename the division and modulus functions in VMS.  */
+
+static void
+ia64_vms_init_libfuncs (void)
+{
+  set_optab_libfunc (sdiv_optab, SImode, "OTS$DIV_I");
+  set_optab_libfunc (sdiv_optab, DImode, "OTS$DIV_L");
+  set_optab_libfunc (udiv_optab, SImode, "OTS$DIV_UI");
+  set_optab_libfunc (udiv_optab, DImode, "OTS$DIV_UL");
+  set_optab_libfunc (smod_optab, SImode, "OTS$REM_I");
+  set_optab_libfunc (smod_optab, DImode, "OTS$REM_L");
+  set_optab_libfunc (umod_optab, SImode, "OTS$REM_UI");
+  set_optab_libfunc (umod_optab, DImode, "OTS$REM_UL");
+}
 \f
 /* Switch to the section to which we should output X.  The only thing
    special we do here is to honor small data.  */
index 8550eda..2cff151 100644 (file)
@@ -1745,17 +1745,12 @@ do {                                                                    \
 /* A C string constant for text to be output before each `asm' statement or
    group of consecutive ones.  */
 
-/* ??? This won't work with the Intel assembler, because it does not accept
-   # as a comment start character.  However, //APP does not work in gas, so we
-   can't use that either.  Same problem for ASM_APP_OFF below.  */
-
-#define ASM_APP_ON "#APP\n"
+#define ASM_APP_ON (TARGET_GNU_AS ? "#APP\n" : "//APP\n")
 
 /* A C string constant for text to be output after each `asm' statement or
    group of consecutive ones.  */
 
-#define ASM_APP_OFF "#NO_APP\n"
-
+#define ASM_APP_OFF (TARGET_GNU_AS ? "#NO_APP\n" : "//NO_APP\n")
 \f
 /* Output of Uninitialized Variables.  */
 
@@ -2133,7 +2128,7 @@ do {                                                                      \
    add brackets around the label.  */
 
 #define ASM_OUTPUT_DEBUG_LABEL(FILE, PREFIX, NUM) \
-  fprintf (FILE, "[.%s%d:]\n", PREFIX, NUM)
+  fprintf (FILE, TARGET_GNU_AS ? "[.%s%d:]\n" : ".%s%d:\n", PREFIX, NUM)
 
 /* Use section-relative relocations for debugging offsets.  Unlike other
    targets that fake this by putting the section VMA at 0, IA-64 has