📄 a29k.h
字号:
/* 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. On the 29k, large masks are expensive, so we want to use bytes to manipulate fields. */#define SLOW_BYTE_ACCESS 0/* 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/* This uses COFF, so it wants SDB format. */#define SDB_DEBUGGING_INFO/* Define this to be the delimiter between SDB sub-sections. The default is ";". */#define SDB_DELIM "\n"/* Do not break .stabs pseudos into continuations. */#define DBX_CONTIN_LENGTH 0/* Don't try to use the `x' type-cross-reference character in DBX data. Also has the consequence of putting each struct, union or enum into a separate .stabs, containing only cross-refs to the others. */#define DBX_NO_XREFS/* 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/* We assume that the store-condition-codes instructions store 0 for false and some other value for true. This is the value stored for true. */#define STORE_FLAG_VALUE 0x80000000/* 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 29k. */#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/* 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) \{ 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 \"%s\"\n", after_dir); \ 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/* 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" }/* How to renumber registers for dbx and gdb. */extern int a29k_debug_reg_map[];#define DBX_REGISTER_NUMBER(REGNO) a29k_debug_reg_map[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 { 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)/* 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, "_%s", 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 %.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 %.20e\n", (VALUE))/* This is how to output an assembler line defining an `int' constant. */#define ASM_OUTPUT_INT(FILE,VALUE) \( fprintf (FILE, "\t.word "), \ output_addr_const (FILE, (VALUE)), \ fprintf (FILE, "\n"))/* Likewise for `char' and `short' constants. */#define ASM_OUTPUT_SHORT(FILE,VALUE) \( fprintf (FILE, "\t.hword "), \ 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 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 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 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. (29k does not use such vectors, but we must define this macro anyway.) */#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) abort ()/* 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)))/* Define the parentheses used to group arithmetic operations in assembler code. */#define ASM_OPEN_PAREN "("#define ASM_CLOSE_PAREN ")"/* Define results of standard character escape sequences. */#define TARGET_BELL 007#define TARGET_BS 010#define TARGET_TAB 011#define TARGET_NEWLINE 012#define TARGET_VT 013#define TARGET_FF 014#define TARGET_CR 015/* 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}}, \ {"shift_constant_operand", {CONST_INT, ASHIFT}}, \ {"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}}, \ {"spec_reg_operand", {REG}}, \ {"accum_reg_operand", {REG}}, \ {"srcb_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}}, \ {"epilogue_operand", {CODE_LABEL}},
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -