📄 alpha.h
字号:
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, 0}, {0, ~0}, {~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 ? 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)/* 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 ? 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. */#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) \ && unaligned_memory_operand (IN, MODE)))) \ ? 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 \ || ((MODE) == SImode && (CLASS) == FLOAT_REGS)))) \ ? GENERAL_REGS : NO_REGS)/* If we are copying between general and FP registers, we need a memory location. */#define SECONDARY_MEMORY_NEEDED(CLASS1,CLASS2,MODE) ((CLASS1) != (CLASS2))/* 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)/* 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 : 20)/* 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. */#define MEMORY_MOVE_COST(MODE) 6/* 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 (- current_function_pretend_args_size)/* 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 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) (- current_function_pretend_args_size)/* Definitions for register eliminations. We have one register that can be eliminated on the Alpha. The frame pointer register can often be eliminated in favor of the stack pointer register. In addition, we use the elimination mechanism to see if gp (r29) is needed. Initially we assume that it isn't. If it is, we spill it. This is done by making it an eliminable register. It doesn't matter what we replace it with, since it will never occur in the rtl at this point. *//* 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 \{{ FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ { 29, 0}}/* Given FROM and TO register numbers, say whether this elimination is allowed. Frame pointer elimination is automatically handled. We need gp (r29) if we have calls or load symbols (tested in alpha_need_gp). All other eliminations are valid since the cases where FP can't be eliminated are already handled. */#define CAN_ELIMINATE(FROM, TO) ((FROM) == 29 ? ! alpha_need_gp () : 1)/* 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 && (TO) == STACK_POINTER_REGNUM) \ (OFFSET) = (get_frame_size () + current_function_outgoing_args_size \ + current_function_pretend_args_size \ + alpha_sa_size () + 15) & ~ 15; \}/* 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. 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(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, \ ((TREE_CODE (VALTYPE) == INTEGER_TYPE \ || TREE_CODE (VALTYPE) == ENUMERAL_TYPE \ || TREE_CODE (VALTYPE) == BOOLEAN_TYPE \ || TREE_CODE (VALTYPE) == CHAR_TYPE \ || TREE_CODE (VALTYPE) == POINTER_TYPE \ || TREE_CODE (VALTYPE) == OFFSET_TYPE) \ && TYPE_PRECISION (VALTYPE) < BITS_PER_WORD) \ ? word_mode : TYPE_MODE (VALTYPE), \ TARGET_FPREGS && TREE_CODE (VALTYPE) == REAL_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 ? 32 : 0)/* 1 if N is a possible register number for a function value as seen by the caller. */#define FUNCTION_VALUE_REGNO_P(N) ((N) == 0 || (N) == 32)/* 1 if N is a possible register number for function argument passing. On Alpha, these are $16-$21 and $f16-$f21. */#define FUNCTION_ARG_REGNO_P(N) \ (((N) >= 16 && (N) <= 21) || ((N) >= 16 + 32 && (N) <= 21 + 32))/* Define a data type for recording info about an argument list during the scan of that argument list. This data type should hold all necessary information about the function itself and about the args processed so far, enough to enable macros such as FUNCTION_ARG to determine where the next arg should go. On Alpha, this is a single integer, which is a number of words of arguments scanned so far. Thus 6 or more means all following args should go on the stack. */#define CUMULATIVE_ARGS int/* Initialize a variable CUM of type CUMULATIVE_ARGS for a call to a function whose data type is FNTYPE. For a library call, FNTYPE is 0. */#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME) (CUM) = 0/* Define intermediate macro to compute the size (in registers) of an argument for the Alpha. */#define ALPHA_ARG_SIZE(MODE, TYPE, NAMED) \((MODE) != BLKmode \ ? (GET_MODE_SIZE (MODE) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD \ : (int_size_in_bytes (TYPE) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD)/* Update the data in CUM to advance over an argument of mode MODE and data type TYPE. (TYPE is null for libcalls where that information may not be available.) */#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ if (MUST_PASS_IN_STACK (MODE, TYPE)) \ (CUM) = 6; \ else \ (CUM) += ALPHA_ARG_SIZE (MODE, TYPE, NAMED)/* Determine where to put an argument to a function. Value is zero to push the argument on the stack, or a hard register in which to store the argument. MODE is the argument's machine mode. TYPE is the data type of the argument (as a tree). This is null for libcalls where that information may not be available. CUM is a variable of type CUMULATIVE_ARGS which gives info about the preceding args and about the function being called. NAMED is nonzero if this argument is a named parameter (otherwise it is an extra parameter matching an ellipsis). On Alpha the first 6 words of args are normally in registers and the rest are pushed. */#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \((CUM) < 6 && ! MUST_PASS_IN_STACK (MODE, TYPE) \ ? gen_rtx(REG, (MODE), \ (CUM) + 16 + (TARGET_FPREGS \ && GET_MODE_CLASS (MODE) == MODE_FLOAT) * 32) : 0)/* Specify the padding direction of arguments. On the Alpha, we must pad upwards in order to be able to pass args in registers. */#define FUNCTION_ARG_PADDING(MODE, TYPE) upward/* For an arg passed partly in registers and partly in memory, this is the number of registers used. For args passed entirely in registers or entirely in memory, zero. */#define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \((CUM) < 6 && 6 < (CUM) + ALPHA_ARG_SIZE (MODE, TYPE, NAMED) \ ? 6 - (CUM) : 0)/* Generate necessary RTL for __builtin_saveregs(). ARGLIST is the argument list; see expr.c. */extern struct rtx_def *alpha_builtin_saveregs ();#define EXPAND_BUILTIN_SAVEREGS(ARGLIST) alpha_builtin_saveregs (ARGLIST)/* Define the information needed to generate branch and scc insns. This is stored from the compare operation. Note that we can't use "rtx" here since it hasn't been defined! */extern struct rtx_def *alpha_compare_op0, *alpha_compare_op1;extern int alpha_compare_fp_p;/* This macro produces the initial definition of a function name. On the 29k, we need to save the function name for the epilogue. */extern char *alpha_function_name;#define ASM_DECLARE_FUNCTION_NAME(FILE,NAME,DECL) \ { fprintf (FILE, "\t.ent %s 2\n", NAME); \ ASM_OUTPUT_LABEL (FILE, NAME); \ alpha_function_name = NAME; \} /* This macro generates the assembly code for function entry. FILE is a stdio stream to output the code to. SIZE is an int: how many units of temporary storage to allocate. Refer to the array `regs_ever_live' to determine which registers to save; `regs_ever_live[I]' is nonzero if register number I is ever used in the function. This macro is responsible for knowing which registers should not be saved even if used. */#define FUNCTION_PROLOGUE(FILE, SIZE) output_prolog (FILE, SIZE)/* Output assembler code to FILE to increment profiler label # LABELNO for profiling a function entry. */#define FUNCTION_PROFILER(FILE, LABELNO)/* EXIT_IGNORE_STACK should be nonzero if, when returning from a function, the stack pointer does not matter. The value is tested only in functions that have frame pointers. No definition is equivalent to always zero. */#define EXIT_IGNORE_STACK 1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -