📄 sh.h
字号:
/* Register to hold the addressing base for position independent code access to data items. */#define PIC_OFFSET_TABLE_REGNUM (flag_pic ? PIC_REG : INVALID_REGNUM)#define GOT_SYMBOL_NAME "*_GLOBAL_OFFSET_TABLE_"/* 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 AP_REG/* Register in which the static-chain is passed to a function. */#define STATIC_CHAIN_REGNUM (TARGET_SH5 ? 1 : 3)/* 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. *//* The Hitachi calling convention doesn't quite fit into this scheme since the address is passed like an invisible argument, but one that is always passed in memory. */#define STRUCT_VALUE \ (TARGET_HITACHI ? 0 : gen_rtx_REG (Pmode, STRUCT_VALUE_REGNUM))#define RETURN_IN_MEMORY(TYPE) \ (TARGET_SH5 \ ? ((TYPE_MODE (TYPE) == BLKmode \ ? (unsigned HOST_WIDE_INT) int_size_in_bytes (TYPE) \ : GET_MODE_SIZE (TYPE_MODE (TYPE))) > 8) \ : (TYPE_MODE (TYPE) == BLKmode \ || TARGET_HITACHI && TREE_CODE (TYPE) == RECORD_TYPE))/* 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 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_HI_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_HI_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_HI_REGS: Initialized in CONDITIONAL_REGISTER_USAGE. */ \ { 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0x0000ff00 }, \/* 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 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) \ ((((REGCLASS_HAS_FP_REG (CLASS) \ && (GET_CODE (X) == REG \ && (GENERAL_OR_AP_REGISTER_P (REGNO (X)) \ || (FP_REGISTER_P (REGNO (X)) && (MODE) == SImode \ && TARGET_FMOVD)))) \ || (REGCLASS_HAS_GENERAL_REG (CLASS) \ && GET_CODE (X) == REG \ && FP_REGISTER_P (REGNO (X)))) \ && ! TARGET_SHMEDIA \ && ((MODE) == SFmode || (MODE) == SImode)) \ ? FPUL_REGS \ : (((CLASS) == FPUL_REGS \ || (REGCLASS_HAS_FP_REG (CLASS) \
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -