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

📄 m68k.h

📁 gcc库的原代码,对编程有很大帮助.
💻 H
📖 第 1 页 / 共 5 页
字号:
#define FP_REG_P(X) (REG_P (X) && REGNO_OK_FOR_FP_P (REGNO (X)))/* 1 if X is an address register  */#define ADDRESS_REG_P(X) (REG_P (X) && REGNO_OK_FOR_BASE_P (REGNO (X)))#ifdef SUPPORT_SUN_FPA/* 1 if X is a register in the Sun FPA.  */#define FPA_REG_P(X) (REG_P (X) && REGNO_OK_FOR_FPA_P (REGNO (X)))#else/* Answer must be no if we don't have an FPA.  */#define FPA_REG_P(X) 0#endif/* 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)   \  (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF		\   || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST		\   || GET_CODE (X) == HIGH)/* 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/* Nonzero if the constant value X is a legitimate general operand   when generating PIC code.  It is given that flag_pic is on and    that X satisfies CONSTANT_P or is a CONST_DOUBLE.  */#define LEGITIMATE_PIC_OPERAND_P(X)	\  ((! symbolic_operand (X, VOIDmode)				\    && ! (GET_CODE (X) == CONST_DOUBLE && CONST_DOUBLE_MEM (X)	\	  && GET_CODE (CONST_DOUBLE_MEM (X)) == MEM		\	  && symbolic_operand (XEXP (CONST_DOUBLE_MEM (X), 0),	\			       VOIDmode)))			\   || (GET_CODE (X) == SYMBOL_REF && SYMBOL_REF_FLAG (X)))/* 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) ((REGNO (X) ^ 020) >= 8)/* 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) ((REGNO (X) & ~027) != 0)#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.   When generating PIC, an address involving a SYMBOL_REF is legitimate   if and only if it is the sum of pic_offset_table_rtx and the SYMBOL_REF.   We use LEGITIMATE_PIC_OPERAND_P to throw out the illegitimate addresses,   and we explicitly check for the sum of pic_offset_table_rtx and a SYMBOL_REF.   Likewise for a LABEL_REF when generating PIC.   The other macros defined here are used only in GO_IF_LEGITIMATE_ADDRESS.  *//* Allow SUBREG everywhere we allow REG.  This results in better code.  It   also makes function inlining work when inline functions are called with   arguments that are SUBREGs.  */#define LEGITIMATE_BASE_REG_P(X)   \  ((GET_CODE (X) == REG && REG_OK_FOR_BASE_P (X))	\   || (GET_CODE (X) == SUBREG				\       && GET_CODE (SUBREG_REG (X)) == REG		\       && REG_OK_FOR_BASE_P (SUBREG_REG (X))))#define INDIRECTABLE_1_ADDRESS_P(X)  \  ((CONSTANT_ADDRESS_P (X) && (!flag_pic || LEGITIMATE_PIC_OPERAND_P (X))) \   || LEGITIMATE_BASE_REG_P (X)						\   || ((GET_CODE (X) == PRE_DEC || GET_CODE (X) == POST_INC)		\       && LEGITIMATE_BASE_REG_P (XEXP (X, 0)))				\   || (GET_CODE (X) == PLUS						\       && LEGITIMATE_BASE_REG_P (XEXP (X, 0))				\       && GET_CODE (XEXP (X, 1)) == CONST_INT				\       && ((unsigned) INTVAL (XEXP (X, 1)) + 0x8000) < 0x10000)		\   || (GET_CODE (X) == PLUS && XEXP (X, 0) == pic_offset_table_rtx 	\       && flag_pic && GET_CODE (XEXP (X, 1)) == SYMBOL_REF)		\   || (GET_CODE (X) == PLUS && XEXP (X, 0) == pic_offset_table_rtx 	\       && flag_pic && GET_CODE (XEXP (X, 1)) == LABEL_REF))		\#if 0/* This should replace the last two (non-pic) lines   except that Sun's assembler does not seem to handle such operands.  */       && (TARGET_68020 ? CONSTANT_ADDRESS_P (XEXP (X, 1))		\	   : (GET_CODE (XEXP (X, 1)) == CONST_INT			\	      && ((unsigned) INTVAL (XEXP (X, 1)) + 0x8000) < 0x10000))))#endif#define GO_IF_NONINDEXED_ADDRESS(X, ADDR)  \{ if (INDIRECTABLE_1_ADDRESS_P (X)) goto ADDR; }/* Only labels on dispatch tables are valid for indexing from.  */#define GO_IF_INDEXABLE_BASE(X, ADDR)				\{ rtx temp;							\  if (GET_CODE (X) == LABEL_REF					\      && (temp = next_nonnote_insn (XEXP (X, 0))) != 0		\      && GET_CODE (temp) == JUMP_INSN				\      && (GET_CODE (PATTERN (temp)) == ADDR_VEC			\	  || GET_CODE (PATTERN (temp)) == ADDR_DIFF_VEC))	\    goto ADDR;							\  if (LEGITIMATE_BASE_REG_P (X)) goto ADDR; }#define GO_IF_INDEXING(X, ADDR)	\{ if (GET_CODE (X) == PLUS && LEGITIMATE_INDEX_P (XEXP (X, 0)))		\    { GO_IF_INDEXABLE_BASE (XEXP (X, 1), ADDR); }			\  if (GET_CODE (X) == PLUS && LEGITIMATE_INDEX_P (XEXP (X, 1)))		\    { GO_IF_INDEXABLE_BASE (XEXP (X, 0), ADDR); } }#define GO_IF_INDEXED_ADDRESS(X, ADDR)	 \{ GO_IF_INDEXING (X, ADDR);						\  if (GET_CODE (X) == PLUS)						\    { if (GET_CODE (XEXP (X, 1)) == CONST_INT				\	  && (unsigned) INTVAL (XEXP (X, 1)) + 0x80 < 0x100)		\	{ rtx go_temp = XEXP (X, 0); GO_IF_INDEXING (go_temp, ADDR); }	\      if (GET_CODE (XEXP (X, 0)) == CONST_INT				\	  && (unsigned) INTVAL (XEXP (X, 0)) + 0x80 < 0x100)		\	{ rtx go_temp = XEXP (X, 1); GO_IF_INDEXING (go_temp, ADDR); } } }#define LEGITIMATE_INDEX_REG_P(X)   \  ((GET_CODE (X) == REG && REG_OK_FOR_INDEX_P (X))	\   || (GET_CODE (X) == SIGN_EXTEND			\       && GET_CODE (XEXP (X, 0)) == REG			\       && GET_MODE (XEXP (X, 0)) == HImode		\       && REG_OK_FOR_INDEX_P (XEXP (X, 0)))		\   || (GET_CODE (X) == SUBREG				\       && GET_CODE (SUBREG_REG (X)) == REG		\       && REG_OK_FOR_INDEX_P (SUBREG_REG (X))))#define LEGITIMATE_INDEX_P(X)   \   (LEGITIMATE_INDEX_REG_P (X)				\    || (TARGET_68020 && GET_CODE (X) == MULT		\	&& LEGITIMATE_INDEX_REG_P (XEXP (X, 0))		\	&& GET_CODE (XEXP (X, 1)) == CONST_INT		\	&& (INTVAL (XEXP (X, 1)) == 2			\	    || INTVAL (XEXP (X, 1)) == 4		\	    || INTVAL (XEXP (X, 1)) == 8)))/* If pic, we accept INDEX+LABEL, which is what do_tablejump makes.  */#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)				\{ GO_IF_NONINDEXED_ADDRESS (X, ADDR);					\  GO_IF_INDEXED_ADDRESS (X, ADDR);					\  if (flag_pic && MODE == CASE_VECTOR_MODE && GET_CODE (X) == PLUS	\      && LEGITIMATE_INDEX_P (XEXP (X, 0))				\      && GET_CODE (XEXP (X, 1)) == LABEL_REF)				\    goto ADDR; }/* Don't call memory_address_noforce for the address to fetch   the switch offset.  This address is ok as it stands (see above),   but memory_address_noforce would alter it.  */#define PIC_CASE_VECTOR_ADDRESS(index) index/* 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.   For the 68000, we handle X+REG by loading X into a register R and   using R+REG.  R will go in an address reg and indexing will be used.   However, if REG is a broken-out memory address or multiplication,   nothing needs to be done because REG can certainly go in an address reg.  */#define COPY_ONCE(Y) if (!copied) { Y = copy_rtx (Y); copied = ch = 1; }#define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN)   \{ register int ch = (X) != (OLDX);					\  if (GET_CODE (X) == PLUS)						\    { int copied = 0;							\      if (GET_CODE (XEXP (X, 0)) == MULT)				\	{ COPY_ONCE (X); XEXP (X, 0) = force_operand (XEXP (X, 0), 0);}	\      if (GET_CODE (XEXP (X, 1)) == MULT)				\	{ COPY_ONCE (X); XEXP (X, 1) = force_operand (XEXP (X, 1), 0);}	\      if (ch && GET_CODE (XEXP (X, 1)) == REG				\	  && GET_CODE (XEXP (X, 0)) == REG)				\	goto WIN;							\      if (ch) { GO_IF_LEGITIMATE_ADDRESS (MODE, X, WIN); }		\      if (GET_CODE (XEXP (X, 0)) == REG					\	       || (GET_CODE (XEXP (X, 0)) == SIGN_EXTEND		\		   && GET_CODE (XEXP (XEXP (X, 0), 0)) == REG		\		   && GET_MODE (XEXP (XEXP (X, 0), 0)) == HImode))	\	{ register rtx temp = gen_reg_rtx (Pmode);			\	  register rtx val = force_operand (XEXP (X, 1), 0);		\	  emit_move_insn (temp, val);					\	  COPY_ONCE (X);						\	  XEXP (X, 1) = temp;						\	  goto WIN; }							\      else if (GET_CODE (XEXP (X, 1)) == REG				\	       || (GET_CODE (XEXP (X, 1)) == SIGN_EXTEND		\		   && GET_CODE (XEXP (XEXP (X, 1), 0)) == REG		\		   && GET_MODE (XEXP (XEXP (X, 1), 0)) == HImode))	\	{ register rtx temp = gen_reg_rtx (Pmode);			\	  register rtx val = force_operand (XEXP (X, 0), 0);		\	  emit_move_insn (temp, val);					\	  COPY_ONCE (X);						\	  XEXP (X, 0) = temp;						\	  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 68000, only predecrement and postincrement address depend thus   (the amount of decrement or increment being the length of the operand).  */#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL)	\ if (GET_CODE (ADDR) == POST_INC || GET_CODE (ADDR) == PRE_DEC) goto LABEL/* Specify the machine mode that this machine uses   for the index in the tablejump instruction.  */#define CASE_VECTOR_MODE HImode/* 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/* Don't cse the address of the function being compiled.  */#define NO_RECURSIVE_FUNCTION_CSE/* Max number of bytes we can move from memory to memory   in one reasonably fast instruction.  */#define MOVE_MAX 4/* Define this if zero-extension is slow (more than one real instruction).  */#define SLOW_ZERO_EXTEND/* Nonzero if access to memory by bytes is slow and undesirable.  */#define SLOW_BYTE_ACCESS 0/* 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/* 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/* 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 QImode/* 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,OUTER_CODE) \  case CONST_INT:						\    /* Constant zero is super cheap due to clr instruction.  */	\    if (RTX == const0_rtx) return 0;				\    /* if ((OUTER_CODE) == SET) */				\      return const_int_cost(RTX);				\  case CONST:							\  case LABEL_REF:						\  case SYMBOL_REF:						\    return 3;							\  case CONST_DOUBLE:						\    return 5;/* Compute the cost of various arithmetic operations.   These are vaguely right for a 68020.  *//* The costs for long multiply have been adjusted to   work properly in synth_mult on the 68020,   relative to an average of the time for add and the time for shift,   taking away a little more because sometimes move insns are needed.  *//* div?.w is relatively cheaper on 68000 counted in COSTS_N_INSNS terms.  */#define MULL_COST (TARGET_68040 ? 5 : 13)#define MULW_COST (TARGET_68040 ? 3 : TARGET_68020 ? 8 : 5)#define DIVW_COST (TARGET_68020 ? 27 : 12)#define RTX_COSTS(X,CODE,OUTER_CODE)				\  case PLUS:							\    /* An lea costs about three times as much as a simple add.  */  \    if (GET_MODE (X) == SImode					\	&& GET_CODE (XEXP (X, 0)) == REG			\	&& GET_CODE (XEXP (X, 1)) == MULT			\	&& GET_CODE (XEXP (XEXP (X, 1), 0)) == REG		\	&& GET_CODE (XEXP (XEXP (X, 1), 1)) == CONST_INT	\	&& (INTVAL (XEXP (XEXP (X, 1), 1)) == 2			\	    || INTVAL (XEXP (XEXP (X, 1), 1)) == 4		\	    || INTVAL (XEXP (XEXP (X, 1), 1)) == 8))		\      return COSTS_N_INSNS (3);	 /* lea an@(dx:l:i),am */	\    break;							\  case ASHIFT:							\  case ASHIFTRT:						\  case LSHIFTRT:							\    if (! TARGET_68020)							\      {									\	if (GET_CODE (XEXP (X, 1)) == CONST_INT)			\	  {								\	    if (INTVAL (XEXP (X, 1)) < 16)				\	      return COSTS_N_INSNS (2) + INTVAL (XEXP (X, 1)) / 2;	\	    else							\	      /* We're using clrw + swap for these cases.  */		\

⌨️ 快捷键说明

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