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

📄 sparc.h

📁 gcc库的原代码,对编程有很大帮助.
💻 H
📖 第 1 页 / 共 5 页
字号:
/* target machine storage layout *//* Define for cross-compilation to a sparc target with no TFmode from a host   with a different float format (e.g. VAX).  */#define REAL_ARITHMETIC/* Define this if most significant bit is lowest numbered   in instructions that operate on numbered bit-fields.  */#define BITS_BIG_ENDIAN 1/* Define this if most significant byte of a word is the lowest numbered.  *//* This is true on the SPARC.  */#define BYTES_BIG_ENDIAN 1/* Define this if most significant word of a multiword number is the lowest   numbered.  *//* Doubles are stored in memory with the high order word first.  This   matters when cross-compiling.  */#define WORDS_BIG_ENDIAN 1/* number of bits in an addressable storage unit */#define BITS_PER_UNIT 8/* Width in bits of a "word", which is the contents of a machine register.   Note that this is not necessarily the width of data type `int';   if using 16-bit ints on a 68000, this would still be 32.   But on a machine with 16-bit registers, this would be 16.  */#define BITS_PER_WORD		(TARGET_V9 ? 64 : 32)#define MAX_BITS_PER_WORD	64/* Width of a word, in units (bytes).  */#define UNITS_PER_WORD		(TARGET_V9 ? 8 : 4)#define MIN_UNITS_PER_WORD	4/* Now define the sizes of the C data types.  */#define SHORT_TYPE_SIZE		16#define INT_TYPE_SIZE		(TARGET_INT64 ? 64 : 32)#define LONG_TYPE_SIZE		(TARGET_LONG64 ? 64 : 32)#define LONG_LONG_TYPE_SIZE	64#define FLOAT_TYPE_SIZE		32#define DOUBLE_TYPE_SIZE	64#define MAX_INT_TYPE_SIZE	64#define MAX_LONG_TYPE_SIZE	64#ifdef SPARCV9/* ??? This does not work in SunOS 4.x, so it is not enabled here.   Instead, it is enabled in sol2.h, because it does work under Solaris.  *//* Define for support of TFmode long double and REAL_ARITHMETIC.   Sparc ABI says that long double is 4 words.  */#define LONG_DOUBLE_TYPE_SIZE 128#endif/* Width in bits of a pointer.   See also the macro `Pmode' defined below.  */#define POINTER_SIZE (TARGET_PTR64 ? 64 : 32)/* Allocation boundary (in *bits*) for storing arguments in argument list.  */#define PARM_BOUNDARY (TARGET_V9 ? 64 : 32)/* Boundary (in *bits*) on which stack pointer should be aligned.  */#define STACK_BOUNDARY (TARGET_V9 ? 128 : 64)/* ALIGN FRAMES on double word boundaries */#define SPARC_STACK_ALIGN(LOC) \  (TARGET_V9 ? (((LOC)+15) & ~15) : (((LOC)+7) & ~7))/* Allocation boundary (in *bits*) for the code of a function.  */#define FUNCTION_BOUNDARY 32/* Alignment of field after `int : 0' in a structure.  *//* ??? Should this be based on TARGET_INT64?  */#define EMPTY_FIELD_BOUNDARY (TARGET_V9 ? 64 : 32)/* Every structure's size must be a multiple of this.  */#define STRUCTURE_SIZE_BOUNDARY 8/* A bitfield declared as `int' forces `int' alignment for the struct.  */#define PCC_BITFIELD_TYPE_MATTERS 1/* No data type wants to be aligned rounder than this.  */#define BIGGEST_ALIGNMENT (TARGET_V9 ? 128 : 64)/* The best alignment to use in cases where we have a choice.  */#define FASTEST_ALIGNMENT 64/* Make strings word-aligned so strcpy from constants will be faster.  */#define CONSTANT_ALIGNMENT(EXP, ALIGN)  \  ((TREE_CODE (EXP) == STRING_CST	\    && (ALIGN) < FASTEST_ALIGNMENT)	\   ? FASTEST_ALIGNMENT : (ALIGN))/* Make arrays of chars word-aligned for the same reasons.  */#define DATA_ALIGNMENT(TYPE, ALIGN)		\  (TREE_CODE (TYPE) == ARRAY_TYPE		\   && TYPE_MODE (TREE_TYPE (TYPE)) == QImode	\   && (ALIGN) < FASTEST_ALIGNMENT ? FASTEST_ALIGNMENT : (ALIGN))/* Set this nonzero if move instructions will actually fail to work   when given unaligned data.  */#define STRICT_ALIGNMENT 1/* Things that must be doubleword aligned cannot go in the text section,   because the linker fails to align the text section enough!   Put them in the data section.  This macro is only used in this file.  */#define MAX_TEXT_ALIGN 32/* This forces all variables and constants to the data section when PIC.   This is because the SunOS 4 shared library scheme thinks everything in   text is a function, and patches the address to point to a loader stub.  *//* This is defined to zero for every system which doesn't use the a.out object   file format.  */#ifndef SUNOS4_SHARED_LIBRARIES#define SUNOS4_SHARED_LIBRARIES 0#endif/* This is defined differently for v9 in a cover file.  */#define SELECT_SECTION(T,RELOC)						\{									\  if (TREE_CODE (T) == VAR_DECL)					\    {									\      if (TREE_READONLY (T) && ! TREE_SIDE_EFFECTS (T)			\	  && DECL_INITIAL (T)						\	  && (DECL_INITIAL (T) == error_mark_node			\	      || TREE_CONSTANT (DECL_INITIAL (T)))			\	  && DECL_ALIGN (T) <= MAX_TEXT_ALIGN				\	  && ! (flag_pic && ((RELOC) || SUNOS4_SHARED_LIBRARIES)))	\	text_section ();						\      else								\	data_section ();						\    }									\  else if (TREE_CODE (T) == CONSTRUCTOR)				\    {									\      if (flag_pic && ((RELOC) || SUNOS4_SHARED_LIBRARIES))		\	data_section ();						\    }									\  else if (TREE_CODE_CLASS (TREE_CODE (T)) == 'c')			\    {									\      if ((TREE_CODE (T) == STRING_CST && flag_writable_strings)	\	  || TYPE_ALIGN (TREE_TYPE (T)) > MAX_TEXT_ALIGN		\	  || (flag_pic && ((RELOC) || SUNOS4_SHARED_LIBRARIES)))	\	data_section ();						\      else								\	text_section ();						\    }									\}/* Use text section for a constant   unless we need more alignment than that offers.  *//* This is defined differently for v9 in a cover file.  */#define SELECT_RTX_SECTION(MODE, X)		\{						\  if (GET_MODE_BITSIZE (MODE) <= MAX_TEXT_ALIGN \      && ! (flag_pic && (symbolic_operand (X) || SUNOS4_SHARED_LIBRARIES)))  \    text_section ();				\  else						\    data_section ();				\}/* Standard register usage.  *//* Number of actual hardware registers.   The hardware registers are assigned numbers for the compiler   from 0 to just below FIRST_PSEUDO_REGISTER.   All registers that the compiler knows about must be given numbers,   even those that are not normally considered general registers.   SPARC has 32 integer registers and 32 floating point registers.   64 bit SPARC has 32 additional fp regs, but the odd numbered ones are not   accessible.  We still account for them to simplify register computations   (eg: in CLASS_MAX_NREGS).  There are also 4 fp condition code registers, so   32+32+32+4 == 100.   Register 0 is used as the integer condition code register.  */#ifdef SPARCV9#define FIRST_PSEUDO_REGISTER 100#else#define FIRST_PSEUDO_REGISTER 64#endif/* 1 for registers that have pervasive standard uses   and are not available for the register allocator.   g0 is used for the condition code and not to represent %g0, which is   hardwired to 0, so reg 0 is *not* fixed.   On non-v9 systems:   g1 is free to use as temporary.   g2-g4 are reserved for applications.  Gcc normally uses them as   temporaries, but this can be disabled via the -mno-app-regs option.   g5 through g7 are reserved for the operating system.   On v9 systems:   g1 and g5 are free to use as temporaries.   g2-g4 are reserved for applications (the compiler will not normally use   them, but they can be used as temporaries with -mapp-regs).   g6-g7 are reserved for the operating system.   ??? Register 1 is used as a temporary by the 64 bit sethi pattern, so must   currently be a fixed register until this pattern is rewritten.   Register 1 is also used when restoring call-preserved registers in large   stack frames.  */#ifdef SPARCV9#define FIXED_REGISTERS  \ {0, 1, 1, 1, 1, 0, 1, 1,	\  0, 0, 0, 0, 0, 0, 1, 0,	\  0, 0, 0, 0, 0, 0, 0, 0,	\  0, 0, 0, 0, 0, 0, 1, 1,	\				\  0, 0, 0, 0, 0, 0, 0, 0,	\  0, 0, 0, 0, 0, 0, 0, 0,	\  0, 0, 0, 0, 0, 0, 0, 0,	\  0, 0, 0, 0, 0, 0, 0, 0,	\				\  0, 0, 0, 0, 0, 0, 0, 0,	\  0, 0, 0, 0, 0, 0, 0, 0,	\  0, 0, 0, 0, 0, 0, 0, 0,	\  0, 0, 0, 0, 0, 0, 0, 0,	\				\  0, 0, 0, 0}#else#define FIXED_REGISTERS  \ {0, 0, 0, 0, 0, 1, 1, 1,	\  0, 0, 0, 0, 0, 0, 1, 0,	\  0, 0, 0, 0, 0, 0, 0, 0,	\  0, 0, 0, 0, 0, 0, 1, 1,	\				\  0, 0, 0, 0, 0, 0, 0, 0,	\  0, 0, 0, 0, 0, 0, 0, 0,	\  0, 0, 0, 0, 0, 0, 0, 0,	\  0, 0, 0, 0, 0, 0, 0, 0}#endif/* 1 for registers not available across function calls.   These must include the FIXED_REGISTERS and also any   registers that can be used without being saved.   The latter must include the registers where values are returned   and the register where structure-value addresses are passed.   Aside from that, you can include as many other registers as you like.  */#ifdef SPARCV9#define CALL_USED_REGISTERS  \ {1, 1, 1, 1, 1, 1, 1, 1,	\  1, 1, 1, 1, 1, 1, 1, 1,	\  0, 0, 0, 0, 0, 0, 0, 0,	\  0, 0, 0, 0, 0, 0, 1, 1,	\				\  1, 1, 1, 1, 1, 1, 1, 1,	\  1, 1, 1, 1, 1, 1, 1, 1,	\  0, 0, 0, 0, 0, 0, 0, 0,	\  0, 0, 0, 0, 0, 0, 0, 0,	\				\  0, 0, 0, 0, 0, 0, 0, 0,	\  0, 0, 0, 0, 0, 0, 0, 0,	\  1, 1, 1, 1, 1, 1, 1, 1,	\  1, 1, 1, 1, 1, 1, 1, 1,	\				\  1, 1, 1, 1}#else#define CALL_USED_REGISTERS  \ {1, 1, 1, 1, 1, 1, 1, 1,	\  1, 1, 1, 1, 1, 1, 1, 1,	\  0, 0, 0, 0, 0, 0, 0, 0,	\  0, 0, 0, 0, 0, 0, 1, 1,	\				\  1, 1, 1, 1, 1, 1, 1, 1,	\  1, 1, 1, 1, 1, 1, 1, 1,	\  1, 1, 1, 1, 1, 1, 1, 1,	\  1, 1, 1, 1, 1, 1, 1, 1}#endif/* If !TARGET_FPU, then make the fp registers fixed so that they won't   be allocated.  On v9, also make the fp cc regs fixed.  */#define CONDITIONAL_REGISTER_USAGE				\do								\  {								\    if (! TARGET_FPU)						\      {								\	int regno;						\	for (regno = 32; regno < FIRST_PSEUDO_REGISTER; regno++) \	  fixed_regs[regno] = 1;				\      }								\    if (! TARGET_APP_REGS)					\      {								\	fixed_regs[2] = 1;					\	fixed_regs[3] = 1;					\	fixed_regs[4] = 1;					\      }								\    else							\      {								\	fixed_regs[2] = 0;					\	fixed_regs[3] = 0;					\	fixed_regs[4] = TARGET_MEDANY != 0;			\      }								\    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_V9								\   ?  ((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))/* 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,

⌨️ 快捷键说明

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