📄 h8300.h
字号:
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. We pretend the MAC register is 32bits -- we don't have any data types on the H8 series to handle more than 32bits. */#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. H8/300: If an even reg, then anything goes. Otherwise the mode must be QI or HI. H8/300H: Anything goes. */#define HARD_REGNO_MODE_OK(REGNO, MODE) \ (TARGET_H8300 \ ? ((((REGNO) & 1) == 0) || ((MODE) == HImode) || ((MODE) == QImode)) \ : (REGNO) == MAC_REG ? (MODE) == SImode : 1)/* Value is 1 if it is a good idea to tie two pseudo registers when one has mode MODE1 and one has mode MODE2. If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2, for any hard reg, then this must be 0 for correct output. */#define MODES_TIEABLE_P(MODE1, MODE2) \ ((MODE1) == (MODE2) \ || (((MODE1) == QImode || (MODE1) == HImode \ || ((TARGET_H8300H || TARGET_H8300S) && (MODE1) == SImode)) \ && ((MODE2) == QImode || (MODE2) == HImode \ || ((TARGET_H8300H || TARGET_H8300S) && (MODE2) == SImode))))/* Specify the registers used for certain standard purposes. The values of these macros are register numbers. *//* H8/300 pc is not overloaded on a register. *//*#define PC_REGNUM 15*//* Register to use for pushing function arguments. */#define STACK_POINTER_REGNUM SP_REG/* Base register for access to local variables of the function. */#define FRAME_POINTER_REGNUM FP_REG/* Value should be nonzero if functions must have frame pointers. Zero means the frame pointer need not be set up (and parms may be accessed via the stack pointer) in functions that seem suitable. This is computed in `reload', in reload1.c. */#define FRAME_POINTER_REQUIRED 0/* Base register for access to arguments of the function. */#define ARG_POINTER_REGNUM AP_REG/* Register in which static-chain is passed to a function. */#define STATIC_CHAIN_REGNUM SC_REG/* Fake register that holds the address on the stack of the current function's return address. */#define RETURN_ADDRESS_POINTER_REGNUM RAP_REG/* 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 already the frame pointer of the COUNT frame, assuming a stack layout with the frame pointer as the first saved register. */#define RETURN_ADDR_RTX(COUNT, FRAME) h8300_return_addr_rtx ((COUNT), (FRAME))/* 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. */enum reg_class { NO_REGS, GENERAL_REGS, MAC_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", "GENERAL_REGS", "MAC_REGS", "ALL_REGS", "LIM_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}, /* No regs */ \ {0x6ff}, /* GENERAL_REGS */ \ {0x100}, /* MAC_REGS */ \ {0x7ff}, /* ALL_REGS */ \}/* 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. */#define REGNO_REG_CLASS(REGNO) (REGNO != MAC_REG ? GENERAL_REGS : MAC_REGS)/* The class value for index registers, and the one for base regs. */#define INDEX_REG_CLASS NO_REGS#define BASE_REG_CLASS GENERAL_REGS/* Get reg_class from a letter such as appears in the machine description. 'a' is the MAC register. */#define REG_CLASS_FROM_LETTER(C) ((C) == 'a' ? MAC_REGS : NO_REGS)/* 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. */#define CONST_OK_FOR_I(VALUE) ((VALUE) == 0)#define CONST_OK_FOR_J(VALUE) (((VALUE) & 0xff) == 0)#define CONST_OK_FOR_L(VALUE) \ (TARGET_H8300H || TARGET_H8300S \ ? (VALUE) == 1 || (VALUE) == 2 || (VALUE) == 4 \ : (VALUE) == 1 || (VALUE) == 2)#define CONST_OK_FOR_N(VALUE) \ (TARGET_H8300H || TARGET_H8300S \ ? (VALUE) == -1 || (VALUE) == -2 || (VALUE) == -4 \ : (VALUE) == -1 || (VALUE) == -2)#define CONST_OK_FOR_LETTER_P(VALUE, C) \ ((C) == 'I' ? CONST_OK_FOR_I (VALUE) : \ (C) == 'J' ? CONST_OK_FOR_J (VALUE) : \ (C) == 'L' ? CONST_OK_FOR_L (VALUE) : \ (C) == 'N' ? CONST_OK_FOR_N (VALUE) : \ 0)/* Similar, but for floating constants, and defining letters G and H. Here VALUE is the CONST_DOUBLE rtx itself. `G' is a floating-point zero. */#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \ ((C) == 'G' ? (VALUE) == CONST0_RTX (DFmode) \ : 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. */#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. *//* On the H8, this is the size of MODE in words. */#define CLASS_MAX_NREGS(CLASS, MODE) \ ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)/* Any SI register-to-register move may need to be reloaded, so define REGISTER_MOVE_COST to be > 2 so that reload never shortcuts. */#define REGISTER_MOVE_COST(MODE, CLASS1, CLASS2) \ (CLASS1 == MAC_REGS || CLASS2 == MAC_REGS ? 6 : 3)/* Stack layout; function entry, exit and calling. *//* 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. */#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/* If we generate an insn to push BYTES bytes, this says how many the stack pointer really advances by. On the H8/300, @-sp really pushes a byte if you ask it to - but that's dangerous, so we claim that it always pushes a word, then we catch the mov.b rx,@-sp and turn it into a mov.w rx,@-sp on output. On the H8/300H, we simplify TARGET_QUICKCALL by setting this to 4 and doing a similar thing. */#define PUSH_ROUNDING(BYTES) \ (((BYTES) + PARM_BOUNDARY / 8 - 1) & -PARM_BOUNDARY / 8)/* Offset of first parameter from the argument pointer register value. *//* Is equal to the size of the saved fp + pc, even if an fp isn't saved since the value is used before we know. */#define FIRST_PARM_OFFSET(FNDECL) 0/* 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. On the H8 the return does not pop anything. */#define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, SIZE) 0/* Definitions for register eliminations. 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. We have two registers that can be eliminated on the h8300. 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. */#define ELIMINABLE_REGS \{{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \ { RETURN_ADDRESS_POINTER_REGNUM, STACK_POINTER_REGNUM},\ { RETURN_ADDRESS_POINTER_REGNUM, FRAME_POINTER_REGNUM},\ { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}}/* Given FROM and TO register numbers, say whether this elimination is allowed. Frame pointer elimination is automatically handled. For the h8300, if frame pointer elimination is being done, we would like to convert ap and rp into sp, not fp. All other eliminations are valid. */#define CAN_ELIMINATE(FROM, TO) \ ((TO) == STACK_POINTER_REGNUM ? ! frame_pointer_needed : 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) = h8300_initial_elimination_offset ((FROM), (TO)))/* 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 the H8 the return value is in R0/R1. */#define FUNCTION_VALUE(VALTYPE, FUNC) \ gen_rtx_REG (TYPE_MODE (VALTYPE), 0)/* Define how to find the value returned by a library function assuming the value has mode MODE. *//* On the H8 the return value is in R0/R1. */#define LIBCALL_VALUE(MODE) \ gen_rtx_REG (MODE, 0)/* 1 if N is a possible register number for a function value. On the H8, R0 is the only register thus used. */#define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)/* Define this if PCC uses the nonreentrant convention for returning structure and union values. *//*#define PCC_STATIC_STRUCT_RETURN*//* 1 if N is a possible register number for function argument passing. On the H8, no registers are used in this way. */#define FUNCTION_ARG_REGNO_P(N) (TARGET_QUICKCALL ? N < 3 : 0)/* Register in which address to store a structure value is passed to a function. */#define STRUCT_VALUE 0/* Return true if X should be returned in memory. */#define RETURN_IN_MEMORY(X) \ (TYPE_MODE (X) == BLKmode || GET_MODE_SIZE (TYPE_MODE (X)) > 4)/* When defined, the compiler allows registers explicitly used in the rtl to be used as spill registers but prevents the compiler from extending the lifetime of these registers. */#define SMALL_REGISTER_CLASSES 1/* 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 H8/300, this is a two item struct, the first is the number of bytes scanned so far and the second is the rtx of the called
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -