📄 rs6000.h
字号:
if ((MODE) != DImode && (MODE) != TImode \ && LEGITIMATE_INDEXED_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. On RS/6000, first check for the sum of a register with a constant integer that is out of range. If so, generate code to add the constant with the low-order 16 bits masked to the register and force this result into another register (this can be done with `cau'). Then generate an address of REG+(CONST&0xffff), allowing for the possibility of bit 16 being a one. Then check for the sum of a register and something not constant, try to load the other things into a register and return the sum. */#define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) \{ if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == REG \ && GET_CODE (XEXP (X, 1)) == CONST_INT \ && (unsigned) (INTVAL (XEXP (X, 1)) + 0x8000) >= 0x10000) \ { int high_int, low_int; \ high_int = INTVAL (XEXP (X, 1)) >> 16; \ low_int = INTVAL (XEXP (X, 1)) & 0xffff; \ if (low_int & 0x8000) \ high_int += 1, low_int |= 0xffff0000; \ (X) = gen_rtx (PLUS, SImode, \ force_operand \ (gen_rtx (PLUS, SImode, XEXP (X, 0), \ gen_rtx (CONST_INT, VOIDmode, \ high_int << 16)), 0),\ gen_rtx (CONST_INT, VOIDmode, low_int)); \ goto WIN; \ } \ else if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == REG \ && GET_CODE (XEXP (X, 1)) != CONST_INT \ && (MODE) != DImode && (MODE) != TImode) \ { \ (X) = gen_rtx (PLUS, SImode, XEXP (X, 0), \ force_reg (SImode, force_operand (XEXP (X, 1), 0))); \ 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 RS/6000 this is true if the address is valid with a zero offset but not with an offset of four (this means it cannot be used as an address for DImode or DFmode) or is a pre-increment or decrement. Since we know it is valid, we just check for an address that is not valid with an offset of four. */#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \{ if (GET_CODE (ADDR) == PLUS \ && LEGITIMATE_ADDRESS_INTEGER_P (XEXP (ADDR, 1), 0) \ && ! LEGITIMATE_ADDRESS_INTEGER_P (XEXP (ADDR, 1), 4)) \ goto LABEL; \ if (GET_CODE (ADDR) == PRE_INC) \ goto LABEL; \ if (GET_CODE (ADDR) == PRE_DEC) \ goto LABEL; \}/* Define this if some processing needs to be done immediately before emitting code for an insn. *//* #define FINAL_PRESCAN_INSN(INSN,OPERANDS,NOPERANDS) *//* Specify the machine mode that this machine uses for the index in the tablejump instruction. */#define CASE_VECTOR_MODE 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/* 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/* Define this as 1 if `char' should by default be signed; else as 0. */#define DEFAULT_SIGNED_CHAR 0/* This flag, if defined, says the same insns that convert to a signed fixnum also convert validly to an unsigned one. *//* #define FIXUNS_TRUNC_LIKE_FIX_TRUNC *//* Max number of bytes we can move from memory to memory in one reasonably fast instruction. */#define MOVE_MAX 16/* Nonzero if access to memory by bytes is no faster than for words. Also non-zero if doing byte operations (specifically shifts) in registers is undesirable. */#define SLOW_BYTE_ACCESS 1/* Define if normal loads of shorter-than-word items from memory clears the rest of the bigs in the register. */#define BYTE_LOADS_ZERO_EXTEND/* The RS/6000 uses the XCOFF format. */#define XCOFF_DEBUGGING_INFO/* Define if the object format being used is COFF or a superset. */#define OBJECT_FORMAT_COFF/* We don't have GAS for the RS/6000 yet, so don't write out special .stabs in cc1plus. */ #define FASCIST_ASSEMBLER/* 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 SImode/* Mode of a function address in a call instruction (for indexing purposes). Doesn't matter on RS/6000. */#define FUNCTION_MODE SImode/* 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/* Define this if shift instructions ignore all but the low-order few bits. */#define SHIFT_COUNT_TRUNCATED/* Use atexit for static constructors/destructors, instead of defining our own exit function. */#define HAVE_ATEXIT/* 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. Otherwise, break from the switch. On the RS/6000, if it is legal in the insn, it is free. So this always returns 0. */#define CONST_COSTS(RTX,CODE,OUTER_CODE) \ case CONST_INT: \ case CONST: \ case LABEL_REF: \ case SYMBOL_REF: \ case CONST_DOUBLE: \ return 0;/* Provide the costs of a rtl expression. This is in the body of a switch on CODE. */#define RTX_COSTS(X,CODE,OUTER_CODE) \ case MULT: \ return (GET_CODE (XEXP (X, 1)) != CONST_INT \ ? COSTS_N_INSNS (5) \ : INTVAL (XEXP (X, 1)) >= -256 && INTVAL (XEXP (X, 1)) <= 255 \ ? COSTS_N_INSNS (3) : COSTS_N_INSNS (4)); \ case DIV: \ case MOD: \ if (GET_CODE (XEXP (X, 1)) == CONST_INT \ && exact_log2 (INTVAL (XEXP (X, 1))) >= 0) \ return COSTS_N_INSNS (2); \ /* otherwise fall through to normal divide. */ \ case UDIV: \ case UMOD: \ return COSTS_N_INSNS (19); \ case MEM: \ /* MEM should be slightly more expensive than (plus (reg) (const)) */ \ return 5;/* Compute the cost of an address. This is meant to approximate the size and/or execution delay of an insn using that address. If the cost is approximated by the RTL complexity, including CONST_COSTS above, as is usually the case for CISC machines, this macro should not be defined. For aggressively RISCy machines, only one insn format is allowed, so this macro should be a constant. The value of this macro only matters for valid addresses. For the RS/6000, everything is cost 0. */#define ADDRESS_COST(RTX) 0/* Adjust the length of an INSN. LENGTH is the currently-computed length and should be adjusted to reflect any required changes. This macro is used when there is some systematic length adjustment required that would be difficult to express in the length attribute. *//* #define ADJUST_INSN_LENGTH(X,LENGTH) *//* Add any extra modes needed to represent the condition code. For the RS/6000, we need separate modes when unsigned (logical) comparisons are being done and we need a separate mode for floating-point. We also use a mode for the case when we are comparing the results of two comparisons. */#define EXTRA_CC_MODES CCUNSmode, CCFPmode, CCEQmode/* Define the names for the modes specified above. */#define EXTRA_CC_NAMES "CCUNS", "CCFP", "CCEQ"/* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE, return the mode to be used for the comparison. For floating-point, CCFPmode should be used. CCUNSmode should be used for unsigned comparisons. CCEQmode should be used when we are doing an inequality comparison on the result of a comparison. CCmode should be used in all other cases. */#define SELECT_CC_MODE(OP,X,Y) \ (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT ? CCFPmode \ : (OP) == GTU || (OP) == LTU || (OP) == GEU || (OP) == LEU ? CCUNSmode \ : (((OP) == EQ || (OP) == NE) && GET_RTX_CLASS (GET_CODE (X)) == '<' \ ? CCEQmode : CCmode))/* 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 *rs6000_compare_op0, *rs6000_compare_op1;extern int rs6000_compare_fp_p;/* Set to non-zero by "fix" operation to indicate that itrunc and uitrunc must be defined. */extern int rs6000_trunc_used;/* Control the assembler format that we output. *//* Output at beginning of assembler file. On the RS/6000, we want to go into the TOC section so at least one .toc will be emitted. Also initialize the section names for the RS/6000 at this point. Also, in order to output proper .bs/.es pairs, we need at least one static [RW] section emitted. */#define ASM_FILE_START(FILE) \{ \ rs6000_gen_section_name (&xcoff_bss_section_name, \ main_input_filename, ".bss_"); \ rs6000_gen_section_name (&xcoff_private_data_section_name, \ main_input_filename, ".rw_"); \ rs6000_gen_section_name (&xcoff_read_only_section_name, \ main_input_filename, ".ro_"); \ \ toc_section (); \ if (write_symbols != NO_DEBUG) \ private_data_section (); \}/* Output at end of assembler file. On the RS/6000, referencing data should automatically pull in text. */#define ASM_FILE_END(FILE) \{ \ text_section (); \ fprintf (FILE, "_section_.text:\n"); \ data_section (); \ fprintf (FILE, "\t.long _section_.text\n"); \}/* We define this to prevent the name mangler from putting dollar signs into function names. */#define NO_DOLLAR_IN_LABEL/* We define this to 0 so that gcc will never accept a dollar sign in a variable name. This is needed because the AIX assembler will not accept dollar signs. */#define DOLLARS_IN_IDENTIFIERS 0/* Implicit library calls should use memcpy, not bcopy, etc. */#define TARGET_MEM_FUNCTIONS/* Define the extra sections we need. We define three: one is the read-only data section which is used for constants. This is a csect whose name is derived from the name of the input file. The second is for initialized global variables. This is a csect whose name is that of the variable. The third is the TOC. */#define EXTRA_SECTIONS \ read_only_data, private_data, read_only_private_data, toc, bss/* Define the name of our readonly data section. */#define READONLY_DATA_SECTION read_only_data_section/* Indicate that jump tables go in the text section. */#define JUMP_TABLES_IN_TEXT_SECTION/* Define the routines to implement these extra sections. */#define EXTRA_SECTION_FUNCTIONS \ \void \read_only_data_section () \{ \ if (in_section != read_only_data) \ { \ fprintf (asm_out_file, "\t.csect %s[RO]\n", \ xcoff_read_only_section_name); \ in_section = read_only_data; \ } \} \ \void \private_data_section () \{ \ if (in_section != private_data) \ { \ fprintf (asm_out_file, "\t.csect %s[RW]\n", \ xcoff_private_data_section_name); \ \ in_section = private_data; \ } \} \ \void \read_only_private_data_section () \{ \ if (in_section != read_only_private_data) \ { \ fprintf (asm_out_file, "\t.csect %s[RO]\n", \ xcoff_private_data_section_name); \ in_section = read_only_private_data; \ } \
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -