📄 pdp11.h
字号:
/* 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) (1)/* 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; \ \ /* 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. */#define CASE_TAKES_INDEX_RAW/* Define as C expression which evaluates to nonzero if the tablejump instruction expects the table to contain offsets from the address of the table. Do not define this if the table should contain absolute addresses. *//* #define CASE_VECTOR_PC_RELATIVE 1 *//* Specify the tree operation to be used to convert reals to integers. */#define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR/* This is the kind of divide that is easiest to do in the general case. */#define EASY_DIV_EXPR TRUNC_DIV_EXPR/* Define this as 1 if `char' should by default be signed; else as 0. */#define DEFAULT_SIGNED_CHAR 1/* Max number of bytes we can move from memory to memory in one reasonably fast instruction. */#define MOVE_MAX 2/* Zero extension is faster if the target is known to be zero *//* #define SLOW_ZERO_EXTEND *//* Nonzero if access to memory by byte is slow and undesirable. -*/#define SLOW_BYTE_ACCESS 0/* Do not break .stabs pseudos into continuations. */#define DBX_CONTIN_LENGTH 0/* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits is done just by pretending it is already truncated. */#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1/* Add any extra modes needed to represent the condition code. CCFPmode is used for FPU, but should we use a separate reg? */#define EXTRA_CC_MODES CCFPmode/* the name for the mode above */#define EXTRA_CC_NAMES "CCFPmode"/* Give a comparison code (EQ, NE etc) and the first operand of a COMPARE, return the mode to be used for the comparison. For floating-point, CCFPmode should be used. */#define SELECT_CC_MODE(OP,X,Y) \(GET_MODE_CLASS(GET_MODE(X)) == MODE_FLOAT? CCFPmode : CCmode)/* We assume that the store-condition-codes instructions store 0 for false and some other value for true. This is the value stored for true. *//* #define STORE_FLAG_VALUE 1 *//* Specify the machine mode that pointers have. After generation of rtl, the compiler makes no further distinction between pointers and any other objects of this machine mode. */#define Pmode HImode/* A function address in a call instruction is a word address (for indexing purposes) so give the MEM rtx a word's mode. */#define FUNCTION_MODE HImode/* Define this if addresses of constant functions shouldn't be put through pseudo regs where they can be cse'd. Desirable on machines where ordinary constants are expensive but a CALL with constant address is cheap. *//* #define NO_FUNCTION_CSE *//* Compute the cost of computing a constant rtl expression RTX whose rtx-code is CODE. The body of this macro is a portion of a switch statement. If the code is computed here, return it with a return statement. Otherwise, break from the switch. -1, 0, 1 are cheaper for add, sub ... */#define CONST_COSTS(RTX,CODE,OUTER_CODE) \ case CONST_INT: \ if (INTVAL(RTX) == 0 \ || INTVAL(RTX) == -1 \ || INTVAL(RTX) == 1) \ return 0; \ case CONST: \ case LABEL_REF: \ case SYMBOL_REF: \ /* twice as expensive as REG */ \ return 2; \ case CONST_DOUBLE: \ /* twice (or 4 times) as expensive as 16 bit */ \ return 4;/* cost of moving one register class to another */#define REGISTER_MOVE_COST(CLASS1, CLASS2) register_move_cost(CLASS1, CLASS2)/* Tell emit-rtl.c how to initialize special values on a per-function base. */extern int optimize;extern struct rtx_def *cc0_reg_rtx;#define CC_STATUS_MDEP rtx#define CC_STATUS_MDEP_INIT (cc_status.mdep = 0)/* Tell final.c how to eliminate redundant test instructions. *//* Here we define machine-dependent flags and fields in cc_status (see `conditions.h'). */#define CC_IN_FPU 04000 /* Do UPDATE_CC if EXP is a set, used in NOTICE_UPDATE_CC floats only do compare correctly, else nullify ... get cc0 out soon ...*//* Store in cc_status the expressions that the condition codes will describe after execution of an instruction whose pattern is EXP. Do not alter them if the instruction would not alter the cc's. */#define NOTICE_UPDATE_CC(EXP, INSN) \{ if (GET_CODE (EXP) == SET) \ { \ notice_update_cc_on_set(EXP, INSN); \ } \ else if (GET_CODE (EXP) == PARALLEL \ && GET_CODE (XVECEXP (EXP, 0, 0)) == SET) \ { \ notice_update_cc_on_set(XVECEXP (EXP, 0, 0), INSN); \ } \ else if (GET_CODE (EXP) == CALL) \ { /* all bets are off */ CC_STATUS_INIT; } \ if (cc_status.value1 && GET_CODE (cc_status.value1) == REG \ && cc_status.value2 \ && reg_overlap_mentioned_p (cc_status.value1, cc_status.value2)) \ { \ printf ("here!\n"); \ cc_status.value2 = 0; \ } \}/* Control the assembler format that we output. *//* Output at beginning of assembler file. */#if 0#define ASM_FILE_START(FILE) \( \fprintf (FILE, "\t.data\n"), \fprintf (FILE, "$help$: . = .+8 ; space for tmp moves!\n") \/* do we need reg def's R0 = %0 etc ??? */ \)#else#define ASM_FILE_START(FILE) (0)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -