📄 alpha.h
字号:
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. */ enum reg_class { NO_REGS, GENERAL_REGS, FLOAT_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", "GENERAL_REGS", "FLOAT_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 \ { {0, 0}, {~0, 0x80000000}, {0, 0x7fffffff}, {~0, ~0} }/* 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. */#define REGNO_REG_CLASS(REGNO) \ ((REGNO) >= 32 && (REGNO) <= 62 ? FLOAT_REGS : GENERAL_REGS)/* The class value for index registers, and the one for base regs. */#define INDEX_REG_CLASS NO_REGS#define BASE_REG_CLASS GENERAL_REGS/* Get reg_class from a letter such as appears in the machine description. */#define REG_CLASS_FROM_LETTER(C) \ ((C) == 'f' ? FLOAT_REGS : NO_REGS)/* Define this macro to change register usage conditional on target flags. *//* #define CONDITIONAL_REGISTER_USAGE *//* The letters I, J, K, L, M, N, O, and P 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. For Alpha: `I' is used for the range of constants most insns can contain. `J' is the constant zero. `K' is used for the constant in an LDA insn. `L' is used for the constant in a LDAH insn. `M' is used for the constants that can be AND'ed with using a ZAP insn. `N' is used for complemented 8-bit constants. `O' is used for negated 8-bit constants. `P' is used for the constants 1, 2 and 3. */#define CONST_OK_FOR_LETTER_P(VALUE, C) \ ((C) == 'I' ? (unsigned HOST_WIDE_INT) (VALUE) < 0x100 \ : (C) == 'J' ? (VALUE) == 0 \ : (C) == 'K' ? (unsigned HOST_WIDE_INT) ((VALUE) + 0x8000) < 0x10000 \ : (C) == 'L' ? (((VALUE) & 0xffff) == 0 \ && (((VALUE)) >> 31 == -1 || (VALUE) >> 31 == 0)) \ : (C) == 'M' ? zap_mask (VALUE) \ : (C) == 'N' ? (unsigned HOST_WIDE_INT) (~ (VALUE)) < 0x100 \ : (C) == 'O' ? (unsigned HOST_WIDE_INT) (- (VALUE)) < 0x100 \ : (C) == 'P' ? (VALUE) == 1 || (VALUE) == 2 || (VALUE) == 3 \ : 0)/* Similar, but for floating or large integer constants, and defining letters G and H. Here VALUE is the CONST_DOUBLE rtx itself. For Alpha, `G' is the floating-point constant zero. `H' is a CONST_DOUBLE that is the operand of a ZAP insn. */#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \ ((C) == 'G' ? (GET_MODE_CLASS (GET_MODE (VALUE)) == MODE_FLOAT \ && (VALUE) == CONST0_RTX (GET_MODE (VALUE))) \ : (C) == 'H' ? (GET_MODE (VALUE) == VOIDmode \ && zap_mask (CONST_DOUBLE_LOW (VALUE)) \ && zap_mask (CONST_DOUBLE_HIGH (VALUE))) \ : 0)/* Optional extra constraints for this machine. For the Alpha, `Q' means that this is a memory operand but not a reference to an unaligned location. `R' is a SYMBOL_REF that has SYMBOL_REF_FLAG set or is the current function. 'S' is a 6-bit constant (valid for a shift insn). */#define EXTRA_CONSTRAINT(OP, C) \ ((C) == 'Q' ? normal_memory_operand (OP, VOIDmode) \ : (C) == 'R' ? current_file_function_operand (OP, Pmode) \ : (C) == 'S' ? (GET_CODE (OP) == CONST_INT \ && (unsigned HOST_WIDE_INT) INTVAL (OP) < 64) \ : 0)extern int normal_memory_operand ();/* 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. On the Alpha, all constants except zero go into a floating-point register via memory. */#define PREFERRED_RELOAD_CLASS(X, CLASS) \ (CONSTANT_P (X) && (X) != const0_rtx && (X) != CONST0_RTX (GET_MODE (X)) \ ? ((CLASS) == FLOAT_REGS || (CLASS) == NO_REGS ? NO_REGS : GENERAL_REGS)\ : (CLASS))/* Loading and storing HImode or QImode values to and from memory usually requires a scratch register. The exceptions are loading QImode and HImode from an aligned address to a general register unless byte instructions are permitted. We also cannot load an unaligned address or a paradoxical SUBREG into an FP register. */#define SECONDARY_INPUT_RELOAD_CLASS(CLASS,MODE,IN) \(((GET_CODE (IN) == MEM \ || (GET_CODE (IN) == REG && REGNO (IN) >= FIRST_PSEUDO_REGISTER) \ || (GET_CODE (IN) == SUBREG \ && (GET_CODE (SUBREG_REG (IN)) == MEM \ || (GET_CODE (SUBREG_REG (IN)) == REG \ && REGNO (SUBREG_REG (IN)) >= FIRST_PSEUDO_REGISTER)))) \ && (((CLASS) == FLOAT_REGS \ && ((MODE) == SImode || (MODE) == HImode || (MODE) == QImode)) \ || (((MODE) == QImode || (MODE) == HImode) \ && ! TARGET_BWX && ! aligned_memory_operand (IN, MODE)))) \ ? GENERAL_REGS \ : ((CLASS) == FLOAT_REGS && GET_CODE (IN) == MEM \ && GET_CODE (XEXP (IN, 0)) == AND) ? GENERAL_REGS \ : ((CLASS) == FLOAT_REGS && GET_CODE (IN) == SUBREG \ && (GET_MODE_SIZE (GET_MODE (IN)) \ > GET_MODE_SIZE (GET_MODE (SUBREG_REG (IN))))) ? GENERAL_REGS \ : NO_REGS)#define SECONDARY_OUTPUT_RELOAD_CLASS(CLASS,MODE,OUT) \(((GET_CODE (OUT) == MEM \ || (GET_CODE (OUT) == REG && REGNO (OUT) >= FIRST_PSEUDO_REGISTER) \ || (GET_CODE (OUT) == SUBREG \ && (GET_CODE (SUBREG_REG (OUT)) == MEM \ || (GET_CODE (SUBREG_REG (OUT)) == REG \ && REGNO (SUBREG_REG (OUT)) >= FIRST_PSEUDO_REGISTER)))) \ && ((((MODE) == HImode || (MODE) == QImode) \ && (! TARGET_BWX || (CLASS) == FLOAT_REGS)) \ || ((MODE) == SImode && (CLASS) == FLOAT_REGS))) \ ? GENERAL_REGS \ : ((CLASS) == FLOAT_REGS && GET_CODE (OUT) == MEM \ && GET_CODE (XEXP (OUT, 0)) == AND) ? GENERAL_REGS \ : ((CLASS) == FLOAT_REGS && GET_CODE (OUT) == SUBREG \ && (GET_MODE_SIZE (GET_MODE (OUT)) \ > GET_MODE_SIZE (GET_MODE (SUBREG_REG (OUT))))) ? GENERAL_REGS \ : NO_REGS)/* If we are copying between general and FP registers, we need a memory location unless the FIX extension is available. */#define SECONDARY_MEMORY_NEEDED(CLASS1,CLASS2,MODE) \ (! TARGET_FIX && (CLASS1) != (CLASS2))/* Specify the mode to be used for memory when a secondary memory location is needed. If MODE is floating-point, use it. Otherwise, widen to a word like the default. This is needed because we always store integers in FP registers in quadword format. This whole area is very tricky! */#define SECONDARY_MEMORY_NEEDED_MODE(MODE) \ (GET_MODE_CLASS (MODE) == MODE_FLOAT ? (MODE) \ : GET_MODE_SIZE (MODE) >= 4 ? (MODE) \ : mode_for_size (BITS_PER_WORD, GET_MODE_CLASS (MODE), 0))/* Return the maximum number of consecutive registers needed to represent mode MODE in a register of class CLASS. */#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 size of the object. */#define CLASS_CANNOT_CHANGE_SIZE FLOAT_REGS/* Define the cost of moving between registers of various classes. Moving between FLOAT_REGS and anything else except float regs is expensive. In fact, we make it quite expensive because we really don't want to do these moves unless it is clearly worth it. Optimizations may reduce the impact of not being able to allocate a pseudo to a hard register. */#define REGISTER_MOVE_COST(CLASS1, CLASS2) \ (((CLASS1) == FLOAT_REGS) == ((CLASS2) == FLOAT_REGS) \ ? 2 \ : TARGET_FIX ? 3 : 4+2*alpha_memory_latency)/* A C expressions returning the cost of moving data of MODE from a register to or from memory. On the Alpha, bump this up a bit. */extern int alpha_memory_latency;#define MEMORY_MOVE_COST(MODE,CLASS,IN) (2*alpha_memory_latency)/* Provide the cost of a branch. Exact meaning under development. */#define BRANCH_COST 5/* Adjust the cost of dependencies. */#define ADJUST_COST(INSN,LINK,DEP,COST) \ (COST) = alpha_adjust_cost (INSN, LINK, DEP, COST)/* Stack layout; function entry, exit and calling. *//* Define this if pushing a word on the stack makes the stack pointer a smaller address. */#define STACK_GROWS_DOWNWARD/* Define this if the nominal address of the stack frame is at the high-address end of the local variables; that is, each additional local variable allocated goes at a more negative offset in the frame. *//* #define FRAME_GROWS_DOWNWARD *//* Offset within stack frame to start allocating local variables at. If FRAME_GROWS_DOWNWARD, this is the offset to the END of the first local allocated. Otherwise, it is the offset to the BEGINNING of the first local allocated. */#define STARTING_FRAME_OFFSET 0/* If we generate an insn to push BYTES bytes, this says how many the stack pointer really advances by. On Alpha, don't define this because there are no push insns. *//* #define PUSH_ROUNDING(BYTES) *//* Define this to be nonzero if stack checking is built into the ABI. */#define STACK_CHECK_BUILTIN 1/* Define this if the maximum size of all the outgoing args is to be accumulated and pushed during the prologue. The amount can be found in the variable current_function_outgoing_args_size. */#define ACCUMULATE_OUTGOING_ARGS/* Offset of first parameter from the argument pointer register value. */#define FIRST_PARM_OFFSET(FNDECL) 0/* Definitions for register eliminations. We have two registers that can be eliminated on the Alpha. 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. *//* 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. */#define ELIMINABLE_REGS \{{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ { ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \ { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ { FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}}/* Given FROM and TO register numbers, say whether this elimination is allowed. Frame pointer elimination is automatically handled. All eliminations are valid since the cases where FP can't be eliminated are already handled. */#define CAN_ELIMINATE(FROM, TO) 1/* Round up to a multiple of 16 bytes. */#define ALPHA_ROUND(X) (((X) + 15) & ~ 15)/* 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) \{ if ((FROM) == FRAME_POINTER_REGNUM) \ (OFFSET) = (ALPHA_ROUND (current_function_outgoing_args_size) \ + alpha_sa_size ()); \ else if ((FROM) == ARG_POINTER_REGNUM) \ (OFFSET) = (ALPHA_ROUND (current_function_outgoing_args_size) \ + alpha_sa_size () \ + (ALPHA_ROUND (get_frame_size () \ + current_function_pretend_args_size) \ - current_function_pretend_args_size)); \}/* Define this if stack space is still allocated for a parameter passed in a register. *//* #define REG_PARM_STACK_SPACE *//* Value is the number of bytes of arguments automatically popped when returning from a subroutine call. FUNDECL is the declaration node of the function (as a tree), FUNTYPE is the data type of the function (as a tree), or for a library call it is an identifier node for the subroutine name. SIZE is the number of bytes of arguments passed on the stack. */#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0/* Define how to find the value returned by a function. VALTYPE is the data type of the value (as a tree). If the precise function being called is known, FUNC is its FUNCTION_DECL; otherwise, FUNC is 0. On Alpha the value is found in $0 for integer functions and $f0 for floating-point functions. */#define FUNCTION_VALUE(VALTYPE, FUNC) \ gen_rtx_REG (((INTEGRAL_TYPE_P (VALTYPE) \ && TYPE_PRECISION (VALTYPE) < BITS_PER_WORD) \ || POINTER_TYPE_P (VALTYPE)) \ ? word_mode : TYPE_MODE (VALTYPE), \ ((TARGET_FPREGS \ && (TREE_CODE (VALTYPE) == REAL_TYPE \ || TREE_CODE (VALTYPE) == COMPLEX_TYPE)) \ ? 32 : 0))/* Define how to find the value returned by a library function assuming the value has mode MODE. */#define LIBCALL_VALUE(MODE) \ gen_rtx_REG (MODE, \ (TARGET_FPREGS \ && (GET_MODE_CLASS (MODE) == MODE_FLOAT \ || GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT) \ ? 32 : 0))/* The definition of this macro implies that there are cases where a scalar value cannot be returned in registers. For the Alpha, any structure or union type is returned in memory, as
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -