📄 pa.h
字号:
or if it is a pseudo reg. */#define REG_OK_FOR_BASE_P(X) \(REGNO (X) && (REGNO (X) < 32 || REGNO (X) >= FIRST_PSEUDO_REGISTER))#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 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. Note we only allow 5 bit immediates for access to a constant address; doing so avoids losing for loading/storing a FP register at an address which will not fit in 5 bits. */#define VAL_5_BITS_P(X) ((unsigned HOST_WIDE_INT)(X) + 0x10 < 0x20)#define INT_5_BITS(X) VAL_5_BITS_P (INTVAL (X))#define VAL_U5_BITS_P(X) ((unsigned HOST_WIDE_INT)(X) < 0x20)#define INT_U5_BITS(X) VAL_U5_BITS_P (INTVAL (X))#define VAL_11_BITS_P(X) ((unsigned HOST_WIDE_INT)(X) + 0x400 < 0x800)#define INT_11_BITS(X) VAL_11_BITS_P (INTVAL (X))#define VAL_14_BITS_P(X) ((unsigned HOST_WIDE_INT)(X) + 0x2000 < 0x4000)#define INT_14_BITS(X) VAL_14_BITS_P (INTVAL (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 = 0; \ 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) != DImode \ && (MODE) != SFmode \ && (MODE) != DFmode) \ /* The base register for DImode loads and stores \ with long displacements must be aligned because \ the lower three bits in the displacement are \ assumed to be zero. */ \ || ((MODE) == DImode \ && (!TARGET_64BIT \ || (INTVAL (index) % 8) == 0)) \ /* Similarly, the base register for SFmode/DFmode \ loads and stores with long displacements must \ be aligned. \ \ FIXME: the ELF32 linker clobbers the LSB of \ the FP register number in PA 2.0 floating-point \ insns with long displacements. This is because \ R_PARISC_DPREL14WR and other relocations like \ it are not supported. For now, we reject long \ displacements on this target. */ \ || (((MODE) == SFmode || (MODE) == DFmode) \ && (TARGET_SOFT_FLOAT \ || (TARGET_PA_20 \ && !TARGET_ELF32 \ && (INTVAL (index) \ % GET_MODE_SIZE (MODE)) == 0))))) \ || INT_5_BITS (index))) \ goto ADDR; \ if (! TARGET_SOFT_FLOAT \ && ! TARGET_DISABLE_INDEXING \ && base \ && ((MODE) == SFmode || (MODE) == DFmode) \ && GET_CODE (index) == MULT \ && GET_CODE (XEXP (index, 0)) == REG \ && REG_OK_FOR_BASE_P (XEXP (index, 0)) \ && GET_CODE (XEXP (index, 1)) == CONST_INT \ && INTVAL (XEXP (index, 1)) == ((MODE) == SFmode ? 4 : 8))\ 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)) \ && (TARGET_SOFT_FLOAT \ /* We can allow symbolic LO_SUM addresses\ for PA2.0. */ \ || (TARGET_PA_20 \ && !TARGET_ELF32 \ && GET_CODE (XEXP (X, 1)) != CONST_INT)\ || ((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)) \ && (TARGET_SOFT_FLOAT \ /* We can allow symbolic LO_SUM addresses\ for PA2.0. */ \ || (TARGET_PA_20 \ && !TARGET_ELF32 \ && GET_CODE (XEXP (X, 1)) != CONST_INT)\ || ((MODE) != SFmode \ && (MODE) != DFmode))) \ goto ADDR; \ else if (GET_CODE (X) == LABEL_REF \ || (GET_CODE (X) == CONST_INT \ && INT_5_BITS (X))) \ goto ADDR; \ /* Needed for -fPIC */ \ else if (GET_CODE (X) == LO_SUM \ && GET_CODE (XEXP (X, 0)) == REG \ && REG_OK_FOR_BASE_P (XEXP (X, 0)) \ && GET_CODE (XEXP (X, 1)) == UNSPEC \ && (TARGET_SOFT_FLOAT \ || (TARGET_PA_20 && !TARGET_ELF32) \ || ((MODE) != SFmode \ && (MODE) != DFmode))) \ goto ADDR; \}/* Look for machine dependent ways to make the invalid address AD a valid address. For the PA, transform: memory(X + <large int>) into: if (<large int> & mask) >= 16 Y = (<large int> & ~mask) + mask + 1 Round up. else Y = (<large int> & ~mask) Round down. Z = X + Y memory (Z + (<large int> - Y)); This makes reload inheritance and reload_cse work better since Z can be reused. There may be more opportunities to improve code with this hook. */#define LEGITIMIZE_RELOAD_ADDRESS(AD, MODE, OPNUM, TYPE, IND, WIN) \do { \ int offset, newoffset, mask; \ rtx new, temp = NULL_RTX; \ \ mask = (GET_MODE_CLASS (MODE) == MODE_FLOAT \ ? (TARGET_PA_20 && !TARGET_ELF32 ? 0x3fff : 0x1f) : 0x3fff); \ \ if (optimize \ && GET_CODE (AD) == PLUS) \ temp = simplify_binary_operation (PLUS, Pmode, \ XEXP (AD, 0), XEXP (AD, 1)); \ \ new = temp ? temp : AD; \ \ if (optimize \ && GET_CODE (new) == PLUS \ && GET_CODE (XEXP (new, 0)) == REG \ && GET_CODE (XEXP (new, 1)) == CONST_INT) \ { \ offset = INTVAL (XEXP ((new), 1)); \ \ /* Choose rounding direction. Round up if we are >= halfway. */ \ if ((offset & mask) >= ((mask + 1) / 2)) \ newoffset = (offset & ~mask) + mask + 1; \ else \ newoffset = offset & ~mask; \ \ /* Ensure that long displacements are aligned. */ \ if (!VAL_5_BITS_P (newoffset) \ && GET_MODE_CLASS (MODE) == MODE_FLOAT) \ newoffset &= ~(GET_MODE_SIZE (MODE) -1); \ \ if (newoffset != 0 \ && VAL_14_BITS_P (newoffset)) \ { \ \ temp = gen_rtx_PLUS (Pmode, XEXP (new, 0), \ GEN_INT (newoffset)); \ AD = gen_rtx_PLUS (Pmode, temp, GEN_INT (offset - newoffset));\ push_reload (XEXP (AD, 0), 0, &XEXP (AD, 0), 0, \ BASE_REG_CLASS, Pmode, VOIDmode, 0, 0, \ (OPNUM), (TYPE)); \ goto WIN; \ } \ } \} while (0)/* 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. */#define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN) \{ rtx orig_x = (X); \ (X) = hppa_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. */#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 TARGET_ASM_SELECT_SECTION pa_select_section /* 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) \ && (! DECL_INITIAL (DECL) || ! reloc_needed (DECL_INITIAL (DECL))) \ && !flag_pic) \ || (TREE_CODE_CLASS (TREE_CODE (DECL)) == 'c' \ && !(TREE_CODE (DECL) == STRING_CST && flag_writable_strings)))#define FUNCTION_NAME_P(NAME) (*(NAME) == '@')/* Specify the machine mode that this machine uses for the index in the tablejump instruction. */#define CASE_VECTOR_MODE (TARGET_BIG_SWITCH ? TImode : DImode)/* Jump tables must be 32 bit aligned, no matter the size of the element. */#define ADDR_VEC_ALIGN(ADDR_VEC) 2/* 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/* Higher than the default as we prefer to use simple move insns (better scheduling and delay slot filling) and because our built-in block move is really a 2X unrolled loop. Believe it or not, this has to be big enough to allow for copying all arguments passed in registers to avoid infinite recursion during argument setup for a function call. Why? Consider how we copy the stack slots reserved for parameters when they may be trashed by a call. */#define MOVE_RATIO (TARGET_64BIT ? 8 : 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) ZERO_EXTEND/* Nonzero if access to memory by bytes is slow and undesirable. */#define SLOW_BYTE_ACCESS 1/* 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 1#define PROMOTE_FUNCTION_RETURN 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 word_mode/* 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 : CCm
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -