📄 tm-m68k.h
字号:
#define REG_CLASS_NAMES \ { "NO_REGS", "LO_FPA_REGS", "FPA_REGS", "FP_REGS", \ "FP_OR_FPA_REGS", "DATA_REGS", "DATA_OR_FPA_REGS", "DATA_OR_FP_REGS", \ "DATA_OR_FP_OR_FPA_REGS", "ADDR_REGS", "GENERAL_REGS", \ "GENERAL_OR_FPA_REGS", "GENERAL_OR_FP_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}, /* NO_REGS */ \ {0xff000000, 0x000000ff}, /* LO_FPA_REGS */ \ {0xff000000, 0x00ffffff}, /* FPA_REGS */ \ {0x00ff0000, 0x00000000}, /* FP_REGS */ \ {0xffff0000, 0x00ffffff}, /* FP_OR_FPA_REGS */ \ {0x000000ff, 0x00000000}, /* DATA_REGS */ \ {0xff0000ff, 0x00ffffff}, /* DATA_OR_FPA_REGS */ \ {0x00ff00ff, 0x00000000}, /* DATA_OR_FP_REGS */ \ {0xffff00ff, 0x00ffffff}, /* DATA_OR_FP_OR_FPA_REGS */\ {0x0000ff00, 0x00000000}, /* ADDR_REGS */ \ {0x0000ffff, 0x00000000}, /* GENERAL_REGS */ \ {0xff00ffff, 0x00ffffff}, /* GENERAL_OR_FPA_REGS */\ {0x00ffffff, 0x00000000}, /* GENERAL_OR_FP_REGS */\ {0xffffffff, 0x00ffffff}, /* 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. */extern enum reg_class regno_reg_class[];#define REGNO_REG_CLASS(REGNO) (regno_reg_class[(REGNO)>>3])/* The class value for index registers, and the one for base regs. */#define INDEX_REG_CLASS GENERAL_REGS#define BASE_REG_CLASS ADDR_REGS/* Get reg_class from a letter such as appears in the machine description. We do a trick here to modify the effective constraints on the machine description; we zorch the constraint letters that aren't appropriate for a specific target. This allows us to guarantee that a specific kind of register will not be used for a given target without fiddling with the register classes above. */#define REG_CLASS_FROM_LETTER(C) \ ((C) == 'a' ? ADDR_REGS : \ ((C) == 'd' ? DATA_REGS : \ ((C) == 'f' ? (TARGET_68881 ? FP_REGS : \ NO_REGS) : \ ((C) == 'x' ? (TARGET_FPA ? FPA_REGS : \ NO_REGS) : \ ((C) == 'y' ? (TARGET_FPA ? LO_FPA_REGS : \ NO_REGS) : \ NO_REGS)))))/* The letters I, J, K, L and M 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. For the 68000, `I' is used for the range 1 to 8 allowed as immediate shift counts and in addq. `J' is used for the range of signed numbers that fit in 16 bits. `K' is for numbers that moveq can't handle. `L' is for range -8 to -1, range of values that can be added with subq. */#define CONST_OK_FOR_LETTER_P(VALUE, C) \ ((C) == 'I' ? (VALUE) > 0 && (VALUE) <= 8 : \ (C) == 'J' ? (VALUE) >= -0x8000 && (VALUE) <= 0x7FFF : \ (C) == 'K' ? (VALUE) < -0x80 || (VALUE) >= 0x80 : \ (C) == 'L' ? (VALUE) < 0 && (VALUE) >= -8 : 0)/* * A small bit of explanation: * "G" defines all of the floating constants that are *NOT* 68881 * constants. this is so 68881 constants get reloaded and the * fpmovecr is used. "H" defines *only* the class of constants that * the fpa can use, because these can be gotten at in any fpa * instruction and there is no need to force reloads. */#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \ ((C) == 'G' ? ! (TARGET_68881 && standard_68881_constant_p (VALUE)) : \ (C) == 'H' ? (TARGET_FPA && standard_sun_fpa_constant_p (VALUE)) : 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. On the 68000 series, use a data reg if possible when the value is a constant in the range where moveq could be used and we ensure that QImodes are reloaded into data regs. */#define PREFERRED_RELOAD_CLASS(X,CLASS) \ ((GET_CODE (X) == CONST_INT \ && (unsigned) (INTVAL (X) + 0x80) < 0x100 \ && (CLASS) != ADDR_REGS) \ ? DATA_REGS \ : GET_MODE (X) == QImode \ ? DATA_REGS \ : (CLASS))/* Return the maximum number of consecutive registers needed to represent mode MODE in a register of class CLASS. *//* On the 68000, this is the size of MODE in words, except in the FP regs, where a single reg is always enough. */#define CLASS_MAX_NREGS(CLASS, MODE) \ ((CLASS) == FP_REGS || (CLASS) == FPA_REGS || (CLASS) == LO_FPA_REGS ? 1 \ : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))/* 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 68000, sp@- in a byte insn really pushes a word. */#define PUSH_ROUNDING(BYTES) (((BYTES) + 1) & ~1)/* Offset of first parameter from the argument pointer register value. */#define FIRST_PARM_OFFSET(FNDECL) 8/* Value is 1 if returning from a function call automatically pops the arguments described by the number-of-args field in the call. 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. On the 68000, the RTS insn cannot pop anything. On the 68010, the RTD insn may be used to pop them if the number of args is fixed, but if the number is variable then the caller must pop them all. RTD can't be used for library calls now because the library is compiled with the Unix compiler. Use of RTD is a selectable option, since it is incompatible with standard Unix calling sequences. If the option is not selected, the caller must always pop the args. */#define RETURN_POPS_ARGS(FUNTYPE) \ (TARGET_RTD && TREE_CODE (FUNTYPE) != IDENTIFIER_NODE \ && (TYPE_ARG_TYPES (FUNTYPE) == 0 \ || TREE_VALUE (tree_last (TYPE_ARG_TYPES (FUNTYPE))) == void_type_node))/* 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 68000 the return value is in D0 regardless. */#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 68000 the return value is in D0 regardless. */#define LIBCALL_VALUE(MODE) gen_rtx (REG, MODE, 0)/* 1 if N is a possible register number for a function value. On the 68000, d0 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 68000, no registers are used in this way. */#define FUNCTION_ARG_REGNO_P(N) 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. On the m68k, this is a single integer, which is a number of bytes of arguments scanned so far. */#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. On the m68k, the offset starts at 0. */#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE) \ ((CUM) = 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) += ((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 68000 all args are pushed, except if -mregparm is specified then the first two words of arguments are passed in d0, d1. *NOTE* -mregparm does not work. It exists only to test register calling conventions. */#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \((TARGET_REGPARM && (CUM) < 8) ? gen_rtx (REG, (MODE), (CUM) / 4) : 0)/* For an arg passed partly in registers and partly in memory, this is the number of registers used. For args passed entirely in registers or entirely in memory, zero. */#define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \((TARGET_REGPARM && (CUM) < 8 \ && 8 < ((CUM) + ((MODE) == BLKmode \ ? int_size_in_bytes (TYPE) \ : GET_MODE_SIZE (MODE)))) \ ? 2 - (CUM) / 4 : 0)/* This macro generates the assembly code for function entry. FILE is a stdio stream to output the code to. SIZE is an int: how many units of temporary storage to allocate. Refer to the array `regs_ever_live' to determine which registers to save; `regs_ever_live[I]' is nonzero if register number I is ever used in the function. This macro is responsible for knowing which registers should not be saved even if used. *//* Note that the order of the bit mask for fmovem is the opposite of the order for movem! */#define FUNCTION_PROLOGUE(FILE, SIZE) \{ register int regno; \ register int mask = 0; \ extern char call_used_regs[]; \ int fsize = ((SIZE) + 3) & -4; \ if (frame_pointer_needed) \ { if (TARGET_68020 || fsize < 0x8000) \ fprintf (FILE, "\tlink a6,#%d\n", -fsize); \ else \ fprintf (FILE, "\tlink a6,#0\n\tsubl #%d,sp\n", fsize); } \ for (regno = 24; regno < 56; regno++) \ if (regs_ever_live[regno] && ! call_used_regs[regno]) \ fprintf(FILE, "\tfpmoved %s, sp@-\n", \ reg_names[regno]); \ for (regno = 16; regno < 24; regno++) \ if (regs_ever_live[regno] && ! call_used_regs[regno]) \ mask |= 1 << (regno - 16); \ if ((mask & 0xff) != 0) \ fprintf (FILE, "\tfmovem #0x%x,sp@-\n", mask & 0xff); \ mask = 0; \ for (regno = 0; regno < 16; regno++) \ if (regs_ever_live[regno] && ! call_used_regs[regno]) \ mask |= 1 << (15 - regno); \ if (frame_pointer_needed) \ mask &= ~ (1 << (15-FRAME_POINTER_REGNUM)); \ if (exact_log2 (mask) >= 0) \ fprintf (FILE, "\tmovel %s,sp@-\n", reg_names[15 - exact_log2 (mask)]); \ else if (mask) fprintf (FILE, "\tmoveml #0x%x,sp@-\n", mask); }/* Output assembler code to FILE to increment profiler label # LABELNO for profiling a function entry. */#define FUNCTION_PROFILER(FILE, LABELNO) \ fprintf (FILE, "\tlea LP%d,a0\n\tjsr mcount\n", (LABELNO))/* Output assembler code to FILE to initialize this source file's basic block profiling info, if that has not already been done. */#define FUNCTION_BLOCK_PROFILER(FILE, LABELNO) \ fprintf (FILE, "\ttstl LPBX0\n\tbne LPI%d\n\tpea LPBX0\n\tjsr ___bb_init_func\n\taddql #4,sp\nLPI%d:\n", \ LABELNO, LABELNO);/* Output assembler code to FILE to increment the entry-count for the BLOCKNO'th basic block in this source file. */#define BLOCK_PROFILER(FILE, BLOCKNO) \ fprintf (FILE, "\taddql #1,LPBX2+%d\n", 4 * BLOCKNO)/* 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/* This macro generates the assembly code for function exit, on machines that need it. If FUNCTION_EPILOGUE is not defined then individual return instructions are generated for each return statement. Args are same as for FUNCTION_PROLOGUE. The function epilogue should not depend on the current stack pointer! It should use the frame pointer only. This is mandatory because of alloca; we also take advantage of it to omit stack adjustments before returning. */#define FUNCTION_EPILOGUE(FILE, SIZE) \
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -