📄 s390.h
字号:
goto ADDR; \}#endif/* 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. */#define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN) \{ \ (X) = legitimize_address (X, OLDX, MODE); \ if (memory_address_p (MODE, X)) \ goto WIN; \}/* 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) \ legitimate_constant_p (X)/* Helper macro for s390.c and s390.md to check for symbolic constants. */#define SYMBOLIC_CONST(X) \(GET_CODE (X) == SYMBOL_REF \ || GET_CODE (X) == LABEL_REF \ || (GET_CODE (X) == CONST && symbolic_reference_mentioned_p (X)))#define TLS_SYMBOLIC_CONST(X) \((GET_CODE (X) == SYMBOL_REF && tls_symbolic_operand (X)) \ || (GET_CODE (X) == CONST && tls_symbolic_reference_mentioned_p (X)))/* Condition codes. *//* 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;/* Relative costs of operations. *//* 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. */#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 COSTS_N_INSNS (1); \ case MULT: \ if (GET_MODE (XEXP (X, 0)) == DImode) \ return COSTS_N_INSNS (40); \ else \ return COSTS_N_INSNS (7); \ case DIV: \ case UDIV: \ case MOD: \ case UMOD: \ return COSTS_N_INSNS (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. */#define ADDRESS_COST(RTX) s390_address_cost ((RTX))/* 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'. */#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/* Nonzero if access to memory by bytes is slow and undesirable. */#define SLOW_BYTE_ACCESS 1/* The maximum number of bytes that a single instruction can move quickly between memory and registers or between two memory locations. */#define MOVE_MAX (TARGET_64BIT ? 16 : 8)#define MAX_MOVE_MAX 16/* Determine whether to use move_by_pieces or block move insn. */#define MOVE_BY_PIECES_P(SIZE, ALIGN) \ ( (SIZE) == 1 || (SIZE) == 2 || (SIZE) == 4 \ || (TARGET_64BIT && (SIZE) == 8) )/* Determine whether to use clear_by_pieces or block clear insn. */#define CLEAR_BY_PIECES_P(SIZE, ALIGN) \ ( (SIZE) == 1 || (SIZE) == 2 || (SIZE) == 4 \ || (TARGET_64BIT && (SIZE) == 8) )/* Don't perform CSE on function addresses. */#define NO_FUNCTION_CSE/* Sections. *//* Output before read-only data. */#define TEXT_SECTION_ASM_OP ".text"/* Output before writable (initialized) data. */#define DATA_SECTION_ASM_OP ".data"/* Output before writable (uninitialized) data. */#define BSS_SECTION_ASM_OP ".bss"/* 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/* Position independent code. */extern int flag_pic; #define PIC_OFFSET_TABLE_REGNUM (flag_pic ? 12 : INVALID_REGNUM)#define LEGITIMATE_PIC_OPERAND_P(X) legitimate_pic_operand_p (X)/* Assembler file format. *//* Character to start a comment. */#define ASM_COMMENT_START "#"/* Declare an uninitialized external linkage data object. */#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)/* Globalizing directive for a label. */#define GLOBAL_ASM_OP ".globl "/* Advance the location counter to a multiple of 2**LOG bytes. */#define ASM_OUTPUT_ALIGN(FILE, LOG) \ if ((LOG)) fprintf ((FILE), "\t.align\t%d\n", 1 << (LOG))/* Advance the location counter by SIZE bytes. */#define ASM_OUTPUT_SKIP(FILE, SIZE) \ fprintf ((FILE), "\t.set\t.,.+%u\n", (SIZE))/* Output a reference to a user-level label named NAME. */#define ASM_OUTPUT_LABELREF(FILE, NAME) \ asm_fprintf ((FILE), "%U%s", (*targetm.strip_name_encoding) (NAME))/* Store in OUTPUT a string (made with alloca) containing an assembler-name for a local static variable named NAME. LABELNO is an integer which is different for each call. */#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \ ((OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \ sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))/* The LOCAL_LABEL_PREFIX variable is used by dbxelf.h. */#define LOCAL_LABEL_PREFIX "."/* Either simplify a location expression, or return the original. */#define ASM_SIMPLIFY_DWARF_ADDR(X) \ s390_simplify_dwarf_addr (X)/* 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" \}/* Print operand X (an rtx) in assembler syntax to file FILE. */#define PRINT_OPERAND(FILE, X, CODE) print_operand (FILE, X, CODE)#define PRINT_OPERAND_ADDRESS(FILE, ADDR) print_operand_address (FILE, ADDR)/* Output an element of a case-vector that is absolute. */#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \do { \ char buf[32]; \ fputs (integer_asm_op (UNITS_PER_WORD, TRUE), (FILE)); \ ASM_GENERATE_INTERNAL_LABEL (buf, "L", (VALUE)); \ assemble_name ((FILE), buf); \ fputc ('\n', (FILE)); \} while (0)/* Output an element of a case-vector that is relative. */#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \do { \ char buf[32]; \ fputs (integer_asm_op (UNITS_PER_WORD, TRUE), (FILE)); \ ASM_GENERATE_INTERNAL_LABEL (buf, "L", (VALUE)); \ assemble_name ((FILE), buf); \ fputc ('-', (FILE)); \ ASM_GENERATE_INTERNAL_LABEL (buf, "L", (REL)); \ assemble_name ((FILE), buf); \ fputc ('\n', (FILE)); \} while (0)/* 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;#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 (); \ \ REAL_VALUE_FROM_CONST_DOUBLE (r, EXP); \ assemble_real (r, MODE, ALIGN); \ break; \ \ case MODE_INT: \ case MODE_PARTIAL_INT: \ if (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; \}/* Miscellaneous parameters. *//* 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 }},/* Specify the machine mode that this machine uses for the index in the tablejump instruction. */#define CASE_VECTOR_MODE (TARGET_64BIT ? DImode : SImode)/* 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))/* 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/* 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/* This macro definition sets up a default value for `main' to return. */#define DEFAULT_MAIN_RETURN c_expand_return (integer_zero_node)/* 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) s390_machine_dependent_reorg (INSN)#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -