📄 pa.h
字号:
/* 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) && (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) && (REGNO (X) < 32 || REGNO (X) > FIRST_PSEUDO_REGISTER))#define EXTRA_CONSTRAINT(OP, C) \ ((C) == 'Q' ? \ ((GET_CODE (OP) == MEM \ && memory_address_p (GET_MODE (OP), XEXP (OP, 0)) \ && ! symbolic_memory_operand (OP, VOIDmode))) \ : ((C) == 'R' ? \ (GET_CODE (OP) == LO_SUM \ && GET_CODE (XEXP (OP, 0)) == REG \ && REG_OK_FOR_BASE_P (XEXP (OP, 0))) \ : ((C) == 'S' \ ? CONSTANT_P (OP) || memory_address_p (Pmode, OP)\ : ((C) == 'T' ? short_memory_operand (OP, VOIDmode) : 0))))\#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))#define EXTRA_CONSTRAINT(OP, C) \ (((C) == 'Q' || (C) == 'T') ? \ (GET_CODE (OP) == REG ? \ (REGNO (OP) >= FIRST_PSEUDO_REGISTER \ && reg_renumber[REGNO (OP)] < 0) \ : GET_CODE (OP) == MEM) \ : ((C) == 'R' ? \ (GET_CODE (OP) == LO_SUM \ && GET_CODE (XEXP (OP, 0)) == REG \ && REG_OK_FOR_BASE_P (XEXP (OP, 0))) \ : (CONSTANT_P (OP) \ || (GET_CODE (OP) == REG && reg_renumber[REGNO (OP)] > 0)\ || strict_memory_address_p (Pmode, OP))))#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 HP-PA, the actual legitimate addresses must be REG+REG, REG+(REG*SCALE) 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. */#define VAL_5_BITS_P(X) ((unsigned)(X) + 0x10 < 0x20)#define INT_5_BITS(X) VAL_5_BITS_P (INTVAL (X))#define VAL_U5_BITS_P(X) ((unsigned)(X) < 0x20)#define INT_U5_BITS(X) VAL_U5_BITS_P (INTVAL (X))#define VAL_11_BITS_P(X) ((unsigned)(X) + 0x400 < 0x800)#define INT_11_BITS(X) VAL_11_BITS_P (INTVAL (X))#define VAL_14_BITS_P(X) ((unsigned)(X) + 0x2000 < 0x4000)#define INT_14_BITS(X) VAL_14_BITS_P (INTVAL (X))#define FITS_14_BITS(X) \ (GET_CODE (X) == CONST_INT && INT_14_BITS (X))#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \{ \ if ((REG_P (X) && REG_OK_FOR_BASE_P (X)) \ || ((GET_CODE (X) == PRE_DEC || GET_CODE (X) == POST_DEC \ || GET_CODE (X) == PRE_INC || GET_CODE (X) == POST_INC) \ && REG_P (XEXP (X, 0)) \ && REG_OK_FOR_BASE_P (XEXP (X, 0)))) \ goto ADDR; \ else if (GET_CODE (X) == PLUS) \ { \ rtx base = 0, index; \ if (flag_pic && XEXP (X, 0) == pic_offset_table_rtx)\ { \ if (GET_CODE (XEXP (X, 1)) == REG \ && REG_OK_FOR_BASE_P (XEXP (X, 1))) \ goto ADDR; \ else if (flag_pic == 1 \ && GET_CODE (XEXP (X, 1)) != REG \ && GET_CODE (XEXP (X, 1)) != LO_SUM \ && GET_CODE (XEXP (X, 1)) != MEM) \ goto ADDR; \ } \ else if (REG_P (XEXP (X, 0)) \ && REG_OK_FOR_BASE_P (XEXP (X, 0))) \ base = XEXP (X, 0), index = XEXP (X, 1); \ else if (REG_P (XEXP (X, 1)) \ && REG_OK_FOR_BASE_P (XEXP (X, 1))) \ base = XEXP (X, 1), index = XEXP (X, 0); \ if (base != 0) \ if (GET_CODE (index) == CONST_INT \ && ((INT_14_BITS (index) && (MODE) != SFmode && (MODE) != DFmode) \ || INT_5_BITS (index))) \ goto ADDR; \ } \ else if (GET_CODE (X) == LO_SUM \ && GET_CODE (XEXP (X, 0)) == REG \ && REG_OK_FOR_BASE_P (XEXP (X, 0)) \ && CONSTANT_P (XEXP (X, 1)) \ && (MODE) != SFmode \ && (MODE) != DFmode) \ goto ADDR; \ else if (GET_CODE (X) == LO_SUM \ && GET_CODE (XEXP (X, 0)) == SUBREG \ && GET_CODE (SUBREG_REG (XEXP (X, 0))) == REG\ && REG_OK_FOR_BASE_P (SUBREG_REG (XEXP (X, 0)))\ && CONSTANT_P (XEXP (X, 1)) \ && (MODE) != SFmode \ && (MODE) != DFmode) \ goto ADDR; \ else if (GET_CODE (X) == LABEL_REF \ || (GET_CODE (X) == CONST_INT \ && INT_14_BITS (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 HP-PA, change REG+N into REG+REG, and REG+(X*Y) into REG+REG. */#define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) \{ if (GET_CODE (X) == PLUS && CONSTANT_ADDRESS_P (XEXP (X, 1))) \ (X) = gen_rtx (PLUS, SImode, XEXP (X, 0), \ copy_to_mode_reg (SImode, XEXP (X, 1))); \ if (GET_CODE (X) == PLUS && CONSTANT_ADDRESS_P (XEXP (X, 0))) \ (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, 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 (memory_address_p (MODE, X)) \ goto WIN; \ if (flag_pic) (X) = legitimize_pic_address (X, MODE, gen_reg_rtx (Pmode));\ else if ((GET_CODE (X) == SYMBOL_REF && read_only_operand (X))\ || GET_CODE (X) == LABEL_REF) \ (X) = gen_rtx (LO_SUM, Pmode, \ copy_to_mode_reg (Pmode, gen_rtx (HIGH, Pmode, X)), X); \ else if (GET_CODE (X) == SYMBOL_REF) \ { \ rtx temp2 = gen_reg_rtx (Pmode); \ emit_insn (gen_rtx (SET, VOIDmode, temp2, \ gen_rtx (PLUS, Pmode, gen_rtx (REG, Pmode, 27),\ gen_rtx (HIGH, Pmode, X)))); \ (X) = gen_rtx (LO_SUM, Pmode, temp2, 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. */#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/* Define this macro if references to a symbol must be treated differently depending on something about the variable or function named by the symbol (such as what section it is in). The macro definition, if any, is executed immediately after the rtl for DECL or other node is created. The value of the rtl will be a `mem' whose address is a `symbol_ref'. The usual thing for this macro to do is to a flag in the `symbol_ref' (such as `SYMBOL_REF_FLAG') or to store a modified name string in the `symbol_ref' (if one bit is not enough information). On the HP-PA we use this to indicate if a symbol is in text or data space. Also, function labels need special treatment. */#define TEXT_SPACE_P(DECL)\ (TREE_CODE (DECL) == FUNCTION_DECL \ || (TREE_CODE (DECL) == VAR_DECL \ && TREE_READONLY (DECL) && ! TREE_SIDE_EFFECTS (DECL) \ && !flag_pic) \ || (*tree_code_type[(int) TREE_CODE (DECL)] == 'c' \ && !(TREE_CODE (DECL) == STRING_CST && flag_writable_strings)))#define FUNCTION_NAME_P(NAME) \(*(NAME) == '@' || (*(NAME) == '*' && *((NAME) + 1) == '@'))#define ENCODE_SECTION_INFO(DECL)\do \ { if (TEXT_SPACE_P (DECL)) \ { rtx _rtl; \ if (TREE_CODE (DECL) == FUNCTION_DECL \ || TREE_CODE (DECL) == VAR_DECL) \ _rtl = DECL_RTL (DECL); \ else \ _rtl = TREE_CST_RTL (DECL); \ SYMBOL_REF_FLAG (XEXP (_rtl, 0)) = 1; \ if (TREE_CODE (DECL) == FUNCTION_DECL) \ hppa_encode_label (XEXP (DECL_RTL (DECL), 0));\ } \ } \while (0) /* Store the user-specified part of SYMBOL_NAME in VAR. This is sort of inverse to ENCODE_SECTION_INFO. */#define STRIP_NAME_ENCODING(VAR,SYMBOL_NAME) \ (VAR) = ((SYMBOL_NAME) + ((SYMBOL_NAME)[0] == '*' ? \ 1 + (SYMBOL_NAME)[1] == '@'\ : (SYMBOL_NAME)[0] == '@'))/* 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/* 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 8/* Define if normal loads of shorter-than-word items from memory clears the rest of the bigs in the register. */#define BYTE_LOADS_ZERO_EXTEND/* Nonzero if access to memory by bytes is slow and undesirable. */#define SLOW_BYTE_ACCESS 1/* 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/* 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/* When a prototype says `char' or `short', really pass an `int'. */#define PROMOTE_PROTOTYPES/* 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/* Add any extra modes needed to represent the condition code. HPPA floating comparisons produce condition codes. */#define EXTRA_CC_MODES CCFPmode/* Define the names for the modes specified above. */#define EXTRA_CC_NAMES "CCFP"/* 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) \ (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT ? CCFPmode : CCmode) \/* 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 (INT_14_BITS (RTX)) return 1; \ case CONST: \ case LABEL_REF: \ case SYMBOL_REF: \ return 2; \ case CONST_DOUBLE: \ return 4;#define ADDRESS_COST(RTX) \ (GET_CODE (RTX) == REG ? 1 : hppa_address_cost (RTX))/* Compute extra cost of moving data between one register class and another. */#define REGISTER_MOVE_COST(CLASS1, CLASS2) \ ((((CLASS1 == FP_REGS || CLASS1 == SNAKE_FP_REGS \ || CLASS1 == HI_SNAKE_FP_REGS) \ && (CLASS2 == R1_REGS || CLASS2 == GENERAL_REGS)) \ || ((CLASS1 == R1_REGS || CLASS1 == GENERAL_REGS) \ && (CLASS2 == FP_REGS || CLASS2 == SNAKE_FP_REGS \ || CLASS2 == HI_SNAKE_FP_REGS))) ? 6 : 2) /* Provide the costs of a rtl expression. This is in the body of a switch on CODE. The purpose for the cost of MULT is to encourage `synth_mult' to find a synthetic multiply when reasonable. */#define RTX_COSTS(X,CODE,OUTER_CODE) \ case MULT: \ return COSTS_N_INSNS (20); \ case DIV: \ case UDIV: \ case MOD: \ case UMOD: \ return COSTS_N_INSNS (60); \ case PLUS: /* this includes shNadd insns */ \ return COSTS_N_INSNS (1) + 2;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -