⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pa.h

📁 linux下的gcc编译器
💻 H
📖 第 1 页 / 共 5 页
字号:
/* 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.  The start of the locals must lie on   a STACK_BOUNDARY or else the frame size of leaf functions will not   be zero.  */#define STARTING_FRAME_OFFSET (TARGET_64BIT ? 16 : 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.  */#define FIRST_PARM_OFFSET(FNDECL) (TARGET_64BIT ? -64 : -32)/* When a parameter is passed in a register, stack space is still   allocated for it.  */#define REG_PARM_STACK_SPACE(DECL) (TARGET_64BIT ? 64 : 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 1/* 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.   On the 64-bit port, the HP C compiler allocates a 48-byte frame   marker, although the runtime documentation only describes a 16   byte marker.  For compatibility, we allocate 48 bytes.  */#define STACK_POINTER_OFFSET \  (TARGET_64BIT ? -(current_function_outgoing_args_size + 48): -32)#define STACK_DYNAMIC_OFFSET(FNDECL)	\  (TARGET_64BIT				\   ? (STACK_POINTER_OFFSET)		\   : ((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.  */#define FUNCTION_VALUE(VALTYPE, FUNC) function_value (VALTYPE, FUNC)/* 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))/* 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, the WORDS field holds the 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.      The INCOMING field tracks whether this is an "incoming" or   "outgoing" argument.      The INDIRECT field indicates whether this is is an indirect   call or not.      The NARGS_PROTOTYPE field indicates that an argument does not   have a prototype when it less than or equal to 0.  */struct hppa_args {int words, nargs_prototype, incoming, 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).incoming = 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).incoming = 1,				\  (CUM).indirect = 0,				\  (CUM).nargs_prototype = 1000/* Figure out the size in words of the function argument.  The size   returned by this macro should always be greater than zero because   we pass variable and zero sized objects by reference.  */#define FUNCTION_ARG_SIZE(MODE, TYPE)	\  ((((MODE) != BLKmode \     ? (HOST_WIDE_INT) GET_MODE_SIZE (MODE) \     : 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)			\{ (CUM).nargs_prototype--;						\  (CUM).words += FUNCTION_ARG_SIZE(MODE, TYPE)	 			\    + (((CUM).words & 01) && (TYPE) != 0				\	&& FUNCTION_ARG_SIZE(MODE, TYPE) > 1);				\}/* 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.   The caller must make a distinction between calls to explicitly named   functions and calls through pointers to functions -- the conventions   are different!  Calls through pointers to functions only use general   registers for the first four argument words.   Of course all this is different for the portable runtime model   HP wants everyone to use for ELF.  Ugh.  Here's a quick description   of how it's supposed to work.   1) callee side remains unchanged.  It expects integer args to be   in the integer registers, float args in the float registers and   unnamed args in integer registers.   2) caller side now depends on if the function being called has   a prototype in scope (rather than if it's being called indirectly).      2a) If there is a prototype in scope, then arguments are passed      according to their type (ints in integer registers, floats in float      registers, unnamed args in integer registers.      2b) If there is no prototype in scope, then floating point arguments      are passed in both integer and float registers.  egad.  FYI: The portable parameter passing conventions are almost exactly like  the standard parameter passing conventions on the RS6000.  That's why  you'll see lots of similar code in rs6000.h.  */#define FUNCTION_ARG_PADDING(MODE, TYPE) function_arg_padding ((MODE), (TYPE))/* Do not expect to understand this without reading it several times.  I'm   tempted to try and simply it, but I worry about breaking something.  */#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \  function_arg (&CUM, MODE, TYPE, NAMED)/* Nonzero if we do not know how to pass TYPE solely in registers.  */#define MUST_PASS_IN_STACK(MODE,TYPE) \  ((TYPE) != 0							\   && (TREE_CODE (TYPE_SIZE (TYPE)) != INTEGER_CST		\       || TREE_ADDRESSABLE (TYPE)))/* 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.  *//* For PA32 there are never split arguments. PA64, on the other hand, can   pass arguments partially in registers and partially in memory.  */#define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \  (TARGET_64BIT ? 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.  *//* Arguments larger than one word are double word aligned.  */#define FUNCTION_ARG_BOUNDARY(MODE, TYPE)				\  (((TYPE)								\    ? (integer_zerop (TYPE_SIZE (TYPE))					\       || !TREE_CONSTANT (TYPE_SIZE (TYPE))				\       || int_size_in_bytes (TYPE) <= UNITS_PER_WORD)			\    : GET_MODE_SIZE(MODE) <= UNITS_PER_WORD)				\   ? PARM_BOUNDARY : MAX_PARM_BOUNDARY)/* In the 32-bit runtime, arguments larger than eight bytes are passed   by invisible reference.  As a GCC extension, we also pass anything   with a zero or variable size by reference.   The 64-bit runtime does not describe passing any types by invisible   reference.  The internals of GCC can't currently handle passing   empty structures, and zero or variable length arrays when they are   not passed entirely on the stack or by reference.  Thus, as a GCC   extension, we pass these types by reference.  The HP compiler doesn't   support these types, so hopefully there shouldn't be any compatibility   issues.  This may have to be revisited when HP releases a C99 compiler   or updates the ABI.  */#define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED)		\  (TARGET_64BIT								\   ? ((TYPE) && int_size_in_bytes (TYPE) <= 0)				\   : (((TYPE) && (int_size_in_bytes (TYPE) > 8				\		  || int_size_in_bytes (TYPE) <= 0))			\      || ((MODE) && GET_MODE_SIZE (MODE) > 8))) #define FUNCTION_ARG_CALLEE_COPIES(CUM, MODE, TYPE, NAMED) 		\  FUNCTION_ARG_PASS_BY_REFERENCE (CUM, MODE, TYPE, NAMED)extern GTY(()) rtx hppa_compare_op0;extern GTY(()) rtx hppa_compare_op1;extern enum cmp_type hppa_branch_type;/* On HPPA, we emit profiling code as rtl via PROFILE_HOOK rather than   as assembly via FUNCTION_PROFILER.  Just output a local label.   We can't use the function label because the GAS SOM target can't   handle the difference of a global symbol and a local symbol.  */#ifndef FUNC_BEGIN_PROLOG_LABEL#define FUNC_BEGIN_PROLOG_LABEL        "LFBP"#endif#define FUNCTION_PROFILER(FILE, LABEL) \  ASM_OUTPUT_INTERNAL_LABEL (FILE, FUNC_BEGIN_PROLOG_LABEL, LABEL)#define PROFILE_HOOK(label_no) hppa_profile_hook (label_no)void hppa_profile_hook PARAMS ((int label_no));/* The profile counter if emitted must come before the prologue.  */#define PROFILE_BEFORE_PROLOGUE 1/* 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;#define EXIT_IGNORE_STACK	\ (get_frame_size () != 0	\  || current_function_calls_alloca || current_function_outgoing_args_size)/* Output assembler code for a block containing the constant parts   of a trampoline, leaving space for the variable parts.\   The trampoline sets the static chain pointer to STATIC_CHAIN_REGNUM   and then branches to the specified routine.   This code template is copied from text segment to stack location   and then patched with INITIALIZE_TRAMPOLINE to contain   valid values, and then entered as a subroutine.   It is best to keep this as small as possible to avoid having to   flush multiple lines in the cache.  */#define TRAMPOLINE_TEMPLATE(FILE) 					\  {									\    if (!TARGET_64BIT)							\      {									\	fputs ("\tldw	36(%r22),%r21\n", FILE);			\	fputs ("\tbb,>=,n	%r21,30,.+16\n", FILE);			\	if (ASSEMBLER_DIALECT == 0)					\	  fputs ("\tdepi	0,31,2,%r21\n", FILE);			\	else								\	  fputs ("\tdepwi	0,31,2,%r21\n", FILE);			\	fputs ("\tldw	4(%r21),%r19\n", FILE);				\	fputs ("\tldw	0(%r21),%r21\n", FILE);				\	if (TARGET_PA_20)						\	  {								\	    fputs ("\tbve	(%r21)\n", FILE);			\	    fputs ("\tldw	40(%r22),%r29\n", FILE);		\	    fputs ("\t.word	0\n", FILE);				\

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -