📄 i860.h
字号:
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 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/* Must pass floats to libgcc functions as doubles. */#define LIBGCC_NEEDS_DOUBLE 1#define DIVSI3_LIBCALL "*.div"#define UDIVSI3_LIBCALL "*.udiv"#define REMSI3_LIBCALL "*.rem"#define UREMSI3_LIBCALL "*.urem"/* 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/* 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. */#define CONST_COSTS(RTX,CODE, OUTER_CODE) \ case CONST_INT: \ if (INTVAL (RTX) == 0) \ return 0; \ if (INTVAL (RTX) < 0x2000 && INTVAL (RTX) >= -0x2000) return 1; \ case CONST: \ case LABEL_REF: \ case SYMBOL_REF: \ return 4; \ case CONST_DOUBLE: \ return 6;/* 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_BYTE_OP "\t.byte"#define ASM_SHORT "\t.short"#define ASM_LONG "\t.long"#define ASM_DOUBLE "\t.double"/* Output at beginning of assembler file. *//* The .file command should always begin the output. */#define ASM_FILE_START(FILE)#if 0#define ASM_FILE_START(FILE) \ do { output_file_directive ((FILE), main_input_filename); \ if (optimize) ASM_FILE_START_1 (FILE); \ } while (0)#endif#define ASM_FILE_START_1(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 \{"r0", "r1", "sp", "fp", "r4", "r5", "r6", "r7", "r8", "r9", \ "r10", "r11", "r12", "r13", "r14", "r15", "r16", "r17", "r18", "r19", \ "r20", "r21", "r22", "r23", "r24", "r25", "r26", "r27", "r28", "r29", \ "r30", "r31", \ "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", \ "f10", "f11", "f12", "f13", "f14", "f15", "f16", "f17", "f18", "f19", \ "f20", "f21", "f22", "f23", "f24", "f25", "f26", "f27", "f28", "f29", \ "f30", "f31" }/* How to renumber registers for dbx and gdb. */#define DBX_REGISTER_NUMBER(REGNO) (REGNO)/* This is how to output the definition of a user-level label named NAME, such as the label on a static function or variable NAME. */#define ASM_OUTPUT_LABEL(FILE,NAME) \ do { assemble_name (FILE, NAME); fputs (":\n", FILE); } while (0)/* This is how to output a command to make the user-level label named NAME defined for reference from other files. */#define ASM_GLOBALIZE_LABEL(FILE,NAME) \ do { fputs (".globl ", FILE); \ assemble_name (FILE, NAME); \ fputs ("\n", FILE); \ } while (0)/* The prefix to add to user-visible assembler symbols. This definition is overridden in i860v4.h because under System V Release 4, user-level symbols are *not* prefixed with underscores in the generated assembly code. */#define USER_LABEL_PREFIX "_"/* This is how to output an internal numbered label where PREFIX is the class of label and NUM is the number within the class. */#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \ fprintf (FILE, ".%s%d:\n", PREFIX, NUM)/* This is how to output an internal numbered label which labels a jump table. */#undef ASM_OUTPUT_CASE_LABEL#define ASM_OUTPUT_CASE_LABEL(FILE, PREFIX, NUM, JUMPTABLE) \do { ASM_OUTPUT_ALIGN ((FILE), 2); \ ASM_OUTPUT_INTERNAL_LABEL ((FILE), PREFIX, NUM); \ } while (0)/* Output at the end of a jump table. */#define ASM_OUTPUT_CASE_END(FILE,NUM,INSN) \ fprintf (FILE, ".text\n")
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -