📄 i960.h
字号:
/* #define HAVE_PRE_DECREMENT 0 *//* #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) < 32 || (unsigned) reg_renumber[REGNO] < 32)#define REGNO_OK_FOR_BASE_P(REGNO) \ ((REGNO) < 32 || (unsigned) reg_renumber[REGNO] < 32)#define REGNO_OK_FOR_FP_P(REGNO) \ ((REGNO) < 36 || (unsigned) reg_renumber[REGNO] < 36)/* 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 960, and may be used only in code for printing assembler insns and in conditions for define_optimization. *//* 1 if X is an fp register. */#define FP_REG_P(X) (REGNO (X) >= 32 && REGNO (X) < 36)/* Maximum number of registers that can appear in a valid memory address. */#define MAX_REGS_PER_ADDRESS 2#define CONSTANT_ADDRESS_P(X) \ (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \ || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST \ || GET_CODE (X) == HIGH)/* LEGITIMATE_CONSTANT_P is nonzero if the constant value X is a legitimate general operand. It is given that X satisfies CONSTANT_P. Anything but a CONST_DOUBLE can be made to work, excepting 0.0 and 1.0. ??? This probably should be defined to 1. */#define LEGITIMATE_CONSTANT_P(X) \ ((GET_CODE (X) != CONST_DOUBLE) || fp_literal ((X), GET_MODE (X)))/* 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) < 32 || REGNO (X) >= FIRST_PSEUDO_REGISTER)/* 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) < 32 || REGNO (X) >= FIRST_PSEUDO_REGISTER)#define REG_OK_FOR_INDEX_P_STRICT(X) REGNO_OK_FOR_INDEX_P (REGNO (X))#define REG_OK_FOR_BASE_P_STRICT(X) REGNO_OK_FOR_BASE_P (REGNO (X))#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. On 80960, legitimate addresses are: base ld (g0),r0 disp (12 or 32 bit) ld foo,r0 base + index ld (g0)[g1*1],r0 base + displ ld 0xf00(g0),r0 base + index*scale + displ ld 0xf00(g0)[g1*4],r0 index*scale + base ld (g0)[g1*4],r0 index*scale + displ ld 0xf00[g1*4],r0 index*scale ld [g1*4],r0 index + base + displ ld 0xf00(g0)[g1*1],r0 In each case, scale can be 1, 2, 4, 8, or 16. *//* Returns 1 if the scale factor of an index term is valid. */#define SCALE_TERM_P(X) \ (GET_CODE (X) == CONST_INT \ && (INTVAL (X) == 1 || INTVAL (X) == 2 || INTVAL (X) == 4 \ || INTVAL(X) == 8 || INTVAL (X) == 16))#ifdef REG_OK_STRICT#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \ { if (legitimate_address_p (MODE, X, 1)) goto ADDR; }#else#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \ { if (legitimate_address_p (MODE, X, 0)) goto ADDR; }#endif/* 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. *//* On 80960, convert non-canonical addresses to canonical form. */extern struct rtx_def *legitimize_address ();#define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN) \{ rtx orig_x = (X); \ (X) = legitimize_address (X, OLDX, MODE); \ if ((X) != orig_x && memory_address_p (MODE, X)) \ goto 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 960 this is never true. */#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL)/* Specify the machine mode that this machine uses for the index in the tablejump instruction. */#define CASE_VECTOR_MODE SImode/* 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 0/* Allow and ignore #sccs directives. */#define SCCS_DIRECTIVE/* Max number of bytes we can move from memory to memory in one reasonably fast instruction. */#define MOVE_MAX 16/* Define if operations between registers always perform the operation on the full register even if a narrower mode is specified. */#define WORD_REGISTER_OPERATIONS/* Define if loading in MODE, an integral mode narrower than BITS_PER_WORD will either zero-extend or sign-extend. The value of this macro should be the code that says which one of the two operations is implicitly done, NIL if none. */#define LOAD_EXTEND_OP(MODE) ZERO_EXTEND/* Nonzero if access to memory by bytes is no faster than for words. Value changed to 1 after reports of poor bitfield code with g++. Indications are that code is usually as good, sometimes better. */ #define SLOW_BYTE_ACCESS 1/* Force sizeof(bool) == 1 to maintain binary compatibility; otherwise, the change in SLOW_BYTE_ACCESS would have changed it to 4. */#define BOOL_TYPE_SIZE CHAR_TYPE_SIZE/* 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/* Define this to be nonzero if shift instructions ignore all but the low-order few bits. */#define SHIFT_COUNT_TRUNCATED 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/* 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 SImode/* Specify the widest mode that BLKmode objects can be promoted to */#define MAX_FIXED_MODE_SIZE GET_MODE_BITSIZE (TImode)/* These global variables are used to pass information between cc setter and cc user at insn emit time. */extern struct rtx_def *i960_compare_op0, *i960_compare_op1;/* Define the function that build the compare insn for scc and bcc. */extern struct rtx_def *gen_compare_reg ();/* Add any extra modes needed to represent the condition code. Also, signed and unsigned comparisons are distinguished, as are operations which are compatible with chkbit insns. */#define EXTRA_CC_MODES CC_UNSmode, CC_CHKmode/* Define the names for the modes specified above. */#define EXTRA_CC_NAMES "CC_UNS", "CC_CHK"/* Given 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. CC_NOOVmode should be used when the first operand is a PLUS, MINUS, or NEG. CCmode should be used when no special processing is needed. */#define SELECT_CC_MODE(OP,X,Y) select_cc_mode (OP, X)/* A function address in a call instruction is a byte address (for indexing purposes) so give the MEM rtx a byte's mode. */#define FUNCTION_MODE SImode/* 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/* Use memcpy, etc. instead of bcopy. */#ifndef WIND_RIVER#define TARGET_MEM_FUNCTIONS 1#endif/* 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. *//* Constants that can be (non-ldconst) insn operands are cost 0. Constants that can be non-ldconst operands in rare cases are cost 1. Other constants have higher costs. *//* Must check for OUTER_CODE of SET for power2_operand, because reload_cse_move2add calls us with OUTER_CODE of PLUS to decide when to replace set with add. */#define CONST_COSTS(RTX, CODE, OUTER_CODE) \ case CONST_INT: \ if ((INTVAL (RTX) >= 0 && INTVAL (RTX) < 32) \ || (OUTER_CODE == SET && power2_operand (RTX, VOIDmode))) \ return 0; \ else if (INTVAL (RTX) >= -31 && INTVAL (RTX) < 0) \ return 1; \ case CONST: \ case LABEL_REF: \ case SYMBOL_REF: \ return (TARGET_C_SERIES ? 6 : 8); \ case CONST_DOUBLE: \ if ((RTX) == CONST0_RTX (DFmode) || (RTX) == CONST0_RTX (SFmode) \ || (RTX) == CONST1_RTX (DFmode) || (RTX) == CONST1_RTX (SFmode))\ return 1; \ return 12;/* The i960 offers addressing modes which are "as cheap as a register". See i960.c (or gcc.texinfo) for details. */#define ADDRESS_COST(RTX) \ (GET_CODE (RTX) == REG ? 1 : i960_address_cost (RTX))/* Control the assembler format that we output. *//* Output at beginning of assembler file. */#define ASM_FILE_START(file)/* Output to assembler file text saying following lines may contain character constants, extra white space, comments, etc. */#define ASM_APP_ON ""/* Output to assembler file text saying following lines no longer contain unusual constructs. */#define ASM_APP_OFF ""/* Output before read-only data. */#define TEXT_SECTION_ASM_OP ".text"/* Output before writable data. */#define DATA_SECTION_ASM_OP ".data"/* How to refer to registers in assembler output. This sequence is indexed by compiler's hard-register-number (see above). */#define REGISTER_NAMES { \ "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7", \ "g8", "g9", "g10", "g11", "g12", "g13", "g14", "fp", \ "pfp","sp", "rip", "r3", "r4", "r5", "r6", "r7", \ "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", \ "fp0","fp1","fp2", "fp3", "cc", "fake" }/* How to renumber registers for dbx and gdb. In the 960 encoding, g0..g15 are registers 16..31. */#define DBX_REGISTER_NUMBER(REGNO) \ (((REGNO) < 16) ? (REGNO) + 16 \ : (((REGNO) > 31) ? (REGNO) : (REGNO) - 16))/* Don't emit dbx records longer than this. This is an arbitrary value. */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -