📄 sh.h
字号:
#define LABEL_ALIGN_AFTER_BARRIER(LABEL_AFTER_BARRIER) \ barrier_align (LABEL_AFTER_BARRIER)#define LOOP_ALIGN(A_LABEL) \ ((! optimize || TARGET_HARWARD || TARGET_SMALLCODE) ? 0 : 2)#define LABEL_ALIGN(A_LABEL) \( \ (PREV_INSN (A_LABEL) \ && GET_CODE (PREV_INSN (A_LABEL)) == INSN \ && GET_CODE (PATTERN (PREV_INSN (A_LABEL))) == UNSPEC_VOLATILE \ && XINT (PATTERN (PREV_INSN (A_LABEL)), 1) == 1) \ /* explicit alignment insn in constant tables. */ \ ? INTVAL (XVECEXP (PATTERN (PREV_INSN (A_LABEL)), 0, 0)) \ : 0)/* Jump tables must be 32 bit aligned, no matter the size of the element. */#define ADDR_VEC_ALIGN(ADDR_VEC) 2/* The base two logarithm of the known minimum alignment of an insn length. */#define INSN_LENGTH_ALIGNMENT(A_INSN) \ (GET_CODE (A_INSN) == INSN \ ? 1 \ : GET_CODE (A_INSN) == JUMP_INSN || GET_CODE (A_INSN) == CALL_INSN \ ? 1 \ : CACHE_LOG)/* Standard register usage. *//* Register allocation for the Hitachi calling convention: r0 arg return r1..r3 scratch r4..r7 args in r8..r13 call saved r14 frame pointer/call saved r15 stack pointer ap arg pointer (doesn't really exist, always eliminated) pr subroutine return address t t bit mach multiply/accumulate result, high part macl multiply/accumulate result, low part. fpul fp/int communication register rap return address pointer register fr0 fp arg return fr1..fr3 scratch floating point registers fr4..fr11 fp args in fr12..fr15 call saved floating point registers *//* 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. */#define AP_REG 16#define PR_REG 17#define T_REG 18#define GBR_REG 19#define MACH_REG 20#define MACL_REG 21#define SPECIAL_REG(REGNO) ((REGNO) >= 18 && (REGNO) <= 21)#define FPUL_REG 22#define RAP_REG 23#define FIRST_FP_REG 24#define LAST_FP_REG 39#define FIRST_XD_REG 40#define LAST_XD_REG 47#define FPSCR_REG 48#define FIRST_PSEUDO_REGISTER 49/* 1 for registers that have pervasive standard uses and are not available for the register allocator. Mach register is fixed 'cause it's only 10 bits wide for SH1. It is 32 bits wide for SH2. */#define FIXED_REGISTERS \ { 0, 0, 0, 0, \ 0, 0, 0, 0, \ 0, 0, 0, 0, \ 0, 0, 0, 1, \ 1, 1, 1, 1, \ 1, 1, 0, 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, \ 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, \ 0, 0, 0, 0, \ 0, 0, 0, 1, \ 1, 0, 1, 1, \ 1, 1, 1, 1, \ 1, 1, 1, 1, \ 1, 1, 1, 1, \ 1, 1, 1, 1, \ 0, 0, 0, 0, \ 1, 1, 1, 1, \ 1, 1, 0, 0, \ 1, \}/* 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 the SH all but the XD regs are UNITS_PER_WORD bits wide. */#define HARD_REGNO_NREGS(REGNO, MODE) \ ((REGNO) >= FIRST_XD_REG && (REGNO) <= LAST_XD_REG \ ? (GET_MODE_SIZE (MODE) / (2 * UNITS_PER_WORD)) \ : ((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. We can allow any mode in any general register. The special registers only allow SImode. Don't allow any mode in the PR. *//* We cannot hold DCmode values in the XD registers because alter_reg handles subregs of them incorrectly. We could work around this by spacing the XD registers like the DR registers, but this would require additional memory in every compilation to hold larger register vectors. We could hold SFmode / SCmode values in XD registers, but that would require a tertiary reload when reloading from / to memory, and a secondary reload to reload from / to general regs; that seems to be a loosing proposition. */#define HARD_REGNO_MODE_OK(REGNO, MODE) \ (SPECIAL_REG (REGNO) ? (MODE) == SImode \ : (REGNO) == FPUL_REG ? (MODE) == SImode || (MODE) == SFmode \ : (REGNO) >= FIRST_FP_REG && (REGNO) <= LAST_FP_REG && (MODE) == SFmode \ ? 1 \ : (REGNO) >= FIRST_FP_REG && (REGNO) <= LAST_FP_REG \ ? ((MODE) == SFmode \ || (TARGET_SH3E && (MODE) == SCmode) \ || (((TARGET_SH4 && (MODE) == DFmode) || (MODE) == DCmode) \ && (((REGNO) - FIRST_FP_REG) & 1) == 0)) \ : (REGNO) >= FIRST_XD_REG && (REGNO) <= LAST_XD_REG \ ? (MODE) == DFmode \ : (REGNO) == PR_REG ? 0 \ : (REGNO) == FPSCR_REG ? (MODE) == PSImode \ : 1)/* 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. */#define MODES_TIEABLE_P(MODE1, MODE2) \ ((MODE1) == (MODE2) || GET_MODE_CLASS (MODE1) == GET_MODE_CLASS (MODE2))/* Specify the registers used for certain standard purposes. The values of these macros are register numbers. *//* Define this if the program counter is overloaded on a register. *//* #define PC_REGNUM 15*//* Register to use for pushing function arguments. */#define STACK_POINTER_REGNUM 15/* Base register for access to local variables of the function. */#define FRAME_POINTER_REGNUM 14/* Fake register that holds the address on the stack of the current function's return address. */#define RETURN_ADDRESS_POINTER_REGNUM 23/* 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. */#define FRAME_POINTER_REQUIRED 0/* Definitions for register eliminations. We have three registers that can be eliminated on the SH. First, the frame pointer register can often be eliminated in favor of the stack pointer register. Secondly, the argument pointer register can always be eliminated; it is replaced with either the stack or frame pointer. Third, there is the return address pointer, which can also be replaced with either the stack or the frame pointer. *//* This is an array of structures. Each structure initializes one pair of eliminable registers. The "from" register number is given first, followed by "to". Eliminations of the same "from" register are listed in order of preference. *//* If you add any registers here that are not actually hard registers, and that have any alternative of elimination that doesn't always apply, you need to amend calc_live_regs to exclude it, because reload spills all eliminable registers where it sees an can_eliminate == 0 entry, thus making them 'live' . If you add any hard registers that can be eliminated in different ways, you have to patch reload to spill them only when all alternatives of elimination fail. */#define ELIMINABLE_REGS \{{ FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ { RETURN_ADDRESS_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ { RETURN_ADDRESS_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \ { ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM},}/* Given FROM and TO register numbers, say whether this elimination is allowed. */#define CAN_ELIMINATE(FROM, TO) \ (!((FROM) == FRAME_POINTER_REGNUM && FRAME_POINTER_REQUIRED))/* Define the offset between two registers, one to be eliminated, and the other its replacement, at the start of a routine. */#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ OFFSET = initial_elimination_offset ((FROM), (TO))/* Base register for access to arguments of the function. */#define ARG_POINTER_REGNUM 16/* Register in which the static-chain is passed to a function. */#define STATIC_CHAIN_REGNUM 13/* The register in which a struct value address is passed. */#define STRUCT_VALUE_REGNUM 2/* If the structure value address is not passed in a register, define `STRUCT_VALUE' as an expression returning an RTX for the place where the address is passed. If it returns 0, the address is passed as an "invisible" first argument. *//*#define STRUCT_VALUE ((rtx)0)*//* Don't default to pcc-struct-return, because we have already specified exactly how to return structures in the RETURN_IN_MEMORY macro. */#define DEFAULT_PCC_STRUCT_RETURN 0/* 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 SH has two sorts of general registers, R0 and the rest. R0 can be used as the destination of some of the arithmetic ops. There are also some special purpose registers; the T bit register, the Procedure Return Register and the Multiply Accumulate Registers. *//* Place GENERAL_REGS after FPUL_REGS so that it will be preferred by reg_class_subunion. We don't want to have an actual union class of these, because it would only be used when both classes are calculated to give the same cost, but there is only one FPUL register. Besides, regclass fails to notice the different REGISTER_MOVE_COSTS applying to the actual instruction alternative considered. E.g., the y/r alternative of movsi_ie is considered to have no more cost that the r/r alternative, which is patently untrue. */enum reg_class{ NO_REGS, R0_REGS, PR_REGS, T_REGS, MAC_REGS, FPUL_REGS, GENERAL_REGS, FP0_REGS, FP_REGS, DF_REGS, FPSCR_REGS, GENERAL_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", \ "R0_REGS", \ "PR_REGS", \ "T_REGS", \ "MAC_REGS", \ "FPUL_REGS", \ "GENERAL_REGS", \ "FP0_REGS", \ "FP_REGS", \ "DF_REGS", \ "FPSCR_REGS", \ "GENERAL_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 \{ \ { 0x00000000, 0x00000000 }, /* NO_REGS */ \ { 0x00000001, 0x00000000 }, /* R0_REGS */ \ { 0x00020000, 0x00000000 }, /* PR_REGS */ \ { 0x00040000, 0x00000000 }, /* T_REGS */ \ { 0x00300000, 0x00000000 }, /* MAC_REGS */ \ { 0x00400000, 0x00000000 }, /* FPUL_REGS */ \ { 0x0081FFFF, 0x00000000 }, /* GENERAL_REGS */ \ { 0x01000000, 0x00000000 }, /* FP0_REGS */ \ { 0xFF000000, 0x000000FF }, /* FP_REGS */ \ { 0xFF000000, 0x0000FFFF }, /* DF_REGS */ \ { 0x00000000, 0x00010000 }, /* FPSCR_REGS */ \ { 0xFF81FFFF, 0x0000FFFF }, /* GENERAL_FP_REGS */ \ { 0xFFFFFFFF, 0x0001FFFF }, /* 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 int regno_reg_class[];#define REGNO_REG_CLASS(REGNO) regno_reg_class[(REGNO)]/* When defined, the compiler allows registers explicitly used in the rtl to be used as spill registers but prevents the compiler from
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -