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

📄 pa.h

📁 gcc3.2.1源代码
💻 H
📖 第 1 页 / 共 5 页
字号:
   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, ) *//* This must perform the same promotions as PROMOTE_MODE, else   PROMOTE_FUNCTION_RETURN will not work correctly.  */#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),		\	       TREE_CODE (VALTYPE) == REAL_TYPE && !TARGET_SOFT_FLOAT ? 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))/* 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 \     ? (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, 0)#define FUNCTION_INCOMING_ARG(CUM, MODE, TYPE, NAMED) \  function_arg (&CUM, MODE, TYPE, NAMED, 1)/* 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.  */#define FUNCTION_ARG_BOUNDARY(MODE, TYPE)			\  (((TYPE) != 0)						\   ? ((integer_zerop (TYPE_SIZE (TYPE))				\       || ! TREE_CONSTANT (TYPE_SIZE (TYPE)))			\      ? BITS_PER_UNIT						\      : (((int_size_in_bytes (TYPE)) + UNITS_PER_WORD - 1)	\	 / UNITS_PER_WORD) * BITS_PER_WORD)			\   : ((GET_MODE_ALIGNMENT(MODE) <= PARM_BOUNDARY)		\      ? PARM_BOUNDARY : GET_MODE_ALIGNMENT(MODE)))/* Arguments larger than eight bytes are passed by invisible reference *//* PA64 does not pass anything by invisible reference.  */#define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED)		\  (TARGET_64BIT								\   ? 0									\   : (((TYPE) && int_size_in_bytes (TYPE) > 8)				\      || ((MODE) && GET_MODE_SIZE (MODE) > 8))) /* PA64 does not pass anything by invisible reference.   This should be undef'ed for 64bit, but we'll see if this works. The   problem is that we can't test TARGET_64BIT from the preprocessor.  */#define FUNCTION_ARG_CALLEE_COPIES(CUM, MODE, TYPE, NAMED) \  (TARGET_64BIT							\   ? 0								\   : (((TYPE) && int_size_in_bytes (TYPE) > 8)			\      || ((MODE) && GET_MODE_SIZE (MODE) > 8)))extern struct rtx_def *hppa_compare_op0, *hppa_compare_op1;extern enum cmp_type hppa_branch_type;#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \{ const char *target_name = XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0); \  static unsigned int current_thunk_number; \  char label[16]; \  char *lab; \  ASM_GENERATE_INTERNAL_LABEL (label, "LTHN", current_thunk_number); \  STRIP_NAME_ENCODING (lab, label); \  STRIP_NAME_ENCODING (target_name, target_name); \  /* FIXME: total_code_bytes is not handled correctly in files with \     mi thunks.  */ \  pa_output_function_prologue (FILE, 0); \  if (VAL_14_BITS_P (DELTA)) \    { \      if (! TARGET_64BIT && ! TARGET_PORTABLE_RUNTIME && flag_pic) \	{ \	  fprintf (FILE, "\taddil LT%%%s,%%r19\n", lab); \	  fprintf (FILE, "\tldw RT%%%s(%%r1),%%r22\n", lab); \	  fprintf (FILE, "\tldw 0(%%sr0,%%r22),%%r22\n"); \	  fprintf (FILE, "\tbb,>=,n %%r22,30,.+16\n"); \	  fprintf (FILE, "\tdepi 0,31,2,%%r22\n"); \	  fprintf (FILE, "\tldw 4(%%sr0,%%r22),%%r19\n"); \	  fprintf (FILE, "\tldw 0(%%sr0,%%r22),%%r22\n"); \	  fprintf (FILE, "\tldsid (%%sr0,%%r22),%%r1\n\tmtsp %%r1,%%sr0\n"); \	  fprintf (FILE, "\tbe 0(%%sr0,%%r22)\n\tldo "); \	  fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, DELTA); \	  fprintf (FILE, "(%%r26),%%r26\n"); \	} \      else \	{ \	  fprintf (FILE, "\tb %s\n\tldo ", target_name); \	  fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, DELTA); \	  fprintf (FILE, "(%%r26),%%r26\n"); \	} \    } \  else \    { \      if (! TARGET_64BIT && ! TARGET_PORTABLE_RUNTIME && flag_pic) \	{ \	  fprintf (FILE, "\taddil L%%"); \	  fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, DELTA); \	  fprintf (FILE, ",%%r26\n\tldo R%%"); \	  fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, DELTA); \	  fprintf (FILE, "(%%r1),%%r26\n"); \	  fprintf (FILE, "\taddil LT%%%s,%%r19\n", lab); \	  fprintf (FILE, "\tldw RT%%%s(%%r1),%%r22\n", lab); \	  fprintf (FILE, "\tldw 0(%%sr0,%%r22),%%r22\n"); \	  fprintf (FILE, "\tbb,>=,n %%r22,30,.+16\n"); \	  fprintf (FILE, "\tdepi 0,31,2,%%r22\n"); \	  fprintf (FILE, "\tldw 4(%%sr0,%%r22),%%r19\n"); \	  fprintf (FILE, "\tldw 0(%%sr0,%%r22),%%r22\n"); \	  fprintf (FILE, "\tldsid (%%sr0,%%r22),%%r1\n\tmtsp %%r1,%%sr0\n"); \	  fprintf (FILE, "\tbe,n 0(%%sr0,%%r22)\n"); \	} \      else \	{ \	  fprintf (FILE, "\taddil L%%"); \	  fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, DELTA); \	  fprintf (FILE, ",%%r26\n\tb %s\n\tldo R%%", target_name); \	  fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, DELTA); \	  fprintf (FILE, "(%%r1),%%r26\n"); \	} \    } \  fprintf (FILE, "\t.EXIT\n\t.PROCEND\n"); \  if (! TARGET_64BIT && ! TARGET_PORTABLE_RUNTIME && flag_pic) \    { \      data_section (); \      fprintf (FILE, "\t.align 4\n"); \      ASM_OUTPUT_INTERNAL_LABEL (FILE, "LTHN", current_thunk_number); \      fprintf (FILE, "\t.word P%%%s\n", target_name); \      function_section (THUNK_FNDECL); \    } \  current_thunk_number++; \}/* 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);				\	fputs ("\tldsid	(%r21),%r1\n", FILE);				\	fputs ("\tmtsp	%r1,%sr0\n", FILE);				\	fputs ("\tbe	0(%sr0,%r21)\n", FILE);				\	fputs ("\tldw	40(%r22),%r29\n", FILE);			\	fputs ("\t.word	0\n", FILE);					\	fputs ("\t.word	0\n", FILE);					\	fputs ("\t.word	0\n", FILE);					\	fputs ("\t.word	0\n", FILE);					\      }									\    else								\      {									\	fputs ("\t.dword 0\n", FILE);					\	fputs ("\t.dword 0\n", FILE);					\	fputs ("\t.dword 0\n", FILE);					\

⌨️ 快捷键说明

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