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

📄 rs6000.h

📁 早期freebsd实现
💻 H
📖 第 1 页 / 共 5 页
字号:
   The values of these macros are register numbers.  *//* RS/6000 pc isn't overloaded on a register that the compiler knows about.  *//* #define PC_REGNUM  *//* Register to use for pushing function arguments.  */#define STACK_POINTER_REGNUM 1/* Base register for access to local variables of the function.  */#define FRAME_POINTER_REGNUM 31/* Value should be nonzero if functions must have frame pointers.   Zero means the frame pointer need not be set up (and parms   may be accessed via the stack pointer) in functions that seem suitable.   This is computed in `reload', in reload1.c.  */#define FRAME_POINTER_REQUIRED 0/* Base register for access to arguments of the function.  */#define ARG_POINTER_REGNUM 67/* Place to put static chain when calling a function that requires it.  */#define STATIC_CHAIN_REGNUM 11/* Place that structure value return address is placed.   On the RS/6000, it is passed as an extra parameter.  */#define STRUCT_VALUE	0/* 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 RS/6000 has three types of registers, fixed-point, floating-point,   and condition registers, plus three special registers, MQ, CTR, and the   link register.   However, r0 is special in that it cannot be used as a base register.   So make a class for registers valid as base registers.   Also, cr0 is the only condition code register that can be used in   arithmetic insns, so make a separate class for it. */enum reg_class { NO_REGS, BASE_REGS, GENERAL_REGS, FLOAT_REGS,  NON_SPECIAL_REGS, MQ_REGS, LINK_REGS, CTR_REGS, LINK_OR_CTR_REGS,  SPECIAL_REGS, SPEC_OR_GEN_REGS, CR0_REGS, CR_REGS, NON_FLOAT_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", "BASE_REGS", "GENERAL_REGS", "FLOAT_REGS",	\    "NON_SPECIAL_REGS", "MQ_REGS", "LINK_REGS", "CTR_REGS",	\    "LINK_OR_CTR_REGS", "SPECIAL_REGS", "SPEC_OR_GEN_REGS",	\    "CR0_REGS", "CR_REGS", "NON_FLOAT_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, 0}, {0xfffffffe, 0, 8}, {~0, 0, 8},		\    {0, ~0, 0}, {~0, ~0, 8}, {0, 0, 1}, {0, 0, 2},	\    {0, 0, 4}, {0, 0, 6}, {0, 0, 7}, {~0, 0, 15},	\    {0, 0, 16}, {0, 0, 0xff0}, {~0, 0, 0xffff},		\    {~0, ~0, 0xffff} }/* 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 ? GENERAL_REGS	\  : (REGNO) < 32 ? BASE_REGS	\  : FP_REGNO_P (REGNO) ? FLOAT_REGS \  : (REGNO) == 68 ? CR0_REGS	\  : CR_REGNO_P (REGNO) ? CR_REGS \  : (REGNO) == 64 ? MQ_REGS	\  : (REGNO) == 65 ? LINK_REGS	\  : (REGNO) == 66 ? CTR_REGS	\  : (REGNO) == 67 ? BASE_REGS	\  : NO_REGS)/* The class value for index registers, and the one for base regs.  */#define INDEX_REG_CLASS GENERAL_REGS#define BASE_REG_CLASS BASE_REGS/* Get reg_class from a letter such as appears in the machine description.  */#define REG_CLASS_FROM_LETTER(C) \  ((C) == 'f' ? FLOAT_REGS	\   : (C) == 'b' ? BASE_REGS	\   : (C) == 'h' ? SPECIAL_REGS	\   : (C) == 'q' ? MQ_REGS	\   : (C) == 'c' ? CTR_REGS	\   : (C) == 'l' ? LINK_REGS	\   : (C) == 'x' ? CR0_REGS	\   : (C) == 'y' ? CR_REGS	\   : NO_REGS)/* The letters I, J, K, L, M, N, and P 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 signed 16-bit constants    `J' is a constant with only the high-order 16 bits non-zero   `K' is a constant with only the low-order 16 bits non-zero   `L' is a constant that can be placed into a mask operand   `M' is a constant that is greater than 31   `N' is a constant that is an exact power of two   `O' is the constant zero   `P' is a constant whose negation is a signed 16-bit constant */#define CONST_OK_FOR_LETTER_P(VALUE, C)				\   ( (C) == 'I' ? (unsigned) ((VALUE) + 0x8000) < 0x10000	\   : (C) == 'J' ? ((VALUE) & 0xffff) == 0			\   : (C) == 'K' ? ((VALUE) & 0xffff0000) == 0			\   : (C) == 'L' ? mask_constant (VALUE)				\   : (C) == 'M' ? (VALUE) > 31					\   : (C) == 'N' ? exact_log2 (VALUE) >= 0			\   : (C) == 'O' ? (VALUE) == 0					\   : (C) == 'P' ? (unsigned) ((- (VALUE)) + 0x8000) < 0x1000	\   : 0)/* Similar, but for floating constants, and defining letters G and H.   Here VALUE is the CONST_DOUBLE rtx itself.   We flag for special constants when we can copy the constant into   a general register in two insns for DF and one insn for SF.  */#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C)  \  ((C) == 'G' ? easy_fp_constant (VALUE, GET_MODE (VALUE)) : 0)/* Optional extra constraints for this machine.   For the RS/6000, `Q' means that this is a memory operand that is just   an offset from a register.  */#define EXTRA_CONSTRAINT(OP, C)						\  ((C) == 'Q' ? GET_CODE (OP) == MEM && GET_CODE (XEXP (OP, 0)) == REG	\   : 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.    On the RS/6000, we have to return NO_REGS when we want to reload a   floating-point CONST_DOUBLE to force it to be copied to memory.  */#define PREFERRED_RELOAD_CLASS(X,CLASS)	\  ((GET_CODE (X) == CONST_DOUBLE			\    && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT)	\   ? NO_REGS : (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.  */#define SECONDARY_RELOAD_CLASS(CLASS,MODE,IN) \  secondary_reload_class (CLASS, MODE, IN)/* Return the maximum number of consecutive registers   needed to represent mode MODE in a register of class CLASS.   On RS/6000, this is the size of MODE in words,   except in the FP regs, where a single reg is enough for two words.  */#define CLASS_MAX_NREGS(CLASS, MODE)	\ ((CLASS) == FLOAT_REGS			\  ? ((GET_MODE_SIZE (MODE) + 2 * UNITS_PER_WORD - 1) / (2 * UNITS_PER_WORD)) \  : ((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/* 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.   On the RS/6000, we grow upwards, from the area after the outgoing   arguments.  *//* #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.    On the RS/6000, the frame pointer is the same as the stack pointer,   except for dynamic allocations.  So we start after the fixed area and   outgoing parameter area.  */#define STARTING_FRAME_OFFSET (current_function_outgoing_args_size + 24)/* If we generate an insn to push BYTES bytes,   this says how many the stack pointer really advances by.   On RS/6000, don't define this because there are no push insns.  *//*  #define PUSH_ROUNDING(BYTES) *//* Offset of first parameter from the argument pointer register value.   On the RS/6000, we define the argument pointer to the start of the fixed   area.  */#define FIRST_PARM_OFFSET(FNDECL) 24/* Define this if stack space is still allocated for a parameter passed   in a register.  The value is the number of bytes allocated to this   area.  */#define REG_PARM_STACK_SPACE(FNDECL)	32/* 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/* This is the difference between the logical top of stack and the actual sp.   For the RS/6000, sp points past the fixed area. */#define STACK_POINTER_OFFSET 24/* Define this if the maximum size of all the outgoing args is to be   accumulated and pushed during the prologue.  The amount can be   found in the variable current_function_outgoing_args_size.  */#define ACCUMULATE_OUTGOING_ARGS/* Value is the number of bytes of arguments automatically   popped when returning from a subroutine call.   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.  */#define RETURN_POPS_ARGS(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 RS/6000 an integer value is in r3 and a floating-point value is in    fp1.  */#define FUNCTION_VALUE(VALTYPE, FUNC)	\  gen_rtx (REG, TYPE_MODE (VALTYPE),	\	   TREE_CODE (VALTYPE) == REAL_TYPE ? 33 : 3)/* 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, GET_MODE_CLASS (MODE) == MODE_FLOAT ? 33 : 3)/* The definition of this macro implies that there are cases where   a scalar value cannot be returned in registers.   For the RS/6000, any structure or union type is returned in memory.  */#define RETURN_IN_MEMORY(TYPE) \  (TREE_CODE (TYPE) == RECORD_TYPE || TREE_CODE (TYPE) == UNION_TYPE)/* 1 if N is a possible register number for a function value   as seen by the caller.   On RS/6000, this is r3 and fp1.  */#define FUNCTION_VALUE_REGNO_P(N)  ((N) == 3 || ((N) == 33))/* 1 if N is a possible register number for function argument passing.   On RS/6000, these are r3-r10 and fp1-fp13.  */#define FUNCTION_ARG_REGNO_P(N)	\  (((N) <= 10 && (N) >= 3) || ((N) >= 33 && (N) <= 45))/* 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 RS/6000, this is a structure.  The first element is the number of   total argument words, the second is used to store the next   floating-point register number, and the third says how many more args we   have prototype types for.  */struct rs6000_args {int words, fregno, nargs_prototype; };#define CUMULATIVE_ARGS struct rs6000_args/* Define intermediate macro to compute the size (in registers) of an argument   for the RS/6000.  */#define RS6000_ARG_SIZE(MODE, TYPE, NAMED)				\(! (NAMED) ? 0								\ : (MODE) != BLKmode							\ ? (GET_MODE_SIZE (MODE) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD 	\ : (int_size_in_bytes (TYPE) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD)/* 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).words = 0,				\  (CUM).fregno = 33,				\  (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 an EXPR_LIST.  */#define INIT_CUMULATIVE_INCOMING_ARGS(CUM,FNTYPE,IGNORE) \  (CUM).words = 0,				\  (CUM).fregno = 33,				\  (CUM).nargs_prototype = 1000/* 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--;				\  if (NAMED)						\    {							\      (CUM).words += RS6000_ARG_SIZE (MODE, TYPE, NAMED); \      if (GET_MODE_CLASS (MODE) == MODE_FLOAT)		\	(CUM).fregno++;					\    }							\}/* Non-zero if we can use a floating-point register to pass this arg.  */#define USE_FP_FOR_ARG_P(CUM,MODE,TYPE)	\  (GET_MODE_CLASS (MODE) == MODE_FLOAT && (CUM).fregno < 46)

⌨️ 快捷键说明

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