📄 dsp16xx.h
字号:
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) 0/* 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) >= REG_R0 && REGNO (X) < REG_R3 + 1 ) \ || (REGNO (X) >= FIRST_PSEUDO_REGISTER))/* Nonzero if X is the 'ybase' register */#define REG_OK_FOR_YBASE_P(X) \ (REGNO(X) == REG_YBASE || (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))/* Nonzero if X is the 'ybase' register */#define REG_OK_FOR_YBASE_P(X) REGNO_OK_FOR_YBASE_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 1610, the actual legitimate addresses must be N (N must fit in 5 bits), *rn (register indirect), *rn++, or *rn-- */#define INT_FITS_5_BITS(I) ((unsigned long) (I) < 0x20)#define INT_FITS_16_BITS(I) ((unsigned long) (I) < 0x10000)#define YBASE_CONST_OFFSET(I) ((I) >= -31 && (I) <= 0)#define YBASE_OFFSET(X) (GET_CODE (X) == CONST_INT && YBASE_CONST_OFFSET (INTVAL(X)))#define FITS_16_BITS(X) (GET_CODE (X) == CONST_INT && INT_FITS_16_BITS(INTVAL(X)))#define FITS_5_BITS(X) (GET_CODE (X) == CONST_INT && INT_FITS_5_BITS(INTVAL(X)))#define ILLEGAL_HIMODE_ADDR(MODE, CONST) ((MODE) == HImode && CONST == -31)#define INDIRECTABLE_ADDRESS_P(X) \ ((GET_CODE(X) == REG && REG_OK_FOR_BASE_P(X)) \ || ((GET_CODE(X) == POST_DEC || GET_CODE(X) == POST_INC) \ && REG_P(XEXP(X,0)) && REG_OK_FOR_BASE_P(XEXP(X,0))) \ || (GET_CODE(X) == CONST_INT && (unsigned long) (X) < 0x20))#define INDEXABLE_ADDRESS_P(X,MODE) \ ((GET_CODE(X) == PLUS && GET_CODE (XEXP (X,0)) == REG && \ XEXP(X,0) == stack_pointer_rtx && YBASE_OFFSET(XEXP(X,1)) && \ !ILLEGAL_HIMODE_ADDR(MODE, INTVAL(XEXP(X,1)))) || \ (GET_CODE(X) == PLUS && GET_CODE (XEXP (X,1)) == REG && \ XEXP(X,1) == stack_pointer_rtx && YBASE_OFFSET(XEXP(X,0)) && \ !ILLEGAL_HIMODE_ADDR(MODE, INTVAL(XEXP(X,0)))))#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \{ \ if (INDIRECTABLE_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. For the 1610, we need not do anything. However, if we don't, `memory_address' will try lots of things to get a valid address, most of which will result in dead code and extra pseudos. So we make the address valid here. This is easy: The only valid addresses are an offset from a register and we know the address isn't valid. So just call either `force_operand' or `force_reg' unless this is a (plus (reg ...) (const_int 0)). */#define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) \{ if (GET_CODE (X) == PLUS && XEXP (X, 1) == const0_rtx) \ X = XEXP (x, 0); \ if (GET_CODE (X) == MULT || GET_CODE (X) == PLUS) \ X = force_operand (X, 0); \ else \ X = force_reg (Pmode, 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 1610, only postdecrement and postincrement address depend thus (the amount of decrement or increment being the length of the operand). */#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \ if (GET_CODE (ADDR) == POST_INC || GET_CODE (ADDR) == POST_DEC) goto LABEL/* Nonzero if the constant value X is a legitimate general operand. It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */#define LEGITIMATE_CONSTANT_P(X) (1)/* CONDITION CODE INFORMATION *//* 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. */#define NOTICE_UPDATE_CC(EXP, INSN) \ notice_update_cc( (EXP) )/* DESCRIBING RELATIVE COSTS OF OPERATIONS *//* 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. */#define CONST_COSTS(RTX,CODE,OUTER_CODE) \ case CONST_INT: \ return 0; \ case LABEL_REF: \ case SYMBOL_REF: \ case CONST: \ return COSTS_N_INSNS (1); \ \ case CONST_DOUBLE: \ return COSTS_N_INSNS (2);/* Like CONST_COSTS but applies to nonconstant RTL expressions. This can be used, for example to indicate how costly a multiply instruction is. */#define RTX_COSTS(X,CODE,OUTER_CODE) \ case MEM: \ return GET_MODE (X) == QImode ? COSTS_N_INSNS (2) : \ COSTS_N_INSNS (4); \ case DIV: \ case MOD: \ return COSTS_N_INSNS (38); \ case MULT: \ if (GET_MODE (X) == QImode) \ return COSTS_N_INSNS (2); \ else \ return COSTS_N_INSNS (38); \ case PLUS: \ if (GET_MODE_CLASS (GET_MODE (X)) == MODE_INT) \ { \ if (GET_CODE (XEXP (X,1)) == CONST_INT) \ { \ int number = INTVAL(XEXP (X,1)); \ if (number == 1) \ return COSTS_N_INSNS (1); \ if (INT_FITS_16_BITS(number)) \ return COSTS_N_INSNS (2); \ else \ return COSTS_N_INSNS (4); \ } \ return COSTS_N_INSNS (1); \ } \ else \ return COSTS_N_INSNS (38); \ case MINUS: \ if (GET_MODE_CLASS (GET_MODE (X)) == MODE_INT) \ { \ if (GET_CODE (XEXP (X,1)) == CONST_INT) \ { \ if (INT_FITS_16_BITS(INTVAL(XEXP(X,1)))) \ return COSTS_N_INSNS (2); \ else \ return COSTS_N_INSNS (4); \ } \ return COSTS_N_INSNS (1); \ } \ else \ return COSTS_N_INSNS (38); \ case AND: case IOR: case XOR: \ if (GET_CODE (XEXP (X,1)) == CONST_INT) \ { \ if (INT_FITS_16_BITS(INTVAL(XEXP(X,1)))) \ return COSTS_N_INSNS (2); \ else \ return COSTS_N_INSNS (4); \ } \ return COSTS_N_INSNS (1); \ case NEG: case NOT: \ return COSTS_N_INSNS (1); \ case ASHIFT: \ case ASHIFTRT: \ case LSHIFTRT: \ if (GET_CODE (XEXP (X,1)) == CONST_INT) \ { \ int number = INTVAL(XEXP (X,1)); \ if (number == 1 || number == 4 || number == 8 || \ number == 16) \ return COSTS_N_INSNS (1); \ else \ return COSTS_N_INSNS (2); \ } \ return COSTS_N_INSNS (1);/* An expression giving the cost of an addressing mode that contains address. */#define ADDRESS_COST(ADDR) dsp16xx_address_cost (ADDR)/* A c expression for the cost of moving data from a register in class FROM to one in class TO. The classes are expressed using the enumeration values such as GENERAL_REGS. A value of 2 is the default. */#define REGISTER_MOVE_COST(FROM,TO) dsp16xx_register_move_cost (FROM, TO)/* A C expression for the cost of moving data of mode MODE between a register and memory. A value of 2 is the default. */#define MEMORY_MOVE_COST(MODE,CLASS,IN) \ (GET_MODE_CLASS(MODE) == MODE_INT && MODE == QImode ? 12 \ : 16)/* A C expression for the cost of a branch instruction. A value of 1 is the default; */#define BRANCH_COST 2/* Define this because otherwise gcc will try to put the function address in any old pseudo register. We can only use pt. */#define NO_FUNCTION_CSE/* Define this macro as a C expression which is nonzero if accessing less than a word of memory (i.e a char or short) is no faster than accessing a word of memory, i.e if such access require more than one instruction or if ther is no difference in cost between byte and (aligned) word loads. */#define SLOW_BYTE_ACCESS 1/* Define this macro if zero-extension (of a char or short to an int) can be done faster if the destination is a register that is know to be zero. *//* #define SLOW_ZERO_EXTEND *//* Define this macro if unaligned accesses have a cost many times greater than aligned accesses, for example if they are emulated in a trap handler *//* define SLOW_UNALIGNED_ACCESS *//* Define this macro to inhibit strength reduction of memory addresses *//* #define DONT_REDUCE_ADDR *//* DIVIDING THE OUTPUT IN SECTIONS *//* Output before read-only data. */#define DEFAULT_TEXT_SEG_NAME ".text"#define TEXT_SECTION_ASM_OP rsect_text/* Output before constants and strings */#define DEFAULT_CONST_SEG_NAME ".const"#define READONLY_SECTION_ASM_OP rsect_const#define READONLY_DATA_SECTION const_section/* Output before writable data. */#define DEFAULT_DATA_SEG_NAME ".data"#define DATA_SECTION_ASM_OP rsect_data#define DEFAULT_BSS_SEG_NAME ".bss"#define BSS_SECTION_ASM_OP rsect_bss/* We will default to using 1610 if the user doesn't specify it. */#define DEFAULT_CHIP_NAME "1610"/* A list of names for sections other than the standard ones, which are 'in_text' and 'in_data' (and .bss if BSS_SECTION_ASM_OP is defined). */#define EXTRA_SECTIONS in_const#define EXTRA_SECTION_FUNCTIONS \void \const_section () \{ \ if (in_section != in_const) \ { \ fprintf (asm_out_file, "%s\n", READONLY_SECTION_ASM_OP); \ in_section = in_const; \ } \}/* THE OVERALL FRAMEWORK OF AN ASSEMBLER FILE *//* Output at beginning of assembler file. */#define ASM_FILE_START(FILE) dsp16xx_file_start () /* Prevent output of .gcc_compiled */#define ASM_IDENTIFY_GCC(FILE) /* A C string constant describing how to begin a comment in the target assembler language. *//* define ASM_COMMENT_START *//* 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 OF DATA *//* This is how to output an assembler line defining a `double' constant. */#define ASM_OUTPUT_DOUBLE(FILE,VALUE) asm_output_float (FILE,VALUE)/* This is how to output an assembler line defining a `float' constant. */#define ASM_OUTPUT_FLOAT(FILE,VALUE) asm_output_float (FILE, VALUE)/* This is how to output an assembler line defining a 'float' constant of size HFmode. */#define ASM_OUTPUT_SHORT_FLOAT(FILE,VALUE) asm_output_float (FILE, VALUE)/* This is how to output an assembler line defining an `char' constant. */#define ASM_OUTPUT_CHAR(FILE,VALUE) \( fprintf (FILE, "\tint "),
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -