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

📄 tm-i860.h

📁 这是完整的gcc源代码
💻 H
📖 第 1 页 / 共 3 页
字号:
#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE)	\ ((CUM).ints = ((FNTYPE) != 0 && aggregate_value_p ((FNTYPE)) \		? 4 : 0),			\  (CUM).floats = 0)/* Machine-specific subroutines of the following macros.  */#define CEILING(X,Y)  (((X) + (Y) - 1) / (Y))#define ROUNDUP(X,Y)  (CEILING ((X), (Y)) * (Y))/* 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.)   Floats, and doubleword ints, are returned in f regs;   other ints, in r regs.   Aggregates, even short ones, are passed in memory.  */#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED)		\ ((TYPE) != 0 && (TREE_CODE ((TYPE)) == RECORD_TYPE		\		  || TREE_CODE ((TYPE)) == UNION_TYPE)		\  ? 0								\  : GET_MODE_CLASS ((MODE)) == MODE_FLOAT || (MODE) == DImode	\  ? ((CUM).floats = (ROUNDUP ((CUM).floats, GET_MODE_SIZE ((MODE)))	\		     + ROUNDUP (GET_MODE_SIZE (MODE), 4)))	\  : GET_MODE_CLASS ((MODE)) == MODE_INT				\  ? ((CUM).ints = (ROUNDUP ((CUM).ints, GET_MODE_SIZE ((MODE))) \		   + ROUNDUP (GET_MODE_SIZE (MODE), 4)))	\  : 0)/* 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 i860, the first 12 words of integer arguments go in r16-r27,   and the first 8 words of floating arguments go in f8-f15.   DImode values are treated as floats.  */#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED)		\ ((TYPE) != 0 && (TREE_CODE ((TYPE)) == RECORD_TYPE	\		  || TREE_CODE ((TYPE)) == UNION_TYPE)	\  ? 0							\  : GET_MODE_CLASS ((MODE)) == MODE_FLOAT || (MODE) == DImode	\  ? (ROUNDUP ((CUM).floats, GET_MODE_SIZE ((MODE))) < 32	\     ? gen_rtx (REG, (MODE),				\		40+(ROUNDUP ((CUM).floats,		\			     GET_MODE_SIZE ((MODE)))	\		    / 4))				\     : 0)						\  : GET_MODE_CLASS ((MODE)) == MODE_INT			\  ? (ROUNDUP ((CUM).ints, GET_MODE_SIZE ((MODE))) < 48	\     ? gen_rtx (REG, (MODE),				\		16+(ROUNDUP ((CUM).ints,		\			     GET_MODE_SIZE ((MODE)))	\		    / 4))				\     : 0)						\  : 0)/* 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[];					\  int fsize = (SIZE);						\  int nregs, i;							\  for (i = 0, nregs = 0; i < FIRST_PSEUDO_REGISTER; i++)	\    {								\      if (regs_ever_live[i] && ! call_used_regs[i])		\        nregs++;						\    }								\  fsize += nregs * 4 + 8;					\  fsize = (fsize + 15) & -16;					\  if (fsize > 0x7fff)						\    {								\      fprintf (FILE, "\tadds -16,sp,sp\n");			\      fprintf (FILE, "\tst.l fp,8(sp)\n");			\      fprintf (FILE, "\tst.l r1,12(sp)\n");			\      fprintf (FILE, "\tadds 8,sp,fp\n");			\      fprintf (FILE, "\torh %d,r0,r31\n", (fsize - 16) >> 16);	\      fprintf (FILE, "\tor %d,r31,r31\n", (fsize - 16) & 0xffff); \      fprintf (FILE, "\tsubs sp,r31,sp\n");			\    }								\  else								\    {								\      fprintf (FILE, "\tadds -%d,sp,sp\n", fsize);		\      fprintf (FILE, "\tst.l fp,%d(sp)\n", fsize - 8);		\      fprintf (FILE, "\tst.l r1,%d(sp)\n", fsize - 4);		\      fprintf (FILE, "\tadds %d,sp,fp\n", fsize - 8);		\    }								\  for (i = 0, nregs = 0; i < 32; i++)				\    if (regs_ever_live[i] && ! call_used_regs[i])		\      fprintf (FILE, "\tst.l %s,%d(sp)\n",			\	       reg_names[i], 4 * nregs++);			\  for (i = 32; i < 64; i++)					\    if (regs_ever_live[i] && ! call_used_regs[i])		\      fprintf (FILE, "\tfst.l %s,%d(sp)\n",			\	       reg_names[i], 4 * nregs++);			\}/* ??? maybe save pairs or quads of fp registers.  *//* 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.  *//* #define EXIT_IGNORE_STACK 0 *//* 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[];					\  int fsize = (SIZE);						\  int nregs, i;							\  for (i = 0, nregs = 0; i < FIRST_PSEUDO_REGISTER; i++)	\    {								\      if (regs_ever_live[i] && ! call_used_regs[i])		\        nregs++;						\    }								\  fsize += nregs * 4 + 8;					\  fsize = (fsize + 15) & -16;					\  if (fsize < 0x7fff)						\    {								\      for (i = 0, nregs = 0; i < 32; i++)			\	if (regs_ever_live[i] && ! call_used_regs[i])		\	  fprintf (FILE, "\tld.l %d(fp),%s\n",			\		   4 * nregs++ - (fsize - 8), reg_names[i]);	\      for (i = 32; i < 64; i++)					\	if (regs_ever_live[i] && ! call_used_regs[i])		\	  fprintf (FILE, "\tfld.l %d(fp),%s\n",			\		   4 * nregs++ - (fsize - 8), reg_names[i]);	\    }								\  else								\    {								\      fprintf (FILE, "\torh %d,r0,r31\n", (fsize - 8) >> 16);	\      fprintf (FILE, "\tor %d,r31,r31\n", (fsize - 8) & 0xffff); \      fprintf (FILE, "\tsubs fp,r31,sp\n");			\      for (i = 0, nregs = 0; i < 32; i++)			\	if (regs_ever_live[i] && ! call_used_regs[i])		\	  fprintf (FILE, "\tld.l %d(sp),%s\n",			\		   4 * nregs++, reg_names[i]);			\      for (i = 32; i < 64; i++)					\	if (regs_ever_live[i] && ! call_used_regs[i])		\	  fprintf (FILE, "\tfld.l %d(sp),%s\n",			\		   4 * nregs++, reg_names[i]);			\    }								\  if (fsize < 0x7fff)						\    {								\      fprintf (FILE, "\tld.l 4(fp),r1\n");			\      fprintf (FILE, "\tld.l 0(fp),fp\n");			\      fprintf (FILE, "\tbri r1\n\taddu %d,sp,sp\n", fsize);	\    }								\  else								\    {								\      fprintf (FILE, "\tld.l 4(fp),r1\n");			\      fprintf (FILE, "\tadds 8,fp,r31\n");			\      fprintf (FILE, "\tld.l 0(fp),fp\n");			\      fprintf (FILE, "\tbri r1\n\tmov r31,sp\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)  abort ();/* 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)#define REGNO_OK_FOR_FP_P(REGNO) \(((REGNO) ^ 0x20) < 32 || (unsigned) (reg_renumber[REGNO] ^ 0x20) < 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 i860, and may be used only   in code for printing assembler insns and in conditions for   define_optimization.  *//* 1 if X is an fp register.  */#define FP_REG_P(X) (REG_P (X) && REGNO_OK_FOR_FP_P (REGNO (X)))/* 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.   On the Sparc, this is anything but a CONST_DOUBLE.   Let's try permitting CONST_DOUBLEs and see what happens.  */#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) (((unsigned) REGNO (X)) - 32 >= 14)/* 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) (((unsigned) REGNO (X)) - 32 >= 14)#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 i860, the actual 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.   The displacement in an address must be a multiple of the alignment.   Try making SYMBOL_REF (and other things which are CONSTANT_ADDRESS_P)   a legitimate address, regardless.  Because the only insns which can use   memory are load or store insns, the added hair in the machine description   is not that bad.  It should also speed up the compiler by halving the number   of insns it must manage for each (MEM (SYMBOL_REF ...)) involved.  */#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)		\{ if (GET_CODE (X) == REG)				\    { if (REG_OK_FOR_BASE_P (X)) goto ADDR; }		\  else if (GET_CODE (X) == PLUS)			\    {							\      if (GET_CODE (XEXP (X, 0)) == REG			\	  && REG_OK_FOR_BASE_P (XEXP (X, 0)))		\	{						\	  if (GET_CODE (XEXP (X, 1)) == CONST_INT	\	      && INTVAL (XEXP (X, 1)) >= -0x8000	\	      && INTVAL (XEXP (X, 1)) < 0x8000		\	      && (INTVAL (XEXP (X, 1)) & (GET_MODE_SIZE (MODE) - 1)) == 0) \	    goto ADDR;					\	}						\      else if (GET_CODE (XEXP (X, 1)) == REG		\	  && REG_OK_FOR_BASE_P (XEXP (X, 1)))		\	{						\	  if (GET_CODE (XEXP (X, 0)) == CONST_INT	\	      && INTVAL (XEXP (X, 0)) >= -0x8000	\	      && INTVAL (XEXP (X, 0)) < 0x8000		\	      && (INTVAL (XEXP (X, 0)) & (GET_MODE_SIZE (MODE) - 1)) == 0) \	    goto ADDR;					\	}						\    }							\  else if (CONSTANT_ADDRESS_P (X))			\    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 i860, change COMPLICATED + CONSTANT to REG+CONSTANT.   Also change a symbolic constant to a REG,   though that may not be necessary.  */#define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN)	\{ 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 (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == PLUS)	\    (X) = gen_rtx (PLUS, SImode, XEXP (X, 1),			\		   force_operand (XEXP (X, 0), 0));		\  if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 1)) == PLUS)	\    (X) = gen_rtx (PLUS, SImode, XEXP (X, 0),			\		   force_operand (XEXP (X, 1), 0));		\  if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) != REG	\      && GET_CODE (XEXP (X, 0)) != CONST_INT)			\    (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, 1)) != REG	\      && GET_CODE (XEXP (X, 1)) != CONST_INT)			\    (X) = gen_rtx (PLUS, SImode, XEXP (X, 0),			\		   copy_to_mode_reg (SImode, XEXP (X, 1)));	\  if (GET_CODE (x) == SYMBOL_REF)				\    (X) = copy_to_reg (X);					\  if (GET_CODE (x) == CONST)					\    (X) = copy_to_reg (X);					\  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 i860 this is never true.   There are some addresses that are invalid in wide modes   but valid for narrower modes, but they shouldn't cause trouble.  */#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL)/* On the 860, every legit address is offsettable,   but GCC would have trouble figuring this out.  */#define OFFSETTABLE_ADDRESS_P(MODE, ADDR) (memory_address_p ((MODE), (ADDR)))/* Specify the machine mode that this machine uses   for the index in the tablejump instruction.  */#define CASE_VECTOR_MODE SImode/* Define this if the tablejump instruction expects the table   to contain offsets from the address of the table.   Do not define this if the table should contain absolute addresses.  *//* #define CASE_VECTOR_PC_RELATIVE *//* Specify the tree operation to be used to convert reals to integers.  */#define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR/* This is the kind of divide that is easiest to do in the general case.  */#define EASY_DIV_EXPR TRUNC_DIV_EXPR/* Must pass floats to gnulib functions as doubles.  */#define GNULIB_NEEDS_DOUBLE 1#define DIVSI3_LIBCALL "*.div"#define UDIVSI3_LIBCALL "*.udiv"#define REMSI3_LIBCALL "*.rem"#define UREMSI3_LIBCALL "*.urem"/* Define this as 1 if `char' should by default be signed; else as 0.  */#define DEFAULT_SIGNED_CHAR 1

⌨️ 快捷键说明

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