📄 pdp11.h
字号:
((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 nonzero 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/* 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;#define EXIT_IGNORE_STACK 1#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; \} /* Addressing modes, and classification of registers for them. */#define HAVE_POST_INCREMENT 1/* #define HAVE_POST_DECREMENT 0 */#define HAVE_PRE_DECREMENT 1/* #define HAVE_PRE_INCREMENT 0 *//* 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) < 8 || (unsigned) reg_renumber[REGNO] < 8)#define REGNO_OK_FOR_BASE_P(REGNO) \ ((REGNO) < 8 || (unsigned) reg_renumber[REGNO] < 8)/* Now macros that check whether X is a register and also, strictly, whether it is in a specified class.*//* 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. */#define LEGITIMATE_CONSTANT_P(X) (TARGET_FPU? 1: !(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) (1)/* 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) (1)#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.*/#define GO_IF_LEGITIMATE_ADDRESS(mode, operand, ADDR) \{ \ rtx xfoob; \ \ /* accept (R0) */ \ if (GET_CODE (operand) == REG \ && REG_OK_FOR_BASE_P(operand)) \ goto ADDR; \ \ /* accept @#address */ \ if (CONSTANT_ADDRESS_P (operand)) \ goto ADDR; \ \ /* accept X(R0) */ \ if (GET_CODE (operand) == PLUS \ && GET_CODE (XEXP (operand, 0)) == REG \ && REG_OK_FOR_BASE_P (XEXP (operand, 0)) \ && CONSTANT_ADDRESS_P (XEXP (operand, 1))) \ goto ADDR; \ \ /* accept -(R0) */ \ if (GET_CODE (operand) == PRE_DEC \ && GET_CODE (XEXP (operand, 0)) == REG \ && REG_OK_FOR_BASE_P (XEXP (operand, 0))) \ goto ADDR; \ \ /* accept (R0)+ */ \ if (GET_CODE (operand) == POST_INC \ && GET_CODE (XEXP (operand, 0)) == REG \ && REG_OK_FOR_BASE_P (XEXP (operand, 0))) \ goto ADDR; \ \ /* accept -(SP) -- which uses PRE_MODIFY for byte mode */ \ if (GET_CODE (operand) == PRE_MODIFY \ && GET_CODE (XEXP (operand, 0)) == REG \ && REGNO (XEXP (operand, 0)) == 6 \ && GET_CODE ((xfoob = XEXP (operand, 1))) == PLUS \ && GET_CODE (XEXP (xfoob, 0)) == REG \ && REGNO (XEXP (xfoob, 0)) == 6 \ && CONSTANT_P (XEXP (xfoob, 1)) \ && INTVAL (XEXP (xfoob,1)) == -2) \ goto ADDR; \ \ /* accept (SP)+ -- which uses POST_MODIFY for byte mode */ \ if (GET_CODE (operand) == POST_MODIFY \ && GET_CODE (XEXP (operand, 0)) == REG \ && REGNO (XEXP (operand, 0)) == 6 \ && GET_CODE ((xfoob = XEXP (operand, 1))) == PLUS \ && GET_CODE (XEXP (xfoob, 0)) == REG \ && REGNO (XEXP (xfoob, 0)) == 6 \ && CONSTANT_P (XEXP (xfoob, 1)) \ && INTVAL (XEXP (xfoob,1)) == 2) \ goto ADDR; \ \ \ /* handle another level of indirection ! */ \ if (GET_CODE(operand) != MEM) \ goto fail; \ \ xfoob = XEXP (operand, 0); \ \ /* (MEM:xx (MEM:xx ())) is not valid for SI, DI and currently */ \ /* also forbidden for float, because we have to handle this */ \ /* in output_move_double and/or output_move_quad() - we could */ \ /* do it, but currently it's not worth it!!! */ \ /* now that DFmode cannot go into CPU register file, */ \ /* maybe I should allow float ... */ \ /* but then I have to handle memory-to-memory moves in movdf ?? */ \ \ if (GET_MODE_BITSIZE(mode) > 16) \ goto fail; \ \ /* accept @(R0) - which is @0(R0) */ \ if (GET_CODE (xfoob) == REG \ && REG_OK_FOR_BASE_P(xfoob)) \ goto ADDR; \ \ /* accept @address */ \ if (CONSTANT_ADDRESS_P (xfoob)) \ goto ADDR; \ \ /* accept @X(R0) */ \ if (GET_CODE (xfoob) == PLUS \ && GET_CODE (XEXP (xfoob, 0)) == REG \ && REG_OK_FOR_BASE_P (XEXP (xfoob, 0)) \ && CONSTANT_ADDRESS_P (XEXP (xfoob, 1))) \ goto ADDR; \ \ /* accept @-(R0) */ \ if (GET_CODE (xfoob) == PRE_DEC \ && GET_CODE (XEXP (xfoob, 0)) == REG \ && REG_OK_FOR_BASE_P (XEXP (xfoob, 0))) \ goto ADDR; \ \ /* accept @(R0)+ */ \ if (GET_CODE (xfoob) == POST_INC \ && GET_CODE (XEXP (xfoob, 0)) == REG \ && REG_OK_FOR_BASE_P (XEXP (xfoob, 0))) \ goto ADDR; \ \ /* anything else is invalid */ \ fail: ; \}/* Try machine-dependent ways of modifying an illegitimate address to be legitimate. If we find one, return the new, valid address. This macro is used in only one place: `memory_address' in explow.c. OLDX is the address as it was before break_out_memory_refs was called. In some cases it is useful to look at this to decide what needs to be done. MODE and WIN are passed so that this macro can use GO_IF_LEGITIMATE_ADDRESS. It is always safe for this macro to do nothing. It exists to recognize opportunities to optimize the output. */#define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) {}/* Go to LABEL if ADDR (a legitimate address expression) has an effect that depends on the machine mode it is used for. On the pdp this is for predec/postinc */#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \ { if (GET_CODE (ADDR) == POST_INC || GET_CODE (ADDR) == PRE_DEC) \ goto LABEL; \ }/* Specify the machine mode that this machine uses for the index in the tablejump instruction. */#define CASE_VECTOR_MODE HImode/* Define this if a raw index is all that is needed for a `tablejump' insn. */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -