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

📄 sparc.h

📁 gcc编译工具没有什么特别
💻 H
📖 第 1 页 / 共 5 页
字号:
	/* %fcc0 is used by v8 and v9.  */			\	for (regno = SPARC_FIRST_V9_FCC_REG + 1;		\	     regno <= SPARC_LAST_V9_FCC_REG;			\	     regno++)						\	  fixed_regs[regno] = 1;				\      }								\    if (! TARGET_FPU)						\      {								\	int regno;						\	for (regno = 32; regno < SPARC_LAST_V9_FCC_REG; regno++) \	  fixed_regs[regno] = 1;				\      }								\    /* Don't unfix g2-g4 if they were fixed with -ffixed-.  */	\    fixed_regs[2] |= ! TARGET_APP_REGS;				\    fixed_regs[3] |= ! TARGET_APP_REGS;				\    fixed_regs[4] |= ! TARGET_APP_REGS || TARGET_CM_EMBMEDANY;	\    if (TARGET_FLAT)						\      {								\	/* Let the compiler believe the frame pointer is still	\	   %fp, but output it as %i7.  */			\	fixed_regs[31] = 1;					\	reg_names[FRAME_POINTER_REGNUM] = "%i7";		\	/* ??? This is a hack to disable leaf functions.  */	\	global_regs[7] = 1;					\      }								\    if (profile_block_flag)					\      {								\	/* %g1 and %g2 must be fixed, because BLOCK_PROFILER	\	    uses them.  */					\	fixed_regs[1] = 1;					\	fixed_regs[2] = 1;					\      }								\  }								\while (0)/* Return number of consecutive hard regs needed starting at reg REGNO   to hold something of mode MODE.   This is ordinarily the length in words of a value of mode MODE   but can be less for certain modes in special long registers.   On SPARC, ordinary registers hold 32 bits worth;   this means both integer and floating point registers.   On v9, integer regs hold 64 bits worth; floating point regs hold   32 bits worth (this includes the new fp regs as even the odd ones are   included in the hard register count).  */#define HARD_REGNO_NREGS(REGNO, MODE) \  (TARGET_ARCH64							\   ?  ((REGNO) < 32							\       ? (GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD	\       : (GET_MODE_SIZE (MODE) + 3) / 4)				\   : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))/* A subreg in 64 bit mode will have the wrong offset for a floating point   register.  The least significant part is at offset 1, compared to 0 for   integer registers.  This only applies when FMODE is a larger mode.   We also need to handle a special case of TF-->DF conversions.  */#define ALTER_HARD_SUBREG(TMODE, WORD, FMODE, REGNO)			\     (TARGET_ARCH64							\      && (REGNO) >= SPARC_FIRST_FP_REG					\      && (REGNO) <= SPARC_LAST_V9_FP_REG				\      && (TMODE) == SImode						\      && !((FMODE) == QImode || (FMODE) == HImode)			\      ? ((REGNO) + 1)							\      : ((TMODE) == DFmode && (FMODE) == TFmode)			\        ? ((REGNO) + ((WORD) * 2))					\        : ((REGNO) + (WORD)))/* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.   See sparc.c for how we initialize this.  */extern int *hard_regno_mode_classes;extern int sparc_mode_class[];#define HARD_REGNO_MODE_OK(REGNO, MODE) \  ((hard_regno_mode_classes[REGNO] & sparc_mode_class[MODE]) != 0)/* Value is 1 if it is a good idea to tie two pseudo registers   when one has mode MODE1 and one has mode MODE2.   If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,   for any hard reg, then this must be 0 for correct output.   For V9: SFmode can't be combined with other float modes, because they can't   be allocated to the %d registers.  Also, DFmode won't fit in odd %f   registers, but SFmode will.  */#define MODES_TIEABLE_P(MODE1, MODE2) \  ((MODE1) == (MODE2)						\   || (GET_MODE_CLASS (MODE1) == GET_MODE_CLASS (MODE2)		\       && (! TARGET_V9						\	   || (GET_MODE_CLASS (MODE1) != MODE_FLOAT		\	       || (MODE1 != SFmode && MODE2 != SFmode)))))/* Specify the registers used for certain standard purposes.   The values of these macros are register numbers.  *//* SPARC pc isn't overloaded on a register that the compiler knows about.  *//* #define PC_REGNUM  *//* Register to use for pushing function arguments.  */#define STACK_POINTER_REGNUM 14/* Actual top-of-stack address is 92/176 greater than the contents of the   stack pointer register for !v9/v9.  That is:   - !v9: 64 bytes for the in and local registers, 4 bytes for structure return     address, and 6*4 bytes for the 6 register parameters.   - v9: 128 bytes for the in and local registers + 6*8 bytes for the integer     parameter regs.  */#define STACK_POINTER_OFFSET FIRST_PARM_OFFSET(0)/* The stack bias (amount by which the hardware register is offset by).  */#define SPARC_STACK_BIAS ((TARGET_ARCH64 && TARGET_STACK_BIAS) ? 2047 : 0)/* Is stack biased? */#define STACK_BIAS SPARC_STACK_BIAS/* Base register for access to local variables of the function.  */#define FRAME_POINTER_REGNUM 30#if 0/* Register that is used for the return address for the flat model.  */#define RETURN_ADDR_REGNUM 15#endif/* Value should be nonzero if functions must have frame pointers.   Zero means the frame pointer need not be set up (and parms   may be accessed via the stack pointer) in functions that seem suitable.   This is computed in `reload', in reload1.c.   Used in flow.c, global.c, and reload1.c.   Being a non-leaf function does not mean a frame pointer is needed in the   flat window model.  However, the debugger won't be able to backtrace through   us with out it.  */#define FRAME_POINTER_REQUIRED \  (TARGET_FLAT ? (current_function_calls_alloca || current_function_varargs \		  || !leaf_function_p ()) \   : ! (leaf_function_p () && only_leaf_regs_used ()))/* C statement to store the difference between the frame pointer   and the stack pointer values immediately after the function prologue.   Note, we always pretend that this is a leaf function because if   it's not, there's no point in trying to eliminate the   frame pointer.  If it is a leaf function, we guessed right!  */#define INITIAL_FRAME_POINTER_OFFSET(VAR) \  ((VAR) = (TARGET_FLAT ? sparc_flat_compute_frame_size (get_frame_size ()) \	    : compute_frame_size (get_frame_size (), 1)))/* Base register for access to arguments of the function.  */#define ARG_POINTER_REGNUM FRAME_POINTER_REGNUM/* Register in which static-chain is passed to a function.  This must   not be a register used by the prologue.  */#define STATIC_CHAIN_REGNUM (TARGET_ARCH64 ? 5 : 2)/* Register which holds offset table for position-independent   data references.  */#define PIC_OFFSET_TABLE_REGNUM 23#define FINALIZE_PIC finalize_pic ()/* Pick a default value we can notice from override_options:   !v9: Default is on.   v9: Default is off.  */#define DEFAULT_PCC_STRUCT_RETURN -1/* Sparc ABI says that quad-precision floats and all structures are returned   in memory.   For v9: unions <= 32 bytes in size are returned in int regs,   structures up to 32 bytes are returned in int and fp regs.  */#define RETURN_IN_MEMORY(TYPE)				\(TARGET_ARCH32						\ ? (TYPE_MODE (TYPE) == BLKmode				\    || TYPE_MODE (TYPE) == TFmode			\    || TYPE_MODE (TYPE) == TCmode)			\ : (TYPE_MODE (TYPE) == BLKmode				\    && int_size_in_bytes (TYPE) > 32))/* Functions which return large structures get the address   to place the wanted value at offset 64 from the frame.   Must reserve 64 bytes for the in and local registers.   v9: Functions which return large structures get the address to place the   wanted value from an invisible first argument.  *//* Used only in other #defines in this file.  */#define STRUCT_VALUE_OFFSET 64#define STRUCT_VALUE \  (TARGET_ARCH64					\   ? 0							\   : gen_rtx_MEM (Pmode,				\		  gen_rtx_PLUS (Pmode, stack_pointer_rtx, \		       GEN_INT (STRUCT_VALUE_OFFSET))))#define STRUCT_VALUE_INCOMING \  (TARGET_ARCH64					\   ? 0							\   : gen_rtx_MEM (Pmode,				\		  gen_rtx_PLUS (Pmode, frame_pointer_rtx, \		       GEN_INT (STRUCT_VALUE_OFFSET))))/* Define the classes of registers for register constraints in the   machine description.  Also define ranges of constants.   One of the classes must always be named ALL_REGS and include all hard regs.   If there is more than one class, another class must be named NO_REGS   and contain no registers.   The name GENERAL_REGS must be the name of a class (or an alias for   another name such as ALL_REGS).  This is the class of registers   that is allowed by "g" or "r" in a register constraint.   Also, registers outside this class are allocated only when   instructions express preferences for them.   The classes must be numbered in nondecreasing order; that is,   a larger-numbered class must never be contained completely   in a smaller-numbered class.   For any two classes, it is very desirable that there be another   class that represents their union.  *//* The SPARC has various kinds of registers: general, floating point,   and condition codes [well, it has others as well, but none that we   care directly about].   For v9 we must distinguish between the upper and lower floating point   registers because the upper ones can't hold SFmode values.   HARD_REGNO_MODE_OK won't help here because reload assumes that register(s)   satisfying a group need for a class will also satisfy a single need for   that class.  EXTRA_FP_REGS is a bit of a misnomer as it covers all 64 fp   regs.   It is important that one class contains all the general and all the standard   fp regs.  Otherwise find_reg() won't properly allocate int regs for moves,   because reg_class_record() will bias the selection in favor of fp regs,   because reg_class_subunion[GENERAL_REGS][FP_REGS] will yield FP_REGS,   because FP_REGS > GENERAL_REGS.   It is also important that one class contain all the general and all the   fp regs.  Otherwise when spilling a DFmode reg, it may be from EXTRA_FP_REGS   but find_reloads() may use class GENERAL_OR_FP_REGS. This will cause   allocate_reload_reg() to bypass it causing an abort because the compiler   thinks it doesn't have a spill reg when in fact it does.   v9 also has 4 floating point condition code registers.  Since we don't   have a class that is the union of FPCC_REGS with either of the others,   it is important that it appear first.  Otherwise the compiler will die   trying to compile _fixunsdfsi because fix_truncdfsi2 won't match its   constraints.   It is important that SPARC_ICC_REG have class NO_REGS.  Otherwise combine   may try to use it to hold an SImode value.  See register_operand.   ??? Should %fcc[0123] be handled similarly?*/enum reg_class { NO_REGS, FPCC_REGS, I64_REGS, GENERAL_REGS, FP_REGS,		 EXTRA_FP_REGS, GENERAL_OR_FP_REGS, GENERAL_OR_EXTRA_FP_REGS,		 ALL_REGS, LIM_REG_CLASSES };#define N_REG_CLASSES (int) LIM_REG_CLASSES/* Give names of register classes as strings for dump file.   */#define REG_CLASS_NAMES \  { "NO_REGS", "FPCC_REGS", "I64_REGS", "GENERAL_REGS", "FP_REGS",	\     "EXTRA_FP_REGS", "GENERAL_OR_FP_REGS", "GENERAL_OR_EXTRA_FP_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, 0, 0, 0}, {0, 0, 0, 0xf}, {0xffff, 0, 0, 0}, \   {-1, 0, 0, 0}, {0, -1, 0, 0}, {0, -1, -1, 0}, \   {-1, -1, 0, 0}, {-1, -1, -1, 0}, {-1, -1, -1, 0x1f}}/* 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 sparc_regno_reg_class[];#define REGNO_REG_CLASS(REGNO) sparc_regno_reg_class[(REGNO)]/* This is the order in which to allocate registers normally.        We put %f0/%f1 last among the float registers, so as to make it more   likely that a pseudo-register which dies in the float return register   will get allocated to the float return register, thus saving a move   instruction at the end of the function.  */#define REG_ALLOC_ORDER \{ 8, 9, 10, 11, 12, 13, 2, 3,		\  15, 16, 17, 18, 19, 20, 21, 22,	\  23, 24, 25, 26, 27, 28, 29, 31,	\  34, 35, 36, 37, 38, 39,		/* %f2-%f7 */   \  40, 41, 42, 43, 44, 45, 46, 47,	/* %f8-%f15 */  \  48, 49, 50, 51, 52, 53, 54, 55,	/* %f16-%f23 */ \  56, 57, 58, 59, 60, 61, 62, 63,	/* %f24-%f31 */ \  64, 65, 66, 67, 68, 69, 70, 71,	/* %f32-%f39 */ \  72, 73, 74, 75, 76, 77, 78, 79,	/* %f40-%f47 */ \  80, 81, 82, 83, 84, 85, 86, 87,	/* %f48-%f55 */ \  88, 89, 90, 91, 92, 93, 94, 95,	/* %f56-%f63 */ \  32, 33,				/* %f0,%f1 */   \  96, 97, 98, 99, 100,			/* %fcc0-3, %icc */ \  1, 4, 5, 6, 7, 0, 14, 30}/* This is the order in which to allocate registers for   leaf functions.  If all registers can fit in the "i" registers,   then we have the possibility of having a leaf function.  */#define REG_LEAF_ALLOC_ORDER \{ 2, 3, 24, 25, 26, 27, 28, 29,		\  15, 8, 9, 10, 11, 12, 13,		\  16, 17, 18, 19, 20, 21, 22, 23,	\  34, 35, 36, 37, 38, 39,		\  40, 41, 42, 43, 44, 45, 46, 47,	\  48, 49, 50, 51, 52, 53, 54, 55,	\  56, 57, 58, 59, 60, 61, 62, 63,	\  64, 65, 66, 67, 68, 69, 70, 71,	\  72, 73, 74, 75, 76, 77, 78, 79,	\  80, 81, 82, 83, 84, 85, 86, 87,	\  88, 89, 90, 91, 92, 93, 94, 95,	\  32, 33,				\  96, 97, 98, 99, 100,			\  1, 4, 5, 6, 7, 0, 14, 30, 31}#define ORDER_REGS_FOR_LOCAL_ALLOC order_regs_for_local_alloc ()/* ??? %g7 is not a leaf register to effectively #undef LEAF_REGISTERS when   -mflat is used.  Function only_leaf_regs_used will return 0 if a global   register is used and is not permitted in a leaf function.  We make %g7   a global reg if -mflat and voila.  Since %g7 is a system register and is   fixed it won't be used by gcc anyway.  */#define LEAF_REGISTERS \{ 1, 1, 1, 1, 1, 1, 1, 0,	\  0, 0, 0, 0, 0, 0, 1, 0,	\  0, 0, 0, 0, 0, 0, 0, 0,	\  1, 1, 1, 1, 1, 1, 0, 1,	\  1, 1, 1, 1, 1, 1, 1, 1,	\

⌨️ 快捷键说明

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