📄 pa.h
字号:
#define PIC_OFFSET_TABLE_REGNUM 19#define PIC_OFFSET_TABLE_REG_CALL_CLOBBERED 1/* Register into which we save the PIC_OFFEST_TABLE_REGNUM so that it can be restore across function calls. */#define PIC_OFFSET_TABLE_REGNUM_SAVED 4/* SOM ABI says that objects larger than 64 bits are returned in memory. */#define DEFAULT_PCC_STRUCT_RETURN 0#define RETURN_IN_MEMORY(TYPE) \ (int_size_in_bytes (TYPE) > 8)/* Register in which address to store a structure value is passed to a function. */#define STRUCT_VALUE_REGNUM 28/* 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 HP-PA has four kinds of registers: general regs, 1.0 fp regs, 1.1 fp regs, and the high 1.1 fp regs, to which the operands of fmpyadd and fmpysub are restricted. */enum reg_class { NO_REGS, R1_REGS, GENERAL_REGS, FPUPPER_REGS, FP_REGS, GENERAL_OR_FP_REGS, SHIFT_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", "R1_REGS", "GENERAL_REGS", "FPUPPER_REGS", "FP_REGS", \ "GENERAL_OR_FP_REGS", "SHIFT_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. Register 0, the "condition code" register, is in no class. */#define REG_CLASS_CONTENTS \ {{0x00000000, 0x00000000, 0x00000000}, /* NO_REGS */ \ {0x00000002, 0x00000000, 0x00000000}, /* R1_REGS */ \ {0xfffffffe, 0x00000000, 0x00000000}, /* GENERAL_REGS */ \ {0x00000000, 0xff000000, 0x00ffffff}, /* FPUPPER_REGS */ \ {0x00000000, 0xffffffff, 0x00ffffff}, /* FP_REGS */ \ {0xfffffffe, 0xffffffff, 0x00ffffff}, /* GENERAL_OR_FP_REGS */ \ {0x00000000, 0x00000000, 0x01000000}, /* SHIFT_REGS */ \ {0xfffffffe, 0xffffffff, 0x01ffffff}} /* 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. */#define REGNO_REG_CLASS(REGNO) \ ((REGNO) == 0 ? NO_REGS \ : (REGNO) == 1 ? R1_REGS \ : (REGNO) < 32 ? GENERAL_REGS \ : (REGNO) < 56 ? FP_REGS \ : (REGNO) < 88 ? FPUPPER_REGS \ : SHIFT_REGS)/* The class value for index registers, and the one for base regs. */#define INDEX_REG_CLASS GENERAL_REGS#define BASE_REG_CLASS GENERAL_REGS#define FP_REG_CLASS_P(CLASS) \ ((CLASS) == FP_REGS || (CLASS) == FPUPPER_REGS)/* Get reg_class from a letter such as appears in the machine description. *//* Keep 'x' for backward compatibility with user asm. */#define REG_CLASS_FROM_LETTER(C) \ ((C) == 'f' ? FP_REGS : \ (C) == 'y' ? FPUPPER_REGS : \ (C) == 'x' ? FP_REGS : \ (C) == 'q' ? SHIFT_REGS : \ (C) == 'a' ? R1_REGS : \ (C) == 'Z' ? ALL_REGS : 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' is used for the 11 bit constants. `J' is used for the 14 bit constants. `K' is used for values that can be moved with a zdepi insn. `L' is used for the 5 bit constants. `M' is used for 0. `N' is used for values with the least significant 11 bits equal to zero. `O' is used for numbers n such that n+1 is a power of 2. */#define CONST_OK_FOR_LETTER_P(VALUE, C) \ ((C) == 'I' ? VAL_11_BITS_P (VALUE) \ : (C) == 'J' ? VAL_14_BITS_P (VALUE) \ : (C) == 'K' ? zdepi_cint_p (VALUE) \ : (C) == 'L' ? VAL_5_BITS_P (VALUE) \ : (C) == 'M' ? (VALUE) == 0 \ : (C) == 'N' ? ((VALUE) & 0x7ff) == 0 \ : (C) == 'O' ? (((VALUE) & ((VALUE) + 1)) == 0) \ : (C) == 'P' ? and_mask_p (VALUE) \ : 0)/* Prototype function used in macro CONST_OK_FOR_LETTER_P. */int zdepi_cint_p ();/* Similar, but for floating or large integer constants, and defining letters G and H. Here VALUE is the CONST_DOUBLE rtx itself. For PA, `G' is the floating-point constant zero. `H' is undefined. */#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))) \ : 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. */#define PREFERRED_RELOAD_CLASS(X,CLASS) (CLASS)/* Return the register class of a scratch register needed to copy IN into or out of a register in CLASS in MODE. If it can be done directly NO_REGS is returned. Avoid doing any work for the common case calls. */#define SECONDARY_RELOAD_CLASS(CLASS,MODE,IN) \ ((CLASS == BASE_REG_CLASS && GET_CODE (IN) == REG \ && REGNO (IN) < FIRST_PSEUDO_REGISTER) \ ? NO_REGS : secondary_reload_class (CLASS, MODE, IN))/* On the PA it is not possible to directly move data between GENERAL_REGS and FP_REGS. */#define SECONDARY_MEMORY_NEEDED(CLASS1, CLASS2, MODE) \ (FP_REG_CLASS_P (CLASS1) != FP_REG_CLASS_P (CLASS2))/* Return the stack location to use for secondary memory needed reloads. */#define SECONDARY_MEMORY_NEEDED_RTX(MODE) \ gen_rtx_MEM (MODE, gen_rtx_PLUS (Pmode, stack_pointer_rtx, GEN_INT (-16)))/* Return the maximum number of consecutive registers needed to represent mode MODE in a register of class CLASS. */#define CLASS_MAX_NREGS(CLASS, MODE) \ (!TARGET_PA_11 && ((CLASS) == FP_REGS || (CLASS) == FPUPPER_REGS) ? 1 : \ ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))/* 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 *//* Believe it or not. */#define ARGS_GROW_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 8/* If we generate an insn to push BYTES bytes, this says how many the stack pointer really advances by. On the HP-PA, don't define this because there are no push insns. *//* #define PUSH_ROUNDING(BYTES) *//* Offset of first parameter from the argument pointer register value. This value will be negated because the arguments grow down. Also note that on STACK_GROWS_UPWARD machines (such as this one) this is the distance from the frame pointer to the end of the first argument, not it's beginning. To get the real offset of the first argument, the size of the argument must be added. ??? Have to check on this.*/#define FIRST_PARM_OFFSET(FNDECL) -32/* Absolute value of offset from top-of-stack address to location to store the function parameter if it can't go in a register. Addresses for following parameters are computed relative to this one. */#define FIRST_PARM_CALLER_OFFSET(FNDECL) -32/* When a parameter is passed in a register, stack space is still allocated for it. */#define REG_PARM_STACK_SPACE(DECL) 16/* Define this if the above stack space is to be considered part of the space allocated by the caller. */#define OUTGOING_REG_PARM_STACK_SPACE/* Keep the stack pointer constant throughout the function. This is both an optimization and a necessity: longjmp doesn't behave itself when the stack pointer moves within the function! */#define ACCUMULATE_OUTGOING_ARGS/* The weird HPPA calling conventions require a minimum of 48 bytes on the stack: 16 bytes for register saves, and 32 bytes for magic. This is the difference between the logical top of stack and the actual sp. */#define STACK_POINTER_OFFSET -32#define STACK_DYNAMIC_OFFSET(FNDECL) \ ((STACK_POINTER_OFFSET) - current_function_outgoing_args_size)/* Value is 1 if returning from a function call automatically pops the arguments described by the number-of-args field in the 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. */#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 the HP-PA the value is found in register(s) 28(-29), unless the mode is SF or DF. Then the value is returned in fr4 (32, ) */#define FUNCTION_VALUE(VALTYPE, FUNC) \ gen_rtx_REG (TYPE_MODE (VALTYPE), ((! TARGET_SOFT_FLOAT \ && (TYPE_MODE (VALTYPE) == SFmode || \ TYPE_MODE (VALTYPE) == DFmode)) ? \ 32 : 28))/* 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_SOFT_FLOAT \ && ((MODE) == SFmode || (MODE) == DFmode) ? 32 : 28))/* 1 if N is a possible register number for a function value as seen by the caller. */#define FUNCTION_VALUE_REGNO_P(N) \ ((N) == 28 || (! TARGET_SOFT_FLOAT && (N) == 32))/* 1 if N is a possible register number for function argument passing. */#define FUNCTION_ARG_REGNO_P(N) \ (((N) >= 23 && (N) <= 26) || (! TARGET_SOFT_FLOAT && (N) >= 32 && (N) <= 39))/* 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 the HP-PA, this is a single integer, which is a number of words of arguments scanned so far (including the invisible argument, if any, which holds the structure-value-address). Thus 4 or more means all following args should go on the stack. */struct hppa_args {int words, nargs_prototype, indirect; };#define CUMULATIVE_ARGS struct hppa_args/* 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,INDIRECT) \ (CUM).words = 0, \ (CUM).indirect = INDIRECT, \ (CUM).nargs_prototype = (FNTYPE && TYPE_ARG_TYPES (FNTYPE) \ ? (list_length (TYPE_ARG_TYPES (FNTYPE)) - 1 \ + (TYPE_MODE (TREE_TYPE (FNTYPE)) == BLKmode \ || RETURN_IN_MEMORY (TREE_TYPE (FNTYPE)))) \ : 0)/* Similar, but when scanning the definition of a procedure. We always set NARGS_PROTOTYPE large so we never return a PARALLEL. */#define INIT_CUMULATIVE_INCOMING_ARGS(CUM,FNTYPE,IGNORE) \ (CUM).words = 0, \ (CUM).indirect = 0, \ (CUM).nargs_prototype = 1000/* Figure out the size in words of the function argument. */#define FUNCTION_ARG_SIZE(MODE, TYPE) \ ((((MODE) != BLKmode ? GET_MODE_SIZE (MODE) : int_size_in_bytes (TYPE))+3)/4)/* 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) \{ (CUM).nargs_prototype--; \ ((((CUM).words & 01) && (TYPE) != 0 \ && FUNCTION_ARG_SIZE(MODE, TYPE) > 1) \ && (CUM).words++), \ (CUM).words += FUNCTION_ARG_SIZE(MODE, TYPE); \}/* 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 the HP-PA the first four words of args are normally in registers and the rest are pushed. But any arg that won't entirely fit in regs
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -