📄 mn10300.h
字号:
|| REGNO_ADDRESS_P ((regno)) || REGNO_EXTENDED_P ((regno)))#define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))#define REGNO_OK_FOR_BIT_BASE_P(regno) \ (REGNO_SP_P ((regno)) || REGNO_ADDRESS_P ((regno)))#define REG_OK_FOR_BIT_BASE_P(X) REGNO_OK_FOR_BIT_BASE_P (REGNO (X))#define REGNO_OK_FOR_INDEX_P(regno) \ (REGNO_DATA_P ((regno)) || REGNO_EXTENDED_P ((regno)))#define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))/* 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) \ ((X) == stack_pointer_rtx && (CLASS) != SP_REGS \ ? ADDRESS_OR_EXTENDED_REGS \ : (GET_CODE (X) == MEM \ || (GET_CODE (X) == REG \ && REGNO (X) >= FIRST_PSEUDO_REGISTER) \ || (GET_CODE (X) == SUBREG \ && GET_CODE (SUBREG_REG (X)) == REG \ && REGNO (SUBREG_REG (X)) >= FIRST_PSEUDO_REGISTER) \ ? LIMIT_RELOAD_CLASS (GET_MODE (X), CLASS) \ : (CLASS)))#define PREFERRED_OUTPUT_RELOAD_CLASS(X,CLASS) \ (X == stack_pointer_rtx && CLASS != SP_REGS \ ? ADDRESS_OR_EXTENDED_REGS : CLASS)#define LIMIT_RELOAD_CLASS(MODE, CLASS) \ (!TARGET_AM33 && (MODE == QImode || MODE == HImode) ? DATA_REGS : CLASS)#define SECONDARY_RELOAD_CLASS(CLASS,MODE,IN) \ secondary_reload_class(CLASS,MODE,IN)/* 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. */#define INT_8_BITS(VALUE) ((unsigned) (VALUE) + 0x80 < 0x100)#define INT_16_BITS(VALUE) ((unsigned) (VALUE) + 0x8000 < 0x10000)#define CONST_OK_FOR_I(VALUE) ((VALUE) == 0)#define CONST_OK_FOR_J(VALUE) ((VALUE) == 1)#define CONST_OK_FOR_K(VALUE) ((VALUE) == 2)#define CONST_OK_FOR_L(VALUE) ((VALUE) == 4)#define CONST_OK_FOR_M(VALUE) ((VALUE) == 3)#define CONST_OK_FOR_N(VALUE) ((VALUE) == 255 || (VALUE) == 65535)#define CONST_OK_FOR_LETTER_P(VALUE, C) \ ((C) == 'I' ? CONST_OK_FOR_I (VALUE) : \ (C) == 'J' ? CONST_OK_FOR_J (VALUE) : \ (C) == 'K' ? CONST_OK_FOR_K (VALUE) : \ (C) == 'L' ? CONST_OK_FOR_L (VALUE) : \ (C) == 'M' ? CONST_OK_FOR_M (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' ? (GET_MODE_CLASS (GET_MODE (VALUE)) == MODE_FLOAT \ && (VALUE) == CONST0_RTX (GET_MODE (VALUE))) : 0)/* 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/* 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) 4#define ELIMINABLE_REGS \{{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \ { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}}#define CAN_ELIMINATE(FROM, TO) 1#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ OFFSET = initial_offset (FROM, TO)/* We can debug without frame pointers on the mn10300, so eliminate them whenever possible. */#define FRAME_POINTER_REQUIRED 0#define CAN_DEBUG_WITHOUT_FP/* A guess for the MN10300. */#define PROMOTE_PROTOTYPES 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/* We use d0/d1 for passing parameters, so allocate 8 bytes of space for a register flushback area. */#define REG_PARM_STACK_SPACE(DECL) 8#define OUTGOING_REG_PARM_STACK_SPACE#define ACCUMULATE_OUTGOING_ARGS 1/* So we can allocate space for return pointers once for the function instead of around every call. */#define STACK_POINTER_OFFSET 4/* 1 if N is a possible register number for function argument passing. On the MN10300, no registers are used in this way. */#define FUNCTION_ARG_REGNO_P(N) ((N) <= 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 MN10300, this is a single integer, which is a number of bytes of arguments scanned so far. */#define CUMULATIVE_ARGS struct cum_argstruct cum_arg {int nbytes; };/* 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. On the MN10300, the offset starts at 0. */#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT) \ ((CUM).nbytes = 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) \ ((CUM).nbytes += ((MODE) != BLKmode \ ? (GET_MODE_SIZE (MODE) + 3) & ~3 \ : (int_size_in_bytes (TYPE) + 3) & ~3))/* Define where to put the arguments 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 MN10300 all args are pushed. */ #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ function_arg (&CUM, MODE, TYPE, NAMED)#define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \ function_arg_partial_nregs (&CUM, MODE, TYPE, NAMED)#define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) \ ((TYPE) && int_size_in_bytes (TYPE) > 8) #define FUNCTION_ARG_CALLEE_COPIES(CUM, MODE, TYPE, NAMED) \ ((TYPE) && int_size_in_bytes (TYPE) > 8)/* 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) \ gen_rtx_REG (TYPE_MODE (VALTYPE), POINTER_TYPE_P (VALTYPE) \ ? FIRST_ADDRESS_REGNUM : FIRST_DATA_REGNUM)/* Define how to find the value returned by a library function assuming the value has mode MODE. */#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, FIRST_DATA_REGNUM)/* 1 if N is a possible register number for a function value. */#define FUNCTION_VALUE_REGNO_P(N) \ ((N) == FIRST_DATA_REGNUM || (N) == FIRST_ADDRESS_REGNUM)/* Return values > 8 bytes in length in memory. */#define DEFAULT_PCC_STRUCT_RETURN 0#define RETURN_IN_MEMORY(TYPE) \ (int_size_in_bytes (TYPE) > 8 || TYPE_MODE (TYPE) == BLKmode)/* Register in which address to store a structure value is passed to a function. On the MN10300 it's passed as the first parameter. */#define STRUCT_VALUE FIRST_DATA_REGNUM/* EXIT_IGNORE_STACK should be nonzero if, when returning from a function, the stack pointer does not matter. The value is tested only in functions that have frame pointers. No definition is equivalent to always zero. */#define EXIT_IGNORE_STACK 1/* Output assembler code to FILE to increment profiler label # LABELNO for profiling a function entry. */#define FUNCTION_PROFILER(FILE, LABELNO) ;#define TRAMPOLINE_TEMPLATE(FILE) \ do { \ fprintf (FILE, "\tadd -4,sp\n"); \ fprintf (FILE, "\t.long 0x0004fffa\n"); \ fprintf (FILE, "\tmov (0,sp),a0\n"); \ fprintf (FILE, "\tadd 4,sp\n"); \ fprintf (FILE, "\tmov (13,a0),a1\n"); \ fprintf (FILE, "\tmov (17,a0),a0\n"); \ fprintf (FILE, "\tjmp (a0)\n"); \ fprintf (FILE, "\t.long 0\n"); \ fprintf (FILE, "\t.long 0\n"); \ } while (0)/* Length in units of the trampoline for entering a nested function. */#define TRAMPOLINE_SIZE 0x1b#define TRAMPOLINE_ALIGNMENT 32/* 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(TRAMP, FNADDR, CXT) \{ \ emit_move_insn (gen_rtx_MEM (SImode, plus_constant ((TRAMP), 0x14)), \ (CXT)); \ emit_move_insn (gen_rtx_MEM (SImode, plus_constant ((TRAMP), 0x18)), \ (FNADDR)); \}/* A C expression whose value is RTL representing the value of the return address for the frame COUNT steps up from the current frame. On the mn10300, the return address is not at a constant location due to the frame layout. Luckily, it is at a constant offset from the argument pointer, so we define RETURN_ADDR_RTX to return a MEM using arg_pointer_rtx. Reload will replace arg_pointer_rtx with a reference to the stack/frame pointer + an appropriate offset. */#define RETURN_ADDR_RTX(COUNT, FRAME) \ ((COUNT == 0) \ ? gen_rtx_MEM (Pmode, arg_pointer_rtx) \ : (rtx) 0)/* Emit code for a call to builtin_saveregs. We must emit USE insns which reference the 2 integer arg registers. Ordinarily they are not call used registers, but they are for _builtin_saveregs, so we must make this explicit. */#define EXPAND_BUILTIN_SAVEREGS() mn10300_builtin_saveregs ()/* Implement `va_start' for varargs and stdarg. */#define EXPAND_BUILTIN_VA_START(valist, nextarg) \ mn10300_va_start (valist, nextarg)/* Implement `va_arg'. */#define EXPAND_BUILTIN_VA_ARG(valist, type) \ mn10300_va_arg (valist, type)/* Addressing modes, and classification of registers for them. *//* 1 if X is an rtx for a constant that is a valid address. */#define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)/* Extra constraints. */ #define OK_FOR_R(OP) \ (GET_CODE (OP) == MEM \ && GET_MODE (OP) == QImode \ && (CONSTANT_ADDRESS_P (XEXP (OP, 0)) \ || (GET_CODE (XEXP (OP, 0)) == REG \ && REG_OK_FOR_BIT_BASE_P (XEXP (OP, 0)) \ && XEXP (OP, 0) != stack_pointer_rtx) \ || (GET_CODE (XEXP (OP, 0)) == PLUS \ && GET_CODE (XEXP (XEXP (OP, 0), 0)) == REG \ && REG_OK_FOR_BIT_BASE_P (XEXP (XEXP (OP, 0), 0)) \ && XEXP (XEXP (OP, 0), 0) != stack_pointer_rtx \ && GET_CODE (XEXP (XEXP (OP, 0), 1)) == CONST_INT \ && INT_8_BITS (INTVAL (XEXP (XEXP (OP, 0), 1)))))) #define OK_FOR_T(OP) \ (GET_CODE (OP) == MEM \ && GET_MODE (OP) == QImode \ && (GET_CODE (XEXP (OP, 0)) == REG \ && REG_OK_FOR_BIT_BASE_P (XEXP (OP, 0)) \ && XEXP (OP, 0) != stack_pointer_rtx))#define EXTRA_CONSTRAINT(OP, C) \ ((C) == 'R' ? OK_FOR_R (OP) \ : (C) == 'S' ? GET_CODE (OP) == SYMBOL_REF \ : (C) == 'T' ? OK_FOR_T (OP) \ : 0)/* Maximum number of registers that can appear in a valid memory address. */#define MAX_REGS_PER_ADDRESS 2#define HAVE_POST_INCREMENT (TARGET_AM33)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -