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

📄 i386.h

📁 GCC编译器源代码
💻 H
📖 第 1 页 / 共 5 页
字号:
   before calling function (rsp. after returning from function)   `__bb_trace_func', or it can be done inside the function by   defining the macros:	MACHINE_STATE_SAVE(ID)	MACHINE_STATE_RESTORE(ID)   In the latter case care must be taken, that the prologue code   of function `__bb_trace_func' does not already change the   state prior to saving it with MACHINE_STATE_SAVE.   The parameter `ID' is a string identifying a unique macro use.   On the i386 the initialization code at the begin of   function `__bb_trace_func' contains a `sub' instruction   therefore we handle save and restore of the flag register    in the BLOCK_PROFILER macro. */#define MACHINE_STATE_SAVE(ID) \  asm ("	pushl %eax"); \  asm ("	pushl %ecx"); \  asm ("	pushl %edx"); \  asm ("	pushl %esi");#define MACHINE_STATE_RESTORE(ID) \  asm ("	popl %esi"); \  asm ("	popl %edx"); \  asm ("	popl %ecx"); \  asm ("	popl %eax");/* 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.  *//* Note on the 386 it might be more efficient not to define this since    we have to restore it ourselves from the frame pointer, in order to   use pop */#define EXIT_IGNORE_STACK 1/* 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.   If the last non-note insn in the function is a BARRIER, then there   is no need to emit a function prologue, because control does not fall   off the end.  This happens if the function ends in an "exit" call, or   if a `return' insn is emitted directly into the function. */#if 0#define FUNCTION_BEGIN_EPILOGUE(FILE)		\do {						\  rtx last = get_last_insn ();			\  if (last && GET_CODE (last) == NOTE)		\    last = prev_nonnote_insn (last);		\/*  if (! last || GET_CODE (last) != BARRIER)	\    function_epilogue (FILE, SIZE);*/		\} while (0)#endif#define FUNCTION_EPILOGUE(FILE, SIZE)     \  function_epilogue (FILE, SIZE)/* Output assembler code for a block containing the constant parts   of a trampoline, leaving space for the variable parts.  *//* On the 386, the trampoline contains three instructions:     mov #STATIC,ecx     mov #FUNCTION,eax     jmp @eax  */#define TRAMPOLINE_TEMPLATE(FILE)			\{							\  ASM_OUTPUT_CHAR (FILE, GEN_INT (0xb9));		\  ASM_OUTPUT_SHORT (FILE, const0_rtx);			\  ASM_OUTPUT_SHORT (FILE, const0_rtx);			\  ASM_OUTPUT_CHAR (FILE, GEN_INT (0xb8));		\  ASM_OUTPUT_SHORT (FILE, const0_rtx);			\  ASM_OUTPUT_SHORT (FILE, const0_rtx);			\  ASM_OUTPUT_CHAR (FILE, GEN_INT (0xff));		\  ASM_OUTPUT_CHAR (FILE, GEN_INT (0xe0));		\}/* Length in units of the trampoline for entering a nested function.  */#define TRAMPOLINE_SIZE 12/* 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, plus_constant (TRAMP, 1)), CXT); \  emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 6)), FNADDR); \}/* Definitions for register eliminations.   This is an array of structures.  Each structure initializes one pair   of eliminable registers.  The "from" register number is given first,   followed by "to".  Eliminations of the same "from" register are listed   in order of preference.   We have two registers that can be eliminated on the i386.  First, the   frame pointer register can often be eliminated in favor of the stack   pointer register.  Secondly, the argument pointer register can always be   eliminated; it is replaced with either the stack or frame pointer. */#define ELIMINABLE_REGS				\{{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM},	\ { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM},   \ { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}}/* Given FROM and TO register numbers, say whether this elimination is allowed.   Frame pointer elimination is automatically handled.   For the i386, if frame pointer elimination is being done, we would like to   convert ap into sp, not fp.   All other eliminations are valid.  */#define CAN_ELIMINATE(FROM, TO)					\ ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM	\  ? ! frame_pointer_needed					\  : 1)/* Define the offset between two registers, one to be eliminated, and the other   its replacement, at the start of a routine.  */#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET)			\{									\  if ((FROM) == ARG_POINTER_REGNUM && (TO) == FRAME_POINTER_REGNUM)	\    (OFFSET) = 8;	/* Skip saved PC and previous frame pointer */	\  else									\    {									\      int regno;							\      int offset = 0;							\									\      for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)		\	if ((regs_ever_live[regno] && ! call_used_regs[regno])		\	    || ((current_function_uses_pic_offset_table			\		 || current_function_uses_const_pool)			\		&& flag_pic && regno == PIC_OFFSET_TABLE_REGNUM))	\	  offset += 4;							\									\      (OFFSET) = offset + get_frame_size ();				\									\      if ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM)	\	(OFFSET) += 4;	/* Skip saved PC */				\    }									\}/* 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) < STACK_POINTER_REGNUM \   || (unsigned) reg_renumber[REGNO] < STACK_POINTER_REGNUM)#define REGNO_OK_FOR_BASE_P(REGNO) \  ((REGNO) <= STACK_POINTER_REGNUM \   || (REGNO) == ARG_POINTER_REGNUM \   || (unsigned) reg_renumber[REGNO] <= STACK_POINTER_REGNUM)#define REGNO_OK_FOR_SIREG_P(REGNO) ((REGNO) == 4 || reg_renumber[REGNO] == 4)#define REGNO_OK_FOR_DIREG_P(REGNO) ((REGNO) == 5 || reg_renumber[REGNO] == 5)/* 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.  *//* Non strict versions, pseudos are ok */#define REG_OK_FOR_INDEX_NONSTRICT_P(X)					\  (REGNO (X) < STACK_POINTER_REGNUM					\   || REGNO (X) >= FIRST_PSEUDO_REGISTER)#define REG_OK_FOR_BASE_NONSTRICT_P(X)					\  (REGNO (X) <= STACK_POINTER_REGNUM					\   || REGNO (X) == ARG_POINTER_REGNUM					\   || REGNO (X) >= FIRST_PSEUDO_REGISTER)#define REG_OK_FOR_STRREG_NONSTRICT_P(X)				\  (REGNO (X) == 4 || REGNO (X) == 5 || REGNO (X) >= FIRST_PSEUDO_REGISTER)/* Strict versions, hard registers only */#define REG_OK_FOR_INDEX_STRICT_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))#define REG_OK_FOR_BASE_STRICT_P(X)  REGNO_OK_FOR_BASE_P (REGNO (X))#define REG_OK_FOR_STRREG_STRICT_P(X)					\  (REGNO_OK_FOR_DIREG_P (REGNO (X)) || REGNO_OK_FOR_SIREG_P (REGNO (X)))#ifndef REG_OK_STRICT#define REG_OK_FOR_INDEX_P(X)  REG_OK_FOR_INDEX_NONSTRICT_P(X)#define REG_OK_FOR_BASE_P(X)   REG_OK_FOR_BASE_NONSTRICT_P(X)#define REG_OK_FOR_STRREG_P(X) REG_OK_FOR_STRREG_NONSTRICT_P(X)#else#define REG_OK_FOR_INDEX_P(X)  REG_OK_FOR_INDEX_STRICT_P(X)#define REG_OK_FOR_BASE_P(X)   REG_OK_FOR_BASE_STRICT_P(X)#define REG_OK_FOR_STRREG_P(X) REG_OK_FOR_STRREG_STRICT_P(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.   The other macros defined here are used only in GO_IF_LEGITIMATE_ADDRESS,   except for CONSTANT_ADDRESS_P which is usually machine-independent.   See legitimize_pic_address in i386.c for details as to what   constitutes a legitimate address when -fpic is used.  */#define MAX_REGS_PER_ADDRESS 2#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#ifdef REG_OK_STRICT#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)				\{									\  if (legitimate_address_p (MODE, X, 1))				\    goto ADDR;								\}#else#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)				\{									\  if (legitimate_address_p (MODE, X, 0))				\    goto ADDR;								\}#endif/* 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 80386, we handle X+REG by loading X into a register R and   using R+REG.  R will go in a general 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 a general reg.   When -fpic is used, special handling is needed for symbolic references.   See comments by legitimize_pic_address in i386.c for details.  */#define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN)				\{									\  rtx orig_x = (X);							\  (X) = legitimize_address (X, OLDX, MODE);				\  if (memory_address_p (MODE, X))					\    goto WIN;								\}#define REWRITE_ADDRESS(x) rewrite_address(x)/* 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_CONST (X)							\   || (GET_CODE (X) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (X)))#define SYMBOLIC_CONST(X)	\(GET_CODE (X) == SYMBOL_REF						\ || GET_CODE (X) == LABEL_REF						\ || (GET_CODE (X) == CONST && symbolic_reference_mentioned_p (X)))/* Go to LABEL if ADDR (a legitimate address expression)   has an effect that depends on the machine mode it is used for.   On the 80386, only postdecrement 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) == POST_DEC) goto LABEL/* Define this macro if references to a symbol must be treated   differently depending on something about the variable or   function named by the symbol (such as what section it is in).   On i386, if using PIC, mark a SYMBOL_REF for a non-global symbol   so that we may access it directly in the GOT.  */#define ENCODE_SECTION_INFO(DECL) \do									\  {									\    if (flag_pic)							\      {									\	rtx rtl = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd'		\		   ? TREE_CST_RTL (DECL) : DECL_RTL (DECL));		\									\	if (TARGET_DEBUG_ADDR						\	    && TREE_CODE_CLASS (TREE_CODE (DECL)) == 'd')		\	  {								\	    fprintf (stderr, "Encode %s, public = %s\n",		\		     IDENTIFIER_POINTER (DECL_NAME (DECL)),		\		     TREE_PUBLIC (DECL));				\	  }								\									\	SY

⌨️ 快捷键说明

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