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

📄 sparc.h

📁 这是leon3处理器的交叉编译链
💻 H
📖 第 1 页 / 共 5 页
字号:
	  leaf_reg_remap [regno] = regno;			\      }								\  }								\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 || (REGNO) == FRAME_POINTER_REGNUM			\      ? (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))/* Due to the ARCH64 descrepancy above we must override this next   macro too.  */#define REGMODE_NATURAL_SIZE(MODE) \  ((TARGET_ARCH64 && FLOAT_MODE_P (MODE)) ? 4 : UNITS_PER_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 const int *hard_regno_mode_classes;extern int sparc_mode_class[];/* ??? Because of the funny way we pass parameters we should allow certain   ??? types of float/complex values to be in integer registers during   ??? RTL generation.  This only matters on arch32.  */#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/* The stack bias (amount by which the hardware register is offset by).  */#define SPARC_STACK_BIAS ((TARGET_ARCH64 && TARGET_STACK_BIAS) ? 2047 : 0)/* 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) + SPARC_STACK_BIAS)/* Base register for access to local variables of the function.  */#define HARD_FRAME_POINTER_REGNUM 30/* The soft frame pointer does not have the stack bias applied.  */#define FRAME_POINTER_REGNUM 101/* Given the stack bias, the stack pointer isn't actually aligned.  */#define INIT_EXPANDERS							 \  do {									 \    if (cfun && cfun->emit->regno_pointer_align && SPARC_STACK_BIAS)	 \      {									 \	REGNO_POINTER_ALIGN (STACK_POINTER_REGNUM) = BITS_PER_UNIT;	 \	REGNO_POINTER_ALIGN (HARD_FRAME_POINTER_REGNUM) = BITS_PER_UNIT; \      }									 \  } while (0)/* 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 ()))/* 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 (flag_pic ? 23 : INVALID_REGNUM)/* 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				\    && (unsigned HOST_WIDE_INT) 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, plus_constant (stack_pointer_rtx, \					STRUCT_VALUE_OFFSET)))#define STRUCT_VALUE_INCOMING \  (TARGET_ARCH64						\   ? 0								\   : gen_rtx_MEM (Pmode, plus_constant (frame_pointer_rtx,	\					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},	/* NO_REGS */			\   {0, 0, 0, 0xf},	/* FPCC_REGS */			\   {0xffff, 0, 0, 0},	/* I64_REGS */			\   {-1, 0, 0, 0x20},	/* GENERAL_REGS */		\   {0, -1, 0, 0},	/* FP_REGS */			\   {0, -1, -1, 0},	/* EXTRA_FP_REGS */		\   {-1, -1, 0, 0x20},	/* GENERAL_OR_FP_REGS */	\   {-1, -1, -1, 0x20},	/* GENERAL_OR_EXTRA_FP_REGS */	\   {-1, -1, -1, 0x3f}}	/* ALL_REGS *//* 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[FIRST_PSEUDO_REGISTER];#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, 101}/* This is the order in which to allocate registers for   leaf functions.  If all registers can fit in the "gi" registers,   then we have the possibility of having a leaf function.  */#define REG_LEAF_ALLOC_ORDER \{ 2, 3, 24, 25, 26, 27, 28, 29,		\  4, 5, 6, 7, 1,			\  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,			\  0, 14, 30, 31, 101}  #define ORDER_REGS_FOR_LOCAL_ALLOC order_regs_for_local_alloc ()extern char sparc_leaf_regs[];#define LEAF_REGISTERS sparc_leaf_regsextern char leaf_reg_remap[];#define LEAF_REG_REMAP(REGNO) (leaf_reg_remap[REGNO])/* The class value for index registers, and the one for base regs.  */#define INDEX_REG_CLASS GENERAL_REGS#define BASE_REG_CLASS GENERAL_REGS/* Local macro to handle the two v9 classes of FP regs.  */#define FP_REG_CLASS_P(CLASS) ((CLASS) == FP_REGS || (CLASS) == EXTRA_FP_REGS)/* Get reg_class from a letter such as appears in the machine description.   In the not-v9 case, coerce v9's 'e' class to 'f', so we can use 'e' in the   .md file for v8 and v9.   'd' and 'b' are used for single and double precision VIS operations,   if TARGET_VIS.   'h' is used for V8+ 64 bit global and out registers.  */#define REG_CLASS_FROM_LETTER(C)		\(TARGET_V9					\ ? ((C) == 'f' ? FP_REGS			\    : (C) == 'e' ? EXTRA_FP_REGS 		\    : (C) == 'c' ? FPCC_REGS			\    : ((C) == 'd' && TARGET_VIS) ? FP_REGS\    : ((C) == 'b' && TARGET_VIS) ? EXTRA_FP_REGS\    : ((C) == 'h' && TARGET_V8PLUS) ? I64_REGS\    : NO_REGS)					\ : ((C) == 'f' ? FP_REGS			\    : (C) == 'e' ? FP_REGS			\    : (C) == 'c' ? FPCC_REGS			\    : 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 used for the range of constants an insn can actually contain.   `J' is used for the range which is just zero (since that is R0).   `K' is used for constants which can be loaded with a single sethi insn.   `L' is used for the range of constants supported by the movcc insns.   `M' is used for the range of constants supported by the movrcc insns.   `N' is like K, but for constants wider than 32 bits.  */#define SPARC_SIMM10_P(X) ((unsigned HOST_WIDE_INT) (X) + 0x200 < 0x400)#define SPARC_SIMM11_P(X) ((unsigned HOST_WIDE_INT) (X) + 0x400 < 0x800)

⌨️ 快捷键说明

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