📄 mt.h
字号:
NO_REGS, ALL_REGS, LIM_REG_CLASSES};#define GENERAL_REGS ALL_REGS#define N_REG_CLASSES ((int) LIM_REG_CLASSES)#define REG_CLASS_NAMES {"NO_REGS", "ALL_REGS" }#define REG_CLASS_CONTENTS \ { \ { 0x0, 0x0 }, \ { (((1 << (GPR_LAST + 1)) - 1) & ~(1 << GPR_FIRST)), 0x0 }, \ }/* A C expression whose value is a register class containing hard register REGNO. In general there is more than one such class; choose a class which is "minimal", meaning that no smaller class also contains the register. */#define REGNO_REG_CLASS(REGNO) GENERAL_REGS#define BASE_REG_CLASS GENERAL_REGS#define INDEX_REG_CLASS NO_REGS#define REG_CLASS_FROM_LETTER(CHAR) NO_REGS#define REGNO_OK_FOR_BASE_P(NUM) 1#define REGNO_OK_FOR_INDEX_P(NUM) 1/* A C expression that places additional restrictions on the register class to use when it is necessary to copy value X into a register in class CLASS. The value is a register class; perhaps CLASS, or perhaps another, smaller class. On many machines, the following definition is safe: #define PREFERRED_RELOAD_CLASS(X,CLASS) CLASS*/#define PREFERRED_RELOAD_CLASS(X, CLASS) (CLASS)#define SECONDARY_RELOAD_CLASS(CLASS,MODE,X) \ mt_secondary_reload_class((CLASS), (MODE), (X))/* A C expression for the maximum number of consecutive registers of class CLASS needed to hold a value of mode MODE. */#define CLASS_MAX_NREGS(CLASS, MODE) \ ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)/* For MorphoRISC1: `I' is used for the range of constants an arithmetic insn can actually contain (16 bits signed integers). `J' is used for the range which is just zero (ie, $r0). `K' is used for the range of constants a logical insn can actually contain (16 bit zero-extended integers). `L' is used for the range of constants that be loaded with lui (ie, the bottom 16 bits are zero). `M' is used for the range of constants that take two words to load (ie, not matched by `I', `K', and `L'). `N' is used for negative 16 bit constants other than -65536. `O' is a 15 bit signed integer. `P' is used for positive 16 bit constants. */#define SMALL_INT(X) ((unsigned HOST_WIDE_INT) (INTVAL (X) + 0x8000) < 0x10000)#define SMALL_INT_UNSIGNED(X) ((unsigned HOST_WIDE_INT) (INTVAL (X)) < 0x10000)/* A C expression that defines the machine-dependent operand constraint letters that specify particular ranges of integer values. If C is one of those letters, the expression should check that VALUE, an integer, is in the appropriate range and return 1 if so, 0 otherwise. If C is not one of those letters, the value should be 0 regardless of VALUE. */#define CONST_OK_FOR_LETTER_P(VALUE, C) \ ((C) == 'I' ? ((unsigned HOST_WIDE_INT) ((VALUE) + 0x8000) < 0x10000) \ : (C) == 'J' ? ((VALUE) == 0) \ : (C) == 'K' ? ((unsigned HOST_WIDE_INT) (VALUE) < 0x10000) \ : (C) == 'L' ? (((VALUE) & 0x0000ffff) == 0 \ && (((VALUE) & ~2147483647) == 0 \ || ((VALUE) & ~2147483647) == ~2147483647)) \ : (C) == 'M' ? ((((VALUE) & ~0x0000ffff) != 0) \ && (((VALUE) & ~0x0000ffff) != ~0x0000ffff) \ && (((VALUE) & 0x0000ffff) != 0 \ || (((VALUE) & ~2147483647) != 0 \ && ((VALUE) & ~2147483647) != ~2147483647))) \ : (C) == 'N' ? ((unsigned HOST_WIDE_INT) ((VALUE) + 0xffff) < 0xffff) \ : (C) == 'O' ? ((unsigned HOST_WIDE_INT) ((VALUE) + 0x4000) < 0x8000) \ : (C) == 'P' ? ((VALUE) != 0 && (((VALUE) & ~0x0000ffff) == 0)) \ : 0)/* A C expression that defines the machine-dependent operand constraint letters (`G', `H') that specify particular ranges of `const_double' values. */#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) 0/* Most negative value represent on mt */#define MT_MIN_INT 0x80000000/* Basic Stack Layout. */enum save_direction{ FROM_PROCESSOR_TO_MEM, FROM_MEM_TO_PROCESSOR};/* Tell prologue and epilogue if register REGNO should be saved / restored. The return address and frame pointer are treated separately. Don't consider them here. */#define MUST_SAVE_REGISTER(regno) \ ( (regno) != GPR_LINK \ && (regno) != GPR_FP \ && (regno) != GPR_SP \ && (regno) != GPR_R0 \ && (( regs_ever_live [regno] && ! call_used_regs [regno] ) \ /* Save ira register in an interrupt handler. */ \ || (interrupt_handler && (regno) == GPR_INTERRUPT_LINK) \ /* Save any register used in an interrupt handler. */ \ || (interrupt_handler && regs_ever_live [regno]) \ /* Save call clobbered registers in non-leaf interrupt \ handlers. */ \ || (interrupt_handler && call_used_regs[regno] \ && !current_function_is_leaf) \ ||(current_function_calls_eh_return \ && (regno == GPR_R7 || regno == GPR_R8)) \ ) \ )#define STACK_GROWS_DOWNWARD 1/* Offset from the frame pointer to the first local variable slot to be allocated. If `FRAME_GROWS_DOWNWARD', find the next slot's offset by subtracting the first slot's length from `STARTING_FRAME_OFFSET'. Otherwise, it is found by adding the length of the first slot to the value `STARTING_FRAME_OFFSET'. */#define STARTING_FRAME_OFFSET current_function_outgoing_args_size/* Offset from the argument pointer register to the first argument's address. On some machines it may depend on the data type of the function. If `ARGS_GROW_DOWNWARD', this is the offset to the location above the first argument's address. */#define FIRST_PARM_OFFSET(FUNDECL) 0#define RETURN_ADDR_RTX(COUNT, FRAMEADDR) \ mt_return_addr_rtx (COUNT)/* A C expression whose value is RTL representing the location of the incoming return address at the beginning of any function, before the prologue. This RTL is either a `REG', indicating that the return value is saved in `REG', or a `MEM' representing a location in the stack. You only need to define this macro if you want to support call frame debugging information like that provided by DWARF 2. */#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (SImode, GPR_LINK)/* A C expression whose value is an integer giving the offset, in bytes, from the value of the stack pointer register to the top of the stack frame at the beginning of any function, before the prologue. The top of the frame is defined to be the value of the stack pointer in the previous frame, just before the call instruction. You only need to define this macro if you want to support call frame debugging information like that provided by DWARF 2. */#define INCOMING_FRAME_SP_OFFSET 0#define STACK_POINTER_REGNUM GPR_SP#define FRAME_POINTER_REGNUM GPR_FP/* The register number of the arg pointer register, which is used to access the function's argument list. */#define ARG_POINTER_REGNUM (SPECIAL_REG_FIRST + 0)/* Register numbers used for passing a function's static chain pointer. */#define STATIC_CHAIN_REGNUM 10/* A C expression which is nonzero if a function must have and use a frame pointer. */#define FRAME_POINTER_REQUIRED 0/* Structure to be filled in by compute_frame_size with register save masks, and offsets for the current function. */struct mt_frame_info{ unsigned int total_size; /* # Bytes that the entire frame takes up. */ unsigned int pretend_size; /* # Bytes we push and pretend caller did. */ unsigned int args_size; /* # Bytes that outgoing arguments take up. */ unsigned int extra_size; unsigned int reg_size; /* # Bytes needed to store regs. */ unsigned int var_size; /* # Bytes that variables take up. */ unsigned int frame_size; /* # Bytes in current frame. */ unsigned int reg_mask; /* Mask of saved registers. */ unsigned int save_fp; /* Nonzero if frame pointer must be saved. */ unsigned int save_lr; /* Nonzero if return pointer must be saved. */ int initialized; /* Nonzero if frame size already calculated. */}; extern struct mt_frame_info current_frame_info;/* If defined, this macro specifies a table of register pairs used to eliminate unneeded registers that point into the stack frame. */#define ELIMINABLE_REGS \{ \ {ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ {ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \ {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM} \}/* A C expression that returns non-zero if the compiler is allowed to try to replace register number FROM with register number TO. */#define CAN_ELIMINATE(FROM, TO) \ ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM \ ? ! frame_pointer_needed \ : 1)/* This macro is similar to `INITIAL_FRAME_POINTER_OFFSET'. It specifies the initial difference between the specified pair of registers. This macro must be defined if `ELIMINABLE_REGS' is defined. */#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ (OFFSET) = mt_initial_elimination_offset (FROM, TO)/* If defined, the maximum amount of space required for outgoing arguments will be computed and placed into the variable `current_function_outgoing_args_size'. */#define ACCUMULATE_OUTGOING_ARGS 1/* Define this if it is the responsibility of the caller to allocate the area reserved for arguments passed in registers. */#define OUTGOING_REG_PARM_STACK_SPACE/* The number of register assigned to holding function arguments. */#define MT_NUM_ARG_REGS 4/* Define this if it is the responsibility of the caller to allocate the area reserved for arguments passed in registers. */#define REG_PARM_STACK_SPACE(FNDECL) (MT_NUM_ARG_REGS * UNITS_PER_WORD)/* Define this macro if `REG_PARM_STACK_SPACE' is defined, but the stack parameters don't skip the area specified by it. */#define STACK_PARMS_IN_REG_PARM_AREA/* A C expression that should indicate the number of bytes of its own arguments that a function pops on returning, or 0 if the function pops no arguments and the caller must therefore pop them all after the function returns. */#define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACK_SIZE) 0#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ mt_function_arg (& (CUM), (MODE), (TYPE), (NAMED), FALSE)#define CUMULATIVE_ARGS int#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, FNDECL, N_NAMED_ARGS) \ mt_init_cumulative_args (& (CUM), FNTYPE, LIBNAME, FNDECL, FALSE)#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ mt_function_arg_advance (&CUM, MODE, TYPE, NAMED)#define FUNCTION_ARG_BOUNDARY(MODE, TYPE) \ mt_function_arg_boundary (MODE, TYPE)#define FUNCTION_ARG_REGNO_P(REGNO) \ ((REGNO) >= FIRST_ARG_REGNUM && ((REGNO) <= LAST_ARG_REGNUM))#define RETURN_VALUE_REGNUM RETVAL_REGNUM #define FUNCTION_VALUE(VALTYPE, FUNC) \ mt_function_value (VALTYPE, TYPE_MODE(VALTYPE), FUNC)#define LIBCALL_VALUE(MODE) \ mt_function_value (NULL_TREE, MODE, NULL_TREE)#define FUNCTION_VALUE_REGNO_P(REGNO) ((REGNO) == RETURN_VALUE_REGNUM)/* A C expression which can inhibit the returning of certain function values in registers, based on the type of value. */#define RETURN_IN_MEMORY(TYPE) (int_size_in_bytes (TYPE) > UNITS_PER_WORD)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -