📄 arm.h
字号:
goto LABEL; \ else if ((MODE) == TImode) \ ; \ else if ((MODE) == DImode || (TARGET_SOFT_FLOAT && (MODE) == DFmode)) \ { \ if (GET_CODE (X) == PLUS && BASE_REGISTER_RTX_P (XEXP (X, 0)) \ && GET_CODE (XEXP (X, 1)) == CONST_INT) \ { \ HOST_WIDE_INT val = INTVAL (XEXP (X, 1)); \ if (val == 4 || val == -4 || val == -8) \ goto LABEL; \ } \ } \ else if (GET_CODE (X) == PLUS) \ { \ rtx xop0 = XEXP(X,0); \ rtx xop1 = XEXP(X,1); \ \ if (BASE_REGISTER_RTX_P (xop0)) \ GO_IF_LEGITIMATE_INDEX (MODE, REGNO (xop0), xop1, LABEL); \ else if (BASE_REGISTER_RTX_P (xop1)) \ GO_IF_LEGITIMATE_INDEX (MODE, REGNO (xop1), xop0, LABEL); \ } \ /* Reload currently can't handle MINUS, so disable this for now */ \ /* else if (GET_CODE (X) == MINUS) \ { \ rtx xop0 = XEXP (X,0); \ rtx xop1 = XEXP (X,1); \ \ if (BASE_REGISTER_RTX_P (xop0)) \ GO_IF_LEGITIMATE_INDEX (MODE, -1, xop1, LABEL); \ } */ \ else if (GET_MODE_CLASS (MODE) != MODE_FLOAT \ && GET_CODE (X) == SYMBOL_REF \ && CONSTANT_POOL_ADDRESS_P (X)) \ goto LABEL; \ else if ((GET_CODE (X) == PRE_INC || GET_CODE (X) == POST_DEC) \ && (GET_MODE_SIZE (MODE) <= 4) \ && GET_CODE (XEXP (X, 0)) == REG \ && REG_OK_FOR_PRE_POST_P (XEXP (X, 0))) \ goto LABEL; \}/* 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 ARM, try to convert [REG, #BIGCONST] into ADD BASE, REG, #UPPERCONST and [BASE, #VALIDCONST], where VALIDCONST == 0 in case of TImode. */extern struct rtx_def *legitimize_pic_address ();#define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN) \{ \ if (GET_CODE (X) == PLUS) \ { \ rtx xop0 = XEXP (X, 0); \ rtx xop1 = XEXP (X, 1); \ \ if (CONSTANT_P (xop0) && ! symbol_mentioned_p (xop0)) \ xop0 = force_reg (SImode, xop0); \ if (CONSTANT_P (xop1) && ! symbol_mentioned_p (xop1)) \ xop1 = force_reg (SImode, xop1); \ if (BASE_REGISTER_RTX_P (xop0) && GET_CODE (xop1) == CONST_INT) \ { \ HOST_WIDE_INT n, low_n; \ rtx base_reg, val; \ n = INTVAL (xop1); \ \ if (MODE == DImode || (TARGET_SOFT_FLOAT && MODE == DFmode)) \ { \ low_n = n & 0x0f; \ n &= ~0x0f; \ if (low_n > 4) \ { \ n += 16; \ low_n -= 16; \ } \ } \ else \ { \ low_n = ((MODE) == TImode ? 0 \ : n >= 0 ? (n & 0xfff) : -((-n) & 0xfff)); \ n -= low_n; \ } \ base_reg = gen_reg_rtx (SImode); \ val = force_operand (gen_rtx (PLUS, SImode, xop0, \ GEN_INT (n)), NULL_RTX); \ emit_move_insn (base_reg, val); \ (X) = (low_n == 0 ? base_reg \ : gen_rtx (PLUS, SImode, base_reg, GEN_INT (low_n))); \ } \ else if (xop0 != XEXP (X, 0) || xop1 != XEXP (x, 1)) \ (X) = gen_rtx (PLUS, SImode, xop0, xop1); \ } \ else if (GET_CODE (X) == MINUS) \ { \ rtx xop0 = XEXP (X, 0); \ rtx xop1 = XEXP (X, 1); \ \ if (CONSTANT_P (xop0)) \ xop0 = force_reg (SImode, xop0); \ if (CONSTANT_P (xop1) && ! symbol_mentioned_p (xop1)) \ xop1 = force_reg (SImode, xop1); \ if (xop0 != XEXP (X, 0) || xop1 != XEXP (X, 1)) \ (X) = gen_rtx (MINUS, SImode, xop0, xop1); \ } \ if (flag_pic) \ (X) = legitimize_pic_address (OLDX, MODE, NULL_RTX); \ 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. */#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \{ \ if (GET_CODE(ADDR) == PRE_DEC || GET_CODE(ADDR) == POST_DEC \ || GET_CODE(ADDR) == PRE_INC || GET_CODE(ADDR) == POST_INC) \ goto LABEL; \}/* Specify the machine mode that this machine uses for the index in the tablejump instruction. */#define CASE_VECTOR_MODE SImode/* Define this 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 *//* 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/* signed 'char' is most compatible, but RISC OS wants it unsigned. unsigned is probably best, but may break some code. */#ifndef DEFAULT_SIGNED_CHAR#define DEFAULT_SIGNED_CHAR 0#endif/* Don't cse the address of the function being compiled. */#define NO_RECURSIVE_FUNCTION_CSE 1/* Max number of bytes we can move from memory to memory in one reasonably fast instruction. */#define MOVE_MAX 4/* 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) \ ((arm_arch4 || (MODE) == QImode) ? ZERO_EXTEND \ : ((BYTES_BIG_ENDIAN && (MODE) == HImode) ? SIGN_EXTEND : NIL))/* Define this if zero-extension is slow (more than one real instruction). On the ARM, it is more than one instruction only if not fetching from memory. *//* #define SLOW_ZERO_EXTEND *//* Nonzero if access to memory by bytes is slow and undesirable. */#define SLOW_BYTE_ACCESS 0/* Immediate shift counts are truncated by the output routines (or was it the assembler?). Shift counts in a register are truncated by ARM. Note that the native compiler puts too large (> 32) immediate shift counts into a register and shifts by the register, letting the ARM decide what to do instead of doing that itself. *//* This is all wrong. Defining SHIFT_COUNT_TRUNCATED tells combine that code like (X << (Y % 32)) for register X, Y is equivalent to (X << Y). On the arm, Y in a register is used modulo 256 for the shift. Only for rotates is modulo 32 used. *//* #define SHIFT_COUNT_TRUNCATED 1 *//* All integers have the same format so truncation is easy. */#define TRULY_NOOP_TRUNCATION(OUTPREC,INPREC) 1/* Calling from registers is a massive pain. */#define NO_FUNCTION_CSE 1/* Chars and shorts should be passed as ints. */#define PROMOTE_PROTOTYPES 1/* The machine modes of pointers and functions */#define Pmode SImode#define FUNCTION_MODE Pmode/* The structure type of the machine dependent info field of insns No uses for this yet. *//* #define INSN_MACHINE_INFO struct machine_info *//* The relative costs of various types of constants. Note that cse.c defines REG = 1, SUBREG = 2, any node = (2 + sum of subnodes). */#define CONST_COSTS(RTX, CODE, OUTER_CODE) \ case CONST_INT: \ if (const_ok_for_arm (INTVAL (RTX))) \ return (OUTER_CODE) == SET ? 2 : -1; \ else if (OUTER_CODE == AND \ && const_ok_for_arm (~INTVAL (RTX))) \ return -1; \ else if ((OUTER_CODE == COMPARE \ || OUTER_CODE == PLUS || OUTER_CODE == MINUS) \ && const_ok_for_arm (-INTVAL (RTX))) \ return -1; \ else \ return 5; \ case CONST: \ case LABEL_REF: \ case SYMBOL_REF: \ return 6; \ case CONST_DOUBLE: \ if (const_double_rtx_ok_for_fpu (RTX)) \ return (OUTER_CODE) == SET ? 2 : -1; \ else if (((OUTER_CODE) == COMPARE || (OUTER_CODE) == PLUS) \ && neg_const_double_rtx_ok_for_fpu (RTX)) \ return -1; \ return(7);#define ARM_FRAME_RTX(X) \ ((X) == frame_pointer_rtx || (X) == stack_pointer_rtx \ || (X) == arg_pointer_rtx)#define RTX_COSTS(X,CODE,OUTER_CODE) \ default: \ return arm_rtx_costs (X, CODE, OUTER_CODE);/* Moves to and from memory are quite expensive */#define MEMORY_MOVE_COST(MODE) 10/* All address computations that can be done are free, but rtx cost returns the same for practically all of them. So we weight the different types of address here in the order (most pref first): PRE/POST_INC/DEC, SHIFT or NON-INT sum, INT sum, REG, MEM or LABEL. */#define ADDRESS_COST(X) \ (10 - ((GET_CODE (X) == MEM || GET_CODE (X) == LABEL_REF \ || GET_CODE (X) == SYMBOL_REF) \ ? 0 \ : ((GET_CODE (X) == PRE_INC || GET_CODE (X) == PRE_DEC \ || GET_CODE (X) == POST_INC || GET_CODE (X) == POST_DEC) \ ? 10 \ : (((GET_CODE (X) == PLUS || GET_CODE (X) == MINUS) \ ? 6 + (GET_CODE (XEXP (X, 1)) == CONST_INT ? 2 \ : ((GET_RTX_CLASS (GET_CODE (XEXP (X, 0))) == '2' \ || GET_RTX_CLASS (GET_CODE (XEXP (X, 0))) == 'c' \ || GET_RTX_CLASS (GET_CODE (XEXP (X, 1))) == '2' \ || GET_RTX_CLASS (GET_CODE (XEXP (X, 1))) == 'c') \ ? 1 : 0)) \ : 4))))) /* Try to generate sequences that don't involve branches, we can then use conditional instructions */#define BRANCH_COST 4/* A C statement to update the variable COST based on the relationship between INSN that is dependent on DEP through dependence LINK. */#define ADJUST_COST(INSN,LINK,DEP,COST) \ (COST) = arm_adjust_cost ((INSN), (LINK), (DEP), (COST))/* Position Independent Code. *//* We decide which register to use based on the compilation options and the assembler in use; this is more general than the APCS restriction of using sb (r9) all the time. */extern int arm_pic_register;/* The register number of the register used to address a table of static data addresses in memory. */#define PIC_OFFSET_TABLE_REGNUM arm_pic_register#define FINALIZE_PIC arm_finalize_pic ()#define LEGITIMATE_PIC_OPERAND_P(X) (! symbol_mentioned_p (X)) /* Condition code information. *//* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE, return the mode to be used for the comparison. CCFPEmode should be used with floating inequalities, CCFPmode should be used with floating equalities. CC_NOOVmode should be used with SImode integer equalities. CC_Zmode should be used if only the Z flag is set correctly CCmode should be used otherwise. */#define EXTRA_CC_MODES CC_NOOVmode, CC_Zmode, CC_SWPmode, \ CCFPmode, CCFPEmode, CC_DNEmode, CC_DEQmode, CC_DLEmode, \ CC_DLTmode, CC_DGEmode, CC_DGTmode, CC_DLEUmode, CC_DLTUmode, \ CC_DGEUmode, CC_DGTUmode, CC_Cmode#define EXTRA_CC_NAMES "CC_NOOV", "CC_Z", "CC_SWP", "CCFP", "CCFPE", \ "CC_DNE", "CC_DEQ", "CC_DLE", "CC_DLT", "CC_DGE", "CC_DGT", "CC_DLEU", \ "CC_DLTU", "CC_DGEU", "CC_DGTU", "CC_C"enum machine_mode arm_select_cc_mode ();#define SELECT_CC_MODE(OP,X,Y) arm_select_cc_mode ((OP), (X), (Y))#define REVERSIBLE_CC_MODE(MODE) ((MODE) != CCFPEmode)enum rtx_code arm_canonicalize_comparison ();#define CANONICALIZE_COMPARISON(CODE,OP0,OP1) \do \{ \ if (GET_CODE (OP1) == CONST_INT \ && ! (const_ok_for_arm (INTVAL (OP1)) \ || (const_ok_for_arm (- INTVAL (OP1))))) \ { \ rtx const_op = OP1; \ CODE = arm_canonicalize_comparison ((CODE), &const_op); \ } \} while (0)#define STORE_FLAG_VALUE 1/* Define the information needed to generate branch insns. This is stored from the compare operation. Note that we can't use "rtx" here since it hasn't been defined! */extern struct rtx_def *arm_compare_op0, *arm_compare_op1;extern int arm_compare_fp;/* Define the codes that are matched by predicates in arm.c */#define PREDICATE_CODES \ {"s_register_operand", {SUBREG, REG}}, \ {"f_register_operand", {SUBREG, REG}}, \ {"arm_add_operand", {SUBREG, REG, CONST_INT}}, \ {"fpu_add_operand", {SUBREG, REG, CONST_DOUB
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -