📄 sh.h
字号:
#define SHMEDIA_REGS_STACK_ADJUST() \ (TARGET_SHCOMPACT && current_function_has_nonlocal_label \ ? (8 * (/* r28-r35 */ 8 + /* r44-r59 */ 16 + /* tr5-tr7 */ 3) \ + (TARGET_FPU_ANY ? 4 * (/* fr36 - fr63 */ 28) : 0)) \ : 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, SIBCALL_REGS, GENERAL_REGS, FP0_REGS, FP_REGS, DF_REGS, FPSCR_REGS, GENERAL_FP_REGS, TARGET_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", \ "SIBCALL_REGS", \ "GENERAL_REGS", \ "FP0_REGS", \ "FP_REGS", \ "DF_REGS", \ "FPSCR_REGS", \ "GENERAL_FP_REGS", \ "TARGET_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 \{ \/* NO_REGS: */ \ { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, \/* R0_REGS: */ \ { 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, \/* PR_REGS: */ \ { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00040000 }, \/* T_REGS: */ \ { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00080000 }, \/* MAC_REGS: */ \ { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00300000 }, \/* FPUL_REGS: */ \ { 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00400000 }, \/* SIBCALL_REGS: Initialized in CONDITIONAL_REGISTER_USAGE. */ \ { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, \/* GENERAL_REGS: */ \ { 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x01020000 }, \/* FP0_REGS: */ \ { 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000 }, \/* FP_REGS: */ \ { 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0x00000000 }, \/* DF_REGS: */ \ { 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0x0000ff00 }, \/* FPSCR_REGS: */ \ { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00800000 }, \/* GENERAL_FP_REGS: */ \ { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0x0102ff00 }, \/* TARGET_REGS: */ \ { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000000ff }, \/* ALL_REGS: */ \ { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0x01ffffff }, \} /* 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[FIRST_PSEUDO_REGISTER];#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 extending the lifetime of these registers. */#define SMALL_REGISTER_CLASSES (! TARGET_SHMEDIA)/* The order in which register should be allocated. *//* Sometimes FP0_REGS becomes the preferred class of a floating point pseudo, and GENERAL_FP_REGS the alternate class. Since FP0 is likely to be spilled or used otherwise, we better have the FP_REGS allocated first. */#define REG_ALLOC_ORDER \ { 65, 66, 67, 68, 69, 70, 71, 64, \ 72, 73, 74, 75, 76, 77, 78, 79, \ 136,137,138,139,140,141,142,143, \ 80, 81, 82, 83, 84, 85, 86, 87, \ 88, 89, 90, 91, 92, 93, 94, 95, \ 96, 97, 98, 99,100,101,102,103, \ 104,105,106,107,108,109,110,111, \ 112,113,114,115,116,117,118,119, \ 120,121,122,123,124,125,126,127, \ 151, 1, 2, 3, 7, 6, 5, 4, \ 0, 8, 9, 10, 11, 12, 13, 14, \ 16, 17, 18, 19, 20, 21, 22, 23, \ 24, 25, 26, 27, 28, 29, 30, 31, \ 32, 33, 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, \ 150, 15,145,146,147,144,148,149, \ 128,129,130,131,132,133,134,135, \ 152 }/* The class value for index registers, and the one for base regs. */#define INDEX_REG_CLASS (TARGET_SHMEDIA ? GENERAL_REGS : R0_REGS)#define BASE_REG_CLASS GENERAL_REGS/* Get reg_class from a letter such as appears in the machine description. */extern const enum reg_class reg_class_from_letter[];#define REG_CLASS_FROM_LETTER(C) \ ( ISLOWER (C) ? reg_class_from_letter[(C)-'a'] : 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: arithmetic operand -127..128, as used in add, sub, etc J: arithmetic operand -32768..32767, as used in SHmedia movi and shori K: shift operand 1,2,8 or 16 L: logical operand 0..255, as used in and, or, etc. M: constant 1 N: constant 0 O: arithmetic operand -32..31, as used in SHmedia beqi, bnei and xori P: arithmetic operand -512..511, as used in SHmedia andi, ori*/#define CONST_OK_FOR_I(VALUE) (((HOST_WIDE_INT)(VALUE))>= -128 \ && ((HOST_WIDE_INT)(VALUE)) <= 127)#define CONST_OK_FOR_J(VALUE) (((HOST_WIDE_INT)(VALUE)) >= -32768 \ && ((HOST_WIDE_INT)(VALUE)) <= 32767)#define CONST_OK_FOR_K(VALUE) ((VALUE)==1||(VALUE)==2||(VALUE)==8||(VALUE)==16)#define CONST_OK_FOR_L(VALUE) (((HOST_WIDE_INT)(VALUE))>= 0 \ && ((HOST_WIDE_INT)(VALUE)) <= 255)#define CONST_OK_FOR_M(VALUE) ((VALUE)==1)#define CONST_OK_FOR_N(VALUE) ((VALUE)==0)#define CONST_OK_FOR_O(VALUE) (((HOST_WIDE_INT)(VALUE)) >= -32 \ && ((HOST_WIDE_INT)(VALUE)) <= 31)#define CONST_OK_FOR_P(VALUE) (((HOST_WIDE_INT)(VALUE)) >= -512 \ && ((HOST_WIDE_INT)(VALUE)) <= 511)#define CONST_OK_FOR_LETTER_P(VALUE, C) \ ((C) == 'I' ? CONST_OK_FOR_I (VALUE) \ : (C) == 'J' ? CONST_OK_FOR_J (VALUE) \ : (C) == 'K' ? CONST_OK_FOR_K (VALUE) \ : (C) == 'L' ? CONST_OK_FOR_L (VALUE) \ : (C) == 'M' ? CONST_OK_FOR_M (VALUE) \ : (C) == 'N' ? CONST_OK_FOR_N (VALUE) \ : (C) == 'O' ? CONST_OK_FOR_O (VALUE) \ : (C) == 'P' ? CONST_OK_FOR_P (VALUE) \ : 0)/* Similar, but for floating constants, and defining letters G and H. Here VALUE is the CONST_DOUBLE rtx itself. */#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \((C) == 'G' ? (fp_zero_operand (VALUE) && fldi_ok ()) \ : (C) == 'H' ? (fp_one_operand (VALUE) && fldi_ok ()) \ : (C) == 'F')/* Given an rtx X being reloaded into a reg required to be in class CLASS, return the class of reg to actually use. In general this is just CLASS; but on some machines in some cases it is preferable to use a more restrictive class. */#define PREFERRED_RELOAD_CLASS(X, CLASS) \ ((CLASS) == NO_REGS && TARGET_SHMEDIA \ && (GET_CODE (X) == CONST_DOUBLE \ || GET_CODE (X) == SYMBOL_REF) \ ? GENERAL_REGS \ : (CLASS)) \#define SECONDARY_OUTPUT_RELOAD_CLASS(CLASS,MODE,X) \ ((((((CLASS) == FP_REGS || (CLASS) == FP0_REGS \ || (CLASS) == DF_REGS) \ && (GET_CODE (X) == REG && GENERAL_OR_AP_REGISTER_P (REGNO (X)))) \ || (((CLASS) == GENERAL_REGS || (CLASS) == R0_REGS) \ && GET_CODE (X) == REG \ && FP_REGISTER_P (REGNO (X)))) \ && ! TARGET_SHMEDIA \ && MODE == SFmode) \ ? FPUL_REGS \ : ((CLASS) == FPUL_REGS \ && (GET_CODE (X) == MEM \ || (GET_CODE (X) == REG \ && (REGNO (X) >= FIRST_PSEUDO_REGISTER \ || REGNO (X) == T_REG \ || system_reg_operand (X, VOIDmode))))) \ ? GENERAL_REGS \ : (((CLASS) == FP_REGS || (CLASS) == DF_REGS) && TARGET_SHMEDIA \ && immediate_operand ((X), (MODE))) \ ? GENERAL_REGS \ : ((CLASS) == TARGET_REGS \ || (TARGET_SHMEDIA && (CLASS) == SIBCALL_REGS)) \ ? ((target_operand ((X), (MODE)) \ && ! target_reg_operand ((X), (MODE))) \ ? NO_REGS : GENERAL_REGS) \ : (((CLASS) == MAC_REGS || (CLASS) == PR_REGS) \ && GET_CODE (X) == REG && ! GENERAL_REGISTER_P (REGNO (X)) \ && (CLASS) != REGNO_REG_CLASS (REGNO (X))) \ ? GENERAL_REGS : NO_REGS)#define SECONDARY_INPUT_RELOAD_CLASS(CLASS,MODE,X) \ ((((CLASS) == FP_REGS || (CLASS) == FP0_REGS || (CLASS) == DF_REGS) \ && ! TARGET_SHMEDIA \ && immediate_operand ((X), (MODE)) \ && ! ((fp_zero_operand (X) || fp_one_operand (X)) \ && (MODE) == SFmode && fldi_ok ())) \ ? R0_REGS \ : (CLASS == FPUL_REGS \ && ((GET_CODE (X) == REG \ && (REGNO (X) == MACL_REG || REGNO (X) == MACH_REG \ || REGNO (X) == T_REG)))) \ ? GENERAL_REGS \ : CLASS == FPUL_REGS && immediate_operand ((X), (MODE)) \ ? (GET_CODE (X) == CONST_INT && CONST_OK_FOR_I (INTVAL (X)) \ ? GENERAL_REGS \ : R0_REGS) \ : (CLASS == FPSCR_REGS \ && ((GET_CODE (X) == REG && REGNO (X) >= FIRST_PSEUDO_REGISTER) \ || (GET_CODE (X) == MEM && GET_CODE (XEXP ((X), 0)) == PLUS)))\ ? GENERAL_REGS \ : SECONDARY_OUTPUT_RELOAD_CLASS((CLASS),(MODE),(X)))/* Return the maximum number of consecutive registers needed to represent mode MODE in a register of class CLASS. On SH this is the size of MODE in words. */#define CLASS_MAX_NREGS(CLASS, MODE) \ ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)/* If defined, gives a class of registers that cannot be used as the operand of a SUBREG that changes the mode of the object illegally. */#define CLASS_CANNOT_CHANGE_MODE DF_REGS/* Defines illegal mode changes for CLASS_CANNOT_CHANGE_MODE. */#define CLASS_CANNOT_CHANGE_MODE_P(FROM,TO) \ (GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO))/* Stack layout; function entry, exit and calling. *//* Define the number of registers that can hold parameters. These macros are used only in other macro definitions below. */#define NPARM_REGS(MODE) \ (TARGET_FPU_ANY && (MODE) == SFmode \ ? (TARGET_SH5 ? 12 : 8) \ : TARGET_SH4 && (GET_MODE_CLASS (MODE) == MODE_FLOAT \ || GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT) \ ? (TARGET_SH5 ? 12 : 8) \ : (TARGET_SH5 ? 8 : 4))#define FIRST_PARM_REG (FIRST_GENERAL_REG + (TARGET_SH5 ? 2 : 4))#define FIRST_RET_REG (FIRST_GENERAL_REG + (TARGET_SH5 ? 2 : 0))#define FIRST_FP_PARM_REG (FIRST_FP_REG + (TARGET_SH5 ? 0 : 4))#define FIRST_FP_RET_REG FIRST_FP_REG/* Define this if pushing a word on the stack makes the stack pointer a smaller address. */#define STACK_GROWS_DOWNWARD/* Define this macro if the addresses of local variable slots are at negative offsets from the frame pointer. The SH only has positive indexes, so grow the frame up. *//* #define FRAME_GROWS_DOWNWARD *//* Offset from the frame pointer to the first local variable slot to be allocated. */#define STARTING_FRAME_OFFSET 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -