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

📄 alpha.h

📁 GCC编译器源代码
💻 H
📖 第 1 页 / 共 5 页
字号:
}/* Now accept the simple address, or, for DImode only, an AND of a simple   address that turns off the low three bits.  */#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \{ GO_IF_LEGITIMATE_SIMPLE_ADDRESS (MODE, X, ADDR); \  if ((MODE) == DImode				\      && GET_CODE (X) == AND			\      && GET_CODE (XEXP (X, 1)) == CONST_INT	\      && INTVAL (XEXP (X, 1)) == -8)		\    GO_IF_LEGITIMATE_SIMPLE_ADDRESS (MODE, XEXP (X, 0), 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.    For the Alpha, there are three cases we handle:   (1) If the address is (plus reg const_int) and the CONST_INT is not a       valid offset, compute the high part of the constant and add it to the       register.  Then our address is (plus temp low-part-const).   (2) If the address is (const (plus FOO const_int)), find the low-order       part of the CONST_INT.  Then load FOO plus any high-order part of the       CONST_INT into a register.  Our address is (plus reg low-part-const).       This is done to reduce the number of GOT entries.   (3) If we have a (plus reg const), emit the load as in (2), then add       the two registers, and finally generate (plus reg low-part-const) as       our address.  */#define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN)			\{ if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == REG	\      && GET_CODE (XEXP (X, 1)) == CONST_INT			\      && ! CONSTANT_ADDRESS_P (XEXP (X, 1)))			\    {								\      HOST_WIDE_INT val = INTVAL (XEXP (X, 1));			\      HOST_WIDE_INT lowpart = (val & 0xffff) - 2 * (val & 0x8000); \      HOST_WIDE_INT highpart = val - lowpart;			\      rtx high = GEN_INT (highpart);				\      rtx temp = expand_binop (Pmode, add_optab, XEXP (x, 0),	\			       high, NULL_RTX, 1, OPTAB_LIB_WIDEN); \								\      (X) = plus_constant (temp, lowpart);			\      goto WIN;							\    }								\  else if (GET_CODE (X) == CONST				\	   && GET_CODE (XEXP (X, 0)) == PLUS			\	   && GET_CODE (XEXP (XEXP (X, 0), 1)) == CONST_INT)	\    {								\      HOST_WIDE_INT val = INTVAL (XEXP (XEXP (X, 0), 1));	\      HOST_WIDE_INT lowpart = (val & 0xffff) - 2 * (val & 0x8000); \      HOST_WIDE_INT highpart = val - lowpart;			\      rtx high = XEXP (XEXP (X, 0), 0);				\								\      if (highpart)						\	high = plus_constant (high, highpart);			\								\      (X) = plus_constant (force_reg (Pmode, high), lowpart);	\      goto WIN;							\    }								\  else if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == REG \	   && GET_CODE (XEXP (X, 1)) == CONST			\	   && GET_CODE (XEXP (XEXP (X, 1), 0)) == PLUS		\	   && GET_CODE (XEXP (XEXP (XEXP (X, 1), 0), 1)) == CONST_INT) \    {								\      HOST_WIDE_INT val = INTVAL (XEXP (XEXP (XEXP (X, 1), 0), 1)); \      HOST_WIDE_INT lowpart = (val & 0xffff) - 2 * (val & 0x8000); \      HOST_WIDE_INT highpart = val - lowpart;			\      rtx high = XEXP (XEXP (XEXP (X, 1), 0), 0);		\								\      if (highpart)						\	high = plus_constant (high, highpart);			\								\      high = expand_binop (Pmode, add_optab, XEXP (X, 0),	\			   force_reg (Pmode, high),		\			   high, 1, OPTAB_LIB_WIDEN);		\      (X) = plus_constant (high, lowpart);			\      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 Alpha this is true only for the unaligned modes.   We can   simplify this test since we know that the address must be valid.  */#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL)  \{ if (GET_CODE (ADDR) == AND) goto LABEL; }/* Compute the cost of an address.  For the Alpha, all valid addresses are   the same cost.  */#define ADDRESS_COST(X)  0/* Define this if some processing needs to be done immediately before   emitting code for an insn.  */extern void final_prescan_insn ();#define FINAL_PRESCAN_INSN(INSN,OPERANDS,NOPERANDS) \  final_prescan_insn ((INSN), (OPERANDS), (NOPERANDS))/* Define this if FINAL_PRESCAN_INSN should be called for a CODE_LABEL.  */#define FINAL_PRESCAN_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.   On the Alpha, the table is really GP-relative, not relative to the PC   of the table, but we pretend that it is PC-relative; this should be OK,   but we should try to find some better way sometime.  */#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/* This flag, if defined, says the same insns that convert to a signed fixnum   also convert validly to an unsigned one.   We actually lie a bit here as overflow conditions are different.  But   they aren't being checked anyway.  */#define FIXUNS_TRUNC_LIKE_FIX_TRUNC/* Max number of bytes we can move to or from memory   in one reasonably fast instruction.  */#define MOVE_MAX 8/* Largest number of bytes of an object that can be placed in a register.   On the Alpha we have plenty of registers, so use TImode.  */#define MAX_FIXED_MODE_SIZE	GET_MODE_BITSIZE (TImode)/* Nonzero if access to memory by bytes is no faster than for words.   Also non-zero if doing byte operations (specifically shifts) in registers   is undesirable.    On the Alpha, we want to not use the byte operation and instead use   masking operations to access fields; these will save instructions.  */#define SLOW_BYTE_ACCESS	1/* Define if operations between registers always perform the operation   on the full register even if a narrower mode is specified.  */#define WORD_REGISTER_OPERATIONS/* Define if loading in MODE, an integral mode narrower than BITS_PER_WORD   will either zero-extend or sign-extend.  The value of this macro should   be the code that says which one of the two operations is implicitly   done, NIL if none.  */#define LOAD_EXTEND_OP(MODE) ((MODE) == SImode ? SIGN_EXTEND : ZERO_EXTEND)/* Define if loading short immediate values into registers sign extends.  */#define SHORT_IMMEDIATES_SIGN_EXTEND/* 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/* Define the value returned by a floating-point comparison instruction.  */#define FLOAT_STORE_FLAG_VALUE (TARGET_FLOAT_VAX ? 0.5 : 2.0)/* Canonicalize a comparison from one we don't have to one we do have.  */#define CANONICALIZE_COMPARISON(CODE,OP0,OP1) \  do {									\    if (((CODE) == GE || (CODE) == GT || (CODE) == GEU || (CODE) == GTU) \	&& (GET_CODE (OP1) == REG || (OP1) == const0_rtx))		\      {									\	rtx tem = (OP0);						\	(OP0) = (OP1);							\	(OP1) = tem;							\	(CODE) = swap_condition (CODE);					\      }									\    if (((CODE) == LT || (CODE) == LTU)					\	&& GET_CODE (OP1) == CONST_INT && INTVAL (OP1) == 256)		\      {									\	(CODE) = (CODE) == LT ? LE : LEU;				\	(OP1) = GEN_INT (255);						\      }									\  } while (0)/* 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 DImode/* Mode of a function address in a call instruction (for indexing purposes). */#define FUNCTION_MODE Pmode/* 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.   We define this on the Alpha so that gen_call and gen_call_value   get to see the SYMBOL_REF (for the hint field of the jsr).  It will   then copy it into a register, thus actually letting the address be   cse'ed.  */#define NO_FUNCTION_CSE/* Define this to be nonzero if shift instructions ignore all but the low-order   few bits. */#define SHIFT_COUNT_TRUNCATED 1/* Use atexit for static constructors/destructors, instead of defining   our own exit function.  */#define HAVE_ATEXIT/* 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.   If this is an 8-bit constant, return zero since it can be used   nearly anywhere with no cost.  If it is a valid operand for an   ADD or AND, likewise return 0 if we know it will be used in that   context.  Otherwise, return 2 since it might be used there later.   All other constants take at least two insns.  */#define CONST_COSTS(RTX,CODE,OUTER_CODE) \  case CONST_INT:						\    if (INTVAL (RTX) >= 0 && INTVAL (RTX) < 256)		\      return 0;							\  case CONST_DOUBLE:						\    if (((OUTER_CODE) == PLUS && add_operand (RTX, VOIDmode))	\	|| ((OUTER_CODE) == AND && and_operand (RTX, VOIDmode))) \      return 0;							\    else if (add_operand (RTX, VOIDmode) || and_operand (RTX, VOIDmode)) \      return 2;							\    else							\      return COSTS_N_INSNS (2);					\  case CONST:							\  case SYMBOL_REF:						\  case LABEL_REF:						\  switch (alpha_cpu)						\    {								\    case PROCESSOR_EV4:						\      return COSTS_N_INSNS (3);					\    case PROCESSOR_EV5:						\      return COSTS_N_INSNS (2);					\    }    /* Provide the costs of a rtl expression.  This is in the body of a   switch on CODE.  */   #define RTX_COSTS(X,CODE,OUTER_CODE)			\  case PLUS:  case MINUS:				\    if (FLOAT_MODE_P (GET_MODE (X)))			\      switch (alpha_cpu)				\        {						\        case PROCESSOR_EV4:				\          return COSTS_N_INSNS (6);			\        case PROCESSOR_EV5:				\          return COSTS_N_INSNS (4); 			\	}						\    else if (GET_CODE (XEXP (X, 0)) == MULT		\	     && const48_operand (XEXP (XEXP (X, 0), 1), VOIDmode)) \      return (2 + rtx_cost (XEXP (XEXP (X, 0), 0), OUTER_CODE)	\	      + rtx_cost (XEXP (X, 1), OUTER_CODE));	\    break;						\  case MULT:						\    switch (alpha_cpu)					\      {							\      case PROCESSOR_EV4:				\        if (FLOAT_MODE_P (GET_MODE (X)))		\          return COSTS_N_INSNS (6);			\        return COSTS_N_INSNS (23);			\      case PROCESSOR_EV5:				\        if (FLOAT_MODE_P (GET_MODE (X)))		\          return COSTS_N_INSNS (4);			\        else if (GET_MODE (X) == DImode)		\          return COSTS_N_INSNS (12);			\        else						\          return COSTS_N_INSNS (8);			\      }							\  case ASHIFT:						\    if (GET_CODE (XEXP (X, 1)) == CONST_INT		\	&& INTVAL (XEXP (X, 1)) <= 3)			\      break;						\    /* ... fall through ... */				\  case ASHIFTRT:  case LSHIFTRT:  case IF_THEN_ELSE:	\    switch (alpha_cpu)					\      {							\      case PROCESSOR_EV4:				\        return COSTS_N_INSNS (2);			\      case PROCESSOR_EV5:				\        return COSTS_N_INSNS (1); 			\      }							\  case DIV:  case UDIV:  case MOD:  case UMOD:		\    switch (alpha_cpu)					\      {							\      case PROCESSOR_EV4:				\        if (GET_MODE (X) == SFmode)			\          return COSTS_N_INSNS (34);			\        else if (GET_MODE (X) == DFmode)		\          return COSTS_N_INSNS (63);			\        else						\          return COSTS_N_INSNS (70);			\      case PROCESSOR_EV5:				\        if (GET_MODE (X) == SFmode)			\          return COSTS_N_INSNS (15);			\        else if (GET_MODE (X) == DFmode)		\          return COSTS_N_INSNS (22);			\        else						\          return COSTS_N_INSNS (70);	/* EV5 ??? */	\      }							\  case MEM:						\    switch (alpha_cpu)					\      {							\      case PROCESSOR_EV4:				\        return COSTS_N_INSNS (3);			\      case PROCESSOR_EV5:				\        return COSTS_N_INSNS (2); 			\      }							\  ca

⌨️ 快捷键说明

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