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

📄 tm-m88k.h

📁 这是完整的gcc源代码
💻 H
📖 第 1 页 / 共 3 页
字号:
   For a library call, FNTYPE is 0.   On the m88000, the offset normally starts at 0, but starts at 4 bytes   when the function gets a structure-value-address as an   invisible first argument.  */#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE)	\ ((CUM) = ((FNTYPE) != 0 && aggregate_value_p ((FNTYPE))))/* Update the data in CUM to advance over an argument   of mode MODE and data type TYPE.   (TYPE is null for libcalls where that information may not be available.)  */#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED)	\ ((CUM) += ((MODE) != BLKmode			\	    ? (GET_MODE_SIZE (MODE) + 3) / 4	\	    : (int_size_in_bytes (TYPE) + 3) / 4))/* Determine where to put an argument to a function.   Value is zero to push the argument on the stack,   or a hard register in which to store the argument.   MODE is the argument's machine mode.   TYPE is the data type of the argument (as a tree).    This is null for libcalls where that information may    not be available.   CUM is a variable of type CUMULATIVE_ARGS which gives info about    the preceding args and about the function being called.   NAMED is nonzero if this argument is a named parameter    (otherwise it is an extra parameter matching an ellipsis).  *//* On the m88000 the first eight words of args are normally in registers   and the rest are pushed.  But any arg that won't entirely fit in regs   is pushed.  */#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED)		\(8 >= ((CUM)						\       + ((MODE) == BLKmode				\	  ? (int_size_in_bytes (TYPE) + 3) / 4		\	  : (GET_MODE_SIZE (MODE) + 3) / 4))		\ ? gen_rtx (REG, (MODE), 2 + (CUM))			\ : 0)/* Define where a function finds its arguments.   This would be different from FUNCTION_ARG if we had register windows.  */#define FUNCTION_INCOMING_ARG(CUM, MODE, TYPE, NAMED)	\  FUNCTION_ARG (CUM, MODE, TYPE, NAMED)/* For an arg passed partly in registers and partly in memory,   this is the number of registers used.   For args passed entirely in registers or entirely in memory, zero.  */#define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) 0/* This macro generates the assembly code for function entry.   FILE is a stdio stream to output the code to.   SIZE is an int: how many units of temporary storage to allocate.   Refer to the array `regs_ever_live' to determine which registers   to save; `regs_ever_live[I]' is nonzero if register number I   is ever used in the function.  This macro is responsible for   knowing which registers should not be saved even if used.  */#define FUNCTION_PROLOGUE(FILE, SIZE)				\{								\  extern char call_used_regs[];					\  extern int current_function_pretend_args_size;		\  extern int frame_pointer_needed;				\  int fsize = ((SIZE) + current_function_pretend_args_size + 7) & ~7;	\  int regno, nregs, i;						\  int offset = 0;						\  for (regno = 2, nregs = 0; regno < FRAME_POINTER_REGNUM; regno++)	\    if (regs_ever_live[regno] && ! call_used_regs[regno])	\      nregs++;							\  nregs = (nregs + 1) & ~1;					\  if (regs_ever_live[1] + frame_pointer_needed + nregs)		\    {								\      if (fsize + 8 + nregs*4 < 0x10000)			\	offset = fsize;						\      fprintf (FILE, "\tsub r31,r31,%d\n", 8 + nregs*4 + offset);	\    }								\  if (frame_pointer_needed)					\    fprintf (FILE, "\tst r30,r31,%d\n", offset);		\  if (regs_ever_live[1])					\    fprintf (FILE, "\tst r1,r31,%d\n", 4 + offset);		\  if (nregs)							\    for (regno = 2, nregs = 2; regno < FRAME_POINTER_REGNUM; regno++)	\      if (regs_ever_live[regno] && ! call_used_regs[regno])	\	if (regno & 1 || !regs_ever_live[regno+1] || call_used_regs[regno+1])\	  fprintf (FILE, "\tst r%d,r31,%d\n", regno, offset + nregs++ * 4);\	else							\	  {							\	    fprintf (FILE, "\tst.d r%d,r31,%d\n", regno, offset + nregs * 4);\	    regno += 1; nregs += 2;				\	  }							\  if (offset || fsize == 0) /* do nothing.  */ ;		\  else if ((unsigned) fsize < 0x10000)				\    fprintf (FILE, "\tsub r31,r31,%d\n", fsize);		\  else fprintf (FILE, "\tor.u r25,r0,hi16(%d)\n\tor r25,r0,lo16(%d)\n\tsub r31,r31,r25\n", fsize, fsize); \  if (frame_pointer_needed) fprintf (FILE, "\tor r30,r0,r31\n");	\}/* Output assembler code to FILE to increment profiler label # LABELNO   for profiling a function entry.  */#define FUNCTION_PROFILER(FILE, LABELNO)  \   abort ();/* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,   the stack pointer does not matter.  The value is tested only in   functions that have frame pointers.   No definition is equivalent to always zero.  */extern int may_call_alloca;extern int current_function_pretend_args_size;#define EXIT_IGNORE_STACK	\ (get_frame_size () != 0	\  || may_call_alloca || current_function_pretend_args_size)/* This macro generates the assembly code for function exit,   on machines that need it.  If FUNCTION_EPILOGUE is not defined   then individual return instructions are generated for each   return statement.  Args are same as for FUNCTION_PROLOGUE.   The function epilogue should not depend on the current stack pointer!   It should use the frame pointer only.  This is mandatory because   of alloca; we also take advantage of it to omit stack adjustments   before returning.  */#define FUNCTION_EPILOGUE(FILE, SIZE)				\{								\  extern char call_used_regs[];					\  extern int may_call_alloca;					\  int fsize = ((SIZE) + current_function_pretend_args_size + 7) & ~7;	\  int nregs, regno, i;						\  for (regno = 2, nregs = 0; regno < FRAME_POINTER_REGNUM; regno++) \    if (regs_ever_live[regno] && ! call_used_regs[regno])	\      nregs++;							\  if (frame_pointer_needed)					\    {								\      if ((unsigned) fsize < 0x10000)				\	fprintf (FILE, "\tadd r31,r30,%d\n", fsize);		\      else fprintf (FILE, "\tor.u r25,r0,hi16(%d)\n\tor r25,r0,lo16(%d)\n\tadd r31,r30,r25\n", fsize, fsize); \    }								\  else if (fsize) fprintf (FILE, "\tadd r31,r31,%d\n", fsize);	\  if (nregs)							\    for (regno = 2, nregs = 2; regno < FRAME_POINTER_REGNUM; regno++) \      if (regs_ever_live[regno] && ! call_used_regs[regno])	\	if (regno & 1 || !regs_ever_live[regno+1] || call_used_regs[regno+1])\	  fprintf (FILE, "\tld r%d,r31,%d\n", regno, nregs++ * 4);\	else							\	  {							\	    fprintf (FILE, "\tld.d r%d,r31,%d\n", regno, nregs * 4);\	    regno += 1; nregs += 2;				\	  }							\  if (regs_ever_live[1])					\    fprintf (FILE, "\tld r1,r31,4\n");				\  else								\    fprintf (FILE, ";; r1 is set to go!\n");			\  if (frame_pointer_needed)					\    fprintf (FILE, "\tld r30,r31,0\n");				\  nregs = (nregs + 1) & ~1;					\  if (regs_ever_live[1] + frame_pointer_needed + (nregs > 2))	\    fprintf (FILE, "\tjmp.n r1\n\taddu r31,r31,%d\n", nregs * 4);	\  else fprintf (FILE, "\tjmp r1\n");				\  /* let insn reorganizer know that we are at the end of a function.  */ \  fprintf (FILE, "\tdata\n");					\}/* If the memory address ADDR is relative to the frame pointer,   correct it to be relative to the stack pointer instead.   This is for when we don't use a frame pointer.   ADDR should be a variable name.  */#define FIX_FRAME_POINTER_ADDRESS(ADDR,DEPTH)  \{ int offset = -1;							\  rtx regs = stack_pointer_rtx;						\  if (ADDR == frame_pointer_rtx)					\    offset = 0;								\  else if (GET_CODE (ADDR) == PLUS && XEXP (ADDR, 0) == frame_pointer_rtx \	   && GET_CODE (XEXP (ADDR, 1)) == CONST_INT)			\    offset = INTVAL (XEXP (ADDR, 1));					\  else if (GET_CODE (ADDR) == PLUS && XEXP (ADDR, 0) == frame_pointer_rtx) \    { rtx other_reg = XEXP (ADDR, 1);					\      offset = 0;							\      regs = gen_rtx (PLUS, Pmode, stack_pointer_rtx, other_reg); }	\  else if (GET_CODE (ADDR) == PLUS && XEXP (ADDR, 1) == frame_pointer_rtx) \    { rtx other_reg = XEXP (ADDR, 0);					\      offset = 0;							\      regs = gen_rtx (PLUS, Pmode, stack_pointer_rtx, other_reg); }	\  if (offset >= 0)							\    { int regno;							\      extern char call_used_regs[];					\      for (regno = 2; regno < FRAME_POINTER_REGNUM; regno++)		\	if (regs_ever_live[regno] && ! call_used_regs[regno])		\	  offset += 4;							\      offset -= 4;							\      ADDR = plus_constant (regs, offset + (DEPTH)); } }/* Addressing modes, and classification of registers for them.  *//* #define HAVE_POST_INCREMENT *//* #define HAVE_POST_DECREMENT *//* #define HAVE_PRE_DECREMENT *//* #define HAVE_PRE_INCREMENT *//* Macros to check register numbers against specific register classes.  *//* These assume that REGNO is a hard or pseudo reg number.   They give nonzero only if REGNO is a hard reg of the suitable class   or a pseudo reg currently allocated to a suitable hard reg.   Since they use reg_renumber, they are safe only once reg_renumber   has been allocated, which happens in local-alloc.c.  */#define REGNO_OK_FOR_INDEX_P(REGNO) \  ((REGNO) < 32 || (unsigned) reg_renumber[REGNO] < 32)#define REGNO_OK_FOR_BASE_P(REGNO)  \  ((REGNO) < 32 || (unsigned) reg_renumber[REGNO] < 32)/* Now macros that check whether X is a register and also,   strictly, whether it is in a specified class.   These macros are specific to the the m88000, and may be used only   in code for printing assembler insns and in conditions for   define_optimization.  *//* Maximum number of registers that can appear in a valid memory address.  */#define MAX_REGS_PER_ADDRESS 2/* Recognize any constant value that is a valid address.  */#define CONSTANT_ADDRESS_P(X)  CONSTANT_P (X)/* Nonzero if the constant value X is a legitimate general operand.   It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE.  */#define LEGITIMATE_CONSTANT_P(X) (1)/* The macros REG_OK_FOR..._P assume that the arg is a REG rtx   and check its validity for a certain class.   We have two alternate definitions for each of them.   The usual definition accepts all pseudo regs; the other rejects   them unless they have been allocated suitable hard regs.   The symbol REG_OK_STRICT causes the latter definition to be used.   Most source files want to accept pseudo regs in the hope that   they will get allocated to the class that the insn wants them to be in.   Source files for reload pass need to be strict.   After reload, it makes no difference, since pseudo regs have   been eliminated by then.  */#ifndef REG_OK_STRICT/* Nonzero if X is a hard reg that can be used as an index   or if it is a pseudo reg.  */#define REG_OK_FOR_INDEX_P(X) (1)/* Nonzero if X is a hard reg that can be used as a base reg   or if it is a pseudo reg.  */#define REG_OK_FOR_BASE_P(X) (1)#else/* Nonzero if X is a hard reg that can be used as an index.  */#define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))/* Nonzero if X is a hard reg that can be used as a base reg.  */#define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))#endif/* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression   that is a valid memory address for an instruction.   The MODE argument is the machine mode for the MEM expression   that wants to use this address.   On the m88000, the actual legitimate addresses must be REG+REG or REG+SMALLINT.   But we can treat a SYMBOL_REF as legitimate if it is part of this   function's constant-pool, because such addresses can actually   be output as REG+SMALLINT.  */#define INT_FITS_16_BITS(I) ((unsigned) (I) < 0x10000)#define FITS_16_BITS(X)	\   (GET_CODE (X) == CONST_INT && INT_FITS_16_BITS (INTVAL (X)))#define LEGITIMATE_INDEX_P(X, MODE)   \   (FITS_16_BITS (X)					\    || (REG_P (X)					\	&& REG_OK_FOR_INDEX_P (X))			\    || (GET_CODE (X) == MULT				\	&& REG_P (XEXP (X, 0))				\	&& REG_OK_FOR_INDEX_P (XEXP (X, 0))		\	&& GET_CODE (XEXP (X, 1)) == CONST_INT		\	&& (INTVAL (XEXP (X, 1)) == GET_MODE_SIZE (MODE)))	\    || (GET_CODE (X) == MULT				\	&& REG_P (XEXP (X, 1))				\	&& REG_OK_FOR_INDEX_P (XEXP (X, 1))		\	&& GET_CODE (XEXP (X, 0)) == CONST_INT		\	&& (INTVAL (XEXP (X, 0)) == GET_MODE_SIZE (MODE))	\        && (warning ("MULT backwards"), 1)))#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)  \{							\  if (GET_CODE (X) == CONST_INT)			\    {							\      if (FITS_16_BITS (X))				\	goto ADDR;					\    }							\  else if (CONSTANT_ADDRESS_P (X))			\    goto ADDR;						\  else if (REG_P (X))					\    {							\      if (REG_OK_FOR_BASE_P (X))			\	goto ADDR;					\    }							\  else if (GET_CODE (X) == PLUS)			\    if (REG_P (XEXP (X, 0))				\	&& REG_OK_FOR_BASE_P (XEXP (X, 0)))		\      {							\	if (LEGITIMATE_INDEX_P (XEXP (X, 1), MODE))	\	  goto ADDR;					\      }							\    else if (REG_P (XEXP (X, 1))			\	     && REG_OK_FOR_BASE_P (XEXP (X, 1)))	\      {							\	if (LEGITIMATE_INDEX_P (XEXP (X, 0), MODE))	\	  goto ADDR;					\      }							\}/* Try machine-dependent ways of modifying an illegitimate address   to be legitimate.  If we find one, return the new, valid address.   This macro is used in only one place: `memory_address' in explow.c.   OLDX is the address as it was before break_out_memory_refs was called.   In some cases it is useful to look at this to decide what needs to be done.   MODE and WIN are passed so that this macro can use   GO_IF_LEGITIMATE_ADDRESS.   It is always safe for this macro to do nothing.  It exists to recognize   opportunities to optimize the output.  *//* On the m88000, change REG+N into REG+REG, and REG+(X*Y) into REG+REG.  */#define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN)	\{ if (GET_CODE (X) == PLUS && CONSTANT_ADDRESS_P (XEXP (X, 1)))	\    (X) = gen_rtx (PLUS, SImode, XEXP (X, 0),			\		   copy_to_mode_reg (SImode, XEXP (X, 1)));	\  if (GET_CODE (X) == PLUS && CONSTANT_ADDRESS_P (XEXP (X, 0)))	\    (X) = gen_rtx (PLUS, SImode, XEXP (X, 1),			\		   copy_to_mode_reg (SImode, XEXP (X, 0)));	\  if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == MULT)	\    (X) = gen_rtx (PLUS, SImode, XEXP (X, 1),			\		   force_operand (XEXP (X, 0), 0));		\  if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 1)) == MULT)	\    (X) = gen_rtx (PLUS, SImode, XEXP (X, 0),			\		   force_operand (XEXP (X, 1), 0));		\  if (memory_address_p (MODE, X))				\    goto WIN; }/* Go to LABEL if ADDR (a legitimate address expression)   has an effect that depends on the machine mode it is used for.   On the the m88000 this is never true.  */#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL)/* Specify the machine mode that this machine uses   for the index in the tablejump instruction.  */#define CASE_VECTOR_MODE SImode/* Define this if a raw index is all that is needed for a   `tablejump' insn.  */#define CASE_TAKES_INDEX_RAW

⌨️ 快捷键说明

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