📄 rs6000.h
字号:
The System V.4 varargs/stdarg support requires that this structure's size be a multiple of sizeof(int), and that WORDS, FREGNO, NARGS_PROTOTYPE, ORIG_NARGS, and VARARGS_OFFSET be the first five ints. */typedef struct rs6000_args{ int words; /* # words uses for passing GP registers */ int fregno; /* next available FP register */ int nargs_prototype; /* # args left in the current prototype */ int orig_nargs; /* Original value of nargs_prototype */ int varargs_offset; /* offset of the varargs save area */ int prototype; /* Whether a prototype was defined */ int call_cookie; /* Do special things for this call */} CUMULATIVE_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,INDIRECT) \ init_cumulative_args (&CUM, FNTYPE, LIBNAME, FALSE)/* 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,LIBNAME) \ init_cumulative_args (&CUM, FNTYPE, LIBNAME, TRUE)/* 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) \ function_arg_advance (&CUM, MODE, TYPE, NAMED)/* 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 <= FP_ARG_MAX_REG \ && TARGET_HARD_FLOAT)/* 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 RS/6000 the first eight words of non-FP are normally in registers and the rest are pushed. The first 13 FP args are in registers. If this is floating-point and no prototype is specified, we use both an FP and integer register (or possibly FP reg and stack). Library functions (when TYPE is zero) always have the proper types for args, so we can pass the FP value just in one register. emit_library_function doesn't support EXPR_LIST anyway. */#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ function_arg (&CUM, MODE, TYPE, NAMED)/* 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. */#define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \ function_arg_partial_nregs (&CUM, MODE, TYPE, NAMED)/* A C expression that indicates when an argument must be passed by reference. If nonzero for an argument, a copy of that argument is made in memory and a pointer to the argument is passed instead of the argument itself. The pointer is passed in whatever way is appropriate for passing a pointer to that type. */#define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) \ function_arg_pass_by_reference(&CUM, MODE, TYPE, NAMED)/* If defined, a C expression which determines whether, and in which direction, to pad out an argument with extra space. The value should be of type `enum direction': either `upward' to pad above the argument, `downward' to pad below, or `none' to inhibit padding. */#define FUNCTION_ARG_PADDING(MODE, TYPE) \ function_arg_padding (MODE, TYPE)/* 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) \ function_arg_boundary (MODE, TYPE)/* Perform any needed actions needed for a function that is receiving a variable number of arguments. CUM is as above. MODE and TYPE are the mode and type of the current parameter. PRETEND_SIZE is a variable that should be set to the amount of stack that must be pushed by the prolog to pretend that our caller pushed it. Normally, this macro will push all remaining incoming registers on the stack and set PRETEND_SIZE to the length of the registers pushed. */#define SETUP_INCOMING_VARARGS(CUM,MODE,TYPE,PRETEND_SIZE,NO_RTL) \ setup_incoming_varargs (&CUM, MODE, TYPE, &PRETEND_SIZE, NO_RTL)/* If defined, is a C expression that produces the machine-specific code for a call to `__builtin_saveregs'. This code will be moved to the very beginning of the function, before any parameter access are made. The return value of this function should be an RTX that contains the value to use as the return of `__builtin_saveregs'. The argument ARGS is a `tree_list' containing the arguments that were passed to `__builtin_saveregs'. If this macro is not defined, the compiler will output an ordinary call to the library function `__builtin_saveregs'. */#define EXPAND_BUILTIN_SAVEREGS(ARGS) \ expand_builtin_saveregs (ARGS)/* 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. */#define FUNCTION_PROLOGUE(FILE, SIZE) output_prolog (FILE, SIZE)/* Output assembler code to FILE to increment profiler label # LABELNO for profiling a function entry. */#define FUNCTION_PROFILER(FILE, LABELNO) \ output_function_profiler ((FILE), (LABELNO));/* EXIT_IGNORE_STACK should be nonzero if, when returning from a function, the stack pointer does not matter. No definition is equivalent to always zero. On the RS/6000, this is non-zero because we can restore the stack from its backpointer, which we maintain. */#define EXIT_IGNORE_STACK 1/* This macro generates the assembly code for function exit, on machines that need it. If FUNCTION_EPILOGUE is not defined then individual return instructions are generated for each return statement. Args are same as for FUNCTION_PROLOGUE. The function epilogue should not depend on the current stack pointer! It should use the frame pointer only. This is mandatory because of alloca; we also take advantage of it to omit stack adjustments before returning. */#define FUNCTION_EPILOGUE(FILE, SIZE) output_epilog (FILE, SIZE)/* TRAMPOLINE_TEMPLATE deleted *//* Length in units of the trampoline for entering a nested function. */#define TRAMPOLINE_SIZE rs6000_trampoline_size ()/* 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(ADDR, FNADDR, CXT) \ rs6000_initialize_trampoline (ADDR, FNADDR, CXT)/* If defined, a C expression whose value is nonzero if IDENTIFIER with arguments ARGS is a valid machine specific attribute for DECL. The attributes in ATTRIBUTES have previously been assigned to DECL. */#define VALID_MACHINE_DECL_ATTRIBUTE(DECL, ATTRIBUTES, NAME, ARGS) \ (rs6000_valid_decl_attribute_p (DECL, ATTRIBUTES, NAME, ARGS))/* If defined, a C expression whose value is nonzero if IDENTIFIER with arguments ARGS is a valid machine specific attribute for TYPE. The attributes in ATTRIBUTES have previously been assigned to TYPE. */#define VALID_MACHINE_TYPE_ATTRIBUTE(TYPE, ATTRIBUTES, NAME, ARGS) \ (rs6000_valid_type_attribute_p (TYPE, ATTRIBUTES, NAME, ARGS))/* If defined, a C expression whose value is zero if the attributes on TYPE1 and TYPE2 are incompatible, one if they are compatible, and two if they are nearly compatible (which causes a warning to be generated). */#define COMP_TYPE_ATTRIBUTES(TYPE1, TYPE2) \ (rs6000_comp_type_attributes (TYPE1, TYPE2))/* If defined, a C statement that assigns default attributes to newly defined TYPE. */#define SET_DEFAULT_TYPE_ATTRIBUTES(TYPE) \ (rs6000_set_default_type_attributes (TYPE))/* Definitions for __builtin_return_address and __builtin_frame_address. __builtin_return_address (0) should give link register (65), enable this. *//* This should be uncommented, so that the link register is used, but currently this would result in unmatched insns and spilling fixed registers so we'll leave it for another day. When these problems are taken care of one additional fetch will be necessary in RETURN_ADDR_RTX. (mrs) *//* #define RETURN_ADDR_IN_PREVIOUS_FRAME *//* Number of bytes into the frame return addresses can be found. See rs6000_stack_info in rs6000.c for more information on how the different abi's store the return address. */#define RETURN_ADDRESS_OFFSET \ ((DEFAULT_ABI == ABI_AIX \ || DEFAULT_ABI == ABI_AIX_NODESC) ? 8 : \ (DEFAULT_ABI == ABI_V4 \ || DEFAULT_ABI == ABI_SOLARIS) ? (TARGET_32BIT ? 4 : 8) : \ (DEFAULT_ABI == ABI_NT) ? -4 : \ (fatal ("RETURN_ADDRESS_OFFSET not supported"), 0))/* The current return address is in link register (65). The return address of anything farther back is accessed normally at an offset of 8 from the frame pointer. */#define RETURN_ADDR_RTX(count, frame) \ ((count == -1) \ ? gen_rtx (REG, Pmode, 65) \ : gen_rtx (MEM, Pmode, \ memory_address (Pmode, \ plus_constant (copy_to_reg (gen_rtx (MEM, Pmode, \ memory_address (Pmode, frame))), \ RETURN_ADDRESS_OFFSET))))/* Definitions for register eliminations. We have two registers that can be eliminated on the RS/6000. First, the frame pointer register can often be eliminated in favor of the stack pointer register. Secondly, the argument pointer register can always be eliminated; it is replaced with either the stack or frame pointer. In addition, we use the elimination mechanism to see if r30 is needed Initially we assume that it isn't. If it is, we spill it. This is done by making it an eliminable register. We replace it with itself so that if it isn't needed, then existing uses won't be modified. *//* This is an array of structures. Each structure initializes one pair of eliminable registers. The "from" register number is given first, followed by "to". Eliminations of the same "from" register are listed in order of preference. */#define ELIMINABLE_REGS \{{ FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ { ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \ { 30, 30} }/* Given FROM and TO register numbers, say whether this elimination is allowed. Frame pointer elimination is automatically handled. For the RS/6000, if frame pointer elimination is being done, we would like to convert ap into fp, not sp. We need r30 if -mminimal-toc was specified, and there are constant pool references. */#define CAN_ELIMINATE(FROM, TO) \ ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM \ ? ! frame_pointer_needed \ : (FROM) == 30 ? ! TARGET_MINIMAL_TOC || TARGET_NO_TOC || get_pool_size () == 0 \ : 1)/* Define the offset between two registers, one to be eliminated, and the other its replacement, at the start of a routine. */#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \{ \ rs6000_stack_t *info = rs6000_stack_info (); \ \ if ((FROM) == FRAME_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM) \ (OFFSET) = (info->push_p) ? 0 : - info->total_size; \ else if ((FROM) == ARG_POINTER_REGNUM && (TO) == FRAME_POINTER_REGNUM) \ (OFFSET) = info->total_size; \ else if ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM) \ (OFFSET) = (info->push_p) ? info->total_size : 0; \ else if ((FROM) == 30) \ (OFFSET) = 0; \ else \ abort (); \}/* Addressing modes, and classification of registers for them. *//* #define HAVE_POST_INCREMENT *//* #define HAVE_POST_DECREMENT */#define HAVE_PRE_DECREMENT#define HAVE_PRE_INCREMENT/* Macros to check register numbers against specific register classes. *//* These assume that REGNO is a hard or pseudo reg number. They give nonzero only if REGNO is a hard reg of the suitable class or a pseudo reg currently allocated to a suitable hard reg. Since they use reg_renumber, they are safe only once reg_renumber has been allocated, which happens in local-alloc.c. */#define REGNO_OK_FOR_INDEX_P(REGNO) \((REGNO) < FIRST_PSEUDO_REGISTER \ ? (REGNO) <= 31 || (REGNO) == 67 \ : (reg_renumber[REGNO] >= 0 \ && (reg_renumber[REGNO] <= 31 || reg_renumber[REGNO] == 67)))#define REGNO_OK_FOR_BASE_P(REGNO) \((REGNO) < FIRST_PSEUDO_REGISTER \ ? ((REGNO) > 0 && (REGNO) <= 31) || (REGNO) == 67 \ : (reg_renumber[REGNO] > 0 \ && (reg_renumber[REGNO] <= 31 || reg_renumber[REGNO] == 67)))/* Maximum number of registers that can appear in a valid memory address. */#define MAX_REGS_PER_ADDRESS 2/* Recognize any constant value that is a valid address. */#define CONSTANT_ADDRESS_P(X) \ (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \ || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST \
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -