📄 pdp11.h
字号:
#endif/* 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 read-only data. */#define TEXT_SECTION_ASM_OP "\t.text\n"/* Output before writable data. */#define DATA_SECTION_ASM_OP "\t.data\n"/* How to refer to registers in assembler output. This sequence is indexed by compiler's hard-register-number (see above). */#define REGISTER_NAMES \{"r0", "r1", "r2", "r3", "r4", "r5", "sp", "pc", \ "ac0", "ac1", "ac2", "ac3", "ac4", "ac5" }/* 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 { 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.globl ", FILE); assemble_name (FILE, NAME); fputs("\n", FILE); } while (0)/* The prefix to add to user-visible assembler symbols. */#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 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, "\tdouble %.20e\n", (VALUE))/* This is how to output an assembler line defining a `float' constant. */#define ASM_OUTPUT_FLOAT(FILE,VALUE) \ fprintf (FILE, "\tfloat %.12e\n", (VALUE))/* Likewise for `short' and `char' constants. */#define ASM_OUTPUT_SHORT(FILE,VALUE) \( fprintf (FILE, TARGET_UNIX_ASM ? "\t" : "\t.word "), \ output_addr_const_pdp11 (FILE, (VALUE)), \ fprintf (FILE, " /*short*/\n"))#define ASM_OUTPUT_CHAR(FILE,VALUE) \( fprintf (FILE, "\t.byte "), \ output_addr_const_pdp11 (FILE, (VALUE)), \ fprintf (FILE, " /* char */\n"))/* This is how to output an assembler line for a numeric constant byte. This won't actually be used since we define ASM_OUTPUT_CHAR.*/#define ASM_OUTPUT_BYTE(FILE,VALUE) \ fprintf (FILE, "\t.byte %o\n", (VALUE))#define ASM_OUTPUT_ASCII(FILE, P, SIZE) \ output_ascii (FILE, P, SIZE)/* 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%sL_%d\n", TARGET_UNIX_ASM ? "" : ".word ", 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. who needs this????*/#define ASM_OUTPUT_ALIGN(FILE,LOG) \ switch (LOG) \ { \ case 0: \ break; \ case 1: \ fprintf (FILE, "\t.even\n"); \ break; \ default: \ abort (); \ }#define ASM_OUTPUT_SKIP(FILE,SIZE) \ fprintf (FILE, "\t.=.+ %o\n", (SIZE))/* This says how to output an assembler line to define a global common symbol. */#define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \( fprintf ((FILE), ".globl "), \ assemble_name ((FILE), (NAME)), \ fprintf ((FILE), "\n"), \ assemble_name ((FILE), (NAME)), \ fprintf ((FILE), ": .=.+ %o\n", (ROUNDED)) \)/* This says how to output an assembler line to define a local common symbol. */#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \( assemble_name ((FILE), (NAME)), \ fprintf ((FILE), ":\t.=.+ %o\n", (ROUNDED)))/* 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) \{ if (CODE == '#') fprintf (FILE, "#"); \ else if (GET_CODE (X) == REG) \ fprintf (FILE, "%s", reg_names[REGNO (X)]); \ else if (GET_CODE (X) == MEM) \ output_address (XEXP (X, 0)); \ else if (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) != SImode) \ { union { double d; int i[2]; } u; \ u.i[0] = CONST_DOUBLE_LOW (X); u.i[1] = CONST_DOUBLE_HIGH (X); \ fprintf (FILE, "#%.20e", u.d); } \ else { putc ('$', FILE); output_addr_const_pdp11 (FILE, X); }}/* Print a memory address as an operand to reference that memory location. */#define PRINT_OPERAND_ADDRESS(FILE, ADDR) \ print_operand_address (FILE, ADDR)#define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \( \ fprintf (FILE, "\tmov %s, -(sp)\n", reg_names[REGNO]) \)#define ASM_OUTPUT_REG_POP(FILE,REGNO) \( \ fprintf (FILE, "\tmov (sp)+, %s\n", reg_names[REGNO]) \)#define ASM_IDENTIFY_GCC(FILE) \ fprintf(FILE, "gcc_compiled:\n")/* trampoline - how should i do it in separate i+d ? have some allocate_trampoline magic??? the following should work for shared I/D: *//* lets see whether this works as trampoline:MV #STATIC, $4 0x940Y 0x0000 <- STATIC; Y = STATIC_CHAIN_REGNUMJMP FUNCTION 0x0058 0x0000 <- FUNCTION*/#define TRAMPOLINE_TEMPLATE(FILE) \{ \ if (TARGET_SPLIT) \ abort(); \ \ ASM_OUTPUT_SHORT (FILE, GEN_INT (0x9400+STATIC_CHAIN_REGNUM)); \ ASM_OUTPUT_SHORT (FILE, const0_rtx); \ ASM_OUTPUT_SHORT (FILE, GEN_INT(0x0058)); \ ASM_OUTPUT_SHORT (FILE, const0_rtx); \}#define TRAMPOLINE_SIZE 8#define TRAMPOLINE_ALIGN 16/* Emit RTL insns to initialize the variable parts of a trampoline. FNADDR is an RTX for the address of the function's pure code. CXT is an RTX for the static chain value for the function. */#define INITIALIZE_TRAMPOLINE(TRAMP,FNADDR,CXT) \{ \ if (TARGET_SPLIT) \ abort(); \ \ emit_move_insn (gen_rtx (MEM, HImode, plus_constant (TRAMP, 2)), CXT); \ emit_move_insn (gen_rtx (MEM, HImode, plus_constant (TRAMP, 6)), FNADDR); \}/* Some machines may desire to change what optimizations are performed for various optimization levels. This macro, if defined, is executed once just after the optimization level is determined and before the remainder of the command options have been parsed. Values set in this macro are used as the default values for the other command line options. LEVEL is the optimization level specified; 2 if -O2 is specified, 1 if -O is specified, and 0 if neither is specified. */#define OPTIMIZATION_OPTIONS(LEVEL,SIZE) \{ \ if (LEVEL >= 3) \ { \ if (! SIZE) \ flag_inline_functions = 1; \ flag_omit_frame_pointer = 1; \ /* flag_unroll_loops = 1; */ \ } \}/* Provide the costs of a rtl expression. This is in the body of a switch on CODE. we don't say how expensive SImode is - pretty expensive!!! there is something wrong in MULT because MULT is not as cheap as total = 2 even if we can shift! if optimizing for size make mult etc cheap, but not 1, so when in doubt the faster insn is chosen.*/#define RTX_COSTS(X,CODE,OUTER_CODE) \ case MULT: \ if (optimize_size) \ total = COSTS_N_INSNS(2); \ else \ total = COSTS_N_INSNS (11); \ break; \ case DIV: \ if (optimize_size) \ total = COSTS_N_INSNS(2); \ else \ total = COSTS_N_INSNS (25); \ break; \ case MOD: \ if (optimize_size) \ total = COSTS_N_INSNS(2); \ else \ total = COSTS_N_INSNS (26); \ break; \ case ABS: \ /* equivalent to length, so same for optimize_size */ \ total = COSTS_N_INSNS (3); \ break; \ case ZERO_EXTEND: \ /* only used for: qi->hi */ \ total = COSTS_N_INSNS(1); \ break; \ case SIGN_EXTEND: \ if (GET_MODE(X) == HImode) \ total = COSTS_N_INSNS(1); \ else if (GET_MODE(X) == SImode) \ total = COSTS_N_INSNS(6); \ else \ total = COSTS_N_INSNS(2); \ break; \ /* case LSHIFT: */ \ case ASHIFT: \ case LSHIFTRT: \ case ASHIFTRT: \ if (optimize_size) \ total = COSTS_N_INSNS(1); \ else if (GET_MODE(X) == QImode) \ { \ if (GET_CODE(XEXP (X,1)) != CONST_INT) \ total = COSTS_N_INSNS(8); /* worst case */ \ else \ total = COSTS_N_INSNS(INTVAL(XEXP (X,1))); \ } \ else if (GET_MODE(X) == HImode) \ { \ if (GET_CODE(XEXP (X,1)) == CONST_INT) \ { \ if (abs (INTVAL (XEXP (X, 1))) == 1) \ total = COSTS_N_INSNS(1); \ else \ total = COSTS_N_INSNS(2.5 + 0.5 *INTVAL(XEXP(X,1))); \ } \ else /* worst case */ \ total = COSTS_N_INSNS (10); \ } \ else if (GET_MODE(X) == SImode) \ { \ if (GET_CODE(XEXP (X,1)) == CONST_INT) \ total = COSTS_N_INSNS(2.5 + 0.5 *INTVAL(XEXP(X,1))); \ else /* worst case */ \ total = COSTS_N_INSNS(18); \ } \ break;/* there is no point in avoiding branches on a pdp, since branches are really cheap - I just want to find out how much difference the BRANCH_COST macro makes in code */#define BRANCH_COST (TARGET_BRANCH_CHEAP ? 0 : 1)#define COMPARE_FLAG_MODE HImode
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -