📄 gmicro.h
字号:
/* #define UDIVSI3_LIBCALL "*udiv" *//* #define UMODSI3_LIBCALL "*urem" *//* Tell final.c how to eliminate redundant test instructions. *//* Here we define machine-dependent flags and fields in cc_status (see `conditions.h'). *//* Set if the cc value is actually in the FPU, so a floating point conditional branch must be output. */#define CC_IN_FPU 04000/* Store in cc_status the expressions that the condition codes will describe after execution of an instruction whose pattern is EXP. Do not alter them if the instruction would not alter the cc's. *//* Since Gmicro's compare instructions depend on the branch condition, all branch should be kept. More work must be done to optimize condition code !! M.Yuhara */#define NOTICE_UPDATE_CC(EXP, INSN) {CC_STATUS_INIT;}/* The skeleton of the next macro is taken from "vax.h". FPU-reg manipulation is added. M.Yuhara *//* Now comment out.#define NOTICE_UPDATE_CC(EXP, INSN) { \ if (GET_CODE (EXP) == SET) { \ if ( !FPU_REG_P (XEXP (EXP, 0)) \ && (XEXP (EXP, 0) != cc0_rtx) \ && (FPU_REG_P (XEXP (EXP, 1)) \ || GET_CODE (XEXP (EXP, 1)) == FIX \ || GET_CODE (XEXP (EXP, 1)) == FLOAT_TRUNCATE \ || GET_CODE (XEXP (EXP, 1)) == FLOAT_EXTEND)) { \ CC_STATUS_INIT; \ } else if (GET_CODE (SET_SRC (EXP)) == CALL) { \ CC_STATUS_INIT; \ } else if (GET_CODE (SET_DEST (EXP)) != PC) { \ cc_status.flags = 0; \ cc_status.value1 = SET_DEST (EXP); \ cc_status.value2 = SET_SRC (EXP); \ } \ } else if (GET_CODE (EXP) == PARALLEL \ && GET_CODE (XVECEXP (EXP, 0, 0)) == SET \ && GET_CODE (SET_DEST (XVECEXP (EXP, 0, 0))) != PC) {\ cc_status.flags = 0; \ cc_status.value1 = SET_DEST (XVECEXP (EXP, 0, 0)); \ cc_status.value2 = SET_SRC (XVECEXP (EXP, 0, 0)); \ /* PARALLELs whose first element sets the PC are aob, sob VAX insns. \ They do change the cc's. So drop through and forget the cc's. * / \ } else CC_STATUS_INIT; \ if (cc_status.value1 && GET_CODE (cc_status.value1) == REG \ && cc_status.value2 \ && reg_overlap_mentioned_p (cc_status.value1, cc_status.value2)) \ cc_status.value2 = 0; \ if (cc_status.value1 && GET_CODE (cc_status.value1) == MEM \ && cc_status.value2 \ && GET_CODE (cc_status.value2) == MEM) \ cc_status.value2 = 0; \ if ( (cc_status.value1 && FPU_REG_P (cc_status.value1)) \ || (cc_status.value2 && FPU_REG_P (cc_status.value2))) \ cc_status.flags = CC_IN_FPU; \}*/#define OUTPUT_JUMP(NORMAL, FLOAT, NO_OV) \{ if (cc_prev_status.flags & CC_IN_FPU) \ return FLOAT; \ if (cc_prev_status.flags & CC_NO_OVERFLOW) \ return NO_OV; \ return NORMAL; }/* Control the assembler format that we output. *//* Output before read-only data. */#define TEXT_SECTION_ASM_OP ".section text,code,align=4"/* Output before writable data. */#define DATA_SECTION_ASM_OP ".section data,data,align=4"/* Output before uninitialized data. */#define BSS_SECTION_ASM_OP ".section bss,data,align=4"/* Output at beginning of assembler file. It is not appropriate for this to print a list of the options used, since that's not the convention that we use. */#define ASM_FILE_START(FILE)/* Output at the end of assembler file. */#define ASM_FILE_END(FILE) fprintf (FILE, "\t.end\n");/* Don't try to define `gcc_compiled.' since the assembler do not accept symbols with periods and GDB doesn't run on this machine anyway. */#define ASM_IDENTIFY_GCC(FILE)/* Output to assembler file text saying following lines may contain character constants, extra white space, comments, etc. */#define ASM_APP_ON ""/* #define ASM_APP_ON "#APP\n" *//* Output to assembler file text saying following lines no longer contain unusual constructs. */#define ASM_APP_OFF ""/* #define ASM_APP_OFF ";#NO_APP\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", "r6", "r7", \ "r8", "r9", "r10", "r11", "r12", "r13", "fp", "sp", \ "fr0", "fr1", "fr2", "fr3", "fr4", "fr5", "fr6", "fr7", \ "fr8", "fr9", "fr10", "fr11", "fr12", "fr13", "fr14", "fr15"}/* How to renumber registers for dbx and gdb. */#define DBX_REGISTER_NUMBER(REGNO) (REGNO)/* Define this if gcc should produce debugging output for dbx in response to the -g flag. This does not work for the Gmicro now */#define DBX_DEBUGGING_INFO/* 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) { \ assemble_name (FILE, NAME); \ fputs (":\n", FILE); \}/* 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) {\ fputs ("\t.global ", FILE); \ assemble_name (FILE, NAME); \ fputs ("\n", FILE); \}/* This is how to output a command to make the external label named NAME which are not defined in the file to be referable *//* ".import" does not work ??? */#define ASM_OUTPUT_EXTERNAL(FILE,DECL,NAME) { \ fputs ("\t.global ", FILE); \ assemble_name (FILE, NAME); \ fputs ("\n", FILE); \}/* 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. *//* do {...} while(0) is necessary, because these macros are used as if (xxx) MACRO; else .... ^*/#define ASM_OUTPUT_DOUBLE(FILE,VALUE) \do { union { double d; long l[2];} tem; \ tem.d = (VALUE); \ fprintf (FILE, "\t.fdata.d h'%x%08x.d\n", tem.l[0], tem.l[1]); \} while(0)/* This is how to output an assembler line defining a `float' constant. */#define ASM_OUTPUT_FLOAT(FILE,VALUE) \do { union { float f; long l;} tem; \ tem.f = (VALUE); \ fprintf (FILE, "\t.fdata.s h'%x.s\n", tem.l); \} while(0)/* This is how to output an assembler line defining an `int' constant. */#define ASM_OUTPUT_INT(FILE,VALUE) \( fprintf (FILE, "\t.data.w "), \ output_addr_const (FILE, (VALUE)), \ fprintf (FILE, "\n"))/* Likewise for `char' and `short' constants. */#define ASM_OUTPUT_SHORT(FILE,VALUE) \( fprintf (FILE, "\t.data.h "), \ output_addr_const (FILE, (VALUE)), \ fprintf (FILE, "\n"))#define ASM_OUTPUT_CHAR(FILE,VALUE) \( fprintf (FILE, "\t.data.b "), \ 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.data.b h'%x\n", (VALUE))#define ASM_OUTPUT_ASCII(FILE,P,SIZE) \ output_ascii ((FILE), (P), (SIZE))/* 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, "\tmov %s,@-sp\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, "\tmov @sp+,%s\n", reg_names[REGNO])/* This is how to output an element of a case-vector that is absolute. (The Gmicro does not use such vectors, but we must define this macro anyway.) */#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \ fprintf (FILE, "\t.data.w 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, BODY, VALUE, REL) \ fprintf (FILE, "\t.data.w 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) \ fprintf (FILE, "\t.align %d\n", (1 << (LOG)));#define ASM_OUTPUT_SKIP(FILE,SIZE) \ fprintf (FILE, "\t.res.b %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) \( bss_section (), \ assemble_name ((FILE), (NAME)), \ fprintf ((FILE), ":\t.res.b %d\n", (ROUNDED)),\ fprintf ((FILE), "\t.export "), \ assemble_name ((FILE), (NAME)), \ fprintf ((FILE), "\n") )/* This says how to output an assembler line to define a local common symbol. */#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \( bss_section (), \ assemble_name ((FILE), (NAME)), \ fprintf ((FILE), ":\t.res.b %d\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. *//* $__ is unique ????? M.Yuhara */#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 12), \ 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/* Output a float value (represented as a C double) as an immediate operand. This macro is a Gmicro/68k-specific macro. */#define ASM_OUTPUT_FLOAT_OPERAND(FILE,VALUE) \do { union { float f; long l;} tem; \ tem.f = (VALUE); \ fprintf (FILE, "#h'%x.s", tem.l); \} while(0)/* Output a double value (represented as a C double) as an immediate operand. This macro is a 68k-specific macro. */#define ASM_OUTPUT_DOUBLE_OPERAND(FILE,VALUE) \do { union { double d; long l[2];} tem; \ tem.d = (VALUE); \ fprintf (FILE, "#h'%x%08x.d", tem.l[0], tem.l[1]); \} while(0)/* 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. On the Gmicro, we use several CODE characters: 'f' for float insn (print a CONST_DOUBLE as a float rather than in hex) 'b' for branch target label. '-' for an operand pushing on the stack. '+' for an operand pushing on the stack. '#' for an immediate operand prefix */#define PRINT_OPERAND_PUNCT_VALID_P(CODE) \ ( (CODE) == '#' || (CODE) == '-' \ || (CODE) == '+' || (CODE) == '@' || (CODE) == '!')#define PRINT_OPERAND(FILE, X, CODE) \{ int i; \ static char *reg_name[] = REGISTER_NAMES; \/* fprintf (stderr, "PRINT_OPERAND CODE=%c(0x%x), ", CODE, CODE);\myprcode(GET_CODE(X)); */ \ if (CODE == '#') fprintf (FILE, "#"); \ else if (CODE == '-') fprintf (FILE, "@-sp"); \ else if (CODE == '+') fprintf (FILE, "@sp+"); \ else if (CODE == 's') fprintf (stderr, "err: PRINT_OPERAND <s>\n"); \ else if (CODE == '!') fprintf (stderr, "err: PRINT_OPERAND <!>\n"); \ else if (CODE == '.') fprintf (stderr, "err: PRINT_OPERAND <.>\n"); \ else if (CODE == 'b') { \ if (GET_CODE (X) == MEM) \ output_addr_const (FILE, XEXP (X, 0)); /* for bsr */ \ else \ output_addr_const (FILE, X); /* for bcc */ \ } \ else if (CODE == 'p') \ print_operand_address (FILE, X); \ else if (GET_CODE (X) == REG) \ fprintf (FILE, "%s", reg_name[REGNO (X)]); \ else if (GET_CODE (X) == MEM) \ output_address (XEXP (X, 0)); \ else if (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) == SFmode) \ { union { double d; int i[2]; } u; \ union { float f; int i; } u1; \ u.i[0] = CONST_DOUBLE_LOW (X); u.i[1] = CONST_DOUBLE_HIGH (X); \ u1.f = u.d; \ if (CODE == 'f') \ ASM_OUTPUT_FLOAT_OPERAND (FILE, u1.f); \ else \ fprintf (FILE, "#h'%x", u1.i); } \ else if (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) == DFmode) \ { union { double d; int i[2]; } u; \ u.i[0] = CONST_DOUBLE_LOW (X); u.i[1] = CONST_DOUBLE_HIGH (X); \ ASM_OUTPUT_DOUBLE_OPERAND (FILE, u.d); } \ else { putc ('#', FILE); \output_addr_const (FILE, X); }}/* Note that this contains a kludge that knows that the only reason we have an address (plus (label_ref...) (reg...)) is in the insn before a tablejump, and we know that m68k.md generates a label LInnn: on such an insn. */#define PRINT_OPERAND_ADDRESS(FILE, ADDR) \ { print_operand_address (FILE, ADDR); }/*Local variables:version-control: tEnd:*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -