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

📄 pyr.h

📁 gcc-2.95.3 Linux下最常用的C编译器
💻 H
📖 第 1 页 / 共 4 页
字号:
   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 pyramid has only one kind of registers, so NO_REGS and ALL_REGS   are the only classes.  */enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES };#define N_REG_CLASSES (int) LIM_REG_CLASSES/* Since GENERAL_REGS is the same class as ALL_REGS,   don't give it a different class number; just make it an alias.  */#define GENERAL_REGS ALL_REGS/* Give names of register classes as strings for dump file.   */#define REG_CLASS_NAMES \ {"NO_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}, {0xffffffff,0xffffffff}}/* 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) ALL_REGS/* The class value for index registers, and the one for base regs.  */#define BASE_REG_CLASS ALL_REGS#define INDEX_REG_CLASS ALL_REGS/* Get reg_class from a letter such as appears in the machine description.  */#define REG_CLASS_FROM_LETTER(C) NO_REGS/* 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 maximum number of consecutive registers   needed to represent mode MODE in a register of class CLASS.  *//* On the pyramid, this is always the size of MODE in words,   since all registers are the same size.  */#define CLASS_MAX_NREGS(CLASS, MODE)	\ ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)/* 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.   --> For the Pyramid, 'I' can be used for the 6-bit signed integers   --> (-32 to 31) allowed as immediate short operands in many   --> instructions. 'J' cane be used for any value that doesn't fit   --> in 6 bits.  */#define CONST_OK_FOR_LETTER_P(VALUE, C)  \  ((C) == 'I' ? (VALUE) >= -32 && (VALUE) < 32 : \   (C) == 'J' ? (VALUE) < -32 || (VALUE) >= 32 : \   (C) == 'K' ? (VALUE) == 0xff || (VALUE) == 0xffff : 0)/* Similar, but for floating constants, and defining letters G and H.   Here VALUE is the CONST_DOUBLE rtx itself.  */#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) 0/*** 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.  *//* FIXME: this used to work when defined as 0.  But that makes gnu   stdargs clobber the first arg.  What gives?? */#define STARTING_FRAME_OFFSET 0/* Offset of first parameter from the argument pointer register value.  */#define FIRST_PARM_OFFSET(FNDECL) 0/* Value is the number of bytes of arguments automatically   popped when returning from a subroutine 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.   SIZE is the number of bytes of arguments passed on the stack.   The Pyramid OSx Porting Guide says we are never to do this;   using RETD in this way violates the Pyramid calling convention.   We may nevertheless provide this as an option.   */#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE)   \  ((TARGET_RETD && (!(FUNDECL) || TREE_CODE (FUNDECL) != IDENTIFIER_NODE)	\    && (TYPE_ARG_TYPES (FUNTYPE) == 0				\	|| (TREE_VALUE (tree_last (TYPE_ARG_TYPES (FUNTYPE)))	\	    == void_type_node)))				\   ? (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.  *//* --> Pyramid has register windows.   --> The caller sees the return value is in TR0(/TR1) regardless of   --> its type.   */#define FUNCTION_VALUE(VALTYPE, FUNC)  \  gen_rtx (REG, TYPE_MODE (VALTYPE), PYR_TREG(0))/* --> but the callee has to leave it in PR0(/PR1) */#define FUNCTION_OUTGOING_VALUE(VALTYPE, FUNC)	\  gen_rtx (REG, TYPE_MODE (VALTYPE), PYR_PREG(0))/* Define how to find the value returned by a library function   assuming the value has mode MODE.  *//* --> On Pyramid the return value is in TR0/TR1 regardless.  */#define LIBCALL_VALUE(MODE)  gen_rtx (REG, MODE, PYR_TREG(0))/* Define this if PCC uses the nonreentrant convention for returning   structure and union values.  */#define PCC_STATIC_STRUCT_RETURN/* 1 if N is a possible register number for a function value   as seen by the caller.  On the Pyramid, TR0 is the only register thus used.   */#define FUNCTION_VALUE_REGNO_P(N) ((N) == PYR_TREG(0))/* 1 if N is a possible register number for function argument passing.   On the Pyramid, the first twelve temporary registers are available.  *//* FIXME FIXME FIXME   it's not clear whether this macro should be defined from the point   of view of the caller or the callee.  Since it's never actually used   in GNU CC, the point is somewhat moot :-).   This definition is consistent with register usage in the md's for   other register-window architectures (sparc and spur). */#define FUNCTION_ARG_REGNO_P(N) ((PYR_TREG(0) <= (N)) && ((N) <= PYR_TREG(11)))/*** Parameter passing: FUNCTION_ARG and FUNCTION_INCOMING_ARG ***//* 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 Pyramids, each parameter is passed either completely on the stack   or completely in registers.  No parameter larger than a double may   be passed in a register.  Also, no struct or union may be passed in   a register, even if it would fit.    So parameters are not necessarily passed "consecutively".    Thus we need a vector data type: one element to record how many    parameters have been passed in registers and on the stack,    respectively.    ((These constraints seem like a gross waste of registers. But if we    ignore the constraint about structs & unions, we won`t be able to    freely mix gcc-compiled code and pyr cc-compiled code.  It looks    like better argument passing conventions, and a machine-dependent    flag to enable them, might be a win.))   */#define CUMULATIVE_ARGS int/* Define the number of registers that can hold parameters.   This macro is used only in other macro definitions below.   */#define NPARM_REGS 12/* Decide whether or not a parameter can be put in a register.   (We may still have problems with libcalls. GCC doesn't seem   to know about anything more than the machine mode.  I trust   structures are never passed to a libcall...   If compiling with -mgnu-stdarg, this definition should make   functions using the gcc-supplied stdarg, and calls to such   functions (declared with an arglist ending in"..."),  work.   But such fns won't be able to call pyr cc-compiled   varargs fns (eg, printf(), _doprnt.)   If compiling with -mnognu-stdarg, this definition should make   calls to pyr cc-compiled functions work.  Functions using   the gcc-supplied stdarg will be utterly broken.   There will be no better solution until RMS can be persuaded that   one is needed.   This macro is used only in other macro definitions below.   (well, it may be used in pyr.c, because the damn pyramid cc   can't handle the macro definition of PARAM_SAFE_FOR_REG_P !   */#define INNER_PARAM_SAFE_HELPER(TYPE) \ ((TARGET_GNU_STDARG ? (! TREE_ADDRESSABLE ((tree)TYPE)): 1)	\   && (TREE_CODE ((tree)TYPE) != RECORD_TYPE)			\   && (TREE_CODE ((tree)TYPE) != UNION_TYPE))#ifdef __GNUC__#define PARAM_SAFE_HELPER(TYPE) \  INNER_PARAM_SAFE_HELPER((TYPE))#elseextern int inner_param_safe_helper();#define PARAM_SAFE_HELPER(TYPE) \  inner_param_safe_helper((tree)(TYPE))#endif/* Be careful with the expression (long) (TYPE) == 0.   Writing it in more obvious/correct forms makes the Pyr cc   dump core!   */#define PARAM_SAFE_FOR_REG_P(MODE, TYPE, NAMED) \  (((MODE) != BLKmode)				\   && ((TARGET_GNU_STDARG) ? (NAMED) : 1)	\   && ((((long)(TYPE))==0) || PARAM_SAFE_HELPER((TYPE))))/* 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) = (FNTYPE && !flag_pcc_struct_return		\	    && aggregate_value_p (TREE_TYPE (FNTYPE))))/* 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). */#define FUNCTION_ARG_HELPER(CUM, MODE, TYPE, NAMED) \(PARAM_SAFE_FOR_REG_P(MODE,TYPE,NAMED)				\ ? (NPARM_REGS >= ((CUM)					\		   + ((MODE) == BLKmode				\		      ? (int_size_in_bytes (TYPE) + 3) / 4	\		      : (GET_MODE_SIZE (MODE) + 3) / 4))	\    ? gen_rtx (REG, (MODE), PYR_TREG(CUM))			\    : 0)							\ : 0)#ifdef __GNUC__#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \	FUNCTION_ARG_HELPER(CUM, MODE, TYPE, NAMED)#else/*****************  Avoid bug in Pyramid OSx compiler... ******************/#define FUNCTION_ARG  (rtx) pyr_function_argextern void* pyr_function_arg ();#endif/* Define where a function finds its arguments.   This is different from FUNCTION_ARG because of register windows.  */#define FUNCTION_INCOMING_ARG(CUM, MODE, TYPE, NAMED) \(PARAM_SAFE_FOR_REG_P(MODE,TYPE,NAMED)			\ ? (NPARM_REGS >= ((CUM)				\	   + ((MODE) == BLKmode				\	      ? (int_size_in_bytes (TYPE) + 3) / 4	\	      : (GET_MODE_SIZE (MODE) + 3) / 4))	\    ? gen_rtx (REG, (MODE), PYR_PREG(CUM))		\    : 0)						\ : 0)/* 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)	+=  (PARAM_SAFE_FOR_REG_P(MODE,TYPE,NAMED)	\	     ? ((MODE) != BLKmode			\		? (GET_MODE_SIZE (MODE) + 3) / 4	\		: (int_size_in_bytes (TYPE) + 3) / 4)	\	     : 0))/* 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.  */#if FRAME_POINTER_REQUIRED/* We always have frame pointers *//* Don't set up a frame pointer if it's not referenced.  */#define FUNCTION_PROLOGUE(FILE, SIZE) \{									\  int _size = (SIZE) + current_function_pretend_args_size;		\  if (_size + current_function_args_size != 0				\      || current_function_calls_alloca)					\    {									\      fprintf (FILE, "\tadsf $%d\n", _size);				\      if (current_function_pretend_args_size > 0)			\      fprintf (FILE, "\tsubw $%d,cfp\n",				\	  current_function_pretend_args_size);				\    }									\}#else /* !FRAME_POINTER_REQUIRED *//* Don't set up a frame pointer if `frame_pointer_needed' tells us   there is no need.  Also, don't set up a frame pointer if it's not   referenced.  *//* The definition used to be broken.  Write a new one.  */#endif /* !FRAME_POINTER_REQUIRED *//* the trampoline stuff was taken from convex.h - S.P. *//* A C statement to output, on the stream FILE, assembler code for a   block of data that contains the constant parts of a trampoline.  This   code should not include a label - the label is taken care of   automatically.	We use TR12/PR12 for the static chain.	movew $<STATIC>,pr12	# I2R	jump $<func>		# S2R */#define TRAMPOLINE_TEMPLATE(FILE) \{ ASM_OUTPUT_INT (FILE, GEN_INT (0x2100001C));	\  ASM_OUTPUT_INT (FILE, GEN_INT (0x00000000));	\  ASM_OUTPUT_INT (FILE, GEN_INT (0x40000000));	\  ASM_OUTPUT_INT (FILE, GEN_INT (0x00000000)); }#define TRAMPOLINE_SIZE		16#define TRAMPOLINE_ALIGNMENT	32/* 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.  */#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \{ emit_move_insn (gen_rtx (MEM, Pmode, plus_constant (TRAMP, 4)), CXT);	\  emit_move_insn (gen_rtx (MEM, Pmode, plus_constant (TRAMP, 12)), FNADDR); \  emit_call_insn (gen_call (gen_rtx (MEM, QImode,			\

⌨️ 快捷键说明

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