📄 v850.h
字号:
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. Most source files want to accept pseudo regs in the hope that they will get allocated to the class that the insn wants them to be in. Source files for reload pass need to be strict. After reload, it makes no difference, since pseudo regs have 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) 1#define REG_OK_FOR_INDEX_P_STRICT(X) 0#define REG_OK_FOR_BASE_P_STRICT(X) REGNO_OK_FOR_BASE_P (REGNO (X))#define STRICT 0#else/* Nonzero if X is a hard reg that can be used as an index. */#define REG_OK_FOR_INDEX_P(X) 0/* 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 STRICT 1#endif/* A C expression that defines the optional machine-dependent constraint letters that can be used to segregate specific types of operands, usually memory references, for the target machine. Normally this macro will not be defined. If it is required for a particular target machine, it should return 1 if VALUE corresponds to the operand type represented by the constraint letter C. If C is not defined as an extra constraint, the value returned should be 0 regardless of VALUE. For example, on the ROMP, load instructions cannot have their output in r0 if the memory reference contains a symbolic address. Constraint letter `Q' is defined as representing a memory address that does *not* contain a symbolic address. An alternative is specified with a `Q' constraint on the input and `r' on the output. The next alternative specifies `m' on the input and a register class that does not include r0 on the output. */#define EXTRA_CONSTRAINT(OP, C) \ ((C) == 'Q' ? ep_memory_operand (OP, GET_MODE (OP)) \ : (C) == 'R' ? special_symbolref_operand (OP, VOIDmode) \ : (C) == 'S' ? (GET_CODE (OP) == SYMBOL_REF && ! ZDA_NAME_P (XSTR (OP, 0))) \ : (C) == 'T' ? 0 \ : (C) == 'U' ? ((GET_CODE (OP) == SYMBOL_REF && ZDA_NAME_P (XSTR (OP, 0))) \ || (GET_CODE (OP) == CONST \ && GET_CODE (XEXP (OP, 0)) == PLUS \ && GET_CODE (XEXP (XEXP (OP, 0), 0)) == SYMBOL_REF \ && ZDA_NAME_P (XSTR (XEXP (XEXP (OP, 0), 0), 0)))) \ : 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, except for CONSTANT_ADDRESS_P which is actually machine-independent. *//* Accept either REG or SUBREG where a register is valid. */ #define RTX_OK_FOR_BASE_P(X) \ ((REG_P (X) && REG_OK_FOR_BASE_P (X)) \ || (GET_CODE (X) == SUBREG && REG_P (SUBREG_REG (X)) \ && REG_OK_FOR_BASE_P (SUBREG_REG (X))))#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \do { \ if (RTX_OK_FOR_BASE_P (X)) goto ADDR; \ if (CONSTANT_ADDRESS_P (X) \ && (MODE == QImode || INTVAL (X) % 2 == 0)) \ goto ADDR; \ 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)) \ && (GET_CODE (XEXP (X, 1)) != CONST_INT \ || ((MODE == QImode || INTVAL (XEXP (X, 1)) % 2 == 0) \ && CONST_OK_FOR_K (INTVAL (XEXP (X, 1))))) \ && GET_MODE_SIZE (MODE) <= GET_MODE_SIZE (word_mode)) \ goto ADDR; \ if (special_symbolref_operand (X, MODE) \ && (GET_MODE_SIZE (MODE) <= GET_MODE_SIZE (word_mode))) \ goto ADDR; \ if (GET_CODE (X) == PLUS \ && CONSTANT_ADDRESS_P (XEXP (X, 1)) \ && (MODE == QImode || INTVAL (XEXP (X, 1)) % 2 == 0) \ && RTX_OK_FOR_BASE_P (XEXP (X, 0))) goto ADDR; \} 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) {}/* 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) {}/* 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) \ (GET_CODE (X) == CONST_DOUBLE \ || !(GET_CODE (X) == CONST \ && GET_CODE (XEXP (X, 0)) == PLUS \ && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF \ && GET_CODE (XEXP (XEXP (X, 0), 1)) == CONST_INT \ && ! CONST_OK_FOR_K (INTVAL (XEXP (XEXP (X, 0), 1)))))/* In rare cases, correct code generation requires extra machine dependent processing between the second jump optimization pass and delayed branch scheduling. On those machines, define this macro as a C statement to act on the code starting at INSN. */#define MACHINE_DEPENDENT_REORG(INSN) v850_reorg (INSN)/* Tell final.c how to eliminate redundant test instructions. *//* Here we define machine-dependent flags and fields in cc_status (see `conditions.h'). No extra ones are needed for the vax. *//* 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 CC_OVERFLOW_UNUSABLE 0x200#define CC_NO_CARRY CC_NO_OVERFLOW#define NOTICE_UPDATE_CC(EXP, INSN) notice_update_cc(EXP, INSN)/* A part of a C `switch' statement that describes the relative costs of constant RTL expressions. It must contain `case' labels for expression codes `const_int', `const', `symbol_ref', `label_ref' and `const_double'. Each case must ultimately reach a `return' statement to return the relative cost of the use of that kind of constant value in an expression. The cost may depend on the precise value of the constant, which is available for examination in X, and the rtx code of the expression in which it is contained, found in OUTER_CODE. CODE is the expression code--redundant, since it can be obtained with `GET_CODE (X)'. */#define CONST_COSTS(RTX,CODE,OUTER_CODE) \ case CONST_INT: \ case CONST_DOUBLE: \ case CONST: \ case SYMBOL_REF: \ case LABEL_REF: \ { \ int _zxy = const_costs(RTX, CODE); \ return (_zxy) ? COSTS_N_INSNS (_zxy) : 0; \ }/* A crude cut at RTX_COSTS for the V850. *//* Provide the costs of a rtl expression. This is in the body of a switch on CODE. There aren't DImode MOD, DIV or MULT operations, so call them very expensive. Everything else is pretty much a constant cost. */#define RTX_COSTS(RTX,CODE,OUTER_CODE) \ case MOD: \ case DIV: \ return 60; \ case MULT: \ return 20;/* All addressing modes have the same cost on the V850 series. */#define ADDRESS_COST(ADDR) 1/* Nonzero if access to memory by bytes or half words is no faster than accessing full words. */#define SLOW_BYTE_ACCESS 1/* Define this if zero-extension is slow (more than one real instruction). */#define SLOW_ZERO_EXTEND /* According expr.c, a value of around 6 should minimize code size, and for the V850 series, that's our primary concern. */#define MOVE_RATIO 6/* Indirect calls are expensive, never turn a direct call into an indirect call. */#define NO_FUNCTION_CSE/* The four different data regions on the v850. */typedef enum { DATA_AREA_NORMAL, DATA_AREA_SDA, DATA_AREA_TDA, DATA_AREA_ZDA} v850_data_area;/* A list of names for sections other than the standard two, which are `in_text' and `in_data'. You need not define this macro on a system with no other sections (that GCC needs to use). */#undef EXTRA_SECTIONS#define EXTRA_SECTIONS in_tdata, in_sdata, in_zdata, in_const, in_ctors, \in_dtors, in_rozdata, in_rosdata, in_sbss, in_zbss, in_zcommon, in_scommon/* One or more functions to be defined in `varasm.c'. These functions should do jobs analogous to those of `text_section' and `data_section', for your additional sections. Do not define this macro if you do not define `EXTRA_SECTIONS'. */#undef EXTRA_SECTION_FUNCTIONS/* This could be done a lot more cleanly using ANSI C ... */#define EXTRA_SECTION_FUNCTIONS \CONST_SECTION_FUNCTION \CTORS_SECTION_FUNCTION \DTORS_SECTION_FUNCTION \ \void \sdata_section () \{ \ if (in_section != in_sdata) \ { \ fprintf (asm_out_file, "%s\n", SDATA_SECTION_ASM_OP); \ in_section = in_sdata; \ } \} \ \void \rosdata_section () \{ \ if (in_section != in_rosdata) \ { \ fprintf (asm_out_file, "%s\n", ROSDATA_SECTION_ASM_OP); \ in_section = in_sdata; \ } \} \ \void \sbss_section () \{ \ if (in_section != in_sbss) \ { \ fprintf (asm_out_file, "%s\n", SBSS_SECTION_ASM_OP); \ in_section = in_sbss; \ } \} \ \void \tdata_section () \{ \ if (in_section != in_tdata) \ { \ fprintf (asm_out_file, "%s\n", TDATA_SECTION_ASM_OP); \ in_section = in_tdata; \ } \} \ \void \zdata_section () \{ \ if (in_section != in_zdata) \ { \ fprintf (asm_out_file, "%s\n", ZDATA_SECTION_ASM_OP); \ in_section = in_zdata; \ } \} \ \void \rozdata_section () \{ \ if (in_section != in_rozdata) \ { \ fprintf (asm_out_file, "%s\n", ROZDATA_SECTION_ASM_OP); \ in_section = in_rozdata; \ } \} \ \void \zbss_section () \{ \ if (in_section != in_zbss) \ { \ fprintf (asm_out_file, "%s\n", ZBSS_SECTION_ASM_OP); \ in_section = in_zbss; \ } \}#define TEXT_SECTION_ASM_OP "\t.section .text"#define DATA_SECTION_ASM_OP "\t.section .data"#define BSS_SECTION_ASM_OP "\t.section .bss"#define SDATA_SECTION_ASM_OP "\t.section .sdata,\"aw\""#define SBSS_SECTION_ASM_OP "\t.section .sbss,\"aw\""#define ZDATA_SECTION_ASM_OP "\t.section .zdata,\"aw\""#define ZBSS_SECTION_ASM_OP "\t.section .zbss,\"aw\""#define TDATA_SECTION_ASM_OP "\t.section .tdata,\"aw\""#define ROSDATA_SECTION_ASM_OP "\t.section .rosdata,\"a\""#define ROZDATA_SECTION_ASM_OP "\t.section .rozdata,\"a\""#define SCOMMON_ASM_OP ".scomm"#define ZCOMMON_ASM_OP ".zcomm"#define TCOMMON_ASM_OP ".tcomm"/* A C statement or statements to switch to the appropriate section for output of EXP. You can assume that EXP is either a `VAR_DECL' node or a constant of some sort. RELOC indicates whether the initial value of EXP requires link-time relocations. Select the section by calling `text_section' or one of the alternatives for other sections. Do not define this macro if you put all read-only variables and constants in the read-only data section (usually the text section). */#undef SELECT_SECTION#define SELECT_SECTION(EXP, RELOC) \do { \ if (TREE_CODE (EXP) == VAR_DECL) \ { \ int is_const; \ if (!TREE_READONLY (EXP) \ || TREE_SIDE_EFFECTS (EXP) \ || !DECL_INITIAL (EXP) \ || (DECL_INITIAL (EXP) != error_mark_node \ && !TREE_CONSTANT (DECL_INITIAL (EXP)))) \ is_const = FALSE; \ else \ is_const = TRUE; \ \ switch (v850_get_data_area (EXP)) \ { \ case DATA_AREA_ZDA: \ if (is_const) \ rozdata_section (); \ else \ zdata_section (); \ break; \ \ case DATA_AREA_TDA: \ tdata_section (); \ break; \ \ case DATA_AREA_SDA: \ if (is_const) \ rosdata_section (); \ else \ sdata_section (); \ break; \ \ default: \ if (is_const) \ const_section (); \ else \ data_section (); \ break; \ } \ } \ else if (TREE_CODE (EXP) == STRING_CST) \ { \ if (! flag_writable_strings) \ const_section (); \ else \ data_section (); \ } \ \ else \ const_section (); \ \} while (0)/* A C statement or statements to switch to the appropriate section for output of RTX in mode MODE. You can assume that RTX is some kind of constant in RTL. The argument MODE is redundant except in the case of a `const_int' rtx. Select the section by calling `text_section' or one of the alternatives for other sections. Do not define this macro if you put all constants in the read-only data section. *//* #define SELECT_RTX_SECTION(MODE, RTX) *//* Output at beginning/end of assembler file. */#undef ASM_FILE_START#define ASM_FILE_START(FILE) asm_file_start(FILE)#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 "#APP\n"/* Output to assembler file text saying following lines no longer contain unusual constructs. */#define ASM_APP_OFF "#NO_APP\n"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -