⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 h8300.h

📁 gcc编译工具没有什么特别
💻 H
📖 第 1 页 / 共 4 页
字号:
   0x2ff,		/* GENERAL_REGS */    	\   0x100,		/* MAC_REGS */    	\   0x3ff,		/* ALL_REGS 	*/	\}/* The same information, inverted:   Return the class number of the smallest class containing   reg number REGNO.  This could be a conditional expression   or could index an array.  */#define REGNO_REG_CLASS(REGNO) (REGNO != 8 ? GENERAL_REGS : MAC_REGS)/* The class value for index registers, and the one for base regs.  */#define INDEX_REG_CLASS NO_REGS#define BASE_REG_CLASS  GENERAL_REGS/* Get reg_class from a letter such as appears in the machine description.    'a' is the MAC register.  */#define REG_CLASS_FROM_LETTER(C) ((C) == 'a' ? MAC_REGS : NO_REGS)/* The letters I, J, K, L, M, N, O, P in a register constraint string   can be used to stand for particular ranges of immediate operands.   This macro defines what the ranges are.   C is the letter, and VALUE is a constant value.   Return 1 if VALUE is in the range specified by C.  */#define CONST_OK_FOR_I(VALUE) ((VALUE) == 0)#define CONST_OK_FOR_J(VALUE) ((unsigned) (VALUE) < 256)#define CONST_OK_FOR_K(VALUE) (((VALUE) == 1) || (VALUE) == 2)#define CONST_OK_FOR_L(VALUE) (((VALUE) == -1) || (VALUE) == -2)#define CONST_OK_FOR_M(VALUE) (((VALUE) == 3) || (VALUE) == 4)#define CONST_OK_FOR_N(VALUE) (((VALUE) == -3) || (VALUE) == -4)#define CONST_OK_FOR_O(VALUE) (ok_for_bclr (VALUE))#define CONST_OK_FOR_P(VALUE) (small_power_of_two (VALUE))#define CONST_OK_FOR_LETTER_P(VALUE, C) \  ((C) == 'I' ? CONST_OK_FOR_I (VALUE) : \   (C) == 'J' ? CONST_OK_FOR_J (VALUE) : \   (C) == 'K' ? CONST_OK_FOR_K (VALUE) : \   (C) == 'L' ? CONST_OK_FOR_L (VALUE) : \   (C) == 'M' ? CONST_OK_FOR_M (VALUE) : \   (C) == 'N' ? CONST_OK_FOR_N (VALUE) : \   (C) == 'O' ? CONST_OK_FOR_O (VALUE) : \   (C) == 'P' ? CONST_OK_FOR_P(VALUE) : \   0)/* Similar, but for floating constants, and defining letters G and H.   Here VALUE is the CONST_DOUBLE rtx itself.        `G' is a floating-point zero.  */#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \  ((C) == 'G' ? (VALUE) == CONST0_RTX (DFmode)	\   : 0)/* Given an rtx X being reloaded into a reg required to be   in class CLASS, return the class of reg to actually use.   In general this is just CLASS; but on some machines   in some cases it is preferable to use a more restrictive class.  */#define PREFERRED_RELOAD_CLASS(X,CLASS)  (CLASS)/* Return the maximum number of consecutive registers   needed to represent mode MODE in a register of class CLASS.  *//* On the H8, this is the size of MODE in words.  */#define CLASS_MAX_NREGS(CLASS, MODE)	\  ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)/* Any SI register to register move may need to be reloaded,    so define REGISTER_MOVE_COST to be > 2 so that reload never   shortcuts.  */#define REGISTER_MOVE_COST(CLASS1, CLASS2)  \  (CLASS1 == MAC_REGS || CLASS2 == MAC_REGS ? 6 : 3)/* Stack layout; function entry, exit and calling.  *//* Define this if pushing a word on the stack   makes the stack pointer a smaller address.  */#define STACK_GROWS_DOWNWARD/* Define this if the nominal address of the stack frame   is at the high-address end of the local variables;   that is, each additional local variable allocated   goes at a more negative offset in the frame.  */#define FRAME_GROWS_DOWNWARD/* Offset within stack frame to start allocating local variables at.   If FRAME_GROWS_DOWNWARD, this is the offset to the END of the   first local allocated.  Otherwise, it is the offset to the BEGINNING   of the first local allocated.  */#define STARTING_FRAME_OFFSET 0/* If we generate an insn to push BYTES bytes,   this says how many the stack pointer really advances by.   On the H8/300, @-sp really pushes a byte if you ask it to - but that's   dangerous, so we claim that it always pushes a word, then we catch   the mov.b rx,@-sp and turn it into a mov.w rx,@-sp on output.   On the H8/300h, we simplify TARGET_QUICKCALL by setting this to 4 and doing   a similar thing.  */#define PUSH_ROUNDING(BYTES) \  (((BYTES) + PARM_BOUNDARY/8 - 1) & -PARM_BOUNDARY/8)/* Offset of first parameter from the argument pointer register value.  *//* Is equal to the size of the saved fp + pc, even if an fp isn't   saved since the value is used before we know.  */#define FIRST_PARM_OFFSET(FNDECL) 0/* Value is the number of bytes of arguments automatically   popped when returning from a subroutine call.   FUNDECL is the declaration node of the function (as a tree),   FUNTYPE is the data type of the function (as a tree),   or for a library call it is an identifier node for the subroutine name.   SIZE is the number of bytes of arguments passed on the stack.   On the H8 the return does not pop anything.  */#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0/* Definitions for register eliminations.   This is an array of structures.  Each structure initializes one pair   of eliminable registers.  The "from" register number is given first,   followed by "to".  Eliminations of the same "from" register are listed   in order of preference.   We have two registers that can be eliminated on the h8300.  First, the   frame pointer register can often be eliminated in favor of the stack   pointer register.  Secondly, the argument pointer register can always be   eliminated; it is replaced with either the stack or frame pointer. */#define ELIMINABLE_REGS				\{{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM},	\ { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM},   \ { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}}/* Given FROM and TO register numbers, say whether this elimination is allowed.   Frame pointer elimination is automatically handled.   For the h8300, if frame pointer elimination is being done, we would like to   convert ap into sp, not fp.   All other eliminations are valid.  */#define CAN_ELIMINATE(FROM, TO)					\ ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM	\  ? ! frame_pointer_needed					\  : 1)/* Define the offset between two registers, one to be eliminated, and the other   its replacement, at the start of a routine.  */#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \  OFFSET = initial_offset (FROM, TO)/* Define how to find the value returned by a function.   VALTYPE is the data type of the value (as a tree).   If the precise function being called is known, FUNC is its FUNCTION_DECL;   otherwise, FUNC is 0.       On the H8 the return value is in R0/R1.  */#define FUNCTION_VALUE(VALTYPE, FUNC) \  gen_rtx (REG, TYPE_MODE (VALTYPE), 0)/* Define how to find the value returned by a library function   assuming the value has mode MODE.  *//* On the h8 the return value is in R0/R1 */#define LIBCALL_VALUE(MODE) \  gen_rtx (REG, MODE, 0)/* 1 if N is a possible register number for a function value.   On the H8, R0 is the only register thus used.  */#define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)/* Define this if PCC uses the nonreentrant convention for returning   structure and union values.  *//*#define PCC_STATIC_STRUCT_RETURN*//* 1 if N is a possible register number for function argument passing.   On the H8, no registers are used in this way.  */#define FUNCTION_ARG_REGNO_P(N) (TARGET_QUICKCALL ? N < 3 : 0)/* Register in which address to store a structure value   is passed to a function.  */#define STRUCT_VALUE 0/* Return true if X should be returned in memory.  */#define RETURN_IN_MEMORY(X) \  (TYPE_MODE (X) == BLKmode || GET_MODE_SIZE (TYPE_MODE (X)) > 4)/* When defined, the compiler allows registers explicitly used in the   rtl to be used as spill registers but prevents the compiler from   extending the lifetime of these registers. */#define SMALL_REGISTER_CLASSES 1/* Define a data type for recording info about an argument list   during the scan of that argument list.  This data type should   hold all necessary information about the function itself   and about the args processed so far, enough to enable macros   such as FUNCTION_ARG to determine where the next arg should go.   On the H8/300, this is a two item struct, the first is the number of bytes   scanned so far and the second is the rtx of the called library   function if any.  */#define CUMULATIVE_ARGS struct cum_argstruct cum_arg { int nbytes; struct rtx_def * libcall; };/* Initialize a variable CUM of type CUMULATIVE_ARGS   for a call to a function whose data type is FNTYPE.   For a library call, FNTYPE is 0.   On the H8/300, the offset starts at 0.  */#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT)	\ ((CUM).nbytes = 0, (CUM).libcall = LIBNAME)/* Update the data in CUM to advance over an argument   of mode MODE and data type TYPE.   (TYPE is null for libcalls where that information may not be available.)  */#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED)	\ ((CUM).nbytes += ((MODE) != BLKmode			\  ? (GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) & -UNITS_PER_WORD	\  : (int_size_in_bytes (TYPE) + UNITS_PER_WORD - 1) & -UNITS_PER_WORD))/* Define where to put the arguments to a function.   Value is zero to push the argument on the stack,   or a hard register in which to store the argument.   MODE is the argument's machine mode.   TYPE is the data type of the argument (as a tree).    This is null for libcalls where that information may    not be available.   CUM is a variable of type CUMULATIVE_ARGS which gives info about    the preceding args and about the function being called.   NAMED is nonzero if this argument is a named parameter    (otherwise it is an extra parameter matching an ellipsis).  *//* On the H8/300 all normal args are pushed, unless -mquickcall in which   case the first 3 arguments are passed in registers.   See function `function_arg'.  */struct rtx_def *function_arg();#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \  function_arg (&CUM, MODE, TYPE, NAMED)/* Generate assembly output for the start of a function.  */#define FUNCTION_PROLOGUE(FILE, SIZE) \  function_prologue (FILE, SIZE)/* Output assembler code to FILE to increment profiler label # LABELNO   for profiling a function entry.  */#define FUNCTION_PROFILER(FILE, LABELNO)  \  fprintf (FILE, "\t%s\t#LP%d,%s\n\tjsr @mcount\n", \	   h8_mov_op, (LABELNO), h8_reg_names[0]);/* Output assembler code to FILE to initialize this source file's   basic block profiling info, if that has not already been done.  *//* ??? @LPBX0 is moved into r0 twice.  */#define FUNCTION_BLOCK_PROFILER(FILE, LABELNO)  \  fprintf (FILE, "\t%s\t%s\n\t%s\t@LPBX0,%s\n\tbne LPI%d\n\t%s\t@LPBX0,%s\n\t%s\t%s\n\tjsr\t@__bb_init_func\nLPI%d:\t%s\t%s\n", \	   h8_push_op, h8_reg_names[0],		\	   h8_mov_op, h8_reg_names[0],		\	   (LABELNO),				\	   h8_mov_op, h8_reg_names[0],		\	   h8_push_op, h8_reg_names[0],		\	   (LABELNO),				\	   h8_pop_op, h8_reg_names[0]);/* Output assembler code to FILE to increment the entry-count for   the BLOCKNO'th basic block in this source file.  This is a real pain in the   sphincter on a VAX, since we do not want to change any of the bits in the   processor status word.  The way it is done here, it is pushed onto the stack   before any flags have changed, and then the stack is fixed up to account for   the fact that the instruction to restore the flags only reads a word.   It may seem a bit clumsy, but at least it works.  *//* ??? This one needs work.  */#define BLOCK_PROFILER(FILE, BLOCKNO)	\  fprintf (FILE, "\tmovpsl -(sp)\n\tmovw (sp),2(sp)\n\taddl2 $2,sp\n\taddl2 $1,LPBX2+%d\n\tbicpsw $255\n\tbispsw (sp)+\n", \	   4 * BLOCKNO)/* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,   the stack pointer does not matter.  The value is tested only in   functions that have frame pointers.   No definition is equivalent to always zero.  */#define EXIT_IGNORE_STACK 0/* This macro generates the assembly code for function exit,   on machines that need it.  If FUNCTION_EPILOGUE is not defined   then individual return instructions are generated for each   return statement.  Args are same as for FUNCTION_PROLOGUE.  */#define FUNCTION_EPILOGUE(FILE, SIZE) \  function_epilogue (FILE, SIZE)/* Output assembler code for a block containing the constant parts   of a trampoline, leaving space for the variable parts.     H8/300	      vvvv context   1 0000 7900xxxx 		mov.w	#0x1234,r3   2 0004 5A00xxxx 		jmp	@0x1234	      ^^^^ function   H8/300H	      vvvvvvvv context   2 0000 7A00xxxxxxxx 		mov.l	#0x12345678,er3   3 0006 5Axxxxxx 		jmp	@0x123456	    ^^^^^^ function*/#define TRAMPOLINE_TEMPLATE(FILE)			\  do {							\    if (TARGET_H8300)					\      {							\	fprintf (FILE, "\tmov.w	#0x1234,r3\n");		\	fprintf (FILE, "\tjmp	@0x1234\n");		\      }							\    else						\      {							\	fprintf (FILE, "\tmov.l	#0x12345678,er3\n");	\	fprintf (FILE, "\tjmp	@0x123456\n");	\      }							\  } while (0)/* Length in units of the trampoline for entering a nested function.  */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -