📄 a29k.h
字号:
/* Define this to be nonzero if shift instructions ignore all but the low-order few bits. */#define SHIFT_COUNT_TRUNCATED 1/* 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. We only care about the cost if it is valid in an insn. The only constants that cause an insn to generate more than one machine instruction are those involving floating-point or address. So only these need be expensive. */#define CONST_COSTS(RTX,CODE,OUTER_CODE) \ case CONST_INT: \ return 0; \ case CONST: \ case LABEL_REF: \ case SYMBOL_REF: \ return 6; \ case CONST_DOUBLE: \ return GET_MODE (RTX) == SFmode ? 6 : 8; /* Provide the costs of a rtl expression. This is in the body of a switch on CODE. All MEMs cost the same if they are valid. This is used to ensure that (mem (symbol_ref ...)) is placed into a CALL when valid. The multiply cost depends on whether this is a 29050 or not. */#define RTX_COSTS(X,CODE,OUTER_CODE) \ case MULT: \ return TARGET_29050 ? COSTS_N_INSNS (2) : COSTS_N_INSNS (40); \ case DIV: \ case UDIV: \ case MOD: \ case UMOD: \ return COSTS_N_INSNS (50); \ case MEM: \ return COSTS_N_INSNS (2);/* Control the assembler format that we output. *//* Output at beginning of assembler file. */#define ASM_FILE_START(FILE) \{ const char *p, *after_dir = main_input_filename; \ if (TARGET_29050) \ fprintf (FILE, "\t.cputype 29050\n"); \ for (p = main_input_filename; *p; p++) \ if (*p == '/') \ after_dir = p + 1; \ fprintf (FILE, "\t.file "); \ output_quoted_string (FILE, after_dir); \ fprintf (FILE, "\n"); \ fprintf (FILE, "\t.sect .lit,lit\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 ""/* The next few macros don't have tabs on most machines, but at least one 29K assembler wants them. *//* Output before instructions. */#define TEXT_SECTION_ASM_OP "\t.text"/* Output before read-only data. */#define READONLY_DATA_SECTION_ASM_OP "\t.use .lit"/* Output before writable data. */#define DATA_SECTION_ASM_OP "\t.data"/* Define an extra section for read-only data, a routine to enter it, and indicate that it is for read-only data. */#define EXTRA_SECTIONS readonly_data#define EXTRA_SECTION_FUNCTIONS \void \literal_section () \{ \ if (in_section != readonly_data) \ { \ fprintf (asm_out_file, "%s\n", READONLY_DATA_SECTION_ASM_OP); \ in_section = readonly_data; \ } \} \#define READONLY_DATA_SECTION literal_section/* If we are referencing a function that is static or is known to be in this file, make the SYMBOL_REF special. We can use this to indicate that we can branch to this function without emitting a no-op after the call. */#define ENCODE_SECTION_INFO(DECL) \ if (TREE_CODE (DECL) == FUNCTION_DECL \ && (TREE_ASM_WRITTEN (DECL) || ! TREE_PUBLIC (DECL))) \ SYMBOL_REF_FLAG (XEXP (DECL_RTL (DECL), 0)) = 1;/* How to refer to registers in assembler output. This sequence is indexed by compiler's hard-register-number (see above). */#define REGISTER_NAMES \{"gr96", "gr97", "gr98", "gr99", "gr100", "gr101", "gr102", "gr103", "gr104", \ "gr105", "gr106", "gr107", "gr108", "gr109", "gr110", "gr111", "gr112", \ "gr113", "gr114", "gr115", "gr116", "gr117", "gr118", "gr119", "gr120", \ "gr121", "gr122", "gr123", "gr124", "gr125", "gr126", "gr127", \ "lr0", "lr1", "lr2", "lr3", "lr4", "lr5", "lr6", "lr7", "lr8", "lr9", \ "lr10", "lr11", "lr12", "lr13", "lr14", "lr15", "lr16", "lr17", "lr18", \ "lr19", "lr20", "lr21", "lr22", "lr23", "lr24", "lr25", "lr26", "lr27", \ "lr28", "lr29", "lr30", "lr31", "lr32", "lr33", "lr34", "lr35", "lr36", \ "lr37", "lr38", "lr39", "lr40", "lr41", "lr42", "lr43", "lr44", "lr45", \ "lr46", "lr47", "lr48", "lr49", "lr50", "lr51", "lr52", "lr53", "lr54", \ "lr55", "lr56", "lr57", "lr58", "lr59", "lr60", "lr61", "lr62", "lr63", \ "lr64", "lr65", "lr66", "lr67", "lr68", "lr69", "lr70", "lr71", "lr72", \ "lr73", "lr74", "lr75", "lr76", "lr77", "lr78", "lr79", "lr80", "lr81", \ "lr82", "lr83", "lr84", "lr85", "lr86", "lr87", "lr88", "lr89", "lr90", \ "lr91", "lr92", "lr93", "lr94", "lr95", "lr96", "lr97", "lr98", "lr99", \ "lr100", "lr101", "lr102", "lr103", "lr104", "lr105", "lr106", "lr107", \ "lr108", "lr109", "lr110", "lr111", "lr112", "lr113", "lr114", "lr115", \ "lr116", "lr117", "lr118", "lr119", "lr120", "lr121", "lr122", "lr123", \ "lr124", "lr125", "lr126", "lr127", \ "AI0", "AI1", "AI2", "AI3", "AI4", "AI5", "AI6", "AI7", "AI8", "AI9", \ "AI10", "AI11", "AI12", "AI13", "AI14", "AI15", "FP", \ "bp", "fc", "cr", "q", \ "vab", "ops", "cps", "cfg", "cha", "chd", "chc", "rbp", "tmc", "tmr", \ "pc0", "pc1", "pc2", "mmu", "lru", "fpe", "int", "fps", "exo", \ "0", "1", "2", "3", \ "gr64", "gr65", "gr66", "gr67", "gr68", "gr69", "gr70", "gr71", \ "gr72", "gr73", "gr74", "gr75", "gr76", "gr77", "gr78", "gr79", \ "gr80", "gr81", "gr82", "gr83", "gr84", "gr85", "gr86", "gr87", \ "gr88", "gr89", "gr90", "gr91", "gr92", "gr93", "gr94", "gr95" }/* How to renumber registers for dbx and gdb. */extern int a29k_debug_reg_map[FIRST_PSEUDO_REGISTER];#define DBX_REGISTER_NUMBER(REGNO) a29k_debug_reg_map[REGNO]/* Switch into a generic section. */#define TARGET_ASM_NAMED_SECTION a29k_asm_named_section/* 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 { assemble_name (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.global ", FILE); assemble_name (FILE, NAME); fputs ("\n", FILE);} while (0)/* The prefix to add to user-visible assembler symbols. */#undef USER_LABEL_PREFIX#define USER_LABEL_PREFIX "_"/* 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 insn to push a register on the stack. It need not be very fast code. */#define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \ fprintf (FILE, "\tsub %s,%s,4\n\tstore 0,0,%s,%s\n", \ reg_names[R_MSP], reg_names[R_MSP], reg_names[REGNO], \ reg_names[R_MSP]);/* 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, "\tload 0,0,%s,%s\n\tadd %s,%s,4\n", \ reg_names[REGNO], reg_names[R_MSP], reg_names[R_MSP], \ reg_names[R_MSP]);/* This is how to output an element of a case-vector that is absolute. */#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \ fprintf (FILE, "\t.word L%d\n", VALUE)/* This is how to output an element of a case-vector that is relative. Don't define this if it is not supported. *//* #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, 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", 1 << (LOG))#define ASM_OUTPUT_SKIP(FILE,SIZE) \ fprintf (FILE, "\t.block %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) \( fputs ("\t.comm ", (FILE)), \ assemble_name ((FILE), (NAME)), \ fprintf ((FILE), ",%d\n", (SIZE)))/* This says how to output an assembler line to define a local common symbol. */#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE,ROUNDED) \( fputs ("\t.lcomm ", (FILE)), \ assemble_name ((FILE), (NAME)), \ fprintf ((FILE), ",%d\n", (SIZE)))/* 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)))/* 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)/* Determine which codes are valid without a following integer. These must not be alphabetic. We support `#' which is null if a delay slot exists, otherwise "\n\tnop" and `*' which prints the register name for TPC (gr122). */#define PRINT_OPERAND_PUNCT_VALID_P(CODE) ((CODE) == '#' || (CODE) == '*')/* Print a memory address as an operand to reference that memory location. */#define PRINT_OPERAND_ADDRESS(FILE, ADDR) \{ register rtx addr = ADDR; \ if (!REG_P (addr) \ && ! (GET_CODE (addr) == CONST_INT \ && INTVAL (addr) >= 0 && INTVAL (addr) < 256)) \ abort (); \ output_operand (addr, 0); \}/* Define the codes that are matched by predicates in a29k.c. */#define PREDICATE_CODES \ {"cint_8_operand", {CONST_INT}}, \ {"cint_16_operand", {CONST_INT}}, \ {"long_const_operand", {CONST_INT, CONST, CONST_DOUBLE, \ LABEL_REF, SYMBOL_REF}}, \ {"const_0_operand", {CONST_INT, ASHIFT}}, \ {"const_8_operand", {CONST_INT, ASHIFT}}, \ {"const_16_operand", {CONST_INT, ASHIFT}}, \ {"const_24_operand", {CONST_INT, ASHIFT}}, \ {"float_const_operand", {CONST_DOUBLE}}, \ {"gpc_reg_operand", {SUBREG, REG}}, \ {"gpc_reg_or_float_constant_operand", {SUBREG, REG, CONST_DOUBLE}}, \ {"gpc_reg_or_integer_constant_operand", {SUBREG, REG, \ CONST_INT, CONST_DOUBLE}}, \ {"gpc_reg_or_immediate_operand", {SUBREG, REG, CONST_INT, \ CONST_DOUBLE, CONST, \ SYMBOL_REF, LABEL_REF}}, \ {"spec_reg_operand", {REG}}, \ {"accum_reg_operand", {REG}}, \ {"srcb_operand", {SUBREG, REG, CONST_INT}}, \ {"cmplsrcb_operand", {SUBREG, REG, CONST_INT}}, \ {"reg_or_immediate_operand", {SUBREG, REG, CONST_INT, CONST, \ CONST_DOUBLE, CONST, SYMBOL_REF, LABEL_REF}}, \ {"reg_or_u_short_operand", {SUBREG, REG, CONST_INT}}, \ {"and_operand", {SUBREG, REG, CONST_INT}}, \ {"add_operand", {SUBREG, REG, CONST_INT}}, \ {"call_operand", {SYMBOL_REF, CONST_INT}}, \ {"in_operand", {SUBREG, MEM, REG, CONST_INT, CONST, SYMBOL_REF, \ LABEL_REF, CONST_DOUBLE}}, \ {"out_operand", {SUBREG, REG, MEM}}, \ {"reload_memory_operand", {SUBREG, REG, MEM}}, \ {"fp_comparison_operator", {EQ, GT, GE}}, \ {"branch_operator", {GE, LT}}, \ {"load_multiple_operation", {PARALLEL}}, \ {"store_multiple_operation", {PARALLEL}}, \ {"epilogue_operand", {CODE_LABEL}},
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -