⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 m88k.c

📁 linux下的gcc编译器
💻 C
📖 第 1 页 / 共 5 页
字号:
   on condition codes. */intpartial_ccmode_register_operand (op, mode)     rtx op;     enum machine_mode mode ATTRIBUTE_UNUSED;{  return register_operand (op, CCmode) || register_operand (op, CCEVENmode);}/* Return true if OP is a relational operator.  */intrelop (op, mode)     rtx op;     enum machine_mode mode ATTRIBUTE_UNUSED;{  switch (GET_CODE (op))    {    case EQ:    case NE:    case LT:    case LE:    case GE:    case GT:    case LTU:    case LEU:    case GEU:    case GTU:      return 1;    default:      return 0;    }}inteven_relop (op, mode)     rtx op;     enum machine_mode mode ATTRIBUTE_UNUSED;{  switch (GET_CODE (op))    {    case EQ:    case LT:    case GT:    case LTU:    case GTU:      return 1;    default:      return 0;    }}intodd_relop (op, mode)     rtx op;     enum machine_mode mode ATTRIBUTE_UNUSED;{  switch (GET_CODE (op))    {    case NE:    case LE:    case GE:    case LEU:    case GEU:      return 1;    default:      return 0;    }}/* Return true if OP is a relational operator, and is not an unsigned   relational operator.  */intrelop_no_unsigned (op, mode)     rtx op;     enum machine_mode mode ATTRIBUTE_UNUSED;{  switch (GET_CODE (op))    {    case EQ:    case NE:    case LT:    case LE:    case GE:    case GT:      /* @@ What is this test doing?  Why not use `mode'?  */      if (GET_MODE_CLASS (GET_MODE (op)) == MODE_FLOAT	  || GET_MODE (op) == DImode	  || GET_MODE_CLASS (GET_MODE (XEXP (op, 0))) == MODE_FLOAT	  || GET_MODE (XEXP (op, 0)) == DImode	  || GET_MODE_CLASS (GET_MODE (XEXP (op, 1))) == MODE_FLOAT	  || GET_MODE (XEXP (op, 1)) == DImode)	return 0;      return 1;    default:      return 0;    }}/* Return true if the code of this rtx pattern is EQ or NE.  */intequality_op (op, mode)     rtx op;     enum machine_mode mode ATTRIBUTE_UNUSED;{  return (GET_CODE (op) == EQ || GET_CODE (op) == NE);}/* Return true if the code of this rtx pattern is pc or label_ref.  */intpc_or_label_ref (op, mode)     rtx op;     enum machine_mode mode ATTRIBUTE_UNUSED;{  return (GET_CODE (op) == PC || GET_CODE (op) == LABEL_REF);}/* Output to FILE the start of the assembler file.  *//* This definition must match lang_independent_options from toplev.c.  */struct m88k_lang_independent_options{  const char *const string;  int *const variable;  const int on_value;  const char *const description;};static void output_options PARAMS ((FILE *,				    const struct m88k_lang_independent_options *,				    int,				    const struct m88k_lang_independent_options *,				    int, int, int, const char *, const char *,				    const char *));static intoutput_option (file, sep, type, name, indent, pos, max)     FILE *file;     const char *sep;     const char *type;     const char *name;     const char *indent;     int pos;     int max;{  if ((long)(strlen (sep) + strlen (type) + strlen (name) + pos) > max)    {      fprintf (file, indent);      return fprintf (file, "%s%s", type, name);    }  return pos + fprintf (file, "%s%s%s", sep, type, name);}static const struct { const char *const name; const int value; } m_options[] =TARGET_SWITCHES;static voidoutput_options (file, f_options, f_len, W_options, W_len,		pos, max, sep, indent, term)     FILE *file;     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;     const char *sep;     const char *indent;     const char *term;{  register int j;  if (optimize)    pos = output_option (file, sep, "-O", "", indent, pos, max);  if (write_symbols != NO_DEBUG)    pos = output_option (file, sep, "-g", "", indent, pos, max);  if (profile_flag)    pos = output_option (file, sep, "-p", "", indent, pos, max);  for (j = 0; j < f_len; j++)    if (*f_options[j].variable == f_options[j].on_value)      pos = output_option (file, sep, "-f", f_options[j].string,			   indent, pos, max);  for (j = 0; j < W_len; j++)    if (*W_options[j].variable == W_options[j].on_value)      pos = output_option (file, sep, "-W", W_options[j].string,			   indent, pos, max);  for (j = 0; j < (long) ARRAY_SIZE (m_options); j++)    if (m_options[j].name[0] != '\0'	&& m_options[j].value > 0	&& ((m_options[j].value & target_flags)	    == m_options[j].value))      pos = output_option (file, sep, "-m", m_options[j].name,			   indent, pos, max);  if (m88k_short_data)    pos = output_option (file, sep, "-mshort-data-", m88k_short_data,			 indent, pos, max);  fprintf (file, term);}voidoutput_file_start (file, f_options, f_len, W_options, W_len)     FILE *file;     const struct m88k_lang_independent_options *f_options;     const struct m88k_lang_independent_options *W_options;     int f_len, W_len;{  register int pos;  ASM_FIRST_LINE (file);  if (TARGET_88110      && TARGET_SVR4)    fprintf (file, "%s\n", REQUIRES_88110_ASM_OP);  output_file_directive (file, main_input_filename);  /* Switch to the data section so that the coffsem symbol     isn't in the text section.  */  ASM_COFFSEM (file);  if (TARGET_IDENTIFY_REVISION)    {      char indent[256];      time_t now = time ((time_t *)0);      sprintf (indent, "]\"\n%s\"@(#)%s [", IDENT_ASM_OP, main_input_filename);      fprintf (file, indent+3);      pos = fprintf (file, "gcc %s, %.24s,", version_string, ctime (&now));#if 1      /* ??? It would be nice to call print_switch_values here (and thereby	 let us delete output_options) but this is kept in until it is known	 whether the change in content format matters.  */      output_options (file, f_options, f_len, W_options, W_len,		      pos, 150 - strlen (indent), " ", indent, "]\"\n\n");#else      fprintf (file, "]\"\n");      print_switch_values (file, 0, 150 - strlen (indent),			   indent + 3, " ", "]\"\n");#endif    }}/* Output an ascii string.  */voidoutput_ascii (file, opcode, max, p, size)     FILE *file;     const char *opcode;     int max;     const char *p;     int size;{  int i;  int in_escape = 0;  register int num = 0;  fprintf (file, "%s\"", opcode);  for (i = 0; i < size; i++)    {      register int c = (unsigned char) p[i];      if (num > max)	{	  fprintf (file, "\"\n%s\"", opcode);	  num = 0;	}	        if (c == '\"' || c == '\\')	{	escape:	  putc ('\\', file);	  putc (c, file);	  num += 2;	  in_escape = 0;	}      else if (in_escape && ISDIGIT (c))	{	  /* If a digit follows an octal-escape, the VAX assembler fails	     to stop reading the escape after three digits.  Continue to	     output the values as an octal-escape until a non-digit is	     found.  */	  fprintf (file, "\\%03o", c);	  num += 4;	}      else if ((c >= ' ' && c < 0177) || (c == '\t'))	{	  putc (c, file);	  num++;	  in_escape = 0;	}      else	{	  switch (c)	    {	      /* Some assemblers can't handle \a, \v, or \?.  */	    case '\f': c = 'f'; goto escape;	    case '\b': c = 'b'; goto escape;	    case '\r': c = 'r'; goto escape;	    case '\n': c = 'n'; goto escape;	    }	  fprintf (file, "\\%03o", c);	  num += 4;	  in_escape = 1;	}    }  fprintf (file, "\"\n");}/* Output a label (allows insn-output.c to be compiled without including   m88k.c or needing to include stdio.h).  */voidoutput_label (label_number)     int label_number;{  ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L", label_number);}/* Generate the assembly code for function entry.   The prologue is responsible for setting up the stack frame,   initializing the frame pointer register, saving registers that must be   saved, and allocating SIZE additional bytes of storage for the   local variables.  SIZE is an integer.  FILE is a stdio   stream to which the assembler code should be output.   The label for the beginning of the function need not be output by this   macro.  That has already been done when the macro is run.   To determine which registers to save, the macro can refer to the array   `regs_ever_live': element R is nonzero if hard register   R is used anywhere within the function.  This implies the   function prologue should save register R, but not if it is one   of the call-used registers.   On machines where functions may or may not have frame-pointers, the   function entry code must vary accordingly; it must set up the frame   pointer if one is wanted, and not otherwise.  To determine whether a   frame pointer is in wanted, the macro can refer to the variable   `frame_pointer_needed'.  The variable's value will be 1 at run   time in a function that needs a frame pointer.   On machines where an argument may be passed partly in registers and   partly in memory, this macro must examine the variable   `current_function_pretend_args_size', and allocate that many bytes   of uninitialized space on the stack just underneath the first argument   arriving on the stack.  (This may not be at the very end of the stack,   if the calling sequence has pushed anything else since pushing the stack   arguments.  But usually, on such machines, nothing else has been pushed   yet, because the function prologue itself does all the pushing.)   If `ACCUMULATE_OUTGOING_ARGS' is defined, the variable   `current_function_outgoing_args_size' contains the size in bytes   required for the outgoing arguments.  This macro must add that   amount of uninitialized space to very bottom of the stack.   The stack frame we use looks like this: caller                                                  callee        |==============================================|        |                caller's frame                |        |==============================================|        |     [caller's outgoing memory arguments]     |        |==============================================|        |  caller's outgoing argument area (32 bytes)  |  sp -> |==============================================| <- ap        |            [local variable space]            |        |----------------------------------------------|        |            [return address (r1)]             |        |----------------------------------------------|        |        [previous frame pointer (r30)]        |        |==============================================| <- fp        |       [preserved registers (r25..r14)]       |        |----------------------------------------------|        |       [preserved registers (x29..x22)]       |        |==============================================|        |    [dynamically allocated space (alloca)]    |        |==============================================|        |     [callee's outgoing memory arguments]     |        |==============================================|        | [callee's outgoing argument area (32 bytes)] |        |==============================================| <- sp  Notes:  r1 and r30 must be saved if debugging.  fp (if present) is located two words down from the local  variable space.  */static void emit_add PARAMS ((rtx, rtx, int));static void preserve_registers PARAMS ((int, int));static void emit_ldst PARAMS ((int, int, enum machine_mode, int));static void output_tdesc PARAMS ((FILE *, int));static int uses_arg_area_p PARAMS ((void));static int  nregs;static int  nxregs;static char save_regs[FIRST_PSEUDO_REGISTER];static int  frame_laid_out;static int  frame_size;static int  variable_args_p;static int  epilogue_marked;static int  prologue_marked;#define FIRST_OCS_PRESERVE_REGISTER	14#define LAST_OCS_PRESERVE_REGISTER	30#define FIRST_OCS_EXTENDED_PRESERVE_REGISTER	(32 + 22)#define LAST_OCS_EXTENDED_PRESERVE_REGISTER	(32 + 31)#define STACK_UNIT_BOUNDARY (STACK_BOUNDARY / BITS_PER_UNIT)#define ROUND_CALL_BLOCK_SIZE(BYTES) \  (((BYTES) + (STACK_UNIT_BOUNDARY - 1)) & ~(STACK_UNIT_BOUNDARY - 1))/* Establish the position of the FP relative to the SP.  This is done   either during output_function_prologue() or by   INITIAL_ELIMINATION_OFFSET.  */voidm88k_layout_frame (){  int regno, sp_size;  frame_laid_out++;  memset ((char *) &save_regs[0], 0, sizeof (save_regs));  sp_size = nregs = nxregs = 0;  frame_size = get_frame_size ();  /* Since profiling requires a call, make sure r1 is saved.  */  if (current_function_profile)    save_regs[1] = 1;  /* If we are producing debug information, store r1 and r30 where the     debugger wants to find them (r30 at r30+0, r1 at r30+4).  Space has     already been reserved for r1/r30 in STARTING_FRAME_OFFSET.  */  if (write_symbols != NO_DEBUG && !TARGET_OCS_FRAME_POSITION)    save_regs[1] = 1;  /* If there is a call, alloca is used, __builtin_alloca is used, or     a dynamic-sized object is defined, add the 8 additional words     for the callee's argument area.  The common denominator is that the     FP is required.  may_call_alloca only gets calls to alloca;     current_function_calls_alloca gets alloca and __builtin_alloca.  */  if (regs_ever_live[1] || frame_pointer_needed)    {      save_regs[1] = 1;      sp_size += REG_PARM_STACK_SPACE (0);    }  /* If we are producing PIC, save the addressing base register and r1.  */  if (flag_pic && current_function_uses_pic_offset_table)    {      save_regs[PIC_OFFSET_TABLE_REGNUM] = 1;      nregs++;    }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -