📄 pa.h
字号:
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. */#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)/* 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) & 01) && (TYPE) != 0 && FUNCTION_ARG_SIZE(MODE, TYPE) > 1)\ && (CUM)++), (CUM) += 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 is pushed. Arguments passed in registers are either 1 or 2 words long. */#define FUNCTION_ARG_PADDING(MODE, TYPE) function_arg_padding ((MODE), (TYPE))#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ (4 >= ((CUM) + FUNCTION_ARG_SIZE ((MODE), (TYPE))) \ ? gen_rtx (REG, (MODE), \ (FUNCTION_ARG_SIZE ((MODE), (TYPE)) > 1 \ ? ((MODE) == DFmode \ ? ((CUM) ? (TARGET_SNAKE ? 62 : 39) \ : (TARGET_SNAKE ? 58 : 37)) \ : ((CUM) ? 23 : 25)) \ : ((MODE) == SFmode \ ? (TARGET_SNAKE ? 56 + 2 * (CUM) : 36 + (CUM)) \ : (27 - (CUM) - FUNCTION_ARG_SIZE ((MODE), (TYPE))))))\ : 0)/* Define where a function finds its arguments. This would be different from FUNCTION_ARG if we had register windows. */#define FUNCTION_INCOMING_ARG(CUM, MODE, TYPE, NAMED) \ FUNCTION_ARG (CUM, MODE, TYPE, NAMED)/* 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) 0/* If defined, a C expression that gives the alignment boundary, in bits, of an argument with the specified mode and type. If it is not defined, `PARM_BOUNDARY' is used for all arguments. */#define FUNCTION_ARG_BOUNDARY(MODE, TYPE) \ (((TYPE) != 0) \ ? ((TYPE_ALIGN(TYPE) <= PARM_BOUNDARY) \ ? PARM_BOUNDARY \ : TYPE_ALIGN(TYPE)) \ : ((GET_MODE_ALIGNMENT(MODE) <= PARM_BOUNDARY) \ ? PARM_BOUNDARY \ : GET_MODE_ALIGNMENT(MODE)))/* Arguments larger than eight bytes are passed by invisible reference */#define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) \ ((TYPE) && int_size_in_bytes (TYPE) > 8)extern struct rtx_def *hppa_compare_op0, *hppa_compare_op1;extern enum cmp_type hppa_branch_type;/* Output the label for a function definition. */#ifdef HP_FP_ARG_DESCRIPTOR_REVERSED#define ASM_DOUBLE_ARG_DESCRIPTORS(FILE, ARG0, ARG1) \ do { fprintf (FILE, ",ARGW%d=FR", (ARG0)); \ fprintf (FILE, ",ARGW%d=FU", (ARG1));} while (0)#else#define ASM_DOUBLE_ARG_DESCRIPTORS(FILE, ARG0, ARG1) \ do { fprintf (FILE, ",ARGW%d=FU", (ARG0)); \ fprintf (FILE, ",ARGW%d=FR", (ARG1));} while (0)#endif#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ do { tree fntype = TREE_TYPE (TREE_TYPE (DECL)); \ tree tree_type = TREE_TYPE (DECL); \ tree parm; \ int i; \ if (TREE_PUBLIC (DECL)) \ { extern int current_function_varargs; \ fputs ("\t.EXPORT ", FILE); assemble_name (FILE, NAME); \ fputs (",ENTRY,PRIV_LEV=3", FILE); \ for (parm = DECL_ARGUMENTS (DECL), i = 0; parm && i < 4; \ parm = TREE_CHAIN (parm)) \ { \ if (TYPE_MODE (DECL_ARG_TYPE (parm)) == SFmode) \ fprintf (FILE, ",ARGW%d=FR", i++); \ else if (TYPE_MODE (DECL_ARG_TYPE (parm)) == DFmode) \ { \ if (i <= 2) \ { \ if (i == 1) i++; \ ASM_DOUBLE_ARG_DESCRIPTORS (FILE, i++, i++); \ } \ else \ break; \ } \ else \ { \ int arg_size = \ FUNCTION_ARG_SIZE (TYPE_MODE (DECL_ARG_TYPE (parm)),\ DECL_ARG_TYPE (parm)); \ if (arg_size == 2 && i <= 2) \ { \ if (i == 1) i++; \ fprintf (FILE, ",ARGW%d=GR", i++); \ fprintf (FILE, ",ARGW%d=GR", i++); \ } \ else if (arg_size == 1) \ fprintf (FILE, ",ARGW%d=GR", i++); \ else \ i += arg_size; \ } \ } \ /* anonymous args */ \ if ((TYPE_ARG_TYPES (tree_type) != 0 \ && (TREE_VALUE (tree_last (TYPE_ARG_TYPES (tree_type)))\ != void_type_node)) \ || current_function_varargs) \ { \ for (; i < 4; i++) \ fprintf (FILE, ",ARGW%d=GR", i); \ } \ if (TYPE_MODE (fntype) == DFmode) \ fprintf (FILE, ",RTNVAL=FR"); \ else if (TYPE_MODE (fntype) == SFmode) \ fprintf (FILE, ",RTNVAL=FU"); \ else if (fntype != void_type_node) \ fprintf (FILE, ",RTNVAL=GR"); \ fputs ("\n", FILE); \ } \ ASM_OUTPUT_LABEL (FILE, NAME);} while (0)/* Two views of the size of the current frame. */extern int actual_fsize;extern int apparent_fsize;/* 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. *//* On HP-PA, move-double insns between fpu and cpu need an 8-byte block of memory. If any fpu reg is used in the function, we allocate such a block here, at the bottom of the frame, just in case it's needed. If this function is a leaf procedure, then we may choose not to do a "save" insn. The decision about whether or not to do this is made in regclass.c. */#define FUNCTION_PROLOGUE(FILE, SIZE) \ output_function_prologue (FILE, SIZE, leaf_function)/* Output assembler code to FILE to increment profiler label # LABELNO for profiling a function entry. Because HPUX _mcount is so different, we actually emit the profiling code in function_prologue. This just stores LABELNO for that. */#define PROFILE_BEFORE_PROLOGUE#define FUNCTION_PROFILER(FILE, LABELNO) \{ extern int hp_profile_labelno; hp_profile_labelno = (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. */extern int may_call_alloca;extern int current_function_pretend_args_size;#define EXIT_IGNORE_STACK \ (get_frame_size () != 0 \ || current_function_calls_alloca || current_function_outgoing_args_size)/* This macro generates the assembly code for function exit, on machines that need it. If FUNCTION_EPILOGUE is not defined then individual return instructions are generated for each return statement. Args are same as for FUNCTION_PROLOGUE. The function epilogue should not depend on the current stack pointer! It should use the frame pointer only. This is mandatory because of alloca; we also take advantage of it to omit stack adjustments before returning. *//* This declaration is needed due to traditional/ANSI incompatibilities which cannot be #ifdefed away because they occur inside of macros. Sigh. */extern union tree_node *current_function_decl;#define FUNCTION_EPILOGUE(FILE, SIZE) \ output_function_epilogue (FILE, SIZE, leaf_function)#define DELAY_SLOTS_FOR_EPILOGUE 1#define ELIGIBLE_FOR_EPILOGUE_DELAY(trial, slots_filled) \ eligible_for_epilogue_delay (trial, slots_filled)/* Output assembler code for a block containing the constant parts of a trampoline, leaving space for the variable parts. */#define TRAMPOLINE_TEMPLATE(FILE) {}/* Length in units of the trampoline for entering a nested function. */#define TRAMPOLINE_SIZE 0/* Emit RTL insns to initialize the variable parts of a trampoline. FNADDR is an RTX for the address of the function's pure code. CXT is an RTX for the static chain value for the function. This takes 16 insns: 2 shifts & 2 ands (to split up addresses), 4 sethi (to load in opcodes), 4 iors (to merge address and opcodes), and 4 writes (to store insns). This is a bit excessive. Perhaps a different mechanism would be better here. */#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) {}/* Emit code for a call to builtin_saveregs. We must emit USE insns which reference the 4 integer arg registers and 4 fp arg registers. Ordinarily they are not call used registers, but they are for _builtin_saveregs, so we must make this explicit. */#if 0#define EXPAND_BUILTIN_SAVEREGS(ARGLIST) \ (emit_insn (gen_rtx (USE, VOIDmode, gen_rtx (REG, TImode, 23))), \ (TARGET_SNAKE ? \ (emit_insn (gen_rtx (USE, VOIDmode, gen_rtx (REG, DFmode, 56))), \ emit_insn (gen_rtx (USE, VOIDmode, gen_rtx (REG, DFmode, 58))), \ emit_insn (gen_rtx (USE, VOIDmode, gen_rtx (REG, DFmode, 60))), \ emit_insn (gen_rtx (USE, VOIDmode, gen_rtx (REG, DFmode, 62)))) : \ (emit_insn (gen_rtx (USE, VOIDmode, gen_rtx (REG, DFmode, 36))), \ emit_insn (gen_rtx (USE, VOIDmode, gen_rtx (REG, DFmode, 37))), \ emit_insn (gen_rtx (USE, VOIDmode, gen_rtx (REG, DFmode, 38))), \ emit_insn (gen_rtx (USE, VOIDmode, gen_rtx (REG, DFmode, 39))))))#endif#define EXPAND_BUILTIN_SAVEREGS(ARGLIST) (rtx)hppa_builtin_saveregs (ARGLIST)/* Addressing modes, and classification of registers for them. */#define HAVE_POST_INCREMENT#define HAVE_POST_DECREMENT#define HAVE_PRE_DECREMENT#define HAVE_PRE_INCREMENT/* Macros to check register numbers against specific register classes. *//* These assume that REGNO is a hard or pseudo reg number. They give nonzero only if REGNO is a hard reg of the suitable class or a pseudo reg currently allocated to a suitable hard reg. Since they use reg_renumber, they are safe only once reg_renumber has been allocated, which happens in local-alloc.c. */#define REGNO_OK_FOR_INDEX_P(REGNO) \ ((REGNO) && ((REGNO) < 32 || (unsigned) reg_renumber[REGNO] < 32))#define REGNO_OK_FOR_BASE_P(REGNO) \ ((REGNO) && ((REGNO) < 32 || (unsigned) reg_renumber[REGNO] < 32))#define REGNO_OK_FOR_FP_P(REGNO) \ (((REGNO) >= 32 && (REGNO) <= 111)\ || (reg_renumber[REGNO] >= 32 && reg_renumber[REGNO] <= 111))/* Now macros that check whether X is a register and also, strictly, whether it is in a specified class. These macros are specific to the the HP-PA, and may be used only in code for printing assembler insns and in conditions for define_optimization. *//* 1 if X is an fp register. */#define FP_REG_P(X) (REG_P (X) && REGNO_OK_FOR_FP_P (REGNO (X)))/* Maximum number of registers that can appear in a valid memory address. */#define MAX_REGS_PER_ADDRESS 2/* Recognize any constant value that is a valid address. */#define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)/* Nonzero if the constant value X is a legitimate general operand. It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. *//*#define LEGITIMATE_CONSTANT_P(X) (1)*/#define LEGITIMATE_CONSTANT_P(X) \ (GET_CODE (X) != CONST_DOUBLE)/* The macros REG_OK_FOR..._P assume that the arg is a REG rtx and check its validity for a certain class. We have two alternate definitions for each of them. The usual definition accepts all pseudo regs; the other rejects them unless they have been allocated suitable hard regs. The symbol REG_OK_STRICT causes the latter definition to be used. Most source files want to accept pseudo regs in the hope that they will get allocated to the class that the insn wants them to be in. Source files for reload pass need to be strict. After reload, it makes no difference, since pseudo regs have been eliminated by then. *//* Optional extra constraints for this machine. Borrowed from sparc.h. For the HPPA, `Q' means that this is a memory operand but not a symbolic memory operand. Note that an unassigned pseudo register is such a memory operand. Needed because reload will generate these things in insns and then not re-recognize the insns, causing constrain_operands to fail. `R' handles the LO_SUM which can be an address for `Q'. `S' handles constraints for calls. `T' is for fp load and store addresses.*/#ifndef REG_OK_STRICT
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -