📄 tm-alliant.h
字号:
#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 ? 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/* The Alliant uses -fcaller-saves by default. */#define DEFAULT_CALLER_SAVES/* 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 -4/* 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) 0/* 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 Alliant we define this as 1 and make the calling sequence (in alliant.md) pop the args. This wouldn't be necessary if we could add to the pending stack adjustment the size of the argument descriptors that are pushed after the arguments. */#define RETURN_POPS_ARGS(FUNTYPE) 1/* 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 Alliant the return value is in FP0 if real, else D0. */#define FUNCTION_VALUE(VALTYPE, FUNC) \ (TREE_CODE (VALTYPE) == REAL_TYPE \ ? gen_rtx (REG, TYPE_MODE (VALTYPE), 16) \ : 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 Alliant the return value is in FP0 if real, else D0. The Alliant library functions for floating-point emulation return their values both in FP0 and in D0/D1. But since not all gnulib functions return the results of these directly, we cannot assume that D0/D1 contain the values we expect on return from a gnulib function. */#define LIBCALL_VALUE(MODE) \ (((MODE) == DFmode || (MODE) == SFmode) \ ? gen_rtx (REG, MODE, 16) \ : gen_rtx (REG, MODE, 0))/* 1 if N is a possible register number for a function value. On the Alliant, D0 and FP0 are the only registers thus used. (No need to mention D1 when used as a pair with D0.) */#define FUNCTION_VALUE_REGNO_P(N) (((N) & ~16) == 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 Alliant, 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 Alliant, 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 Alliant, 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 Alliant all args are pushed. */#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) 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) 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. The Alliant uses caller-saves, so this macro is very simple. */#define FUNCTION_PROLOGUE(FILE, SIZE) \{ int fsize = ((SIZE) - STARTING_FRAME_OFFSET + 3) & -4; \ if (frame_pointer_needed) \ { \ if (fsize < 0x8000) \ fprintf(FILE,"\tlinkw a6,#%d\n", -fsize); \ else if (TARGET_68020) \ fprintf(FILE,"\tlinkl a6,#%d\n", -fsize); \ else \ fprintf(FILE,"\tlinkw a6,#0\n\tsubl #%d,sp\n", fsize); \ fprintf(FILE, "\tmovl a0,a6@(-4)\n" ); }}/* Output assembler code to FILE to increment profiler label # LABELNO for profiling a function entry. */#define FUNCTION_PROFILER(FILE, LABELNO) \ fprintf (FILE, "\tjbsr __mcount_\n")/* 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) \{ if (frame_pointer_needed) \ fprintf (FILE, "\tunlk a6\n"); \ fprintf (FILE, "\trts\n"); }/* If the memory address ADDR is relative to the frame pointer, correct it to be relative to the stack pointer instead. This is for when we don't use a frame pointer. ADDR should be a variable name. */#define FIX_FRAME_POINTER_ADDRESS(ADDR,DEPTH) \{ int offset = -1; \ rtx regs = stack_pointer_rtx; \ if (ADDR == frame_pointer_rtx) \ offset = 0; \ else if (GET_CODE (ADDR) == PLUS && XEXP (ADDR, 0) == frame_pointer_rtx \ && GET_CODE (XEXP (ADDR, 1)) == CONST_INT) \ offset = INTVAL (XEXP (ADDR, 1)); \ else if (GET_CODE (ADDR) == PLUS && XEXP (ADDR, 0) == frame_pointer_rtx) \ { rtx other_reg = XEXP (ADDR, 1); \ offset = 0; \ regs = gen_rtx (PLUS, Pmode, stack_pointer_rtx, other_reg); } \ else if (GET_CODE (ADDR) == PLUS && XEXP (ADDR, 1) == frame_pointer_rtx) \ { rtx other_reg = XEXP (ADDR, 0); \ offset = 0; \ regs = gen_rtx (PLUS, Pmode, stack_pointer_rtx, other_reg); } \ else if (GET_CODE (ADDR) == PLUS \ && GET_CODE (XEXP (ADDR, 0)) == PLUS \ && XEXP (XEXP (ADDR, 0), 0) == frame_pointer_rtx \ && GET_CODE (XEXP (ADDR, 1)) == CONST_INT) \ { rtx other_reg = XEXP (XEXP (ADDR, 0), 1); \ offset = INTVAL (XEXP (ADDR, 1)); \ regs = gen_rtx (PLUS, Pmode, stack_pointer_rtx, other_reg); } \ else if (GET_CODE (ADDR) == PLUS \ && GET_CODE (XEXP (ADDR, 0)) == PLUS \ && XEXP (XEXP (ADDR, 0), 1) == frame_pointer_rtx \ && GET_CODE (XEXP (ADDR, 1)) == CONST_INT) \ { rtx other_reg = XEXP (XEXP (ADDR, 0), 0); \ offset = INTVAL (XEXP (ADDR, 1)); \ regs = gen_rtx (PLUS, Pmode, stack_pointer_rtx, other_reg); } \ if (offset >= 0) \ { int regno; \ extern char call_used_regs[]; \ for (regno = 16; regno < FIRST_PSEUDO_REGISTER; regno++) \ if (regs_ever_live[regno] && ! call_used_regs[regno]) \ offset += 12; \ for (regno = 0; regno < 16; regno++) \ if (regs_ever_live[regno] && ! call_used_regs[regno]) \ offset += 4; \ offset -= 4; \ ADDR = plus_constant (regs, offset + (DEPTH)); } } \/* Addressing modes, and classification of registers for them. */#define HAVE_POST_INCREMENT/* #define HAVE_POST_DECREMENT */#define HAVE_PRE_DECREMENT/* #define HAVE_PRE_INCREMENT *//* Macros to check register numbers against specific register classes. *//* 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_INDEX_P(REGNO) \((REGNO) < 16 || (unsigned) reg_renumber[REGNO] < 16)#define REGNO_OK_FOR_BASE_P(REGNO) \(((REGNO) ^ 010) < 8 || (unsigned) (reg_renumber[REGNO] ^ 010) < 8)#define REGNO_OK_FOR_DATA_P(REGNO) \((REGNO) < 8 || (unsigned) reg_renumber[REGNO] < 8)#define REGNO_OK_FOR_FP_P(REGNO) \(((REGNO) ^ 020) < 8 || (unsigned) (reg_renumber[REGNO] ^ 020) < 8)/* Now macros that check whether X is a register and also, strictly, whether it is in a specified class. These macros are specific to the 68000, and may be used only in code for printing assembler insns and in conditions for define_optimization. *//* 1 if X is a data register. */#define DATA_REG_P(X) (REG_P (X) && REGNO_OK_FOR_DATA_P (REGNO (X)))/* 1 if X is an fp register. */#define FP_REG_P(X) (REG_P (X) && REGNO_OK_FOR_FP_P (REGNO (X)))/* 1 if X is an address register */#define ADDRESS_REG_P(X) (REG_P (X) && REGNO_OK_FOR_BASE_P (REGNO (X)))/* Maximum number of registers that can appear in a valid memory address. */#define MAX_REGS_PER_ADDRESS 2/* Recognize any constant value that is a valid address. */#define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)/* Nonzero if the constant value X is a legitimate general operand. It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. *//* Alliant FP instructions don't take immediate operands, so this forces them into memory. */#define LEGITIMATE_CONSTANT_P(X) (GET_CODE (X) != CONST_DOUBLE)/* The macros REG_OK_FOR..._P assume that the arg is a REG rtx and check its validity for a certain class. We have two alternate definitions for each of them. The usual definition accepts all pseudo regs; the other rejects them unless they have been allocated suitable hard regs. The symbol REG_OK_STRICT causes the latter definition to be used. Most source files want to accept pseudo regs in the hope that they will get allocated to the class that the insn wants them to be in. Source files for reload pass need to be strict. After reload, it makes no difference, since pseudo regs have been eliminated by then. */#ifndef REG_OK_STRICT/* Nonzero if X is a hard reg that can be used as an index or if it is a pseudo reg. */#define REG_OK_FOR_INDEX_P(X) ((REGNO (X) ^ 020) >= 8)/* Nonzero if X is a hard reg that can be used as a base reg or if it is a pseudo reg. */#define REG_OK_FOR_BASE_P(X) ((REGNO (X) & ~027) != 0)#else/* Nonzero if X is a hard reg that can be used as an index. */#define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))/* Nonzero if X is a hard reg that can be used as a base reg. */#define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))#endif/* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression that is a valid memory address for an instruction. The MODE argument is the machine mode for the MEM expression that wants to use this address. The other macros defined here are used only in GO_IF_LEGITIMATE_ADDRESS. */#define INDIRECTABLE_1_ADDRESS_P(X) \ (CONSTANT_ADDRESS_P (X) \ || (GET_CODE (X) == REG && REG_OK_FOR_BASE_P (X)) \ || ((GET_CODE (X) == PRE_DEC || GET_CODE (X) == POST_INC) \ && REG_P (XEXP (X, 0)) \ && REG_OK_FOR_BASE_P (XEXP (X, 0))) \ || (GET_CODE (X) == PLUS \ && REG_P (XEXP (X, 0)) && REG_OK_FOR_BASE_P (XEXP (X, 0)) \ && GET_CODE (XEXP (X, 1)) == CONST_INT \ && ((unsigned) INTVAL (XEXP (X, 1)) + 0x8000) < 0x10000))#define GO_IF_NONINDEXED_ADDRESS(X, ADDR) \{ if (INDIRECTABLE_1_ADDRESS_P (X)) goto ADDR; }#define GO_IF_INDEXABLE_BASE(X, ADDR) \
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -