📄 pdp11.h
字号:
/* Base register for access to arguments of the function. */#define ARG_POINTER_REGNUM 5/* Register in which static-chain is passed to a function. *//* ??? - i don't want to give up a reg for this! */#define STATIC_CHAIN_REGNUM 4/* Register in which address to store a structure value is passed to a function. let's make it an invisible first argument!!! */#define STRUCT_VALUE 0/* 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. */ /* The pdp has a couple of classes:MUL_REGS are used for odd numbered regs, to use in 16 bit multiplication (even numbered do 32 bit multiply)LMUL_REGS long multiply registers (even numbered regs ) (don't need them, all 32 bit regs are even numbered!)GENERAL_REGS is all cpuLOAD_FPU_REGS is the first four cpu regs, they are easier to loadNO_LOAD_FPU_REGS is ac4 and ac5, currently - difficult to load themFPU_REGS is all fpu regs */enum reg_class { NO_REGS, MUL_REGS, GENERAL_REGS, LOAD_FPU_REGS, NO_LOAD_FPU_REGS, FPU_REGS, ALL_REGS, LIM_REG_CLASSES };#define N_REG_CLASSES (int) LIM_REG_CLASSES/* have to allow this till cmpsi/tstsi are fixed in a better way !! */#define SMALL_REGISTER_CLASSES 1/* Since GENERAL_REGS is the same class as ALL_REGS, don't give it a different class number; just make it an alias. *//* #define GENERAL_REGS ALL_REGS *//* Give names of register classes as strings for dump file. */#define REG_CLASS_NAMES {"NO_REGS", "MUL_REGS", "GENERAL_REGS", "LOAD_FPU_REGS", "NO_LOAD_FPU_REGS", "FPU_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}, {0x00aa}, {0x00ff}, {0x0f00}, {0x3000}, {0x3f00}, {0x3fff}}/* 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)>=8?((REGNO)<=11?LOAD_FPU_REGS:NO_LOAD_FPU_REGS):(((REGNO)&1)?MUL_REGS:GENERAL_REGS))/* The class value for index registers, and the one for base regs. */#define INDEX_REG_CLASS GENERAL_REGS#define BASE_REG_CLASS GENERAL_REGS/* Get reg_class from a letter such as appears in the machine description. */#define REG_CLASS_FROM_LETTER(C) \((C) == 'f' ? FPU_REGS : \ ((C) == 'd' ? MUL_REGS : \ ((C) == 'a' ? LOAD_FPU_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. I bits 31-16 0000 J bits 15-00 0000 K completely random 32 bit L,M,N -1,1,0 respectively O where doing shifts in sequence is faster than one big shift */#define CONST_OK_FOR_LETTER_P(VALUE, C) \ ((C) == 'I' ? ((VALUE) & 0xffff0000) == 0 \ : (C) == 'J' ? ((VALUE) & 0x0000ffff) == 0 \ : (C) == 'K' ? (((VALUE) & 0xffff0000) != 0 \ && ((VALUE) & 0x0000ffff) != 0) \ : (C) == 'L' ? ((VALUE) == 1) \ : (C) == 'M' ? ((VALUE) == -1) \ : (C) == 'N' ? ((VALUE) == 0) \ : (C) == 'O' ? (abs(VALUE) >1 && abs(VALUE) <= 4) \ : 0)/* Similar, but for floating constants, and defining letters G and H. Here VALUE is the CONST_DOUBLE rtx itself. */#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \ ((C) == 'G' && XINT (VALUE, 0) == 0 && XINT (VALUE, 1) == 0)/* Letters in the range `Q' through `U' may be defined in a machine-dependent fashion to stand for arbitrary operand types. The machine description macro `EXTRA_CONSTRAINT' is passed the operand as its first argument and the constraint letter as its second operand. `Q' is for memory references using take more than 1 instruction. `R' is for memory references which take 1 word for the instruction. */#define EXTRA_CONSTRAINT(OP,CODE) \ ((GET_CODE (OP) != MEM) ? 0 \ : !legitimate_address_p (GET_MODE (OP), XEXP (OP, 0)) ? 0 \ : ((CODE) == 'Q') ? !simple_memory_operand (OP, GET_MODE (OP)) \ : ((CODE) == 'R') ? simple_memory_operand (OP, GET_MODE (OP)) \ : 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. loading is easier into LOAD_FPU_REGS than FPU_REGS! */#define PREFERRED_RELOAD_CLASS(X,CLASS) \(((CLASS) != FPU_REGS)?(CLASS):LOAD_FPU_REGS)#define SECONDARY_RELOAD_CLASS(CLASS,MODE,x) \(((CLASS) == NO_LOAD_FPU_REGS && !(REG_P(x) && LOAD_FPU_REG_P(REGNO(x))))?LOAD_FPU_REGS:NO_REGS)/* Return the maximum number of consecutive registers needed to represent mode MODE in a register of class CLASS. */#define CLASS_MAX_NREGS(CLASS, MODE) \((CLASS == GENERAL_REGS || CLASS == MUL_REGS)? \ ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD): \ 1 \)/* 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 pdp11, the stack is on an even boundary */#define PUSH_ROUNDING(BYTES) ((BYTES + 1) & ~1)/* current_first_parm_offset stores the # of registers pushed on the stack */extern int current_first_parm_offset;/* Offset of first parameter from the argument pointer register value. For the pdp11, this is non-zero to account for the return address. 1 - return address 2 - frame pointer (always saved, even when not used!!!!) -- chnage some day !!!:q!*/#define FIRST_PARM_OFFSET(FNDECL) 4/* Value is 1 if returning from a function call automatically pops the arguments described by the number-of-args field in the 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. */#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0/* 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 BASE_RETURN_VALUE_REG(MODE) \ ((MODE) == DFmode ? 8 : 0) /* On the pdp11 the value is found in R0 (or ac0??? not without FPU!!!! ) */#define FUNCTION_VALUE(VALTYPE, FUNC) \ gen_rtx (REG, TYPE_MODE (VALTYPE), BASE_RETURN_VALUE_REG(TYPE_MODE(VALTYPE)))/* and the called function leaves it in the first register. Difference only on machines with register windows. */#define FUNCTION_OUTGOING_VALUE(VALTYPE, FUNC) \ gen_rtx (REG, TYPE_MODE (VALTYPE), BASE_RETURN_VALUE_REG(TYPE_MODE(VALTYPE)))/* 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, BASE_RETURN_VALUE_REG(MODE))/* 1 if N is a possible register number for a function value as seen by the caller. On the pdp, the first "output" reg is the only register thus used. maybe ac0 ? - as option someday! */#define FUNCTION_VALUE_REGNO_P(N) (((N) == 0) || (TARGET_AC0 && (N) == 8))/* should probably return DImode and DFmode in memory,lest we fill up all regs! have to, else we crash - exception: maybe return result in ac0 if DFmode and FPU present - compatibility problem with libraries for non-floating point ...*/#define RETURN_IN_MEMORY(TYPE) \ (TYPE_MODE(TYPE) == DImode || (TYPE_MODE(TYPE) == DFmode && ! TARGET_AC0))/* 1 if N is a possible register number for function argument passing. - not used on pdp */#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.*/#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. ...., the offset normally starts at 0, but starts at 1 word when the function gets a structure-value-address as an invisible first argument. */#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT) \ ((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)) \ : (int_size_in_bytes (TYPE)))) /* Determine where to put an argument 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). */#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) 0/* Define where a function finds its arguments. This would be different from FUNCTION_ARG if we had register windows. *//*#define FUNCTION_INCOMING_ARG(CUM, MODE, TYPE, NAMED) \ FUNCTION_ARG (CUM, MODE, TYPE, NAMED)*//* 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. */#define FUNCTION_PROLOGUE(FILE, SIZE) \ output_function_prologue(FILE, SIZE);/* Output assembler code to FILE to increment profiler label # LABELNO for profiling a function entry. */#define FUNCTION_PROFILER(FILE, LABELNO) \ abort ();/* 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. */extern int may_call_alloca;extern int current_function_pretend_args_size;#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.*/#define FUNCTION_EPILOGUE(FILE, SIZE) \ output_function_epilogue(FILE, SIZE); #define INITIAL_FRAME_POINTER_OFFSET(DEPTH_VAR) \{ \ int offset, regno; \ offset = get_frame_size(); \ for (regno = 0; regno < 8; regno++) \ if (regs_ever_live[regno] && ! call_used_regs[regno]) \ offset += 2; \ for (regno = 8; regno < 14; regno++) \ if (regs_ever_live[regno] && ! call_used_regs[regno]) \ offset += 8; \ /* offset -= 2; no fp on stack frame */ \ (DEPTH_VAR) = offset; \}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -