sparc.h
来自「GCC编译器源代码」· C头文件 代码 · 共 1,699 行 · 第 1/5 页
H
1,699 行
#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 (1 << (sparc_align_funcs + 3))/* 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 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_ARCH64 ? 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 100 is used as the integer condition code register. */#define FIRST_PSEUDO_REGISTER 101#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, 0, 0, 0, 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, 0}/* 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}/* 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 (TARGET_ARCH32) \ { \ fixed_regs[5] = 1; \ } \ else \ { \ fixed_regs[1] = 1; \ } \ 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; \ } \ /* 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))/* 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 \
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?