📄 h8300.h
字号:
On the H8/300, sign extension is expensive, so we'll say that chars are unsigned. */#define DEFAULT_SIGNED_CHAR 0/* This flag, if defined, says the same insns that convert to a signed fixnum also convert validly to an unsigned one. */#define FIXUNS_TRUNC_LIKE_FIX_TRUNC/* Max number of bytes we can move from memory to memory in one reasonably fast instruction. */#define MOVE_MAX (TARGET_H8300H ? 4 : 2)#define MAX_MOVE_MAX 4/* Define this if zero-extension is slow (more than one real instruction). *//* #define SLOW_ZERO_EXTEND *//* Nonzero if access to memory by bytes is slow and undesirable. */#define SLOW_BYTE_ACCESS TARGET_SLOWBYTE/* Define if shifts truncate the shift count which implies one can omit a sign-extension or zero-extension of a shift count. *//* #define SHIFT_COUNT_TRUNCATED *//* 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/* 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 (TARGET_H8300H ? SImode : HImode)/* ANSI C types. We use longs for the 300h because ints can be 16 or 32. GCC requires SIZE_TYPE to be the same size as pointers. */#define NO_BUILTIN_SIZE_TYPE#define NO_BUILTIN_PTRDIFF_TYPE#define SIZE_TYPE (TARGET_H8300 ? "unsigned int" : "long unsigned int")#define PTRDIFF_TYPE (TARGET_H8300 ? "int" : "long int")#define WCHAR_TYPE "short unsigned int"#define WCHAR_TYPE_SIZE 16#define MAX_WCHAR_TYPE_SIZE 16/* A function address in a call instruction is a byte address (for indexing purposes) so give the MEM rtx a byte's mode. */#define FUNCTION_MODE QImode/* 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. */#define CONST_COSTS(RTX,CODE,OUTER_CODE) \ default: { int _zxy= const_costs(RTX, CODE); \ if(_zxy) return _zxy; break;}#define BRANCH_COST 0/* We say that MOD and DIV are so cheap because otherwise we'll generate some really horrible code for division of a power of two. *//* Provide the costs of a rtl expression. This is in the body of a switch on CODE. *//* ??? Shifts need to have a *much* higher cost than this. */#define RTX_COSTS(RTX,CODE,OUTER_CODE) \ case MOD: \ case DIV: \ return 60; \ case MULT: \ return 20; \ case ASHIFT: \ case ASHIFTRT: \ case LSHIFTRT: \ case ROTATE: \ case ROTATERT: \ if (GET_MODE (RTX) == HImode) return 2; \ return 8; /* Tell final.c how to eliminate redundant test instructions. *//* Here we define machine-dependent flags and fields in cc_status (see `conditions.h'). No extra ones are needed for the vax. *//* 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. */#define NOTICE_UPDATE_CC(EXP, INSN) notice_update_cc(EXP, INSN)#define CC_DONE_CBIT 0400#define OUTPUT_JUMP(NORMAL, FLOAT, NO_OV) \{ \ if (cc_status.flags & CC_NO_OVERFLOW) \ return NO_OV; \ return NORMAL; \}/* Control the assembler format that we output. */#define ASM_IDENTIFY_GCC /* nothing *//* Output at beginning/end of assembler file. */#define ASM_FILE_START(FILE) asm_file_start(FILE)#define ASM_FILE_END(FILE) asm_file_end(FILE)/* Output to assembler file text saying following lines may contain character constants, extra white space, comments, etc. */#define ASM_APP_ON "; #APP\n"/* Output to assembler file text saying following lines no longer contain unusual constructs. */#define ASM_APP_OFF "; #NO_APP\n"#define FILE_ASM_OP "\t.file\n"#define IDENT_ASM_OP "\t.ident\n"/* The assembler op to get a word, 2 bytes for the H8/300, 4 for H8/300H. */#define ASM_WORD_OP (TARGET_H8300 ? ".word" : ".long")/* Output before read-only data. */#define TEXT_SECTION_ASM_OP "\t.section .text"#define DATA_SECTION_ASM_OP "\t.section .data"#define BSS_SECTION_ASM_OP "\t.section .bss"#define INIT_SECTION_ASM_OP "\t.section .init"#define CTORS_SECTION_ASM_OP "\t.section .ctors"#define DTORS_SECTION_ASM_OP "\t.section .dtors"#define EXTRA_SECTIONS in_ctors, in_dtors#define EXTRA_SECTION_FUNCTIONS \ \void \ctors_section() \{ \ if (in_section != in_ctors) \ { \ fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \ in_section = in_ctors; \ } \} \ \void \dtors_section() \{ \ if (in_section != in_dtors) \ { \ fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \ in_section = in_dtors; \ } \} \#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \ do { ctors_section(); \ fprintf(FILE, "\t%s\t_%s\n", ASM_WORD_OP, NAME); } while (0)#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \ do { dtors_section(); \ fprintf(FILE, "\t%s\t_%s\n", ASM_WORD_OP, NAME); } while (0)#undef DO_GLOBAL_CTORS_BODY #define DO_GLOBAL_CTORS_BODY \{ \ typedef (*pfunc)(); \ extern pfunc __ctors[]; \ extern pfunc __ctors_end[]; \ pfunc *p; \ for (p = __ctors_end; p > __ctors; ) \ { \ (*--p)(); \ } \} #undef DO_GLOBAL_DTORS_BODY #define DO_GLOBAL_DTORS_BODY \{ \ typedef (*pfunc)(); \ extern pfunc __dtors[]; \ extern pfunc __dtors_end[]; \ pfunc *p; \ for (p = __dtors; p < __dtors_end; p++) \ { \ (*p)(); \ } \} /* 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", "sp", "ap"}#define ADDITIONAL_REGISTER_NAMES { { "r7", 7 } }/* How to renumber registers for dbx and gdb. H8/300 needs no change in the numeration. */#define DBX_REGISTER_NUMBER(REGNO) (REGNO)#define SDB_DEBUGGING_INFO#define SDB_DELIM "\n"/* Output DBX (stabs) debugging information if doing -gstabs. */#define DBX_DEBUGGING_INFO/* Generate SDB debugging information by default. */#define PREFERRED_DEBUGGING_TYPE SDB_DEBUG/* A C statement to output something to the assembler file to switch to section NAME for object DECL which is either a FUNCTION_DECL, a VAR_DECL or NULL_TREE. Some target formats do not support arbitrary sections. Do not define this macro in such cases. */#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME) \ fprintf (FILE, "\t.section %s\n", NAME)/* 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)#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) /* 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)#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ ASM_OUTPUT_LABEL(FILE, NAME)/* 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 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. It is .dfloat or .gfloat, depending. */#define ASM_OUTPUT_DOUBLE(FILE, VALUE) \do { char dstr[30]; \ REAL_VALUE_TO_DECIMAL ((VALUE), "%.20e", dstr); \ fprintf (FILE, "\t.double %s\n", dstr); \ } while (0)/* This is how to output an assembler line defining a `float' constant. */#define ASM_OUTPUT_FLOAT(FILE, VALUE) \do { char dstr[30]; \ REAL_VALUE_TO_DECIMAL ((VALUE), "%.20e", dstr); \ fprintf (FILE, "\t.float %s\n", dstr); \ } while (0)/* This is how to output an assembler line defining an `int' constant. */#define ASM_OUTPUT_INT(FILE, VALUE) \( fprintf (FILE, "\t.long "), \ output_addr_const (FILE, (VALUE)), \ fprintf (FILE, "\n"))/* Likewise for `char' and `short' constants. */#define ASM_OUTPUT_SHORT(FILE, VALUE) \( fprintf (FILE, "\t.word "), \ 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 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 insn to push a register on the stack. It need not be very fast code. */#define ASM_OUTPUT_REG_PUSH(FILE, REGNO) \ fprintf (FILE, "\t%s\t%s\n", h8_push_op, h8_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, "\t%s\t%s\n", h8_pop_op, h8_reg_names[REGNO])/* This is how to output an element of a case-vector that is absolute. */#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \ asm_fprintf (FILE, "\t%s .L%d\n", ASM_WORD_OP, VALUE)/* This is how to output an element of a case-vector that is relative. */#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) \ fprintf (FILE, "\t%s .L%d-.L%d\n", ASM_WORD_OP, 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", (LOG))/* This is how to output an assembler line that says to advance the location counter by SIZE bytes. */#define ASM_OUTPUT_IDENT(FILE, NAME) \ fprintf(FILE, "%s\t \"%s\"\n", IDENT_ASM_OP, NAME)#define ASM_OUTPUT_SKIP(FILE, SIZE) \ fprintf (FILE, "\t.space %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 an instruction operand X on file FILE. look in h8300.c for details */#define PRINT_OPERAND_PUNCT_VALID_P(CODE) \ ((CODE) == '#')#define PRINT_OPERAND(FILE, X, CODE) print_operand(FILE,X,CODE)/* Print a memory operand whose address is X, on file FILE. This uses a function in output-vax.c. */#define PRINT_OPERAND_ADDRESS(FILE, ADDR) print_operand_address (FILE, ADDR)#define HANDLE_PRAGMA(FILE) handle_pragma (FILE)#define FINAL_PRESCAN_INSN(insn, operand, nop) final_prescan_insn (insn, operand,nop)/* Define this macro if GNU CC should generate calls to the System V (and ANSI C) library functions `memcpy' and `memset' rather than the BSD functions `bcopy' and `bzero'. */#define TARGET_MEM_FUNCTIONS 1#define MULHI3_LIBCALL "__mulhi3"#define DIVHI3_LIBCALL "__divhi3"#define UDIVHI3_LIBCALL "__udivhi3"#define MODHI3_LIBCALL "__modhi3"#define UMODHI3_LIBCALL "__umodhi3"/* Perform target dependent optabs initialization. */#define INIT_TARGET_OPTABS \ do { \ smul_optab->handlers[(int) HImode].libfunc \ = gen_rtx (SYMBOL_REF, Pmode, MULHI3_LIBCALL); \ sdiv_optab->handlers[(int) HImode].libfunc \ = gen_rtx (SYMBOL_REF, Pmode, DIVHI3_LIBCALL); \ udiv_optab->handlers[(int) HImode].libfunc \ = gen_rtx (SYMBOL_REF, Pmode, UDIVHI3_LIBCALL); \ smod_optab->handlers[(int) HImode].libfunc \ = gen_rtx (SYMBOL_REF, Pmode, MODHI3_LIBCALL); \ umod_optab->handlers[(int) HImode].libfunc \ = gen_rtx (SYMBOL_REF, Pmode, UMODHI3_LIBCALL); \ } while (0)#define MOVE_RATIO 3/* Declarations for functions used in insn-output.c. */char *emit_a_shift ();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -