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

📄 i386.h

📁 早期freebsd实现
💻 H
📖 第 1 页 / 共 4 页
字号:
{  "NO_REGS",				\   "AREG", "DREG", "CREG", "BREG",	\   "Q_REGS",				\   "SIREG", "DIREG",			\   "INDEX_REGS",			\   "GENERAL_REGS",			\   "FP_TOP_REG", "FP_SECOND_REG",	\   "FLOAT_REGS",			\   "ALL_REGS" }/* Define which registers fit in which classes.   This is an initializer for a vector of HARD_REG_SET   of length N_REG_CLASSES.  */#define REG_CLASS_CONTENTS \{      0,							\     0x1,    0x2,  0x4,	 0x8,	/* AREG, DREG, CREG, BREG */	\     0xf,			/* Q_REGS */			\    0x10,   0x20,		/* SIREG, DIREG */		\ 0x1007f,			/* INDEX_REGS */		\ 0x100ff,			/* GENERAL_REGS */		\  0x0100, 0x0200,		/* FP_TOP_REG, FP_SECOND_REG */	\  0xff00,			/* FLOAT_REGS */		\ 0x1ffff }/* The same information, inverted:   Return the class number of the smallest class containing   reg number REGNO.  This could be a conditional expression   or could index an array.  */extern enum reg_class regclass_map[FIRST_PSEUDO_REGISTER];#define REGNO_REG_CLASS(REGNO) (regclass_map[REGNO])/* When defined, the compiler allows registers explicitly used in the   rtl to be used as spill registers but prevents the compiler from   extending the lifetime of these registers. */#define SMALL_REGISTER_CLASSES#define QI_REG_P(X) \  (REG_P (X) && REGNO (X) < 4)#define NON_QI_REG_P(X) \  (REG_P (X) && REGNO (X) >= 4 && REGNO (X) < FIRST_PSEUDO_REGISTER)#define FP_REG_P(X) (REG_P (X) && FP_REGNO_P (REGNO (X)))#define FP_REGNO_P(n) ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG)  #define STACK_REG_P(xop) (REG_P (xop) &&		       	\			  REGNO (xop) >= FIRST_STACK_REG &&	\			  REGNO (xop) <= LAST_STACK_REG)#define NON_STACK_REG_P(xop) (REG_P (xop) && ! STACK_REG_P (xop))#define STACK_TOP_P(xop) (REG_P (xop) && REGNO (xop) == FIRST_STACK_REG)/* Try to maintain the accuracy of the death notes for regs satisfying the   following.  Important for stack like regs, to know when to pop. *//* #define PRESERVE_DEATH_INFO_REGNO_P(x) FP_REGNO_P(x) *//* 1 if register REGNO can magically overlap other regs.   Note that nonzero values work only in very special circumstances. *//* #define OVERLAPPING_REGNO_P(REGNO) FP_REGNO_P (REGNO) *//* The class value for index registers, and the one for base regs.  */#define INDEX_REG_CLASS INDEX_REGS#define BASE_REG_CLASS GENERAL_REGS/* Get reg_class from a letter such as appears in the machine description.  */#define REG_CLASS_FROM_LETTER(C)	\  ((C) == 'r' ? GENERAL_REGS :					\   (C) == 'q' ? Q_REGS :					\   (C) == 'f' ? (TARGET_80387 || TARGET_FLOAT_RETURNS_IN_80387	\		 ? FLOAT_REGS					\		 : NO_REGS) :					\   (C) == 't' ? (TARGET_80387 || TARGET_FLOAT_RETURNS_IN_80387	\		 ? FP_TOP_REG					\		 : NO_REGS) :					\   (C) == 'u' ? (TARGET_80387 || TARGET_FLOAT_RETURNS_IN_80387	\		 ? FP_SECOND_REG				\		 : NO_REGS) :					\   (C) == 'a' ? AREG :						\   (C) == 'b' ? BREG :						\   (C) == 'c' ? CREG :						\   (C) == 'd' ? DREG :						\   (C) == 'D' ? DIREG :						\   (C) == 'S' ? SIREG : NO_REGS)/* The letters I, J, K, L and M in a register constraint string   can be used to stand for particular ranges of immediate operands.   This macro defines what the ranges are.   C is the letter, and VALUE is a constant value.   Return 1 if VALUE is in the range specified by C.   I is for non-DImode shifts.   J is for DImode shifts.   K and L are for an `andsi' optimization.   M is for shifts that can be executed by the "lea" opcode.   */#define CONST_OK_FOR_LETTER_P(VALUE, C)  \  ((C) == 'I' ? (VALUE) >= 0 && (VALUE) <= 31 :	\   (C) == 'J' ? (VALUE) >= 0 && (VALUE) <= 63 :	\   (C) == 'K' ? (VALUE) == 0xff :		\   (C) == 'L' ? (VALUE) == 0xffff :		\   (C) == 'M' ? (VALUE) >= 0 && (VALUE) <= 3 :	\   0)/* Similar, but for floating constants, and defining letters G and H.   Here VALUE is the CONST_DOUBLE rtx itself.  We allow constants even if   TARGET_387 isn't set, because the stack register converter may need to   load 0.0 into the function value register. */#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C)  \  ((C) == 'G' ? standard_80387_constant_p (VALUE) : 0)/* Place additional restrictions on the register class to use when it   is necessary to be able to hold a value of mode @var{mode} in a reload   register for which class @var{class} would ordinarily be used. */#define LIMIT_RELOAD_CLASS(MODE, CLASS) \  ((MODE) == QImode && ((CLASS) == ALL_REGS || (CLASS) == GENERAL_REGS) \   ? Q_REGS : (CLASS))/* Given an rtx X being reloaded into a reg required to be   in class CLASS, return the class of reg to actually use.   In general this is just CLASS; but on some machines   in some cases it is preferable to use a more restrictive class.   On the 80386 series, we prevent floating constants from being   reloaded into floating registers (since no move-insn can do that)   and we ensure that QImodes aren't reloaded into the esi or edi reg.  *//* Don't put CONST_DOUBLE into FLOAT_REGS.   QImode must go into class Q_REGS.   MODE_INT must not go into FLOAT_REGS. */#define PREFERRED_RELOAD_CLASS(X,CLASS)			\  (GET_CODE (X) == CONST_DOUBLE				\   ? (reg_class_subset_p ((CLASS), GENERAL_REGS) || (CLASS) == ALL_REGS \      ? (CLASS) : NO_REGS)				\   : GET_MODE (X) == QImode				\   ? (! reg_class_subset_p ((CLASS), Q_REGS) ? Q_REGS : (CLASS))	\   : (GET_MODE_CLASS (GET_MODE (X)) == MODE_INT && (CLASS) == FLOAT_REGS ? \      GENERAL_REGS : (CLASS)))/* Return the maximum number of consecutive registers   needed to represent mode MODE in a register of class CLASS.  *//* On the 80386, this is the size of MODE in words,   except in the FP regs, where a single reg is always enough.  */#define CLASS_MAX_NREGS(CLASS, MODE)	\ ((CLASS) == FLOAT_REGS ? 1 :		\  (CLASS) == FP_TOP_REG ? 1 :		\  (CLASS) == FP_SECOND_REG ? 1 :	\   ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))/* Stack layout; function entry, exit and calling.  *//* Define this if pushing a word on the stack   makes the stack pointer a smaller address.  */#define STACK_GROWS_DOWNWARD/* Define this if the nominal address of the stack frame   is at the high-address end of the local variables;   that is, each additional local variable allocated   goes at a more negative offset in the frame.  */#define FRAME_GROWS_DOWNWARD/* Offset within stack frame to start allocating local variables at.   If FRAME_GROWS_DOWNWARD, this is the offset to the END of the   first local allocated.  Otherwise, it is the offset to the BEGINNING   of the first local allocated.  */#define STARTING_FRAME_OFFSET 0/* If we generate an insn to push BYTES bytes,   this says how many the stack pointer really advances by.   On 386 pushw decrements by exactly 2 no matter what the position was.   On the 386 there is no pushb; we use pushw instead, and this   has the effect of rounding up to 2.  */#define PUSH_ROUNDING(BYTES) (((BYTES) + 1) & (-2))/* Offset of first parameter from the argument pointer register value.  */#define FIRST_PARM_OFFSET(FNDECL) 0/* Value is the number of bytes of arguments automatically   popped when returning from a subroutine call.   FUNTYPE is the data type of the function (as a tree),   or for a library call it is an identifier node for the subroutine name.   SIZE is the number of bytes of arguments passed on the stack.   On the 80386, the RTD insn may be used to pop them if the number     of args is fixed, but if the number is variable then the caller     must pop them all.  RTD can't be used for library calls now     because the library is compiled with the Unix compiler.   Use of RTD is a selectable option, since it is incompatible with   standard Unix calling sequences.  If the option is not selected,   the caller must always pop the args.  */#define RETURN_POPS_ARGS(FUNTYPE,SIZE)   \  (TREE_CODE (FUNTYPE) == IDENTIFIER_NODE ? 0			\   : (TARGET_RTD						\      && (TYPE_ARG_TYPES (FUNTYPE) == 0				\	  || (TREE_VALUE (tree_last (TYPE_ARG_TYPES (FUNTYPE)))	\	      == void_type_node))) ? (SIZE)			\   : (aggregate_value_p (FUNTYPE)) ? GET_MODE_SIZE (Pmode) : 0)/* Define how to find the value returned by a function.   VALTYPE is the data type of the value (as a tree).   If the precise function being called is known, FUNC is its FUNCTION_DECL;   otherwise, FUNC is 0.  */#define FUNCTION_VALUE(VALTYPE, FUNC)  \   gen_rtx (REG, TYPE_MODE (VALTYPE), \	    VALUE_REGNO (TYPE_MODE (VALTYPE)))/* Define how to find the value returned by a library function   assuming the value has mode MODE.  */#define LIBCALL_VALUE(MODE) \  gen_rtx (REG, MODE, VALUE_REGNO (MODE))/* 1 if N is a possible register number for function argument passing.   On the 80386, no registers are used in this way.      *NOTE* -mregparm does not work.   It exists only to test register calling conventions.  */#define FUNCTION_ARG_REGNO_P(N) 0/* Define a data type for recording info about an argument list   during the scan of that argument list.  This data type should   hold all necessary information about the function itself   and about the args processed so far, enough to enable macros   such as FUNCTION_ARG to determine where the next arg should go.   On the 80386, this is a single integer, which is a number of bytes   of arguments scanned so far.  */#define CUMULATIVE_ARGS int/* Initialize a variable CUM of type CUMULATIVE_ARGS   for a call to a function whose data type is FNTYPE.   For a library call, FNTYPE is 0.   On the 80386, the offset starts at 0.  */#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME)	\ ((CUM) = 0)/* Update the data in CUM to advance over an argument   of mode MODE and data type TYPE.   (TYPE is null for libcalls where that information may not be available.)  */#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED)	\ ((CUM) += ((MODE) != BLKmode			\	    ? (GET_MODE_SIZE (MODE) + 3) & ~3	\	    : (int_size_in_bytes (TYPE) + 3) & ~3))/* Define where to put the arguments to a function.   Value is zero to push the argument on the stack,   or a hard register in which to store the argument.   MODE is the argument's machine mode.   TYPE is the data type of the argument (as a tree).    This is null for libcalls where that information may    not be available.   CUM is a variable of type CUMULATIVE_ARGS which gives info about    the preceding args and about the function being called.   NAMED is nonzero if this argument is a named parameter    (otherwise it is an extra parameter matching an ellipsis).  *//* On the 80386 all args are pushed, except if -mregparm is specified   then the first two words of arguments are passed in EAX, EDX.   *NOTE* -mregparm does not work.   It exists only to test register calling conventions.  */#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \((TARGET_REGPARM && (CUM) < 8) ? gen_rtx (REG, (MODE), (CUM) / 4) : 0)/* For an arg passed partly in registers and partly in memory,   this is the number of registers used.   For args passed entirely in registers or entirely in memory, zero.  */#define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \((TARGET_REGPARM && (CUM) < 8					\  && 8 < ((CUM) + ((MODE) == BLKmode				\		      ? int_size_in_bytes (TYPE)		\		      : GET_MODE_SIZE (MODE))))  		\ ? 2 - (CUM) / 4 : 0)/* This macro generates the assembly code for function entry.   FILE is a stdio stream to output the code to.   SIZE is an int: how many units of temporary storage to allocate.   Refer to the array `regs_ever_live' to determine which registers   to save; `regs_ever_live[I]' is nonzero if register number I   is ever used in the function.  This macro is responsible for   knowing which registers should not be saved even if used.  */#define FUNCTION_PROLOGUE(FILE, SIZE)     \  function_prologue (FILE, SIZE)/* Output assembler code to FILE to increment profiler label # LABELNO   for profiling a function entry.  */#define FUNCTION_PROFILER(FILE, LABELNO)  \{									\  if (flag_pic)								\    {									\      fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n",		\	       LPREFIX, (LABELNO));					\      fprintf (FILE, "\tcall *_mcount@GOT(%%ebx)\n");			\    }									\  else									\    {									\      fprintf (FILE, "\tmovl $%sP%d,%%edx\n", LPREFIX, (LABELNO));	\      fprintf (FILE, "\tcall _mcount\n");				\    }									\}/* 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. */#define FUNCTION_EPILOGUE(FILE, SIZE) 		\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)/* 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.

⌨️ 快捷键说明

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