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

📄 sh.h

📁 gcc编译工具没有什么特别
💻 H
📖 第 1 页 / 共 5 页
字号:
   We sometimes split args.  */#define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \  ((PASS_IN_REG_P ((CUM), (MODE), (TYPE))			\    && ! TARGET_SH4						\    && (ROUND_REG ((CUM), (MODE))				\	+ ((MODE) != BLKmode					\	   ? ROUND_ADVANCE (GET_MODE_SIZE (MODE))		\	   : ROUND_ADVANCE (int_size_in_bytes (TYPE)))		\	- NPARM_REGS (MODE) > 0))				\   ? NPARM_REGS (MODE) - ROUND_REG ((CUM), (MODE))		\   : 0)extern int current_function_anonymous_args;/* Perform any needed actions needed for a function that is receiving a   variable number of arguments.  */#define SETUP_INCOMING_VARARGS(ASF, MODE, TYPE, PAS, ST) \  current_function_anonymous_args = 1;/* Call the function profiler with a given profile label.   We use two .aligns, so as to make sure that both the .long is aligned   on a 4 byte boundary, and that the .long is a fixed distance (2 bytes)   from the trapa instruction.  */#define FUNCTION_PROFILER(STREAM,LABELNO)			\{								\	fprintf((STREAM), "\t.align\t2\n");			\	fprintf((STREAM), "\ttrapa\t#33\n");			\ 	fprintf((STREAM), "\t.align\t2\n");			\	asm_fprintf((STREAM), "\t.long\t%LLP%d\n", (LABELNO));	\}/* Define this macro if the code for function profiling should come   before the function prologue.  Normally, the profiling code comes   after.  */#define PROFILE_BEFORE_PROLOGUE/* 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 1/* Generate the assembly code for function exit   Just dump out any accumulated constant table.  */#define FUNCTION_EPILOGUE(STREAM, SIZE)  function_epilogue ((STREAM), (SIZE))/*    On the SH, the trampoline looks like   2 0002 DD02     	   	mov.l	l2,r13   1 0000 D301     		mov.l	l1,r3   3 0004 4D2B     		jmp	@r13   4 0006 0009     		nop   5 0008 00000000 	l1:  	.long   function   6 000c 00000000 	l2:	.long   area  *//* Length in units of the trampoline for entering a nested function.  */#define TRAMPOLINE_SIZE  16/* Alignment required for a trampoline in bits .  */#define TRAMPOLINE_ALIGNMENT \  ((CACHE_LOG < 3 || TARGET_SMALLCODE && ! TARGET_HARWARD) ? 32 : 64)/* Emit RTL insns to initialize the variable parts of a trampoline.   FNADDR is an RTX for the address of the function's pure code.   CXT is an RTX for the static chain value for the function.  */#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT)			\{									\  emit_move_insn (gen_rtx (MEM, SImode, (TRAMP)),			\		  GEN_INT (TARGET_LITTLE_ENDIAN ? 0xd301dd02 : 0xdd02d301));\  emit_move_insn (gen_rtx (MEM, SImode, plus_constant ((TRAMP), 4)),	\		  GEN_INT (TARGET_LITTLE_ENDIAN ? 0x00094d2b : 0x4d2b0009));\  emit_move_insn (gen_rtx (MEM, SImode, plus_constant ((TRAMP), 8)),	\		  (CXT));						\  emit_move_insn (gen_rtx (MEM, SImode, plus_constant ((TRAMP), 12)),	\		  (FNADDR));						\  if (TARGET_HARWARD)							\    emit_insn (gen_ic_invalidate_line (TRAMP));				\}/* A C expression whose value is RTL representing the value of the return   address for the frame COUNT steps up from the current frame.   FRAMEADDR is already the frame pointer of the COUNT frame, so we   can ignore COUNT.  */#define RETURN_ADDR_RTX(COUNT, FRAME)	\  (((COUNT) == 0)				\   ? gen_rtx (MEM, Pmode, gen_rtx (REG, Pmode, RETURN_ADDRESS_POINTER_REGNUM)) \   : (rtx) 0)/* Generate necessary RTL for __builtin_saveregs().   ARGLIST is the argument list; see expr.c.  */extern struct rtx_def *sh_builtin_saveregs ();#define EXPAND_BUILTIN_SAVEREGS(ARGLIST) sh_builtin_saveregs (ARGLIST)/* Addressing modes, and classification of registers for them.  */#define HAVE_POST_INCREMENT  1/*#define HAVE_PRE_INCREMENT   1*//*#define HAVE_POST_DECREMENT  1*/#define HAVE_PRE_DECREMENT   1#define USE_LOAD_POST_INCREMENT(mode)    ((mode == SImode || mode == DImode) \                                           ? 0 : 1)#define USE_LOAD_PRE_DECREMENT(mode)     0#define USE_STORE_POST_INCREMENT(mode)   0#define USE_STORE_PRE_DECREMENT(mode)    ((mode == SImode || mode == DImode) \                                           ? 0 : 1)#define MOVE_BY_PIECES_P(SIZE, ALIGN)  (move_by_pieces_ninsns (SIZE, ALIGN) \                                        < (TARGET_SMALLCODE ? 2 :           \                                           ((ALIGN >= 4) ? 16 : 2)))/* 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_BASE_P(REGNO) \  ((REGNO) < PR_REG || (unsigned) reg_renumber[(REGNO)] < PR_REG)#define REGNO_OK_FOR_INDEX_P(REGNO) \  ((REGNO) == 0 || (unsigned) reg_renumber[(REGNO)] == 0)/* 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)/* Nonzero if the constant value X is a legitimate general operand.  */#define LEGITIMATE_CONSTANT_P(X) \  (GET_CODE (X) != CONST_DOUBLE						\   || GET_MODE (X) == DFmode || GET_MODE (X) == SFmode			\   || (TARGET_SH3E && (fp_zero_operand (X) || fp_one_operand (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.  */#ifndef REG_OK_STRICT/* 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) <= 16 || REGNO (X) >= FIRST_PSEUDO_REGISTER)/* 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) == 0 || REGNO (X) >= FIRST_PSEUDO_REGISTER)/* Nonzero if X/OFFSET is a hard reg that can be used as an index   or if X is a pseudo reg.  */#define SUBREG_OK_FOR_INDEX_P(X, OFFSET) \  ((REGNO (X) == 0 && OFFSET == 0) || REGNO (X) >= FIRST_PSEUDO_REGISTER)#else/* 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))/* 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/OFFSET is a hard reg that can be used as an index.  */#define SUBREG_OK_FOR_INDEX_P(X, OFFSET) \  (REGNO_OK_FOR_INDEX_P (REGNO (X)) && (OFFSET) == 0)#endif/* The 'Q' constraint is a pc relative load operand.  */#define EXTRA_CONSTRAINT_Q(OP)                          		\  (GET_CODE (OP) == MEM && 						\   ((GET_CODE (XEXP ((OP), 0)) == LABEL_REF)				\    || (GET_CODE (XEXP ((OP), 0)) == CONST                		\	&& GET_CODE (XEXP (XEXP ((OP), 0), 0)) == PLUS 			\	&& GET_CODE (XEXP (XEXP (XEXP ((OP), 0), 0), 0)) == LABEL_REF	\	&& GET_CODE (XEXP (XEXP (XEXP ((OP), 0), 0), 1)) == CONST_INT)))#define EXTRA_CONSTRAINT(OP, C)		\  ((C) == 'Q' ? EXTRA_CONSTRAINT_Q (OP)	\   : 0)/* 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.   The other macros defined here are used only in GO_IF_LEGITIMATE_ADDRESS.  */#define MODE_DISP_OK_4(X,MODE) \(GET_MODE_SIZE (MODE) == 4 && (unsigned) INTVAL (X) < 64	\ && ! (INTVAL (X) & 3) && ! (TARGET_SH3E && (MODE) == SFmode))#define MODE_DISP_OK_8(X,MODE) \((GET_MODE_SIZE(MODE)==8) && ((unsigned)INTVAL(X)<60)	\ && ! (INTVAL(X) & 3) && ! (TARGET_SH4 && (MODE) == DFmode))#define BASE_REGISTER_RTX_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))))/* Since this must be r0, which is a single register class, we must check   SUBREGs more carefully, to be sure that we don't accept one that extends   outside the class.  */#define INDEX_REGISTER_RTX_P(X)				\  ((GET_CODE (X) == REG && REG_OK_FOR_INDEX_P (X))	\   || (GET_CODE (X) == SUBREG				\       && GET_CODE (SUBREG_REG (X)) == REG		\       && SUBREG_OK_FOR_INDEX_P (SUBREG_REG (X), SUBREG_WORD (X))))/* Jump to LABEL if X is a valid address RTX.  This must also take   REG_OK_STRICT into account when deciding about valid registers, but it uses   the above macros so we are in luck.   Allow  REG	  REG+disp	  REG+r0	  REG++	  --REG  *//* ??? The SH3e does not have the REG+disp addressing mode when loading values   into the FRx registers.  We implement this by setting the maximum offset   to zero when the value is SFmode.  This also restricts loading of SFmode   values into the integer registers, but that can't be helped.  *//* The SH allows a displacement in a QI or HI amode, but only when the   other operand is R0. GCC doesn't handle this very well, so we forgo   all of that.   A legitimate index for a QI or HI is 0, SI can be any number 0..63,   DI can be any number 0..60.  */#define GO_IF_LEGITIMATE_INDEX(MODE, OP, LABEL)  			\  do {									\    if (GET_CODE (OP) == CONST_INT) 					\      {									\	if (MODE_DISP_OK_4 ((OP), (MODE)))  goto LABEL;		      	\	if (MODE_DISP_OK_8 ((OP), (MODE)))  goto LABEL;		      	\      }									\  } while(0)#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, LABEL)			\{									\  if (BASE_REGISTER_RTX_P (X))						\    goto LABEL;								\  else if ((GET_CODE (X) == POST_INC || GET_CODE (X) == PRE_DEC)	\	   && BASE_REGISTER_RTX_P (XEXP ((X), 0)))			\    goto LABEL;								\  else if (GET_CODE (X) == PLUS						\	   && ((MODE) != PSImode || reload_completed))			\    {									\      rtx xop0 = XEXP ((X), 0);						\      rtx xop1 = XEXP ((X), 1);						\      if (GET_MODE_SIZE (MODE) <= 8 && BASE_REGISTER_RTX_P (xop0))	\	GO_IF_LEGITIMATE_INDEX ((MODE), xop1, LABEL);			\      if (GET_MODE_SIZE (MODE) <= 4					\	  || TARGET_SH4 && TARGET_FMOVD && MODE == DFmode)	\	{								\	  if (BASE_REGISTER_RTX_P (xop1) && INDEX_REGISTER_RTX_P (xop0))\	    goto LABEL;							\	  if (INDEX_REGISTER_RTX_P (xop1) && BASE_REGISTER_RTX_P (xop0))\	    goto LABEL;							\	}								\    }									\}/* 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 SH, if X is almost suitable for indexing, but the offset is   out of range, convert it into a normal form so that cse has a chance   of reducing the number of address registers used.  */#define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN)			\{								\  if (GET_CODE (X) == PLUS					\      && (GET_MODE_SIZE (MODE) == 4				\	  || GET_MODE_SIZE (MODE) == 8)				\      && GET_CODE (XEXP ((X), 1)) == CONST_INT			\      && BASE_REGISTER_RTX_P (XEXP ((X), 0))			\      && ! (TARGET_SH4 && (MODE) == DFmode)			\      && ! (TARGET_SH3E && (MODE) == SFmode))			\    {								\      rtx index_rtx = XEXP ((X), 1);				\      HOST_WIDE_INT offset = INTVAL (index_rtx), offset_base;	\      rtx sum;							\								\      GO_IF_LEGITIMATE_INDEX ((MODE), index_rtx, WIN);		\      /* On rare occasions, we might get an unaligned pointer	\	 that is indexed in a way to give an aligned address.	\	 Therefore, keep the lower two bits in offset_base.  */ \      /* Instead of offset_base 128..131 use 124..127, so that	\	 simple add suffices.  */				\      if (offset > 127)						\	{							\	  offset_base = ((offset + 4) & ~60) - 4;		\	}							\      else							\	offset_base = offset & ~60;				\      /* Sometimes the normal form does not suit DImode.  We	\	 could avoid that by using smaller ranges, but that	\	 would give less optimized code when SImode is		\	 prevalent.  */						\      if (GET_MODE_SIZE (MODE) + offset - offset_base <= 64)	\	{							\	  sum = expand_binop (Pmode, add_optab, XEXP ((X), 0),	\			      GEN_INT (offset_base), NULL_RTX, 0, \			      OPTAB_LIB_WIDEN);			\                                                                \	  (X) = gen_rtx (PLUS, Pmode, sum, GEN_INT (offset - offset_base)); \	  goto WIN;						\	}							\    }								\}/* A C compound statement that attempts to replace X, which is an address   that needs reloading, with a valid memory address for an operand of   mode MODE.  WIN is a C statement label elsewhere in the code.   Like for LEGITIMIZE_ADDRESS, for the SH we try to get a normal form   of the address.  That will allow inheritance of the address reloads.  */

⌨️ 快捷键说明

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