📄 sparc.h
字号:
PROCESSOR_SUPERSPARC, PROCESSOR_SPARCLITE, PROCESSOR_F930, PROCESSOR_F934, PROCESSOR_HYPERSPARC, PROCESSOR_SPARCLITE86X, PROCESSOR_SPARCLET, PROCESSOR_TSC701, PROCESSOR_V9, PROCESSOR_ULTRASPARC, PROCESSOR_ULTRASPARC3};/* This is set from -m{cpu,tune}=xxx. */extern enum processor_type sparc_cpu;/* Recast the cpu class to be the cpu attribute. Every file includes us, but not every file includes insn-attr.h. */#define sparc_cpu_attr ((enum attr_cpu) sparc_cpu)#define TARGET_OPTIONS \{ \ { "cpu=", &sparc_select[1].string, \ N_("Use features of and schedule code for given CPU"), 0}, \ { "tune=", &sparc_select[2].string, \ N_("Schedule code for given CPU"), 0}, \ { "cmodel=", &sparc_cmodel_string, \ N_("Use given SPARC code model"), 0}, \ SUBTARGET_OPTIONS \}/* This is meant to be redefined in target specific files. */#define SUBTARGET_OPTIONS/* Support for a compile-time default CPU, et cetera. The rules are: --with-cpu is ignored if -mcpu is specified. --with-tune is ignored if -mtune is specified. --with-float is ignored if -mhard-float, -msoft-float, -mfpu, or -mno-fpu are specified. */#define OPTION_DEFAULT_SPECS \ {"cpu", "%{!mcpu=*:-mcpu=%(VALUE)}" }, \ {"tune", "%{!mtune=*:-mtune=%(VALUE)}" }, \ {"float", "%{!msoft-float:%{!mhard-float:%{!fpu:%{!no-fpu:-m%(VALUE)-float}}}}" }/* sparc_select[0] is reserved for the default cpu. */struct sparc_cpu_select{ const char *string; const char *const name; const int set_tune_p; const int set_arch_p;};extern struct sparc_cpu_select sparc_select[];/* target machine storage layout *//* 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. */#define BYTES_BIG_ENDIAN 1/* Define this if most significant word of a multiword number is the lowest numbered. */#define WORDS_BIG_ENDIAN 1/* Define this to set the endianness to use in libgcc2.c, which can not depend on target_flags. */#if defined (__LITTLE_ENDIAN__) || defined(__LITTLE_ENDIAN_DATA__)#define LIBGCC2_WORDS_BIG_ENDIAN 0#else#define LIBGCC2_WORDS_BIG_ENDIAN 1#endif#define MAX_BITS_PER_WORD 64/* Width of a word, in units (bytes). */#define UNITS_PER_WORD (TARGET_ARCH64 ? 8 : 4)#ifdef IN_LIBGCC2#define MIN_UNITS_PER_WORD UNITS_PER_WORD#else#define MIN_UNITS_PER_WORD 4#endif#define UNITS_PER_SIMD_WORD (TARGET_VIS ? 8 : 0)/* Now define the sizes of the C data types. */#define SHORT_TYPE_SIZE 16#define INT_TYPE_SIZE 32#define LONG_TYPE_SIZE (TARGET_ARCH64 ? 64 : 32)#define LONG_LONG_TYPE_SIZE 64#define FLOAT_TYPE_SIZE 32#define DOUBLE_TYPE_SIZE 64/* LONG_DOUBLE_TYPE_SIZE is defined per OS even though the SPARC ABI says that it is 128-bit wide. *//* #define LONG_DOUBLE_TYPE_SIZE 128 *//* Width in bits of a pointer. See also the macro `Pmode' defined below. */#define POINTER_SIZE (TARGET_PTR64 ? 64 : 32)/* If we have to extend pointers (only when TARGET_ARCH64 and not TARGET_PTR64), we want to do it unsigned. This macro does nothing if ptr_mode and Pmode are the same. */#define POINTERS_EXTEND_UNSIGNED 1/* For TARGET_ARCH64 we need this, as we don't have instructions for arithmetic operations which do zero/sign extension at the same time, so without this we end up with a srl/sra after every assignment to an user variable, which means very very bad code. */#define PROMOTE_FUNCTION_MODE(MODE, UNSIGNEDP, TYPE) \if (TARGET_ARCH64 \ && GET_MODE_CLASS (MODE) == MODE_INT \ && GET_MODE_SIZE (MODE) < UNITS_PER_WORD) \ (MODE) = word_mode;/* Allocation boundary (in *bits*) for storing arguments in argument list. */#define PARM_BOUNDARY (TARGET_ARCH64 ? 64 : 32)/* Boundary (in *bits*) on which stack pointer should be aligned. *//* FIXME, this is wrong when TARGET_ARCH64 and TARGET_STACK_BIAS, because then sp+2047 is 128-bit aligned so sp is really only byte-aligned. */#define STACK_BOUNDARY (TARGET_ARCH64 ? 128 : 64)/* Temporary hack until the FIXME above is fixed. This macro is used only in pad_to_arg_alignment in function.c; see the comment there for details about what it does. */#define SPARC_STACK_BOUNDARY_HACK (TARGET_ARCH64 && TARGET_STACK_BIAS)/* ALIGN FRAMES on double word boundaries */#define SPARC_STACK_ALIGN(LOC) \ (TARGET_ARCH64 ? (((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. */#define EMPTY_FIELD_BOUNDARY (TARGET_ARCH64 ? 64 : 32)/* Every structure's size must be a multiple of this. */#define STRUCTURE_SIZE_BOUNDARY 8/* A bit-field 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_ARCH64 ? 128 : 64)/* The best alignment to use in cases where we have a choice. */#define FASTEST_ALIGNMENT 64/* Define this macro as an expression for the alignment of a structure (given by STRUCT as a tree node) if the alignment computed in the usual way is COMPUTED and the alignment explicitly specified was SPECIFIED. The default is to use SPECIFIED if it is larger; otherwise, use the smaller of COMPUTED and `BIGGEST_ALIGNMENT' */#define ROUND_TYPE_ALIGN(STRUCT, COMPUTED, SPECIFIED) \ (TARGET_FASTER_STRUCTS ? \ ((TREE_CODE (STRUCT) == RECORD_TYPE \ || TREE_CODE (STRUCT) == UNION_TYPE \ || TREE_CODE (STRUCT) == QUAL_UNION_TYPE) \ && TYPE_FIELDS (STRUCT) != 0 \ ? MAX (MAX ((COMPUTED), (SPECIFIED)), BIGGEST_ALIGNMENT) \ : MAX ((COMPUTED), (SPECIFIED))) \ : MAX ((COMPUTED), (SPECIFIED)))/* 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/* 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 (e.g.: in CLASS_MAX_NREGS). There are also 4 fp condition code registers, so 32+32+32+4 == 100. Register 100 is used as the integer condition code register. Register 101 is used as the soft frame pointer register. */#define FIRST_PSEUDO_REGISTER 102#define SPARC_FIRST_FP_REG 32/* Additional V9 fp regs. */#define SPARC_FIRST_V9_FP_REG 64#define SPARC_LAST_V9_FP_REG 95/* V9 %fcc[0123]. V8 uses (figuratively) %fcc0. */#define SPARC_FIRST_V9_FCC_REG 96#define SPARC_LAST_V9_FCC_REG 99/* V8 fcc reg. */#define SPARC_FCC_REG 96/* Integer CC reg. We don't distinguish %icc from %xcc. */#define SPARC_ICC_REG 100/* Nonzero if REGNO is an fp reg. */#define SPARC_FP_REG_P(REGNO) \((REGNO) >= SPARC_FIRST_FP_REG && (REGNO) <= SPARC_LAST_V9_FP_REG)/* Argument passing regs. */#define SPARC_OUTGOING_INT_ARG_FIRST 8#define SPARC_INCOMING_INT_ARG_FIRST 24#define SPARC_FP_ARG_FIRST 32/* 1 for registers that have pervasive standard uses and are not available for the register allocator. 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,g5 are free to use as temporaries, and are free to use between calls if the call is to an external function via the PLT. g4 is free to use as a temporary in the non-embedded case. g4 is reserved in the embedded case. g2-g3 are reserved for applications. Gcc normally uses them as temporaries, but this can be disabled via the -mno-app-regs option. g6-g7 are reserved for the operating system (or application in embedded case). ??? 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. Registers fixed in arch32 and not arch64 (or vice-versa) are marked in CONDITIONAL_REGISTER_USAGE in order to properly handle -ffixed-.*/#define FIXED_REGISTERS \ {1, 0, 2, 2, 2, 2, 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, 0, 1}/* 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. */#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, \ \ 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, 1, 1, 1, 1}/* If !TARGET_FPU, then make the fp registers and fp cc regs fixed so that they won't be allocated. */#define CONDITIONAL_REGISTER_USAGE \do \ { \ if (PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM) \ { \ fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \ call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \ } \ /* If the user has passed -f{fixed,call-{used,saved}}-g5 */ \ /* then honor it. */ \ if (TARGET_ARCH32 && fixed_regs[5]) \ fixed_regs[5] = 1; \ else if (TARGET_ARCH64 && fixed_regs[5] == 2) \ fixed_regs[5] = 0; \ if (! TARGET_V9) \ { \ int regno; \ for (regno = SPARC_FIRST_V9_FP_REG; \ regno <= SPARC_LAST_V9_FP_REG; \ regno++) \ fixed_regs[regno] = 1; \ /* %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; \ } \ /* If the user has passed -f{fixed,call-{used,saved}}-g2 */ \ /* then honor it. Likewise with g3 and g4. */ \ if (fixed_regs[2] == 2) \ fixed_regs[2] = ! TARGET_APP_REGS; \ if (fixed_regs[3] == 2) \ fixed_regs[3] = ! TARGET_APP_REGS; \ if (TARGET_ARCH32 && fixed_regs[4] == 2) \ fixed_regs[4] = ! TARGET_APP_REGS; \ else if (TARGET_CM_EMBMEDANY) \ fixed_regs[4] = 1; \
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -