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

📄 tm-sparc.h

📁 这是完整的gcc源代码
💻 H
📖 第 1 页 / 共 4 页
字号:
    if (regs_ever_live[i]) { n_iregs = 96; break; }		\  actual_fsize = fsize + n_iregs + (n_fregs*4+7 & -8);		\  actual_fsize += current_function_pretend_args_size+7 & -8;	\  fsize += current_function_pretend_args_size+7 & -8;		\  if (n_fregs)							\    {								\      char *base;						\      int offset;						\      if (fsize < 4096)						\	{ base = "%fp"; offset = n_iregs - actual_fsize; }	\      else							\	{ base = "%g1"; offset = n_iregs;			\	  if (fsize < 4096)					\	    fprintf (FILE, "sethi %%hi(0x%x),%%g1\n\tadd %%g1,%%lo(0x%x),%%g1\n\tadd %%fp,%%g1,%%g1\n", -actual_fsize, -actual_fsize);\	}							\      for (i = 32, n_fregs = 0; i < FIRST_PSEUDO_REGISTER; i++)	\	if (regs_ever_live[i] && ! call_used_regs[i])		\	  {							\	    if (regs_ever_live[i+1] && ! call_used_regs[i+1])	\	      fprintf (FILE, "\tldd [%s%+d],%s\n",		\		       base, offset + 4 * n_fregs,		\		       reg_names[i]),				\	      n_fregs += 2, i += 1;				\	    else						\	      fprintf (FILE, "\tldf [%s%+d],%s\n",		\		       base, offset + 4 * n_fregs++,		\		       reg_names[i]);				\	  }							\    }								\  fprintf (FILE, "\tret\n\trestore\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 = 0; regno < FIRST_PSEUDO_REGISTER; 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)#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 SPARC, 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.   Anything but a CONST_DOUBLE can be made to work.  */#define LEGITIMATE_CONSTANT_P(X)		\ (GET_CODE (X) != CONST_DOUBLE)/* 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 >= 32)/* 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 >= 32)#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 SPARC, 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.   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)) == REG		\	      && REG_OK_FOR_INDEX_P (XEXP (X, 1)))	\	    goto ADDR;					\	  if (GET_CODE (XEXP (X, 1)) == CONST_INT	\	      && INTVAL (XEXP (X, 1)) >= -0x1000	\	      && INTVAL (XEXP (X, 1)) < 0x1000)		\	    goto ADDR;					\	}						\      else if (GET_CODE (XEXP (X, 1)) == REG		\	  && REG_OK_FOR_BASE_P (XEXP (X, 1)))		\	{						\	  if (GET_CODE (XEXP (X, 0)) == REG		\	      && REG_OK_FOR_INDEX_P (XEXP (X, 0)))	\	    goto ADDR;					\	  if (GET_CODE (XEXP (X, 0)) == CONST_INT	\	      && INTVAL (XEXP (X, 0)) >= -0x1000	\	      && INTVAL (XEXP (X, 0)) < 0x1000)		\	    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 SPARC, 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 (GET_CODE (x) == SYMBOL_REF)				\    (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 SPARC 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 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/* Define this as 1 if `char' should by default be signed; else as 0.  */#define DEFAULT_SIGNED_CHAR 1/* Max number of bytes we can move from memory to memory   in one reasonably fast instruction.  */#define MOVE_MAX 4/* Nonzero if access to memory by bytes is slow and undesirable.  */#define SLOW_BYTE_ACCESS 0/* We assume that the store-condition-codes instructions store 0 for false   and some other value for true.  This is the value stored for true.  */#define STORE_FLAG_VALUE 1/* When a prototype says `char' or `short', really pass an `int'.  */#define PROMOTE_PROTOTYPES/* Define if shifts truncate the shift count   which implies one can omit a sign-extension or zero-extension   of a shift count.  */#define SHIFT_COUNT_TRUNCATED/* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits   is done just by pretending it is already truncated.  */#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1/* Specify the machine mode that pointers have.   After generation of rtl, the compiler makes no further distinction   between pointers and any other objects of this machine mode.  */#define Pmode SImode/* A function address in a call instruction   is a byte address (for indexing purposes)   so give the MEM rtx a byte's mode.  */#define FUNCTION_MODE SImode/* Define this if addresses of constant functions   shouldn't be put through pseudo regs where they can be cse'd.   Desirable on machines where ordinary constants are expensive   but a CALL with constant address is cheap.  */#define NO_FUNCTION_CSE/* Define subroutines to call to handle multiply and divide.   Use the subroutines that Sun's library provides.   The `*' prevents an underscore from being prepended by the compiler.  */#define DIVSI3_LIBCALL "*.div"#define UDIVSI3_LIBCALL "*.udiv"#define MODSI3_LIBCALL "*.rem"#define UMODSI3_LIBCALL "*.urem"#define MULSI3_LIBCALL "*.mul"#define UMULSI3_LIBCALL "*.umul"/* Compute the cost of computing a constant rtl expression RTX   whose rtx-code is CODE.  The body of this macro is a portion   of a switch statement.  If the code is computed here,   return it with a return statement.  Otherwise, break from the switch.  */#define CONST_COSTS(RTX,CODE) \  case CONST_INT:						\    if (INTVAL (RTX) < 0x1000 && INTVAL (RTX) >= -0x1000) return 0; \  case CONST:							\  case LABEL_REF:						\  case SYMBOL_REF:						\    return 2;							\  case CONST_DOUBLE:						\    return 4;/* Tell final.c how to eliminate redundant test instructions.  *//* Here we define machine-dependent flags and fields in cc_status   (see `conditions.h').  *//* This holds the value sourcing %hi(%g1).  We keep this info   around so that mem/mem ops, such as increment and decrement,   etc, can be performed reasonably.  */#define CC_STATUS_MDEP rtx/* Nonzero if the results of the previous comparison are   in the floating point condition code register.  */#define CC_IN_FCCR 04000/* Nonzero if the results of the previous comparison are   int the coprocessor's condition code register.  */#define CC_IN_CCCR 010000/* Nonzero if we know (easily) that floating point register f0   (f1) contains the value 0.  */#define CC_F0_IS_0 020000#define CC_F1_IS_0 040000/* Nonzero if we know the value of %hi(%g1).  */#define CC_KNOW_HI_G1 0100000#define CC_STATUS_MDEP_INIT (cc_status.mdep = 0)/* Store in cc_status the expressions   that the condition codes will describe   after execution of an instruction whose pattern is EXP.   Do not alter them if the instruction would not alter the cc's.  */#define NOTICE_UPDATE_CC(EXP, INSN) \{ if (GET_CODE (EXP) == SET)					\    { if (SET_DEST (EXP) == cc0_rtx)				\	{ cc_status.flags = 0;					\	  cc_status.value1 = SET_DEST (EXP);			\	  cc_status.value2 = SET_SRC (EXP); }			\      else if (GET_CODE (SET_SRC (EXP)) == CALL)		\	{ CC_STATUS_INIT; }					\      else if (GET_CODE (SET_DEST (EXP)) == REG)		\	{ if (cc_status.value1					\	      && reg_overlap_mentioned_p (SET_DEST (EXP), cc_status.value1)) \

⌨️ 快捷键说明

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