📄 rs6000.h
字号:
#define CALL_NORMAL 0x00000000 /* no special processing *//* Bits in 0x00000001 are unused. */#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 CALL_LIBCALL 0x00000010 /* libcall *//* We don't have prologue and epilogue functions to save/restore everything for most ABIs. */#define WORLD_SAVE_P(INFO) 0/* 1 if N is a possible register number for a function value as seen by the caller. On RS/6000, this is r3, fp1, and v2 (for AltiVec). */#define FUNCTION_VALUE_REGNO_P(N) \ ((N) == GP_ARG_RETURN \ || ((N) == FP_ARG_RETURN && TARGET_HARD_FLOAT && TARGET_FPRS) \ || ((N) == ALTIVEC_ARG_RETURN && TARGET_ALTIVEC && TARGET_ALTIVEC_ABI))/* 1 if N is a possible register number for function argument passing. On RS/6000, these are r3-r10 and fp1-fp13. On AltiVec, v2 - v13 are used for passing vectors. */#define FUNCTION_ARG_REGNO_P(N) \ ((unsigned) (N) - GP_ARG_MIN_REG < GP_ARG_NUM_REG \ || ((unsigned) (N) - ALTIVEC_ARG_MIN_REG < ALTIVEC_ARG_NUM_REG \ && TARGET_ALTIVEC && TARGET_ALTIVEC_ABI) \ || ((unsigned) (N) - FP_ARG_MIN_REG < FP_ARG_NUM_REG \ && TARGET_HARD_FLOAT && TARGET_FPRS))/* 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. For ABI_V4, we treat these slightly differently -- `sysv_gregno' is the next available GP register, `fregno' is the next available FP register, and `words' is the number of words used on the stack. The varargs/stdarg support requires that this structure's size be a multiple of sizeof(int). */typedef struct rs6000_args{ int words; /* # words used for passing GP registers */ int fregno; /* next available FP register */ int vregno; /* next available AltiVec register */ int nargs_prototype; /* # args left in the current prototype */ int prototype; /* Whether a prototype was defined */ int stdarg; /* Whether function is a stdarg function. */ int call_cookie; /* Do special things for this call */ int sysv_gregno; /* next available GP register */ int intoffset; /* running offset in struct (darwin64) */ int use_stack; /* any part of struct on stack (darwin64) */ int named; /* false for varargs params */} CUMULATIVE_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, N_NAMED_ARGS) \ init_cumulative_args (&CUM, FNTYPE, LIBNAME, FALSE, FALSE, N_NAMED_ARGS)/* 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, FALSE, 1000)/* Like INIT_CUMULATIVE_ARGS' but only used for outgoing libcalls. */#define INIT_CUMULATIVE_LIBCALL_ARGS(CUM, MODE, LIBNAME) \ init_cumulative_args (&CUM, NULL_TREE, LIBNAME, FALSE, TRUE, 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) \ function_arg_advance (&CUM, MODE, TYPE, NAMED, 0)/* 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)/* 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)/* Implement `va_start' for varargs and stdarg. */#define EXPAND_BUILTIN_VA_START(valist, nextarg) \ rs6000_va_start (valist, nextarg)#define PAD_VARARGS_DOWN \ (FUNCTION_ARG_PADDING (TYPE_MODE (type), type) == downward)/* 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 nonzero because we can restore the stack from its backpointer, which we maintain. */#define EXIT_IGNORE_STACK 1/* Define this macro as a C expression that is nonzero for registers that are used by the epilogue or the return' pattern. The stack and frame pointer registers are already be assumed to be used as needed. */#define EPILOGUE_USES(REGNO) \ ((reload_completed && (REGNO) == LINK_REGISTER_REGNUM) \ || (TARGET_ALTIVEC && (REGNO) == VRSAVE_REGNO) \ || (current_function_calls_eh_return \ && TARGET_AIX \ && (REGNO) == 2))/* 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)/* 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_DARWIN) ? (TARGET_32BIT ? 8 : 16) : \ (DEFAULT_ABI == ABI_V4) ? 4 : \ (internal_error ("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) \ (rs6000_return_addr (COUNT, FRAME))/* 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 \{{ HARD_FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ { FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \ { ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ { ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \ { RS6000_PIC_OFFSET_TABLE_REGNUM, RS6000_PIC_OFFSET_TABLE_REGNUM } }/* 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) == RS6000_PIC_OFFSET_TABLE_REGNUM \ ? ! 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) \ ((OFFSET) = rs6000_initial_elimination_offset(FROM, TO))/* Addressing modes, and classification of registers for them. */#define HAVE_PRE_DECREMENT 1#define HAVE_PRE_INCREMENT 1/* 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 \ || (REGNO) == FRAME_POINTER_REGNUM \ : (reg_renumber[REGNO] >= 0 \ && (reg_renumber[REGNO] <= 31 || reg_renumber[REGNO] == 67 \ || reg_renumber[REGNO] == FRAME_POINTER_REGNUM)))#define REGNO_OK_FOR_BASE_P(REGNO) \((REGNO) < FIRST_PSEUDO_REGISTER \ ? ((REGNO) > 0 && (REGNO) <= 31) || (REGNO) == 67 \ || (REGNO) == FRAME_POINTER_REGNUM \ : (reg_renumber[REGNO] > 0 \ && (reg_renumber[REGNO] <= 31 || reg_renumber[REGNO] == 67 \ || reg_renumber[REGNO] == FRAME_POINTER_REGNUM)))/* 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 \ || GET_CODE (X) == HIGH)/* Nonzero if the constant value X is a legitimate general operand. It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. On the RS/6000, all integer constants are acceptable, most won't be valid for particular insns, though. Only easy FP constants are acceptable. */#define LEGITIMATE_CONSTANT_P(X) \ (((GET_CODE (X) != CONST_DOUBLE \ && GET_CODE (X) != CONST_VECTOR) \ || GET_MODE (X) == VOIDmode \ || (TARGET_POWERPC64 && GET_MODE (X) == DImode) \ || easy_fp_constant (X, GET_MODE (X)) \ || easy_vector_constant (X, GET_MODE (X))) \ && !rs6000_tls_referenced_p (X))#define EASY_VECTOR_15(n) ((n) >= -16 && (n) <= 15)#define EASY_VECTOR_15_ADD_SELF(n) (!EASY_VECTOR_15((n)) \ && EASY_VECTOR_15((n) >> 1))/* The macros REG_OK_FOR..._P assume that the arg is a REG rtx and check its validity for a certain class. We have two alternate definitions for each of them. The usual definition accepts all pseudo regs; the other rejects them unless they have been allocated suitable hard regs. The symbol REG_OK_STRICT causes the latter definition to be used. Most source files want to accept pseudo regs in the hope that they will get allocated to the class that the insn wants them to be in. Source files for reload pass need to be strict. After reload, it makes no difference, since pseudo regs have been eliminated by then. */#ifdef REG_OK_STRICT# define REG_OK_STRICT_FLAG 1#else# define REG_OK_STRICT_FLAG 0#endif/* Nonzero if X is a hard reg that can be used as an index or if it is a pseudo reg in the non-strict case. */#define INT_REG_OK_FOR_INDEX_P(X, STRICT) \ ((!(STRICT) && REGNO (X) >= FIRST_PSEUDO_REGISTER) \ || REGNO_OK_FOR_INDEX_P (REGNO (X)))/* Nonzero if X is a hard reg that can be used as a base reg or if it is a pseudo reg in the non-strict case. */#define INT_REG_OK_FOR_BASE_P(X, STRICT) \ ((!(STRICT) && REGNO (X) >= FIRST_PSEUDO_REGISTER) \ || REGNO_OK_FOR_BASE_P (REGNO (X)))#define REG_OK_FOR_INDEX_P(X) INT_REG_OK_FOR_INDEX_P (X, REG_OK_STRICT_FLAG)#define REG_OK_FOR_BASE_P(X) INT_REG_OK_FOR_BASE_P (X, REG_OK_STRICT_FLAG)/* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression that is a valid memory address for an instruction. The MODE argument is the machine mode for the MEM expression that wants to use this address. On the RS/6000, there are four valid address: a SYMBOL_REF that refers to a constant pool entry of an address (or the sum of it plus a constant), a short (16-bit signed) constant plus a register, the sum of two registers, or a register indirect, possibly with an auto-increment. For DFmode and DImode with a constant p
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -