📄 s390.h
字号:
#define CASE_VECTOR_MODE (TARGET_64BIT ? DImode : 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 *//* Load from integral MODE < SI from memory into register makes sign_extend or zero_extend In our case sign_extension happens for Halfwords, other no extension. */#define LOAD_EXTEND_OP(MODE) \(TARGET_64BIT ? ((MODE) == QImode ? ZERO_EXTEND : \ (MODE) == HImode ? SIGN_EXTEND : NIL) \ : ((MODE) == HImode ? SIGN_EXTEND : NIL))/* Define this if fixuns_trunc is the same as fix_trunc. *//* #define FIXUNS_TRUNC_LIKE_FIX_TRUNC *//* We use "unsigned char" as default. */#define DEFAULT_SIGNED_CHAR 0/* Max number of bytes we can move from memory to memory in one reasonably fast instruction. */#define MOVE_MAX 256/* Nonzero if access to memory by bytes is slow and undesirable. */#define SLOW_BYTE_ACCESS 1/* Define if shifts truncate the shift count which implies one can omit a sign-extension or zero-extension of a shift count. *//* #define SHIFT_COUNT_TRUNCATED *//* 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 *//* Don't perform CSE on function addresses. */#define NO_FUNCTION_CSE/* 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 ((enum machine_mode) (TARGET_64BIT ? DImode : SImode))/* 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 QImode/* 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)'. *//* Force_const_mem does not work out of reload, because the saveable_obstack is set to reload_obstack, which does not live long enough. Because of this we cannot use force_const_mem in addsi3. This leads to problems with gen_add2_insn with a constant greater than a short. Because of that we give an addition of greater constants a cost of 3 (reload1.c 10096). */#define CONST_COSTS(RTX, CODE, OUTER_CODE) \ case CONST: \ if ((GET_CODE (XEXP (RTX, 0)) == MINUS) && \ (GET_CODE (XEXP (XEXP (RTX, 0), 1)) != CONST_INT)) \ return 1000; \ case CONST_INT: \ if ((OUTER_CODE == PLUS) && \ ((INTVAL (RTX) > 32767) || \ (INTVAL (RTX) < -32768))) \ return COSTS_N_INSNS (3); \ case LABEL_REF: \ case SYMBOL_REF: \ case CONST_DOUBLE: \ return 0; \/* Like `CONST_COSTS' but applies to nonconstant RTL expressions. This can be used, for example, to indicate how costly a multiply instruction is. In writing this macro, you can use the construct `COSTS_N_INSNS (N)' to specify a cost equal to N fast instructions. OUTER_CODE is the code of the expression in which X is contained. This macro is optional; do not define it if the default cost assumptions are adequate for the target machine. */#define RTX_COSTS(X, CODE, OUTER_CODE) \ case ASHIFT: \ case ASHIFTRT: \ case LSHIFTRT: \ case PLUS: \ case AND: \ case IOR: \ case XOR: \ case MINUS: \ case NEG: \ case NOT: \ return 1; \ case MULT: \ if (GET_MODE (XEXP (X, 0)) == DImode) \ return 40; \ else \ return 7; \ case DIV: \ case UDIV: \ case MOD: \ case UMOD: \ return 33;/* An expression giving the cost of an addressing mode that contains ADDRESS. If not defined, the cost is computed from the ADDRESS expression and the `CONST_COSTS' values. For most CISC machines, the default cost is a good approximation of the true cost of the addressing mode. However, on RISC machines, all instructions normally have the same length and execution time. Hence all addresses will have equal costs. In cases where more than one form of an address is known, the form with the lowest cost will be used. If multiple forms have the same, lowest, cost, the one that is the most complex will be used. For example, suppose an address that is equal to the sum of a register and a constant is used twice in the same basic block. When this macro is not defined, the address will be computed in a register and memory references will be indirect through that register. On machines where the cost of the addressing mode containing the sum is no higher than that of a simple indirect reference, this will produce an additional instruction and possibly require an additional register. Proper specification of this macro eliminates this overhead for such machines. Similar use of this macro is made in strength reduction of loops. ADDRESS need not be valid as an address. In such a case, the cost is not relevant and can be any value; invalid addresses need not be assigned a different cost. On machines where an address involving more than one register is as cheap as an address computation involving only one register, defining `ADDRESS_COST' to reflect this can cause two registers to be live over a region of code where only one would have been if `ADDRESS_COST' were not defined in that manner. This effect should be considered in the definition of this macro. Equivalent costs should probably only be given to addresses with different numbers of registers on machines with lots of registers. This macro will normally either not be defined or be defined as a constant. On s390 symbols are expensive if compiled with fpic lifetimes. */#define ADDRESS_COST(RTX) \ ((flag_pic && GET_CODE (RTX) == SYMBOL_REF) ? 2 : 1)/* On s390, copy between fprs and gprs is expensive. */#define REGISTER_MOVE_COST(MODE, CLASS1, CLASS2) \ (( ( reg_classes_intersect_p ((CLASS1), GENERAL_REGS) \ && reg_classes_intersect_p ((CLASS2), FP_REGS)) \ || ( reg_classes_intersect_p ((CLASS1), FP_REGS) \ && reg_classes_intersect_p ((CLASS2), GENERAL_REGS))) ? 10 : 1)/* A C expression for the cost of moving data of mode M between a register and memory. A value of 2 is the default; this cost is relative to those in `REGISTER_MOVE_COST'. If moving between registers and memory is more expensive than between two registers, you should define this macro to express the relative cost. */#define MEMORY_MOVE_COST(M, C, I) 1/* A C expression for the cost of a branch instruction. A value of 1 is the default; other values are interpreted relative to that. */#define BRANCH_COST 1/* Add any extra modes needed to represent the condition code. */#define EXTRA_CC_MODES \ CC (CCZmode, "CCZ") \ CC (CCAmode, "CCA") \ CC (CCLmode, "CCL") \ CC (CCUmode, "CCU") \ CC (CCSmode, "CCS") \ CC (CCTmode, "CCT") /* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE, return the mode to be used for the comparison. */ #define SELECT_CC_MODE(OP, X, Y) s390_select_ccmode ((OP), (X), (Y)) /* Define the information needed to generate branch and scc insns. This is stored from the compare operation. Note that we can't use "rtx" here since it hasn't been defined! */ extern struct rtx_def *s390_compare_op0, *s390_compare_op1;/* How to refer to registers in assembler output. This sequence is indexed by compiler's hard-register-number (see above). */#define REGISTER_NAMES \{ "%r0", "%r1", "%r2", "%r3", "%r4", "%r5", "%r6", "%r7", \ "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", \ "%f0", "%f2", "%f4", "%f6", "%f1", "%f3", "%f5", "%f7", \ "%f8", "%f10", "%f12", "%f14", "%f9", "%f11", "%f13", "%f15", \ "%ap", "%cc", "%fp" \}/* implicit call of memcpy, not bcopy */#define TARGET_MEM_FUNCTIONS/* Either simplify a location expression, or return the original. */#define ASM_SIMPLIFY_DWARF_ADDR(X) \ s390_simplify_dwarf_addr (X)/* Print operand X (an rtx) in assembler syntax to file FILE. CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified. For `%' followed by punctuation, CODE is the punctuation and X is null. */#define PRINT_OPERAND(FILE, X, CODE) print_operand (FILE, X, CODE)#define PRINT_OPERAND_ADDRESS(FILE, ADDR) print_operand_address (FILE, ADDR)/* Define the codes that are matched by predicates in aux-output.c. */#define PREDICATE_CODES \ {"s_operand", { SUBREG, MEM }}, \ {"s_imm_operand", { CONST_INT, CONST_DOUBLE, SUBREG, MEM }}, \ {"bras_sym_operand",{ SYMBOL_REF, CONST }}, \ {"larl_operand", { SYMBOL_REF, CONST, CONST_INT, CONST_DOUBLE }}, \ {"load_multiple_operation", {PARALLEL}}, \ {"store_multiple_operation", {PARALLEL}}, \ {"const0_operand", { CONST_INT, CONST_DOUBLE }}, \ {"consttable_operand", { SYMBOL_REF, LABEL_REF, CONST, \ CONST_INT, CONST_DOUBLE }}, \ {"s390_plus_operand", { PLUS }},/* S/390 constant pool breaks the devices in crtstuff.c to control section in where code resides. We have to write it as asm code. */#ifndef __s390x__#define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \ asm (SECTION_OP "\n\ bras\t%r2,1f\n\0: .long\t" USER_LABEL_PREFIX #FUNC " - 0b\n\1: l\t%r3,0(%r2)\n\ bas\t%r14,0(%r3,%r2)\n\ .previous");#endif/* Constant Pool for all symbols operands which are changed with force_const_mem during insn generation (expand_insn). */extern int s390_pool_count;extern int s390_nr_constants;extern int s390_pool_overflow;#define ASM_OUTPUT_POOL_PROLOGUE(FILE, FUNNAME, fndecl, size) \{ \ struct pool_constant *pool; \ \ if (s390_pool_count == -1) \ { \ s390_nr_constants = 0; \ for (pool = first_pool; pool; pool = pool->next) \ if (pool->mark) s390_nr_constants++; \ return; \ } \}#define ASM_OUTPUT_SPECIAL_POOL_ENTRY(FILE, EXP, MODE, ALIGN, LABELNO, WIN) \{ \ fprintf (FILE, ".LC%d:\n", LABELNO); \ \ /* Output the value of the constant itself. */ \ switch (GET_MODE_CLASS (MODE)) \ { \ case MODE_FLOAT: \ if (GET_CODE (EXP) != CONST_DOUBLE) \ abort (); \ \ memcpy ((char *) &u, (char *) &CONST_DOUBLE_LOW (EXP), sizeof u); \ assemble_real (u.d, MODE, ALIGN); \ break; \ \ case MODE_INT: \ case MODE_PARTIAL_INT: \ if (flag_pic \ && (GET_CODE (EXP) == CONST \ || GET_CODE (EXP) == SYMBOL_REF \ || GET_CODE (EXP) == LABEL_REF )) \ { \ fputs (integer_asm_op (UNITS_PER_WORD, TRUE), FILE); \ s390_output_symbolic_const (FILE, EXP); \ fputc ('\n', (FILE)); \ } \ else \ { \ assemble_integer (EXP, GET_MODE_SIZE (MODE), ALIGN, 1); \ if (GET_MODE_SIZE (MODE) == 1) \ ASM_OUTPUT_SKIP ((FILE), 1); \ } \ break; \ \ default: \ abort (); \ } \ goto WIN; \}#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -