📄 rs6000.h
字号:
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 HOST_WIDE_INT) ((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 HOST_WIDE_INT) ((- (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/DI and one insn for SF. 'H' is used for DI/DF constants that take 3 insns. */#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \ ( (C) == 'G' ? (num_insns_constant (VALUE, GET_MODE (VALUE)) \ == ((GET_MODE (VALUE) == SFmode) ? 1 : 2)) \ : (C) == 'H' ? (num_insns_constant (VALUE, GET_MODE (VALUE)) == 3) \ : 0)/* Optional extra constraints for this machine. 'Q' means that is a memory operand that is just an offset from a reg. 'R' is for AIX TOC entries. 'S' is for Windows NT SYMBOL_REFs 'T' is for Windows NT LABEL_REFs. 'U' is for V.4 small data references. */#define EXTRA_CONSTRAINT(OP, C) \ ((C) == 'Q' ? GET_CODE (OP) == MEM && GET_CODE (XEXP (OP, 0)) == REG \ : (C) == 'R' ? LEGITIMATE_CONSTANT_POOL_ADDRESS_P (OP) \ : (C) == 'S' ? (TARGET_WINDOWS_NT && DEFAULT_ABI == ABI_NT && GET_CODE (OP) == SYMBOL_REF)\ : (C) == 'T' ? (TARGET_WINDOWS_NT && DEFAULT_ABI == ABI_NT && GET_CODE (OP) == LABEL_REF) \ : (C) == 'U' ? ((DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS) \ && small_data_operand (OP, GET_MODE (OP))) \ : 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)/* If we are copying between FP registers and anything else, we need a memory location. */#define SECONDARY_MEMORY_NEEDED(CLASS1,CLASS2,MODE) \ ((CLASS1) != (CLASS2) && ((CLASS1) == FLOAT_REGS || (CLASS2) == FLOAT_REGS))/* 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 || (CLASS) == FPMEM_REGS \ || (CLASS) == FLOAT_OR_FPMEM_REGS) \ ? ((GET_MODE_SIZE (MODE) + UNITS_PER_FP_WORD - 1) / UNITS_PER_FP_WORD) \ : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))/* If defined, gives a class of registers that cannot be used as the operand of a SUBREG that changes the size of the object. */#define CLASS_CANNOT_CHANGE_SIZE FLOAT_OR_FPMEM_REGS/* Stack layout; function entry, exit and calling. *//* Enumeration to give which calling sequence to use. */enum rs6000_abi { ABI_NONE, ABI_AIX, /* IBM's AIX */ ABI_AIX_NODESC, /* AIX calling sequence minus function descriptors */ ABI_V4, /* System V.4/eabi */ ABI_NT, /* Windows/NT */ ABI_SOLARIS /* Solaris */};extern enum rs6000_abi rs6000_current_abi; /* available for use by subtarget *//* Default ABI to compile code for */#ifndef DEFAULT_ABI#define DEFAULT_ABI ABI_AIX/* The prefix to add to user-visible assembler symbols. */#define USER_LABEL_PREFIX "."#endif/* Structure used to define the rs6000 stack */typedef struct rs6000_stack { int first_gp_reg_save; /* first callee saved GP register used */ int first_fp_reg_save; /* first callee saved FP register used */ int lr_save_p; /* true if the link reg needs to be saved */ int cr_save_p; /* true if the CR reg needs to be saved */ int toc_save_p; /* true if the TOC needs to be saved */ int push_p; /* true if we need to allocate stack space */ int calls_p; /* true if the function makes any calls */ int main_p; /* true if this is main */ int main_save_p; /* true if this is main and we need to save args */ int fpmem_p; /* true if float/int conversion temp needed */ enum rs6000_abi abi; /* which ABI to use */ int gp_save_offset; /* offset to save GP regs from initial SP */ int fp_save_offset; /* offset to save FP regs from initial SP */ int lr_save_offset; /* offset to save LR from initial SP */ int cr_save_offset; /* offset to save CR from initial SP */ int toc_save_offset; /* offset to save the TOC pointer */ int varargs_save_offset; /* offset to save the varargs registers */ int main_save_offset; /* offset to save main's args */ int fpmem_offset; /* offset for float/int conversion temp */ int reg_size; /* register size (4 or 8) */ int varargs_size; /* size to hold V.4 args passed in regs */ int vars_size; /* variable save area size */ int parm_size; /* outgoing parameter size */ int main_size; /* size to hold saving main's args */ int save_size; /* save area size */ int fixed_size; /* fixed size of stack frame */ int gp_size; /* size of saved GP registers */ int fp_size; /* size of saved FP registers */ int cr_size; /* size to hold CR if not in save_size */ int lr_size; /* size to hold LR if not in save_size */ int fpmem_size; /* size to hold float/int conversion */ int toc_size; /* size to hold TOC if not in save_size */ int total_size; /* total bytes allocated for stack */} rs6000_stack_t;/* 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 *//* Size of the outgoing register save area */#define RS6000_REG_SAVE (TARGET_32BIT ? 32 : 64)/* Size of the fixed area on the stack */#define RS6000_SAVE_AREA (TARGET_32BIT ? 24 : 48)/* Address to save the TOC register */#define RS6000_SAVE_TOC plus_constant (stack_pointer_rtx, 20)/* Offset & size for fpmem stack locations used for converting between float and integral types. */extern int rs6000_fpmem_offset;extern int rs6000_fpmem_size;/* Size of the V.4 varargs area if needed */#define RS6000_VARARGS_AREA 0/* Whether a V.4 varargs area is needed */extern int rs6000_sysv_varargs_p;/* Align an address */#define RS6000_ALIGN(n,a) (((n) + (a) - 1) & ~((a) - 1))/* Initialize data used by insn expanders. This is called from init_emit, once for each function, before code is generated. */#define INIT_EXPANDERS rs6000_init_expanders ()/* Size of V.4 varargs area in bytes */#define RS6000_VARARGS_SIZE \ ((GP_ARG_NUM_REG * (TARGET_32BIT ? 4 : 8)) + (FP_ARG_NUM_REG * 8) + 8)/* Offset of V.4 varargs area */#define RS6000_VARARGS_OFFSET \ (RS6000_ALIGN (current_function_outgoing_args_size, 8) \ + RS6000_SAVE_AREA)/* 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 \ (RS6000_ALIGN (current_function_outgoing_args_size, 8) \ + RS6000_VARARGS_AREA \ + RS6000_SAVE_AREA)/* Offset from the stack pointer register to an item dynamically allocated on the stack, e.g., by `alloca'. The default value for this macro is `STACK_POINTER_OFFSET' plus the length of the outgoing arguments. The default is correct for most machines. See `function.c' for details. */#define STACK_DYNAMIC_OFFSET(FUNDECL) \ (RS6000_ALIGN (current_function_outgoing_args_size, 8) \ + (STACK_POINTER_OFFSET))/* 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) RS6000_SAVE_AREA/* 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) RS6000_REG_SAVE/* 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 RS6000_SAVE_AREA/* 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. 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. */#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 RS/6000 an integer value is in r3 and a floating-point value is in fp1, unless -msoft-float. */#define FUNCTION_VALUE(VALTYPE, FUNC) \ gen_rtx (REG, TYPE_MODE (VALTYPE), \ TREE_CODE (VALTYPE) == REAL_TYPE && TARGET_HARD_FLOAT ? 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 && TARGET_HARD_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, except for Solaris, which returns structures <= 8 bytes in registers. */#define RETURN_IN_MEMORY(TYPE) \ (TYPE_MODE (TYPE) == BLKmode \ && (DEFAULT_ABI != ABI_SOLARIS || int_size_in_bytes (TYPE) > 8))/* Minimum and maximum general purpose registers used to hold arguments. */#define GP_ARG_MIN_REG 3#define GP_ARG_MAX_REG 10#define GP_ARG_NUM_REG (GP_ARG_MAX_REG - GP_ARG_MIN_REG + 1)/* Minimum and maximum floating point registers used to hold arguments. */#define FP_ARG_MIN_REG 33#define FP_ARG_AIX_MAX_REG 45#define FP_ARG_V4_MAX_REG 40#define FP_ARG_MAX_REG FP_ARG_AIX_MAX_REG#define FP_ARG_NUM_REG (FP_ARG_MAX_REG - FP_ARG_MIN_REG + 1)/* Return registers */#define GP_ARG_RETURN GP_ARG_MIN_REG#define FP_ARG_RETURN FP_ARG_MIN_REG/* Flags for the call/call_value rtl operations set up by function_arg */#define CALL_NORMAL 0x00000000 /* no special processing */#define CALL_NT_DLLIMPORT 0x00000001 /* NT, this is a DLL import call */#define CALL_V4_CLEAR_FP_ARGS 0x00000002 /* V.4, no FP args passed */#define CALL_V4_SET_FP_ARGS 0x00000004 /* V.4, FP args were passed */#define CALL_LONG 0x00000008 /* always call indirect *//* Define cutoff for using external functions to save floating point */#define FP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) == 62 || (FIRST_REG) == 63)/* 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) == GP_ARG_RETURN || ((N) == FP_ARG_RETURN))/* 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) \ (((unsigned)((N) - GP_ARG_MIN_REG) < (unsigned)(GP_ARG_NUM_REG)) \ || ((unsigned)((N) - FP_ARG_MIN_REG) < (unsigned)(FP_ARG_NUM_REG)))/* 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.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -