📄 arc.h
字号:
/* If defined, an initializer for a vector of integers, containing the numbers of hard registers in the order in which GNU CC should prefer to use them (from most preferred to least). */#define REG_ALLOC_ORDER \{ 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, \ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 31, \ 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, \ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, \ 27, 28, 29, 30 }/* Macro to conditionally modify fixed_regs/call_used_regs. */#define CONDITIONAL_REGISTER_USAGE \do { \ if (PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM) \ { \ fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \ call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \ } \} while (0)/* Return number of consecutive hard regs needed starting at reg REGNO to hold something of mode MODE. This is ordinarily the length in words of a value of mode MODE but can be less for certain modes in special long registers. */#define HARD_REGNO_NREGS(REGNO, MODE) \((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)/* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. */extern const unsigned int arc_hard_regno_mode_ok[];extern unsigned int arc_mode_class[];#define HARD_REGNO_MODE_OK(REGNO, MODE) \((arc_hard_regno_mode_ok[REGNO] & arc_mode_class[MODE]) != 0)/* A C expression that is nonzero if it is desirable to choose register allocation so as to avoid move instructions between a value of mode MODE1 and a value of mode MODE2. If `HARD_REGNO_MODE_OK (R, MODE1)' and `HARD_REGNO_MODE_OK (R, MODE2)' are ever different for any R, then `MODES_TIEABLE_P (MODE1, MODE2)' must be zero. *//* Tie QI/HI/SI modes together. */#define MODES_TIEABLE_P(MODE1, MODE2) \(GET_MODE_CLASS (MODE1) == MODE_INT \ && GET_MODE_CLASS (MODE2) == MODE_INT \ && GET_MODE_SIZE (MODE1) <= UNITS_PER_WORD \ && GET_MODE_SIZE (MODE2) <= UNITS_PER_WORD)/* Register classes and constants. *//* 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. It is important that any condition codes have class NO_REGS. See `register_operand'. */enum reg_class { NO_REGS, LPCOUNT_REG, GENERAL_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", "LPCOUNT_REG", "GENERAL_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, 0x10000000}, {0xffffffff, 0xfffffff}, \ {0xffffffff, 0x1fffffff} }/* 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. */extern enum reg_class arc_regno_reg_class[FIRST_PSEUDO_REGISTER];#define REGNO_REG_CLASS(REGNO) \(arc_regno_reg_class[REGNO])/* The class value for index registers, and the one for base regs. */#define INDEX_REG_CLASS GENERAL_REGS#define BASE_REG_CLASS GENERAL_REGS/* Get reg_class from a letter such as appears in the machine description. */#define REG_CLASS_FROM_LETTER(C) \((C) == 'l' ? LPCOUNT_REG /* ??? needed? */ \ : NO_REGS)/* 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_BASE_P(REGNO) \((REGNO) < 29 || (unsigned) reg_renumber[REGNO] < 29)#define REGNO_OK_FOR_INDEX_P(REGNO) \((REGNO) < 29 || (unsigned) reg_renumber[REGNO] < 29)/* 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. */#define PREFERRED_RELOAD_CLASS(X,CLASS) \(CLASS)/* Return the maximum number of consecutive registers needed to represent mode MODE in a register of class CLASS. */#define CLASS_MAX_NREGS(CLASS, MODE) \((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)/* The letters I, J, K, L, M, N, O, 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 used for short immediates (always signed). 'J' is used for long immediates. 'K' is used for any constant up to 64 bits (for 64x32 situations?). *//* local to this file */#define SMALL_INT(X) ((unsigned) ((X) + 0x100) < 0x200)/* local to this file */#define LARGE_INT(X) \((X) >= (-(HOST_WIDE_INT) 0x7fffffff - 1) \ && (X) <= (unsigned HOST_WIDE_INT) 0xffffffff)#define CONST_OK_FOR_LETTER_P(VALUE, C) \((C) == 'I' ? SMALL_INT (VALUE) \ : (C) == 'J' ? LARGE_INT (VALUE) \ : (C) == 'K' ? 1 \ : 0)/* Similar, but for floating constants, and defining letters G and H. Here VALUE is the CONST_DOUBLE rtx itself. *//* 'G' is used for integer values for the multiplication insns where the operands are extended from 4 bytes to 8 bytes. 'H' is used when any 64 bit constant is allowed. */#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \((C) == 'G' ? arc_double_limm_p (VALUE) \ : (C) == 'H' ? 1 \ : 0)/* A C expression that defines the optional machine-dependent constraint letters that can be used to segregate specific types of operands, usually memory references, for the target machine. It should return 1 if VALUE corresponds to the operand type represented by the constraint letter C. If C is not defined as an extra constraint, the value returned should be 0 regardless of VALUE. *//* ??? This currently isn't used. Waiting for PIC. */#if 0#define EXTRA_CONSTRAINT(VALUE, C) \((C) == 'R' ? (SYMBOL_REF_FLAG (VALUE) || GET_CODE (VALUE) == LABEL_REF) \ : 0)#endif/* Stack layout and stack pointer usage. *//* Define this macro if pushing a word onto the stack moves the stack pointer to 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. */#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. */#define STARTING_FRAME_OFFSET 0/* Offset from the stack pointer register to the first location at which outgoing arguments are placed. */#define STACK_POINTER_OFFSET FIRST_PARM_OFFSET (0)/* Offset of first parameter from the argument pointer register value. *//* 4 bytes for each of previous fp, return address, and previous gp. 4 byte reserved area for future considerations. */#define FIRST_PARM_OFFSET(FNDECL) 16/* A C expression whose value is RTL representing the address in a stack frame where the pointer to the caller's frame is stored. Assume that FRAMEADDR is an RTL expression for the address of the stack frame itself. If you don't define this macro, the default is to return the value of FRAMEADDR--that is, the stack frame address is also the address of the stack word that points to the previous frame. *//* ??? unfinished *//*define DYNAMIC_CHAIN_ADDRESS (FRAMEADDR)*//* A C expression whose value is RTL representing the value of the return address for the frame COUNT steps up from the current frame. FRAMEADDR is the frame pointer of the COUNT frame, or the frame pointer of the COUNT - 1 frame if `RETURN_ADDR_IN_PREVIOUS_FRAME' is defined. *//* The current return address is in r31. The return address of anything farther back is at [%fp,4]. */#if 0 /* The default value should work. */#define RETURN_ADDR_RTX(COUNT, FRAME) \(((COUNT) == -1) \ ? gen_rtx_REG (Pmode, 31) \ : copy_to_reg (gen_rtx_MEM (Pmode, \ memory_address (Pmode, \ plus_constant ((FRAME), \ UNITS_PER_WORD)))))#endif/* Register to use for pushing function arguments. */#define STACK_POINTER_REGNUM 28/* Base register for access to local variables of the function. */#define FRAME_POINTER_REGNUM 27/* Base register for access to arguments of the function. */#define ARG_POINTER_REGNUM FRAME_POINTER_REGNUM/* Register in which static-chain is passed to a function. This must not be a register used by the prologue. */#define STATIC_CHAIN_REGNUM 24/* A C expression which is nonzero if a function must have and use a frame pointer. This expression is evaluated in the reload pass. If its value is nonzero the function will have a frame pointer. */#define FRAME_POINTER_REQUIRED \(current_function_calls_alloca)/* C statement to store the difference between the frame pointer and the stack pointer values immediately after the function prologue. */#define INITIAL_FRAME_POINTER_OFFSET(VAR) \((VAR) = arc_compute_frame_size (get_frame_size ()))/* Function argument passing. *//* When a prototype says `char' or `short', really pass an `int'. */#define PROMOTE_PROTOTYPES 1/* If defined, the maximum amount of space required for outgoing arguments will be computed and placed into the variable `current_function_outgoing_args_size'. No space will be pushed onto the stack for each call; instead, the function prologue should increase the stack frame size by this amount. */#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(DECL, FUNTYPE, SIZE) 0/* 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. */#define CUMULATIVE_ARGS int/* 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) \((CUM) = 0)/* The number of registers used for parameter passing. Local to this file. */#define MAX_ARC_PARM_REGS 8/* 1 if N is a possible register number for function argument passing. */#define FUNCTION_ARG_REGNO_P(N) \((unsigned) (N) < MAX_ARC_PARM_REGS)/* The ROUND_ADVANCE* macros are local to this file. *//* Round SIZE up to a word boundary. */#define ROUND_ADVANCE(SIZE) \(((SIZE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)/* Round arg MODE/TYPE up to the next word boundary. */#define ROUND_ADVANCE_ARG(MODE, TYPE) \((MODE) == BLKmode \ ? ROUND_ADVANCE (int_size_in_bytes (TYPE)) \ : ROUND_ADVANCE (GET_MODE_SIZE (MODE)))/* Round CUM up to the necessary point for argument MODE/TYPE. */#define ROUND_ADVANCE_CUM(CUM, MODE, TYPE) \((((MODE) == BLKmode ? TYPE_ALIGN (TYPE) : GET_MODE_BITSIZE (MODE)) \ > BITS_PER_WORD) \ ? (((CUM) + 1) & ~1) \ : (CUM))/* Return boolean indicating arg of type TYPE and mode MODE will be passed in a reg. This includes arguments that have to be passed by reference as the pointer to them is passed in a reg if one is available (and that is what we're given). This macro is only used in this file. */#define PASS_IN_REG_P(CUM, MODE, TYPE) \((CUM) < MAX_ARC_PARM_REGS \ && ((ROUND_ADVANCE_CUM ((CUM), (MODE), (TYPE)) \ + ROUND_ADVANCE_ARG ((MODE), (TYPE)) \ <= MAX_ARC_PARM_REGS)))/* 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 the ARC the first MAX_ARC_PARM_REGS args are normally in registers and the rest are pushed. */#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \(PASS_IN_REG_P ((CUM), (MODE), (TYPE)) \ ? gen_rtx_REG ((MODE), ROUND_ADVANCE_CUM ((CUM), (MODE), (TYPE))) \ : 0)/* A C expression for the number of words, at the beginning of an argument, must be put in registers. The value must be zero for arguments that are passed entirely in registers or that are entirely pushed on the stack. On some machines, certain arguments must be passed partially in registers and partially in memory. On these machines, typically the first @var{n} words of arguments are passed in registers, and the rest on the stack. If a multi-word argument (a @code{double} or a
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -