📄 mmix.h
字号:
FIXME: Not needed if nonlocal_goto_stack_level. */#define EPILOGUE_USES(REGNO) \ ((REGNO) == MMIX_INCOMING_RETURN_ADDRESS_REGNUM)/* Node: Profiling */#define FUNCTION_PROFILER(FILE, LABELNO) \ mmix_function_profiler (FILE, LABELNO)/* Node: Varargs *//* For the moment, let's stick to pushing argument registers on the stack. Later, we can parse all arguments in registers, to improve performance. */#define SETUP_INCOMING_VARARGS(A, M, T, P, S) \ mmix_setup_incoming_varargs(&(A), M, T, &(P), S)/* FIXME: This and other EXPAND_BUILTIN_VA_... target macros are not documented, although used by several targets. */#define EXPAND_BUILTIN_VA_ARG(VALIST, TYPE) \ mmix_expand_builtin_va_arg (VALIST, TYPE)/* Node: Trampolines */#define TRAMPOLINE_TEMPLATE(FILE) \ mmix_trampoline_template (FILE)#define TRAMPOLINE_SIZE mmix_trampoline_size#define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, STATIC_CHAIN) \ mmix_initialize_trampoline (ADDR, FNADDR, STATIC_CHAIN)/* Node: Library Calls */#define TARGET_MEM_FUNCTIONS/* Node: Addressing Modes */#define CONSTANT_ADDRESS_P(X) \ mmix_constant_address_p (X)#define MAX_REGS_PER_ADDRESS 2#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, LABEL) \ if (mmix_legitimate_address (MODE, X, MMIX_REG_OK_STRICT)) \ goto LABEL#ifndef REG_OK_STRICT# define REG_OK_FOR_BASE_P(X) \ (REGNO (X) <= MMIX_LAST_GENERAL_REGISTER \ || REGNO (X) == MMIX_ARG_POINTER_REGNUM \ || REGNO (X) >= FIRST_PSEUDO_REGISTER)#else# define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))#endif /* REG_OK_STRICT */#define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_BASE_P (X)#define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN)#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL)#define LEGITIMATE_CONSTANT_P(X) \ mmix_legitimate_constant_p (X)/* Node: Condition Code */#define SELECT_CC_MODE(OP, X, Y) \ mmix_select_cc_mode (OP, X, Y)/* A definition of CANONICALIZE_COMPARISON that changed LE and GT comparisons with -1 to LT and GE respectively, and LT, LTU, GE or GEU comparisons with 256 to 255 and LE, LEU, GT and GTU has been ineffective; the code path for performing the changes did not trig for neither the GCC test-suite nor ghostscript-6.52 nor Knuth's mmix.tar.gz itself (core GCC functionality supposedly handling it) with sources from 2002-06-06. */#define REVERSIBLE_CC_MODE(MODE) \ mmix_reversible_cc_mode (MODE)/* Node: Costs *//* This one takes on both the RTX_COSTS and CONST_COSTS tasks. */#define DEFAULT_RTX_COSTS(X, CODE, OUTER_CODE) \ { \ int mmix_rtx_cost; \ if (mmix_rtx_cost_recalculated (X, CODE, OUTER_CODE, \ &mmix_rtx_cost)) \ return mmix_rtx_cost; \ }#define ADDRESS_COST(ADDRESS) mmix_address_cost (ADDRESS)/* The special registers can only move to and from general regs, and we need to check that their constraints match, so say 3 for them. *//* WARNING: gcc-2.7.2.2 i686-pc-linux-gnulibc1 (as shipped with RH 4.2) miscompiles reload1.c:reload_cse_simplify_set; a call to reload_cse_regno_equal_p is missing when checking if a substitution of a register setting is valid if this is defined to just the expression in mmix_register_move_cost. Symptom: a (all?) register setting is optimized away for e.g. "char *p1(char *p) { return p+1; }" and the value of register zero ($0) is returned. We can workaround by making this a function call - unknown if this causes dire speed effects. */#define REGISTER_MOVE_COST(MODE, FROM, TO) \ mmix_register_move_cost (MODE, FROM, TO)#define SLOW_BYTE_ACCESS 0/* Node: Sections *//* This must be a constant string, since it's used in crtstuff.c. */#define TEXT_SECTION_ASM_OP \ "\t.text ! mmixal:= 9H LOC 8B"/* FIXME: Not documented. */#define DATA_SECTION_ASM_OP \ mmix_data_section_asm_op ()#define READONLY_DATA_SECTION_ASM_OP "\t.section\t.rodata"/* Node: PIC *//* (empty) *//* Node: File Framework */#define ASM_FILE_START(STREAM) \ mmix_asm_file_start (STREAM)#define ASM_FILE_END(STREAM) \ mmix_asm_file_end (STREAM)/* While any other punctuation character but ";" would do, we prefer "%" or "!"; "!" is an unary operator and so will not be mistakenly included in correctly formed expressions. The hash character adds mass; catches the eye. We can't have it as a comment char by itself, since it's a hex-number prefix. */#define ASM_COMMENT_START "!#"/* These aren't currently functional. We just keep them as markers. */#define ASM_APP_ON "%APP\n"#define ASM_APP_OFF "%NO_APP\n"#define ASM_OUTPUT_SOURCE_FILENAME(STREAM, NAME) \ mmix_asm_output_source_filename (STREAM, NAME)#define OUTPUT_QUOTED_STRING(STREAM, STRING) \ mmix_output_quoted_string (STREAM, STRING, strlen (STRING))#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) \ mmix_asm_output_source_line (STREAM, LINE)#define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section/* Node: Data Output */#define ASM_OUTPUT_ASCII(STREAM, PTR, LEN) \ mmix_asm_output_ascii (STREAM, PTR, LEN)/* Node: Uninitialized Data */#define ASM_OUTPUT_ALIGNED_COMMON(ST, N, S, A) \ mmix_asm_output_aligned_common (ST, N, S, A)#define ASM_OUTPUT_ALIGNED_LOCAL(ST, N, S, A) \ mmix_asm_output_aligned_local (ST, N, S, A)/* Node: Label Output */#define ASM_OUTPUT_LABEL(STREAM, NAME) \ mmix_asm_output_label (STREAM, NAME)#define ASM_DECLARE_REGISTER_GLOBAL(STREAM, DECL, REGNO, NAME) \ mmix_asm_declare_register_global (STREAM, DECL, REGNO, NAME)#define GLOBAL_ASM_OP "\t.global "#define ASM_WEAKEN_LABEL(STREAM, NAME) \ mmix_asm_weaken_label (STREAM, NAME)#define MAKE_DECL_ONE_ONLY(DECL) \ mmix_make_decl_one_only (DECL)#define ASM_OUTPUT_LABELREF(STREAM, NAME) \ mmix_asm_output_labelref (STREAM, NAME)#define ASM_OUTPUT_INTERNAL_LABEL(STREAM, PREFIX, NUM) \ mmix_asm_output_internal_label (STREAM, PREFIX, NUM)/* We insert a ":" to disambiguate against user symbols like L5. */#define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM) \ sprintf (LABEL, "*%s:%ld", PREFIX, (long)(NUM))/* Insert "::"; these are rarer than internal labels. FIXME: Make sure no ":" is seen in the object file; we don't really want that mmixal feature visible there. We don't want the default, which uses a dot; that'd be incompatible with mmixal. */#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \ ((OUTPUT) = (char *) alloca (strlen ((NAME)) + 2 + 10), \ sprintf ((OUTPUT), "%s::%d", (NAME), (LABELNO)))#define ASM_OUTPUT_DEF(STREAM, NAME, VALUE) \ mmix_asm_output_def (STREAM, NAME, VALUE)/* Node: Macros for Initialization *//* We're compiling to ELF and linking to MMO; fundamental ELF features that GCC depend on are there. *//* These must be constant strings, since they're used in crtstuff.c. */#define INIT_SECTION_ASM_OP "\t.section .init,\"ax\" ! mmixal-incompatible"#define FINI_SECTION_ASM_OP "\t.section .fini,\"ax\" ! mmixal-incompatible"#define OBJECT_FORMAT_ELF/* Node: Instruction Output *//* The non-$ register names must be prefixed with ":", since they're affected by PREFIX. We provide the non-colon names as additional names. */#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", \ "$32", "$33", "$34", "$35", "$36", "$37", "$38", "$39", \ "$40", "$41", "$42", "$43", "$44", "$45", "$46", "$47", \ "$48", "$49", "$50", "$51", "$52", "$53", "$54", "$55", \ "$56", "$57", "$58", "$59", "$60", "$61", "$62", "$63", \ "$64", "$65", "$66", "$67", "$68", "$69", "$70", "$71", \ "$72", "$73", "$74", "$75", "$76", "$77", "$78", "$79", \ "$80", "$81", "$82", "$83", "$84", "$85", "$86", "$87", \ "$88", "$89", "$90", "$91", "$92", "$93", "$94", "$95", \ "$96", "$97", "$98", "$99", "$100", "$101", "$102", "$103", \ "$104", "$105", "$106", "$107", "$108", "$109", "$110", "$111", \ "$112", "$113", "$114", "$115", "$116", "$117", "$118", "$119", \ "$120", "$121", "$122", "$123", "$124", "$125", "$126", "$127", \ "$128", "$129", "$130", "$131", "$132", "$133", "$134", "$135", \ "$136", "$137", "$138", "$139", "$140", "$141", "$142", "$143", \ "$144", "$145", "$146", "$147", "$148", "$149", "$150", "$151", \ "$152", "$153", "$154", "$155", "$156", "$157", "$158", "$159", \ "$160", "$161", "$162", "$163", "$164", "$165", "$166", "$167", \ "$168", "$169", "$170", "$171", "$172", "$173", "$174", "$175", \ "$176", "$177", "$178", "$179", "$180", "$181", "$182", "$183", \ "$184", "$185", "$186", "$187", "$188", "$189", "$190", "$191", \ "$192", "$193", "$194", "$195", "$196", "$197", "$198", "$199", \ "$200", "$201", "$202", "$203", "$204", "$205", "$206", "$207", \ "$208", "$209", "$210", "$211", "$212", "$213", "$214", "$215", \ "$216", "$217", "$218", "$219", "$220", "$221", "$222", "$223", \ "$224", "$225", "$226", "$227", "$228", "$229", "$230", "$231", \ "$232", "$233", "$234", "$235", "$236", "$237", "$238", "$239", \ "$240", "$241", "$242", "$243", "$244", "$245", "$246", "$247", \ "$248", "$249", "$250", "$251", "$252", "$253", "$254", "$255", \ ":rD", ":rE", ":rH", ":rJ", ":rR", "ap_!BAD!", ":rO"}#define ADDITIONAL_REGISTER_NAMES \ {{"sp", 254}, {":sp", 254}, {"rD", 256}, {"rE", 257}, \ {"rH", 258}, {"rJ", MMIX_rJ_REGNUM}, {"rO", MMIX_rO_REGNUM}}#define PRINT_OPERAND(STREAM, X, CODE) \ mmix_print_operand (STREAM, X, CODE)#define PRINT_OPERAND_PUNCT_VALID_P(CODE) \ mmix_print_operand_punct_valid_p (CODE)#define PRINT_OPERAND_ADDRESS(STREAM, X) \ mmix_print_operand_address (STREAM, X)#define ASM_OUTPUT_REG_PUSH(STREAM, REGNO) \ mmix_asm_output_reg_push (STREAM, REGNO)#define ASM_OUTPUT_REG_POP(STREAM, REGNO) \ mmix_asm_output_reg_pop (STREAM, REGNO)/* Node: Dispatch Tables *//* We define both types, since SImode is the better, but DImode the only possible for mmixal so that's the one actually used. */#define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM, BODY, VALUE, REL) \ mmix_asm_output_addr_diff_elt (STREAM, BODY, VALUE, REL)#define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE) \ mmix_asm_output_addr_vec_elt (STREAM, VALUE)/* Node: Exception Region Output *//* (empty) *//* Node: Alignment Output */#define ASM_OUTPUT_SKIP(STREAM, NBYTES) \ mmix_asm_output_skip (STREAM, NBYTES)#define ASM_OUTPUT_ALIGN(STREAM, POWER) \ mmix_asm_output_align (STREAM, POWER)/* Node: All Debuggers */#define DBX_REGISTER_NUMBER(REGNO) \ mmix_dbx_register_number (REGNO)/* Node: DBX Options *//* (empty) *//* Node: DBX Hooks *//* (empty) *//* Node: File Names and DBX *//* (empty) *//* Node: SDB and DWARF */#define DWARF2_DEBUGGING_INFO 1#define DWARF2_ASM_LINE_DEBUG_INFO 1/* Node: Misc */#define PREDICATE_CODES \ {"mmix_reg_cc_operand", {SUBREG, REG}}, \ {"mmix_foldable_comparison_operator", \ {NE, EQ, GE, GT, LE, LT}}, \ /* All '<', actually. */ \ {"mmix_comparison_operator", \ {NE, EQ, GE, GT, LE, LT, GEU, GTU, LEU, \ LTU, UNORDERED, ORDERED, UNEQ, UNGE, UNLE, \ UNLT, LTGT}}, \ {"mmix_symbolic_or_address_operand", \ {SYMBOL_REF, LABEL_REF, CONST, \ SUBREG, REG, PLUS}}, \ {"mmix_reg_or_constant_operand", \ {CONST_INT, CONST_DOUBLE, SUBREG, REG}}, \ {"mmix_reg_or_8bit_operand", \ {CONST_INT, CONST_DOUBLE, SUBREG, REG}}, \ {"mmix_reg_or_0_operand", \ {CONST_INT, CONST_DOUBLE, SUBREG, REG}},#define SPECIAL_MODE_PREDICATES "mmix_symbolic_or_address_operand",/* There's no way to get a PC-relative offset into tables for SImode, so for the moment we have absolute entries in DImode. When we're going ELF, these should be SImode and 1. */#define CASE_VECTOR_MODE DImode#define CASE_VECTOR_PC_RELATIVE 0#define WORD_REGISTER_OPERATIONS/* We have a choice, which makes this yet another parameter to tweak. The gut feeling is currently that SIGN_EXTEND wins; "int" is more frequent than "unsigned int", and we have signed characters. FIXME: measure. */#define LOAD_EXTEND_OP(MODE) (TARGET_ZERO_EXTEND ? ZERO_EXTEND : SIGN_EXTEND)#define MOVE_MAX 8#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1/* We have a choice here too. */#if 0/* FIXME: Revisit, we don't have scc expanders yet. */#define STORE_FLAG_VALUE 1#endif#define Pmode DImode#define FUNCTION_MODE QImode#define NO_IMPLICIT_EXTERN_C#define HANDLE_SYSV_PRAGMA 1/* These are checked. */#define DOLLARS_IN_IDENTIFIERS 0#define NO_DOLLAR_IN_LABEL#define NO_DOT_IN_LABEL/* Calculate the highest used supposed saved stack register. */#define MACHINE_DEPENDENT_REORG(INSN) \ mmix_machine_dependent_reorg (INSN)#endif /* GCC_MMIX_H *//* * Local variables: * eval: (c-set-style "gnu") * indent-tabs-mode: t * End: */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -