OSDN Git Service

2002-02-17 Philipp Thomas <pthomas@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / config / m88k / m88k.c
index 05a22f7..c1c2146 100644 (file)
@@ -76,6 +76,17 @@ static void m88k_svr3_asm_out_destructor PARAMS ((rtx, int));
 static int m88k_adjust_cost PARAMS ((rtx, rtx, rtx, int));
 \f
 /* Initialize the GCC target structure.  */
+#undef TARGET_ASM_BYTE_OP
+#define TARGET_ASM_BYTE_OP "\tbyte\t"
+#undef TARGET_ASM_ALIGNED_HI_OP
+#define TARGET_ASM_ALIGNED_HI_OP "\thalf\t"
+#undef TARGET_ASM_ALIGNED_SI_OP
+#define TARGET_ASM_ALIGNED_SI_OP "\tword\t"
+#undef TARGET_ASM_UNALIGNED_HI_OP
+#define TARGET_ASM_UNALIGNED_HI_OP "\tuahalf\t"
+#undef TARGET_ASM_UNALIGNED_SI_OP
+#define TARGET_ASM_UNALIGNED_SI_OP "\tuaword\t"
+
 #undef TARGET_ASM_FUNCTION_PROLOGUE
 #define TARGET_ASM_FUNCTION_PROLOGUE m88k_output_function_prologue
 #undef TARGET_ASM_FUNCTION_END_PROLOGUE
@@ -1503,16 +1514,16 @@ pc_or_label_ref (op, mode)
 /* This definition must match lang_independent_options from toplev.c.  */
 struct m88k_lang_independent_options
 {
-  const char *string;
-  int *variable;
-  int on_value;
-  const char *description;
+  const char *const string;
+  int *const variable;
+  const int on_value;
+  const char *const description;
 };
 
 static void output_options PARAMS ((FILE *,
-                                   struct m88k_lang_independent_options *,
+                                   const struct m88k_lang_independent_options *,
                                    int,
-                                   struct m88k_lang_independent_options *,
+                                   const struct m88k_lang_independent_options *,
                                    int, int, int, const char *, const char *,
                                    const char *));
 
@@ -1541,8 +1552,8 @@ static void
 output_options (file, f_options, f_len, W_options, W_len,
                pos, max, sep, indent, term)
      FILE *file;
-     struct m88k_lang_independent_options *f_options;
-     struct m88k_lang_independent_options *W_options;
+     const struct m88k_lang_independent_options *f_options;
+     const struct m88k_lang_independent_options *W_options;
      int f_len, W_len;
      int pos;
      int max;
@@ -1588,8 +1599,8 @@ output_options (file, f_options, f_len, W_options, W_len,
 void
 output_file_start (file, f_options, f_len, W_options, W_len)
      FILE *file;
-     struct m88k_lang_independent_options *f_options;
-     struct m88k_lang_independent_options *W_options;
+     const struct m88k_lang_independent_options *f_options;
+     const struct m88k_lang_independent_options *W_options;
      int f_len, W_len;
 {
   register int pos;
@@ -1817,7 +1828,7 @@ m88k_layout_frame ()
   frame_size = get_frame_size ();
 
   /* Since profiling requires a call, make sure r1 is saved.  */
-  if (profile_flag)
+  if (current_function_profile)
     save_regs[1] = 1;
 
   /* If we are producing debug information, store r1 and r30 where the
@@ -2028,7 +2039,7 @@ m88k_expand_prologue ()
       if (! save_regs[1])
        emit_move_insn (return_reg, temp_reg);
     }
-  if (profile_flag)
+  if (current_function_profile)
     emit_insn (gen_blockage ());
 }
 \f
@@ -2364,7 +2375,8 @@ output_tdesc (file, offset)
 
   tdesc_section ();
 
-  fprintf (file, "%s%d,%d", ASM_LONG, /* 8:0,22:(20 or 16),2:2 */
+  /* 8:0,22:(20 or 16),2:2 */
+  fprintf (file, "%s%d,%d", integer_asm_op (4, TRUE),
           (((xmask != 0) ? 20 : 16) << 2) | 2,
           flag_pic ? 2 : 1);
 
@@ -2604,7 +2616,7 @@ m88k_function_arg (args_so_far, mode, type, named)
 struct rtx_def *
 m88k_builtin_saveregs ()
 {
-  rtx addr, dest;
+  rtx addr;
   tree fntype = TREE_TYPE (current_function_decl);
   int argadj = ((!(TYPE_ARG_TYPES (fntype) != 0
                   && (TREE_VALUE (tree_last (TYPE_ARG_TYPES (fntype)))
@@ -2627,21 +2639,10 @@ m88k_builtin_saveregs ()
 
   /* Now store the incoming registers.  */
   if (fixed < 8)
-    {
-      dest = adjust_address (addr, Pmode, fixed * UNITS_PER_WORD);
-      move_block_from_reg (2 + fixed, dest, 8 - fixed,
-                          UNITS_PER_WORD * (8 - fixed));
-
-      if (current_function_check_memory_usage)
-       {
-         emit_library_call (chkr_set_right_libfunc, 1, VOIDmode, 3,
-                            dest, ptr_mode,
-                            GEN_INT (UNITS_PER_WORD * (8 - fixed)),
-                            TYPE_MODE (sizetype),
-                            GEN_INT (MEMORY_USE_RW),
-                            TYPE_MODE (integer_type_node));
-       }
-    }
+    move_block_from_reg (2 + fixed,
+                        adjust_address (addr, Pmode, fixed * UNITS_PER_WORD),
+                        8 - fixed,
+                        UNITS_PER_WORD * (8 - fixed));
 
   /* Return the address of the save area, but don't put it in a
      register.  This fails when not optimizing and produces worse code
@@ -2878,7 +2879,7 @@ print_operand (file, x, code)
   if (sequencep)
     {
       if (code < 'B' || code > 'E')
-       output_operand_lossage ("%R not followed by %B/C/D/E");
+       output_operand_lossage ("%%R not followed by %%B/C/D/E");
       if (reversep)
        xc = reverse_condition (xc);
       sequencep = 0;
@@ -2946,43 +2947,43 @@ print_operand (file, x, code)
       value >>= 16;
     case 'x': /* print the lower 16 bits of the integer constant in hex */
       if (xc != CONST_INT)
-       output_operand_lossage ("invalid %x/X value");
+       output_operand_lossage ("invalid %%x/X value");
       fprintf (file, "0x%x", value & 0xffff); return;
 
     case 'H': /* print the low 16 bits of the negated integer constant */
       if (xc != CONST_INT)
-       output_operand_lossage ("invalid %H value");
+       output_operand_lossage ("invalid %%H value");
       value = -value;
     case 'h': /* print the register or low 16 bits of the integer constant */
       if (xc == REG)
        goto reg;
       if (xc != CONST_INT)
-       output_operand_lossage ("invalid %h value");
+       output_operand_lossage ("invalid %%h value");
       fprintf (file, "%d", value & 0xffff);
       return;
 
     case 'Q': /* print the low 8 bits of the negated integer constant */
       if (xc != CONST_INT)
-       output_operand_lossage ("invalid %Q value");
+       output_operand_lossage ("invalid %%Q value");
       value = -value;
     case 'q': /* print the register or low 8 bits of the integer constant */
       if (xc == REG)
        goto reg;
       if (xc != CONST_INT)
-       output_operand_lossage ("invalid %q value");
+       output_operand_lossage ("invalid %%q value");
       fprintf (file, "%d", value & 0xff);
       return;
 
     case 'w': /* print the integer constant (X == 32 ? 0 : 32 - X) */
       if (xc != CONST_INT)
-       output_operand_lossage ("invalid %o value");
+       output_operand_lossage ("invalid %%o value");
       fprintf (file, "%d", value == 32 ? 0 : 32 - value);
       return;
 
     case 'p': /* print the logarithm of the integer constant */
       if (xc != CONST_INT
          || (value = exact_log2 (value)) < 0)
-       output_operand_lossage ("invalid %p value");
+       output_operand_lossage ("invalid %%p value");
       fprintf (file, "%d", value);
       return;
 
@@ -2995,12 +2996,12 @@ print_operand (file, x, code)
        register int top, bottom;
 
        if (xc != CONST_INT)
-         output_operand_lossage ("invalid %s/S value");
+         output_operand_lossage ("invalid %%s/S value");
        /* All the "one" bits must be contiguous.  If so, MASK will be
           a power of two or zero.  */
        mask = (uval | (uval - 1)) + 1;
        if (!(uval && POWER_OF_2_or_0 (mask)))
-         output_operand_lossage ("invalid %s/S value");
+         output_operand_lossage ("invalid %%s/S value");
        top = mask ? exact_log2 (mask) : 32;
        bottom = exact_log2 (uval & ~(uval - 1));
        fprintf (file,"%d<%d>", top - bottom, bottom);
@@ -3011,7 +3012,7 @@ print_operand (file, x, code)
       if (xc == LABEL_REF)
        output_addr_const (file, x);
       else if (xc != PC)
-       output_operand_lossage ("invalid %P operand");
+       output_operand_lossage ("invalid %%P operand");
       return;
 
     case 'L': /* print 0 or 1 if operand is label_ref and then...  */
@@ -3042,7 +3043,7 @@ print_operand (file, x, code)
        case LE: fputs ("le0", file); return;
        case LT: fputs ("lt0", file); return;
        case GE: fputs ("ge0", file); return;
-       default: output_operand_lossage ("invalid %B value");
+       default: output_operand_lossage ("invalid %%B value");
        }
 
     case 'C': /* bb0/bb1 branch values for comparisons */
@@ -3059,7 +3060,7 @@ print_operand (file, x, code)
        case LEU: fputs ("ls", file); return;
        case LTU: fputs ("lo", file); return;
        case GEU: fputs ("hs", file); return;
-       default:  output_operand_lossage ("invalid %C value");
+       default:  output_operand_lossage ("invalid %%C value");
        }
 
     case 'D': /* bcnd branch values for float comparisons */
@@ -3072,7 +3073,7 @@ print_operand (file, x, code)
        case LE: fputs ("0xe", file); return;
        case LT: fputs ("0x4", file); return;
        case GE: fputs ("0xb", file); return;
-       default: output_operand_lossage ("invalid %D value");
+       default: output_operand_lossage ("invalid %%D value");
        }
 
     case 'E': /* bcnd branch values for special integers */
@@ -3080,12 +3081,12 @@ print_operand (file, x, code)
        {
        case EQ: fputs ("0x8", file); return;
        case NE: fputs ("0x7", file); return;
-       default: output_operand_lossage ("invalid %E value");
+       default: output_operand_lossage ("invalid %%E value");
        }
 
     case 'd': /* second register of a two register pair */
       if (xc != REG)
-       output_operand_lossage ("`%d' operand isn't a register");
+       output_operand_lossage ("`%%d' operand isn't a register");
       fputs (reg_names[REGNO (x) + 1], file);
       return;
 
@@ -3096,7 +3097,7 @@ print_operand (file, x, code)
          return;
        }
       else if (xc != REG)
-       output_operand_lossage ("invalid %r value");
+       output_operand_lossage ("invalid %%r value");
     case 0:
     name:
       if (xc == REG)