📄 h8300.h
字号:
GCC requires SIZE_TYPE to be the same size as pointers. */#define SIZE_TYPE \ (TARGET_H8300 || TARGET_NORMAL_MODE ? "unsigned int" : "long unsigned int")#define PTRDIFF_TYPE \ (TARGET_H8300 || TARGET_NORMAL_MODE ? "int" : "long int")#define POINTER_SIZE \ ((TARGET_H8300H || TARGET_H8300S) && !TARGET_NORMAL_MODE ? 32 : 16)#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#define ADJUST_INSN_LENGTH(INSN, LENGTH) \ LENGTH += h8300_adjust_insn_length (INSN, LENGTH);/* 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 DEFAULT_RTX_COSTS(RTX, CODE, OUTER_CODE) \ return (const_costs (RTX, CODE, OUTER_CODE));#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. */#define RTX_COSTS(RTX, CODE, OUTER_CODE) \ case AND: \ return COSTS_N_INSNS (h8300_and_costs (RTX)); \ case MOD: \ case DIV: \ return 60; \ case MULT: \ return 20; \ case ASHIFT: \ case ASHIFTRT: \ case LSHIFTRT: \ return COSTS_N_INSNS (h8300_shift_costs (RTX)); \ 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 h8300. *//* 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)/* The add insns don't set overflow in a usable way. */#define CC_OVERFLOW_UNUSABLE 01000/* The mov,and,or,xor insns don't set carry. That's OK though as the Z bit is all we need when doing unsigned comparisons on the result of these insns (since they're always with 0). However, conditions.h has CC_NO_OVERFLOW defined for this purpose. Rename it to something more understandable. */#define CC_NO_CARRY CC_NO_OVERFLOW/* Control the assembler format that we output. *//* 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\t"/* The assembler op to get a word, 2 bytes for the H8/300, 4 for H8/300H. */#define ASM_WORD_OP \ (TARGET_H8300 || TARGET_NORMAL_MODE ? "\t.word\t" : "\t.long\t")#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 READONLY_DATA_SECTION_ASM_OP "\t.section .rodata"#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)(); \ } \}#define TINY_DATA_NAME_P(NAME) (*(NAME) == '&')/* 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", "mac", "ap", "rap" }#define ADDITIONAL_REGISTER_NAMES \{ {"er0", 0}, {"er1", 1}, {"er2", 2}, {"er3", 3}, {"er4", 4}, \ {"er5", 5}, {"er6", 6}, {"er7", 7}, {"r7", 7} }#define SDB_DEBUGGING_INFO 1#define SDB_DELIM "\n"/* Support -gstabs. */#include "dbxcoff.h"/* Override definition in dbxcoff.h. *//* Generate a blank trailing N_SO to mark the end of the .o file, since we can't depend upon the linker to mark .o file boundaries with embedded stabs. */#undef DBX_OUTPUT_MAIN_SOURCE_FILE_END#define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \ fprintf (FILE, \ "\t.text\n.stabs \"\",%d,0,0,.Letext\n.Letext:\n", N_SO)/* Switch into a generic section. */#define TARGET_ASM_NAMED_SECTION h8300_asm_named_section#define ASM_OUTPUT_LABELREF(FILE, NAME) \ asm_fprintf ((FILE), "%U%s", (NAME) + (TINY_DATA_NAME_P (NAME) ? 1 : 0))#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME)/* Globalizing directive for a label. */#define GLOBAL_ASM_OP "\t.global "#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ ASM_OUTPUT_LABEL (FILE, NAME)/* 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. N.B.: The h8300.md branch_true and branch_false patterns also know how to generate internal labels. */#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 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) \ fprintf (FILE, "%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, BODY, VALUE, REL) \ fprintf (FILE, "%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\"%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 the assembler to define a global uninitialized but not common symbol. Try to use asm_output_bss to implement this macro. */#define ASM_OUTPUT_BSS(FILE, DECL, NAME, SIZE, ROUNDED) \ asm_output_bss ((FILE), (DECL), (NAME), (SIZE), (ROUNDED))/* 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 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 h8300.c. */#define PRINT_OPERAND_ADDRESS(FILE, ADDR) print_operand_address (FILE, ADDR)/* H8300 specific pragmas. */#define REGISTER_TARGET_PRAGMAS(PFILE) \ do \ { \ cpp_register_pragma (PFILE, 0, "saveall", h8300_pr_saveall); \ cpp_register_pragma (PFILE, 0, "interrupt", h8300_pr_interrupt); \ } \ while (0)#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 \ = init_one_libfunc (MULHI3_LIBCALL); \ sdiv_optab->handlers[(int) HImode].libfunc \ = init_one_libfunc (DIVHI3_LIBCALL); \ udiv_optab->handlers[(int) HImode].libfunc \ = init_one_libfunc (UDIVHI3_LIBCALL); \ smod_optab->handlers[(int) HImode].libfunc \ = init_one_libfunc (MODHI3_LIBCALL); \ umod_optab->handlers[(int) HImode].libfunc \ = init_one_libfunc (UMODHI3_LIBCALL); \ } \ while (0)#define MOVE_RATIO 3#endif /* ! GCC_H8300_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -