📄 sh.h
字号:
fprintf ((FILE), " .word 0x200b\n"); \ fprintf ((FILE), " .long 0\n"); \ fprintf ((FILE), " .long 0\n"); \}/* Length in units of the trampoline for entering a nested function. */#define TRAMPOLINE_SIZE 16/* Alignment required for a trampoline in units. */#define TRAMPOLINE_ALIGN 4/* Emit RTL insns to initialize the variable parts of a trampoline. FNADDR is an RTX for the address of the function's pure code. CXT is an RTX for the static chain value for the function. */#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \{ \ emit_move_insn (gen_rtx (MEM, SImode, plus_constant ((TRAMP), 8)), \ (CXT)); \ emit_move_insn (gen_rtx (MEM, SImode, plus_constant ((TRAMP), 12)), \ (FNADDR)); \}/* Addressing modes, and classification of registers for them. */#define HAVE_POST_INCREMENT 1/*#define HAVE_PRE_INCREMENT 1*//*#define HAVE_POST_DECREMENT 1*/#define HAVE_PRE_DECREMENT 1/* 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_BASE_P(REGNO) \ ((REGNO) < PR_REG || (unsigned) reg_renumber[(REGNO)] < PR_REG)#define REGNO_OK_FOR_INDEX_P(REGNO) \ ((REGNO) == 0 || (unsigned) reg_renumber[(REGNO)] == 0)/* 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)/* Nonzero if the constant value X is a legitimate general operand. *//* ??? Should modify this to accept CONST_DOUBLE, and then modify the constant pool table code to fix loads of CONST_DOUBLEs. If that doesn't work well, then we can at least handle simple CONST_DOUBLEs here such as 0.0. */#define LEGITIMATE_CONSTANT_P(X) (GET_CODE(X) != CONST_DOUBLE)/* 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. */#define MODE_DISP_OK_4(X,MODE) ((GET_MODE_SIZE(MODE)==4) && ((unsigned)INTVAL(X)<64) && (!(INTVAL(X) &3)))#define MODE_DISP_OK_8(X,MODE) ((GET_MODE_SIZE(MODE)==8) && ((unsigned)INTVAL(X)<60) && (!(INTVAL(X) &3)))#ifndef REG_OK_STRICT/* 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) <= 16 || REGNO (X) >= FIRST_PSEUDO_REGISTER)/* 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) == 0 || REGNO (X) >= FIRST_PSEUDO_REGISTER)/* Nonzero if X/OFFSET is a hard reg that can be used as an index or if X is a pseudo reg. */#define SUBREG_OK_FOR_INDEX_P(X, OFFSET) \ ((REGNO (X) == 0 && OFFSET == 0) || REGNO (X) >= FIRST_PSEUDO_REGISTER)#else/* 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))/* 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/OFFSET is a hard reg that can be used as an index. */#define SUBREG_OK_FOR_INDEX_P(X, OFFSET) \ (REGNO_OK_FOR_INDEX_P (REGNO (X)) && OFFSET == 0)#endif/* The 'Q' constraint is a pc relative load operand. */#define EXTRA_CONSTRAINT_Q(OP) \ (GET_CODE (OP) == MEM && \ ((GET_CODE (XEXP (OP, 0)) == LABEL_REF) \ || (GET_CODE (XEXP (OP, 0)) == CONST \ && GET_CODE (XEXP (XEXP (OP, 0), 0)) == PLUS \ && GET_CODE (XEXP (XEXP (XEXP (OP, 0), 0), 0)) == LABEL_REF \ && GET_CODE (XEXP (XEXP (XEXP (OP, 0), 0), 1)) == CONST_INT)))#define EXTRA_CONSTRAINT(OP, C) \ ((C) == 'Q' ? EXTRA_CONSTRAINT_Q (OP) \ : 0)/* 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. The other macros defined here are used only in GO_IF_LEGITIMATE_ADDRESS. */#define BASE_REGISTER_RTX_P(X) \ ((GET_CODE (X) == REG && REG_OK_FOR_BASE_P (X)) \ || (GET_CODE (X) == SUBREG \ && GET_CODE (SUBREG_REG (X)) == REG \ && REG_OK_FOR_BASE_P (SUBREG_REG (X))))/* Since this must be r0, which is a single register class, we must check SUBREGs more carefully, to be sure that we don't accept one that extends outside the class. */#define INDEX_REGISTER_RTX_P(X) \ ((GET_CODE (X) == REG && REG_OK_FOR_INDEX_P (X)) \ || (GET_CODE (X) == SUBREG \ && GET_CODE (SUBREG_REG (X)) == REG \ && SUBREG_OK_FOR_INDEX_P (SUBREG_REG (X), SUBREG_WORD (X))))/* Jump to LABEL if X is a valid address RTX. This must also take REG_OK_STRICT into account when deciding about valid registers, but it uses the above macros so we are in luck. Allow REG REG+disp REG+r0 REG++ --REG *//* The SH allows a displacement in a QI or HI amode, but only when the other operand is R0. GCC doesn't handle this very well, so we forgo all of that. A legitimate index for a QI or HI is 0, SI can be any number 0..63, DI can be any number 0..60. */#define GO_IF_LEGITIMATE_INDEX(MODE, OP, LABEL) \ do { \ if (GET_CODE (OP) == CONST_INT) \ { \ if (MODE_DISP_OK_4 (OP, MODE)) goto LABEL; \ if (MODE_DISP_OK_8 (OP, MODE)) goto LABEL; \ } \ } while(0)#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, LABEL) \{ \ if (BASE_REGISTER_RTX_P (X)) \ goto LABEL; \ else if ((GET_CODE (X) == POST_INC || GET_CODE (X) == PRE_DEC) \ && BASE_REGISTER_RTX_P (XEXP (X, 0))) \ goto LABEL; \ else if (GET_CODE (X) == PLUS) \ { \ rtx xop0 = XEXP (X, 0); \ rtx xop1 = XEXP (X, 1); \ if (GET_MODE_SIZE (MODE) <= 8 && BASE_REGISTER_RTX_P (xop0)) \ GO_IF_LEGITIMATE_INDEX (MODE, xop1, LABEL); \ if (GET_MODE_SIZE (MODE) <= 4) \ { \ if (BASE_REGISTER_RTX_P (xop1) && INDEX_REGISTER_RTX_P (xop0))\ goto LABEL; \ if (INDEX_REGISTER_RTX_P (xop1) && BASE_REGISTER_RTX_P (xop0))\ 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. */#define LEGITIMIZE_ADDRESS(X,OLDX,MODE,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_INC) \ goto LABEL; \}/* Specify the machine mode that this machine uses for the index in the tablejump instruction. */#define CASE_VECTOR_MODE (TARGET_BIGTABLE ? SImode : HImode)/* 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/* 'char' is signed by default. */#define DEFAULT_SIGNED_CHAR 1/* The type of size_t unsigned int. */#define SIZE_TYPE "unsigned int"#define WCHAR_TYPE "short unsigned int"#define WCHAR_TYPE_SIZE 16/* 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) SIGN_EXTEND/* Define this if zero-extension is slow (more than one real instruction). On the SH, it's only one instruction. *//* #define SLOW_ZERO_EXTEND *//* Nonzero if access to memory by bytes is slow and undesirable. */#define SLOW_BYTE_ACCESS 0/* 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/* Immediate shift counts are truncated by the output routines (or was it the assembler?). Shift counts in a register are truncated by SH. Note that the native compiler puts too large (> 32) immediate shift counts into a register and shifts by the register, letting the SH decide what to do instead of doing that itself. *//* ??? This is defined, but the library routines in lib1funcs.asm do not truncate the shift count. This may result in incorrect results for unusual cases. Truncating the shift counts in the library routines would make them faster. However, the SH3 has hardware shifts that do not truncate, so it appears that we need to leave this undefined for correct SH3 code. We can still using truncation in the library routines though to make them faster. */#define SHIFT_COUNT_TRUNCATED 1/* All integers have the same format so truncation is easy. */#define TRULY_NOOP_TRUNCATION(OUTPREC,INPREC) 1/* 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 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 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 (INTVAL (RTX) == 0) \ return 0; \ else if (CONST_OK_FOR_I (INTVAL (RTX))) \ return 1; \ else if ((OUTER_CODE == AND || OUTER_CODE == IOR || OUTER_CODE == XOR) \ && CONST_OK_FOR_L (INTVAL (RTX))) \ return 1; \ else \ return 8; \ case CONST: \ case LABEL_REF: \ case SYMBOL_REF: \ return 5; \ case CONST_DOUBLE: \ return 10;#define RTX_COSTS(X, CODE, OUTER_CODE) \ case AND: \ return COSTS_N_INSNS (andcosts (X)); \ case MULT: \ return COSTS_N_INSNS (multcosts (X)); \ case ASHIFT: \ case ASHIFTRT: \ case LSHIFTRT: \ return COSTS_N_INSNS (shiftcosts (X)) ; \ case DIV: \ case UDIV: \ case MOD: \ case UMOD: \ return COSTS_N_INSNS (20); \ case FLOAT: \ case FIX: \ return 100;/* The multiply insn on the SH1 and the divide insns on the SH1 and SH2 are actually function calls with some special constraints on arguments and register usage. These macros tell reorg that the references to arguments and register clobbers for insns of type sfunc do not appear to happen until after the millicode call. This allows reorg to put insns which set the argument registers into the delay slot of the millicode call -- thus they act more like traditional CALL_INSNs. get_attr_type will try to recognize the given insn, so make sure to filter out things it will not accept -- SEQUENCE, USE and CLOBBER insns in particular. */#define INSN_SETS_ARE_DELAYED(X) \ ((GET_CODE (X) == INSN \ && GET_CODE (PATTERN (X)) != SEQUENCE \ && GET_CODE (PATTERN (X)) != USE \ && GET_CODE (PATTERN (X)) != CLOBBER \ && get_attr_type (X) == TYPE_SFUNC))#define INSN_REFERENCES_ARE_DELAYED(X) \ ((GET_CODE (X) == INSN \ && GET_CODE (PATTERN (X)) != SEQUENCE \ && GET_CODE (PATTERN (X)) != USE \ && GET_CODE (PATTERN (X)) != CLOBBER \ && get_attr_type (X) == TYPE_SFUNC))/* Compute extra cost of moving data between one register class and another. On the SH it is hard to move into the T reg, but simple to load
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -