📄 rs6000.h
字号:
} \ \void \toc_section () \{ \ if (in_section != toc) \ fprintf (asm_out_file, "\t.toc\n"); \ \ in_section = toc; \}/* This macro produces the initial definition of a function name. On the RS/6000, we need to place an extra '.' in the function name and output the function descriptor. The csect for the function will have already been created by the `text_section' call previously done. We do have to go back to that csect, however. *//* ??? What do the 16 and 044 in the .function line really mean? */#define ASM_DECLARE_FUNCTION_NAME(FILE,NAME,DECL) \{ if (TREE_PUBLIC (DECL)) \ { \ fprintf (FILE, "\t.globl ."); \ RS6000_OUTPUT_BASENAME (FILE, NAME); \ fprintf (FILE, "\n"); \ } \ else if (write_symbols == XCOFF_DEBUG) \ { \ fprintf (FILE, "\t.lglobl ."); \ RS6000_OUTPUT_BASENAME (FILE, NAME); \ fprintf (FILE, "\n"); \ } \ fprintf (FILE, "\t.csect "); \ RS6000_OUTPUT_BASENAME (FILE, NAME); \ fprintf (FILE, "[DS]\n"); \ RS6000_OUTPUT_BASENAME (FILE, NAME); \ fprintf (FILE, ":\n"); \ fprintf (FILE, "\t.long ."); \ RS6000_OUTPUT_BASENAME (FILE, NAME); \ fprintf (FILE, ", TOC[tc0], 0\n"); \ fprintf (FILE, "\t.csect [PR]\n."); \ RS6000_OUTPUT_BASENAME (FILE, NAME); \ fprintf (FILE, ":\n"); \ if (write_symbols == XCOFF_DEBUG) \ xcoffout_declare_function (FILE, DECL, NAME); \}/* Return non-zero if this entry is to be written into the constant pool in a special way. We do so if this is a SYMBOL_REF, LABEL_REF or a CONST containing one of them. If -mfp-in-toc (the default), we also do this for floating-point constants. We actually can only do this if the FP formats of the target and host machines are the same, but we can't check that since not every file that uses GO_IF_LEGITIMATE_ADDRESS_P includes real.h. */#define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X) \ (GET_CODE (X) == SYMBOL_REF \ || (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS \ && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF) \ || GET_CODE (X) == LABEL_REF \ || (TARGET_FP_IN_TOC && GET_CODE (X) == CONST_DOUBLE \ && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \ && BITS_PER_WORD == HOST_BITS_PER_INT))/* Select section for constant in constant pool. On RS/6000, all constants are in the private read-only data area. However, if this is being placed in the TOC it must be output as a toc entry. */#define SELECT_RTX_SECTION(MODE, X) \{ if (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (X)) \ toc_section (); \ else \ read_only_private_data_section (); \}/* Macro to output a special constant pool entry. Go to WIN if we output it. Otherwise, it is written the usual way. On the RS/6000, toc entries are handled this way. */#define ASM_OUTPUT_SPECIAL_POOL_ENTRY(FILE, X, MODE, ALIGN, LABELNO, WIN) \{ if (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (X)) \ { \ output_toc (FILE, X, LABELNO); \ goto WIN; \ } \}/* Select the section for an initialized data object. On the RS/6000, we have a special section for all variables except those that are static. */#define SELECT_SECTION(EXP,RELOC) \{ \ if ((TREE_READONLY (EXP) \ || (TREE_CODE (EXP) == STRING_CST \ && !flag_writable_strings)) \ && ! TREE_THIS_VOLATILE (EXP) \ && ! (RELOC)) \ { \ if (TREE_PUBLIC (EXP)) \ read_only_data_section (); \ else \ read_only_private_data_section (); \ } \ else \ { \ if (TREE_PUBLIC (EXP)) \ data_section (); \ else \ private_data_section (); \ } \}/* This outputs NAME to FILE up to the first null or '['. */#define RS6000_OUTPUT_BASENAME(FILE, NAME) \ if ((NAME)[0] == '*') \ assemble_name (FILE, NAME); \ else \ { \ char *_p; \ for (_p = (NAME); *_p && *_p != '['; _p++) \ fputc (*_p, FILE); \ }/* Output something to declare an external symbol to the assembler. Most assemblers don't need this. If we haven't already, add "[RW]" (or "[DS]" for a function) to the name. Normally we write this out along with the name. In the few cases where we can't, it gets stripped off. */#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \{ rtx _symref = XEXP (DECL_RTL (DECL), 0); \ if ((TREE_CODE (DECL) == VAR_DECL \ || TREE_CODE (DECL) == FUNCTION_DECL) \ && (NAME)[0] != '*' \ && (NAME)[strlen (NAME) - 1] != ']') \ { \ char *_name = (char *) permalloc (strlen (XSTR (_symref, 0)) + 5); \ strcpy (_name, XSTR (_symref, 0)); \ strcat (_name, TREE_CODE (DECL) == FUNCTION_DECL ? "[DS]" : "[RW]"); \ XSTR (_symref, 0) = _name; \ } \ fprintf (FILE, "\t.extern "); \ assemble_name (FILE, XSTR (_symref, 0)); \ if (TREE_CODE (DECL) == FUNCTION_DECL) \ { \ fprintf (FILE, "\n\t.extern ."); \ RS6000_OUTPUT_BASENAME (FILE, XSTR (_symref, 0)); \ } \ fprintf (FILE, "\n"); \}/* Similar, but for libcall. We only have to worry about the function name, not that of the descriptor. */#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \{ fprintf (FILE, "\t.extern ."); \ assemble_name (FILE, XSTR (FUN, 0)); \ fprintf (FILE, "\n"); \}/* 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 before instructions. */#define TEXT_SECTION_ASM_OP ".csect [PR]"/* Output before writable data. */#define DATA_SECTION_ASM_OP ".csect .data[RW]"/* How to refer to registers in assembler output. This sequence is indexed by compiler's hard-register-number (see above). */#define REGISTER_NAMES \ {"0", "1", "2", "3", "4", "5", "6", "7", \ "8", "9", "10", "11", "12", "13", "14", "15", \ "16", "17", "18", "19", "20", "21", "22", "23", \ "24", "25", "26", "27", "28", "29", "30", "31", \ "0", "1", "2", "3", "4", "5", "6", "7", \ "8", "9", "10", "11", "12", "13", "14", "15", \ "16", "17", "18", "19", "20", "21", "22", "23", \ "24", "25", "26", "27", "28", "29", "30", "31", \ "mq", "lr", "ctr", "ap", \ "0", "1", "2", "3", "4", "5", "6", "7" }/* Table of additional register names to use in user input. */#define ADDITIONAL_REGISTER_NAMES \ {"r0", 0, "r1", 1, "r2", 2, "r3", 3, \ "r4", 4, "r5", 5, "r6", 6, "r7", 7, \ "r8", 8, "r9", 9, "r10", 10, "r11", 11, \ "r12", 12, "r13", 13, "r14", 14, "r15", 15, \ "r16", 16, "r17", 17, "r18", 18, "r19", 19, \ "r20", 20, "r21", 21, "r22", 22, "r23", 23, \ "r24", 24, "r25", 25, "r26", 26, "r27", 27, \ "r28", 28, "r29", 29, "r30", 30, "r31", 31, \ "fr0", 32, "fr1", 33, "fr2", 34, "fr3", 35, \ "fr4", 36, "fr5", 37, "fr6", 38, "fr7", 39, \ "fr8", 40, "fr9", 41, "fr10", 42, "fr11", 43, \ "fr12", 44, "fr13", 45, "fr14", 46, "fr15", 47, \ "fr16", 48, "fr17", 49, "fr18", 50, "fr19", 51, \ "fr20", 52, "fr21", 53, "fr22", 54, "fr23", 55, \ "fr24", 56, "fr25", 57, "fr26", 58, "fr27", 59, \ "fr28", 60, "fr29", 61, "fr30", 62, "fr31", 63, \ /* no additional names for: mq, lr, ctr, ap */ \ "cr0", 68, "cr1", 69, "cr2", 70, "cr3", 71, \ "cr4", 72, "cr5", 73, "cr6", 74, "cr7", 75, \ "cc", 68 }/* How to renumber registers for dbx and gdb. */#define DBX_REGISTER_NUMBER(REGNO) (REGNO)/* This is how to output the definition of a user-level label named NAME, such as the label on a static function or variable NAME. */#define ASM_OUTPUT_LABEL(FILE,NAME) \ do { RS6000_OUTPUT_BASENAME (FILE, NAME); fputs (":\n", FILE); } while (0)/* This is how to output a command to make the user-level label named NAME defined for reference from other files. */#define ASM_GLOBALIZE_LABEL(FILE,NAME) \ do { fputs ("\t.globl ", FILE); \ RS6000_OUTPUT_BASENAME (FILE, NAME); fputs ("\n", FILE);} while (0)/* This is how to output a reference to a user-level label named NAME. `assemble_name' uses this. */#define ASM_OUTPUT_LABELREF(FILE,NAME) \ fprintf (FILE, NAME)/* This is how to output an internal numbered label where PREFIX is the class of label and NUM is the number within the class. */#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \ fprintf (FILE, "%s..%d:\n", PREFIX, NUM)/* This is how to output a label for a jump table. Arguments are the same as for ASM_OUTPUT_INTERNAL_LABEL, except the insn for the jump table is passed. */#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,TABLEINSN) \{ ASM_OUTPUT_ALIGN (FILE, 2); ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); }/* This is how to store into the string LABEL the symbol_ref name of an internal numbered label where PREFIX is the class of label and NUM is the number within the class. This is suitable for output with `assemble_name'. */#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \ sprintf (LABEL, "%s..%d", PREFIX, NUM)/* This is how to output an assembler line defining a `double' constant. */#define ASM_OUTPUT_DOUBLE(FILE,VALUE) \ fprintf (FILE, "\t.double 0d%.20e\n", (VALUE))/* This is how to output an assembler line defining a `float' constant. */#define ASM_OUTPUT_FLOAT(FILE,VALUE) \ fprintf (FILE, "\t.float 0d%.20e\n", (VALUE))/* This is how to output an assembler line defining an `int' constant. */#define ASM_OUTPUT_INT(FILE,VALUE) \( fprintf (FILE, "\t.long "), \ output_addr_const (FILE, (VALUE)), \ fprintf (FILE, "\n"))/* Likewise for `char' and `short' constants. */#define ASM_OUTPUT_SHORT(FILE,VALUE) \( fprintf (FILE, "\t.short "), \ output_addr_const (FILE, (VALUE)), \ fprintf (FILE, "\n"))#define ASM_OUTPUT_CHAR(FILE,VALUE) \( fprintf (FILE, "\t.byte "), \ output_addr_const (FILE, (VALUE)), \ fprintf (FILE, "\n"))/* This is how to output an assembler line for a numeric constant byte. */#define ASM_OUTPUT_BYTE(FILE,VALUE) \ fprintf (FILE, "\t.byte 0x%x\n", (VALUE))/* This is how to output an assembler line to define N characters starting at P to FILE. */#define ASM_OUTPUT_ASCII(FILE, P, N) output_ascii ((FILE), (P), (N))/* This is how to output code to push a register on the stack. It need not be very fast code. */#define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \ fprintf (FILE, "\tstu %s,-4(r1)\n", reg_names[REGNO]);/* This is how to output an insn to pop a register from the stack. It need not be very fast code. */#define ASM_OUTPUT_REG_POP(FILE,REGNO) \ fprintf (FILE, "\tl %s,0(r1)\n\tai r1,r1,4\n", reg_names[REGNO])/* This is how to output an element of a case-vector that is absolute. (RS/6000 does not use such vectors, but we must define this macro anyway.) */#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \ fprintf (FILE, "\t.long L..%d\n", VALUE)/* This is how to output an element of a case-vector that is relative. */#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) \ fprintf (FILE, "\t.long L..%d-L..%d\n", VALUE, REL)/* This is how to output an assembler line that says to advance the location counter to a multiple of 2**LOG bytes. */#define ASM_OUTPUT_ALIGN(FILE,LOG) \ if ((LOG) != 0) \ fprintf (FILE, "\t.align %d\n", (LOG))#define ASM_OUTPUT_SKIP(FILE,SIZE) \ fprintf (FILE, "\t.space %d\n", (SIZE))/* This says how to output an assembler line to define a global common symbol. */#define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \ do { fputs (".comm ", (FILE)); \ RS6000_OUTPUT_BASENAME ((FILE), (NAME)); \ fp
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -