📄 rs6000.h
字号:
: (REGNO) == SPE_ACC_REGNO ? SPE_ACC_REGS \ : (REGNO) == SPEFSCR_REGNO ? SPEFSCR_REGS \ : (REGNO) == FRAME_POINTER_REGNUM ? 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' ? ((TARGET_HARD_FLOAT && TARGET_FPRS) ? FLOAT_REGS : NO_REGS) \ : (C) == 'b' ? BASE_REGS \ : (C) == 'h' ? SPECIAL_REGS \ : (C) == 'q' ? MQ_REGS \ : (C) == 'c' ? CTR_REGS \ : (C) == 'l' ? LINK_REGS \ : (C) == 'v' ? ALTIVEC_REGS \ : (C) == 'x' ? CR0_REGS \ : (C) == 'y' ? CR_REGS \ : (C) == 'z' ? XER_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 a signed 16-bit constant `J' is a constant with only the high-order 16 bits nonzero `K' is a constant with only the low-order 16 bits nonzero `L' is a signed 16-bit constant shifted left 16 bits `M' is a constant that is greater than 31 `N' is a positive 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) & (~ (unsigned HOST_WIDE_INT) 0xffff0000)) == 0 \ : (C) == 'K' ? ((VALUE) & (~ (HOST_WIDE_INT) 0xffff)) == 0 \ : (C) == 'L' ? (((VALUE) & 0xffff) == 0 \ && ((VALUE) >> 31 == -1 || (VALUE) >> 31 == 0)) \ : (C) == 'M' ? (VALUE) > 31 \ : (C) == 'N' ? (VALUE) > 0 && exact_log2 (VALUE) >= 0 \ : (C) == 'O' ? (VALUE) == 0 \ : (C) == 'P' ? (unsigned HOST_WIDE_INT) ((- (VALUE)) + 0x8000) < 0x10000 \ : 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 a constant that can be placed into a 64-bit mask operand. 'T' is a constant that can be placed into a 32-bit mask operand. 'U' is for V.4 small data references. 'W' is a vector constant that can be easily generated (no mem refs). 'Y' is an indexed or word-aligned displacement memory operand. 'Z' is an indexed or indirect memory operand. 'a' is an indexed or indirect address operand. 't' is for AND masks that can be performed by two rldic{l,r} insns (but excluding those that could match other constraints of anddi3.) */#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' ? mask64_operand (OP, DImode) \ : (C) == 'T' ? mask_operand (OP, GET_MODE (OP)) \ : (C) == 'U' ? (DEFAULT_ABI == ABI_V4 \ && small_data_operand (OP, GET_MODE (OP))) \ : (C) == 't' ? (mask64_2_operand (OP, DImode) \ && (fixed_regs[CR0_REGNO] \ || !logical_operand (OP, DImode)) \ && !mask_operand (OP, DImode) \ && !mask64_operand (OP, DImode)) \ : (C) == 'W' ? (easy_vector_constant (OP, GET_MODE (OP))) \ : (C) == 'Y' ? (word_offset_memref_operand (OP, GET_MODE (OP))) \ : (C) == 'Z' ? (indexed_or_indirect_operand (OP, GET_MODE (OP))) \ : (C) == 'a' ? (indexed_or_indirect_address (OP, GET_MODE (OP))) \ : 0)/* Define which constraints are memory constraints. Tell reload that any memory address can be reloaded by copying the memory address into a base register if required. */#define EXTRA_MEMORY_CONSTRAINT(C, STR) \ ((C) == 'Q' || (C) == 'Y' || (C) == 'Z')/* Define which constraints should be treated like address constraints by the reload pass. */#define EXTRA_ADDRESS_CONSTRAINT(C, STR) \ ((C) == 'a')/* 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. We also don't want to reload integer values into floating-point registers if we can at all help it. In fact, this can cause reload to die, if it tries to generate a reload of CTR into a FP register and discovers it doesn't have the memory location required. ??? Would it be a good idea to have reload do the converse, that is try to reload floating modes into FP registers if possible? */#define PREFERRED_RELOAD_CLASS(X,CLASS) \ ((CONSTANT_P (X) \ && reg_classes_intersect_p ((CLASS), FLOAT_REGS)) \ ? NO_REGS \ : (GET_MODE_CLASS (GET_MODE (X)) == MODE_INT \ && (CLASS) == NON_SPECIAL_REGS) \ ? GENERAL_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 or AltiVec registers and anything else, we need a memory location. */#define SECONDARY_MEMORY_NEEDED(CLASS1,CLASS2,MODE) \ ((CLASS1) != (CLASS2) && ((CLASS1) == FLOAT_REGS \ || (CLASS2) == FLOAT_REGS \ || (CLASS1) == ALTIVEC_REGS \ || (CLASS2) == ALTIVEC_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) \ ? ((GET_MODE_SIZE (MODE) + UNITS_PER_FP_WORD - 1) / UNITS_PER_FP_WORD) \ : (TARGET_E500_DOUBLE && (CLASS) == GENERAL_REGS && (MODE) == DFmode) \ ? 1 \ : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))/* Return a class of registers that cannot change FROM mode to TO mode. */#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \ (!TARGET_IEEEQUAD \ && GET_MODE_SIZE (FROM) >= 8 && GET_MODE_SIZE (TO) >= 8 \ ? 0 \ : GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO) \ ? reg_classes_intersect_p (FLOAT_REGS, CLASS) \ : (TARGET_E500_DOUBLE && (((TO) == DFmode) + ((FROM) == DFmode)) == 1) \ ? reg_classes_intersect_p (GENERAL_REGS, CLASS) \ : (TARGET_E500_DOUBLE && (((TO) == DImode) + ((FROM) == DImode)) == 1) \ ? reg_classes_intersect_p (GENERAL_REGS, CLASS) \ : (TARGET_SPE && (SPE_VECTOR_MODE (FROM) + SPE_VECTOR_MODE (TO)) == 1) \ ? reg_classes_intersect_p (GENERAL_REGS, CLASS) \ : 0)/* 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_V4, /* System V.4/eabi */ ABI_DARWIN /* Apple's Darwin (OS X kernel) */};extern enum rs6000_abi rs6000_current_abi; /* available for use by subtarget *//* Define this if pushing a word on the stack makes the stack pointer a smaller address. */#define STACK_GROWS_DOWNWARD/* Offsets recorded in opcodes are a multiple of this alignment factor. */#define DWARF_CIE_DATA_ALIGNMENT (-((int) (TARGET_32BIT ? 4 : 8)))/* Define this to nonzero 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 (flag_stack_protect != 0)/* Size of the outgoing register save area */#define RS6000_REG_SAVE ((DEFAULT_ABI == ABI_AIX \ || DEFAULT_ABI == ABI_DARWIN) \ ? (TARGET_64BIT ? 64 : 32) \ : 0)/* Size of the fixed area on the stack */#define RS6000_SAVE_AREA \ (((DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) ? 24 : 8) \ << (TARGET_64BIT ? 1 : 0))/* MEM representing address to save the TOC register */#define RS6000_SAVE_TOC gen_rtx_MEM (Pmode, \ plus_constant (stack_pointer_rtx, \ (TARGET_32BIT ? 20 : 40)))/* Align an address */#define RS6000_ALIGN(n,a) (((n) + (a) - 1) & ~((a) - 1))/* 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 \ (FRAME_GROWS_DOWNWARD \ ? 0 \ : (RS6000_ALIGN (current_function_outgoing_args_size, \ TARGET_ALTIVEC ? 16 : 8) \ + 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, \ TARGET_ALTIVEC ? 16 : 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/* Offset from the argument pointer register value to the top of stack. This is different from FIRST_PARM_OFFSET because of the register save area. */#define ARG_POINTER_CFA_OFFSET(FNDECL) 0/* 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 1/* 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. */#define FUNCTION_VALUE(VALTYPE, FUNC) rs6000_function_value ((VALTYPE), (FUNC))/* Define how to find the value returned by a library function assuming the value has mode MODE. */#define LIBCALL_VALUE(MODE) rs6000_libcall_value ((MODE))/* DRAFT_V4_STRUCT_RET defaults off. */#define DRAFT_V4_STRUCT_RET 0/* Let TARGET_RETURN_IN_MEMORY control what happens. */#define DEFAULT_PCC_STRUCT_RETURN 0/* Mode of stack savearea. FUNCTION is VOIDmode because calling convention maintains SP. BLOCK needs Pmode for SP. NONLOCAL needs twice Pmode to maintain both backchain and SP. */#define STACK_SAVEAREA_MODE(LEVEL) \ (LEVEL == SAVE_FUNCTION ? VOIDmode \ : LEVEL == SAVE_NONLOCAL ? (TARGET_32BIT ? DImode : TImode) : Pmode)/* 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 ((DEFAULT_ABI == ABI_AIX \ || DEFAULT_ABI == ABI_DARWIN) \ ? FP_ARG_AIX_MAX_REG : FP_ARG_V4_MAX_REG)#define FP_ARG_NUM_REG (FP_ARG_MAX_REG - FP_ARG_MIN_REG + 1)/* Minimum and maximum AltiVec registers used to hold arguments. */#define ALTIVEC_ARG_MIN_REG (FIRST_ALTIVEC_REGNO + 2)#define ALTIVEC_ARG_MAX_REG (ALTIVEC_ARG_MIN_REG + 11)#define ALTIVEC_ARG_NUM_REG (ALTIVEC_ARG_MAX_REG - ALTIVEC_ARG_MIN_REG + 1)/* Return registers */#define GP_ARG_RETURN GP_ARG_MIN_REG#define FP_ARG_RETURN FP_ARG_MIN_REG#define ALTIVEC_ARG_RETURN (FIRST_ALTIVEC_REGNO + 2)/* Flags for the call/call_value rtl operations set up by function_arg */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -