📄 i860.h
字号:
/* Addressing modes, and classification of registers for them. *//* #define HAVE_POST_INCREMENT 0 *//* #define HAVE_POST_DECREMENT 0 *//* #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) ^ 0x20) < 32 || (unsigned) (reg_renumber[REGNO] ^ 0x20) < 32)/* 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 i860, 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) (REG_P (X) && REGNO_OK_FOR_FP_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) \ (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \ || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST \ || GET_CODE (X) == HIGH)/* Nonzero if the constant value X is a legitimate general operand. It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. On the Sparc, this is anything but a CONST_DOUBLE. Let's try permitting CONST_DOUBLEs and see what happens. */#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) (((unsigned) REGNO (X)) - 32 >= 14)/* 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) (((unsigned) REGNO (X)) - 32 >= 14)#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 the i860, the actual addresses must be REG+REG or REG+SMALLINT. But we can treat a SYMBOL_REF as legitimate if it is part of this function's constant-pool, because such addresses can actually be output as REG+SMALLINT. The displacement in an address must be a multiple of the alignment. Try making SYMBOL_REF (and other things which are CONSTANT_ADDRESS_P) a legitimate address, regardless. Because the only insns which can use memory are load or store insns, the added hair in the machine description is not that bad. It should also speed up the compiler by halving the number of insns it must manage for each (MEM (SYMBOL_REF ...)) involved. */#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \{ if (GET_CODE (X) == REG) \ { if (REG_OK_FOR_BASE_P (X)) goto ADDR; } \ else if (GET_CODE (X) == PLUS) \ { \ if (GET_CODE (XEXP (X, 0)) == REG \ && REG_OK_FOR_BASE_P (XEXP (X, 0))) \ { \ if (GET_CODE (XEXP (X, 1)) == CONST_INT \ && INTVAL (XEXP (X, 1)) >= -0x8000 \ && INTVAL (XEXP (X, 1)) < 0x8000 \ && (INTVAL (XEXP (X, 1)) & (GET_MODE_SIZE (MODE) - 1)) == 0) \ goto ADDR; \ } \ else if (GET_CODE (XEXP (X, 1)) == REG \ && REG_OK_FOR_BASE_P (XEXP (X, 1))) \ { \ if (GET_CODE (XEXP (X, 0)) == CONST_INT \ && INTVAL (XEXP (X, 0)) >= -0x8000 \ && INTVAL (XEXP (X, 0)) < 0x8000 \ && (INTVAL (XEXP (X, 0)) & (GET_MODE_SIZE (MODE) - 1)) == 0) \ goto ADDR; \ } \ } \ else if (CONSTANT_ADDRESS_P (X)) \ goto ADDR; \}/* 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 the i860, change COMPLICATED + CONSTANT to REG+CONSTANT. Also change a symbolic constant to a REG, though that may not be necessary. */#define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) \{ if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == MULT) \ (X) = gen_rtx_PLUS (SImode, XEXP (X, 1), \ force_operand (XEXP (X, 0), 0)); \ if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 1)) == MULT) \ (X) = gen_rtx_PLUS (SImode, XEXP (X, 0), \ force_operand (XEXP (X, 1), 0)); \ if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == PLUS) \ (X) = gen_rtx_PLUS (SImode, XEXP (X, 1), \ force_operand (XEXP (X, 0), 0)); \ if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 1)) == PLUS) \ (X) = gen_rtx_PLUS (SImode, XEXP (X, 0), \ force_operand (XEXP (X, 1), 0)); \ if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) != REG \ && GET_CODE (XEXP (X, 0)) != CONST_INT) \ (X) = gen_rtx_PLUS (SImode, XEXP (X, 1), \ copy_to_mode_reg (SImode, XEXP (X, 0))); \ if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 1)) != REG \ && GET_CODE (XEXP (X, 1)) != CONST_INT) \ (X) = gen_rtx_PLUS (SImode, XEXP (X, 0), \ copy_to_mode_reg (SImode, XEXP (X, 1))); \ if (GET_CODE (x) == SYMBOL_REF) \ (X) = copy_to_reg (X); \ if (GET_CODE (x) == CONST) \ (X) = copy_to_reg (X); \ if (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 i860 this is never true. There are some addresses that are invalid in wide modes but valid for narrower modes, but they shouldn't affect the places that use this macro. */#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 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 16/* Nonzero if access to memory by bytes is slow and undesirable. */#define SLOW_BYTE_ACCESS 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/* Value is 1 if it generates better code to perform an unsigned comparison on the given literal integer value in the given mode when we are only looking for an equal/non-equal result. *//* For the i860, if the immediate value has its high-order 27 bits zero, then we want to engineer an unsigned comparison for EQ/NE because such values can fit in the 5-bit immediate field of a bte or btne instruction (which gets zero extended before comparing). For all other immediate values on the i860, we will use signed compares because that avoids the need for doing explicit xor's to zero_extend the non-constant operand in cases where it was (mem:QI ...) or a (mem:HI ...) which always gets automatically sign-extended by the hardware upon loading. */#define LITERAL_COMPARE_BETTER_UNSIGNED(intval, mode) \ (((unsigned) (intval) & 0x1f) == (unsigned) (intval))/* 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/* 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/* Specify the cost of a branch insn; roughly the number of extra insns that should be added to avoid a branch. Set this to 3 on the i860 since branches may often take three cycles. */#define BRANCH_COST 3/* Tell final.c how to eliminate redundant test instructions. *//* Here we define machine-dependent flags and fields in cc_status (see `conditions.h'). *//* This holds the value sourcing h%r31. We keep this info around so that mem/mem ops, such as increment and decrement, etc, can be performed reasonably. */#define CC_STATUS_MDEP rtx#define CC_STATUS_MDEP_INIT (cc_status.mdep = 0)#define CC_NEGATED 01000/* We use this macro in those places in the i860.md file where we would normally just do a CC_STATUS_INIT (for other machines). This macro differs from CC_STATUS_INIT in that it doesn't mess with the special bits or fields which describe what is currently in the special r31 scratch register, but it does clear out everything that actually relates to the condition code bit of the i860. */#define CC_STATUS_PARTIAL_INIT \ (cc_status.flags &= (CC_KNOW_HI_R31 | CC_HI_R31_ADJ), \ cc_status.value1 = 0, \ cc_status.value2 = 0)/* Nonzero if we know the value of h%r31. */#define CC_KNOW_HI_R31 0100000/* Nonzero if h%r31 is actually ha%something, rather than h%something. */#define CC_HI_R31_ADJ 0200000/* 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. *//* On the i860, only compare insns set a useful condition code. */#define NOTICE_UPDATE_CC(EXP, INSN) \{ cc_status.flags &= (CC_KNOW_HI_R31 | CC_HI_R31_ADJ); \ cc_status.value1 = 0; cc_status.value2 = 0; }/* Control the assembler format that we output. *//* Assembler pseudos to introduce constants of various size. */#define ASM_DOUBLE "\t.double"/* 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 "\t.text"/* Output before writable data. */#define DATA_SECTION_ASM_OP "\t.data"/* How to refer to registers in assembler output. This sequence is indexed by compiler's hard-register-number (see above). */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -