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

📄 m68k.h

📁 gcc-2.95.3 Linux下最常用的C编译器
💻 H
📖 第 1 页 / 共 5 页
字号:
#define BLOCK_PROFILER(FILE, BLOCKNO)	\do							\  {							\    switch (profile_block_flag)				\      {							\      case 2:						\        asm_fprintf (FILE, "\tmovel %Ra1,%Rsp@-\n\tlea ___bb,%Ra1\n\tmovel %I%d,%Ra1@(0)\n\tmovel %I%LLPBX0,%Ra1@(4)\n\tmovel %Rsp@+,%Ra1\n\tjsr %U__bb_trace_func\n", \                           BLOCKNO);			\        break;						\							\      default:						\        asm_fprintf (FILE, "\taddql %I1,%LLPBX2+%d\n", 4 * BLOCKNO); \        break;						\      }							\  }							\while(0)/* Output assembler code to FILE to indicate return from    a function during basic block profiling. */#define FUNCTION_BLOCK_PROFILER_EXIT(FILE)		\  asm_fprintf (FILE, "\tjsr %U__bb_trace_ret\n");/* Save all registers which may be clobbered by a function call.   MACHINE_STATE_SAVE and MACHINE_STATE_RESTORE are target-code macros,   used in libgcc2.c.  They may not refer to TARGET_* macros !!! */#if defined (__mc68010__) || defined(mc68010) \	|| defined(__mc68020__) || defined(mc68020) \	|| defined(__mc68030__) || defined(mc68030) \	|| defined(__mc68040__) || defined(mc68040) \	|| defined(__mcpu32__) || defined(mcpu32)#define MACHINE_STATE_m68010_up#endif#ifdef MOTOROLA#if defined(__mcf5200__)#define MACHINE_STATE_SAVE(id)		\    {					\      asm ("sub.l 20,%sp");		\      asm ("movm.l &0x0303,4(%sp)");	\      asm ("move.w %ccr,%d0");		\      asm ("movm.l &0x0001,(%sp)");	\    }#else /* !__mcf5200__ */#if defined(MACHINE_STATE_m68010_up)#ifdef __HPUX_ASM__/* HPUX assembler does not accept %ccr.  */#define MACHINE_STATE_SAVE(id)		\    {					\      asm ("move.w %cc,-(%sp)");	\      asm ("movm.l &0xc0c0,-(%sp)");	\    }#else /* ! __HPUX_ASM__ */#define MACHINE_STATE_SAVE(id)		\    {					\      asm ("move.w %ccr,-(%sp)");	\      asm ("movm.l &0xc0c0,-(%sp)");	\    }#endif /* __HPUX_ASM__ */#else /* !MACHINE_STATE_m68010_up */#define MACHINE_STATE_SAVE(id)		\    {					\      asm ("move.w %sr,-(%sp)");	\      asm ("movm.l &0xc0c0,-(%sp)");	\    }#endif /* MACHINE_STATE_m68010_up */#endif /* __mcf5200__ */#else /* !MOTOROLA */#if defined(__mcf5200__)#define MACHINE_STATE_SAVE(id)		\    {					\      asm ("subl %#20,%/sp" : );	\      asm ("movml %/d0/%/d1/%/a0/%/a1,%/sp@(4)" : ); \      asm ("movew %/cc,%/d0" : );	\      asm ("movml %/d0,%/sp@" : );	\    }#else /* !__mcf5200__ */#if defined(MACHINE_STATE_m68010_up)#define MACHINE_STATE_SAVE(id)		\    {					\      asm ("movew %/cc,%/sp@-" : );	\      asm ("moveml %/d0/%/d1/%/a0/%/a1,%/sp@-" : ); \    }#else /* !MACHINE_STATE_m68010_up */#define MACHINE_STATE_SAVE(id)		\    {					\      asm ("movew %/sr,%/sp@-" : );	\      asm ("moveml %/d0/%/d1/%/a0/%/a1,%/sp@-" : ); \    }#endif /* MACHINE_STATE_m68010_up */#endif /* __mcf5200__ */#endif /* MOTOROLA *//* Restore all registers saved by MACHINE_STATE_SAVE. */#ifdef MOTOROLA#if defined(__mcf5200__)#define MACHINE_STATE_RESTORE(id)	\    {					\      asm ("movm.l (%sp),&0x0001");	\      asm ("move.w %d0,%ccr");		\      asm ("movm.l 4(%sp),&0x0303");	\      asm ("add.l 20,%sp");		\    }#else /* !__mcf5200__ */#ifdef __HPUX_ASM__/* HPUX assembler does not accept %ccr.  */#define MACHINE_STATE_RESTORE(id)	\    {					\      asm ("movm.l (%sp)+,&0x0303");	\      asm ("move.w (%sp)+,%cc");	\    }#else /* ! __HPUX_ASM__ */#define MACHINE_STATE_RESTORE(id)	\    {					\      asm ("movm.l (%sp)+,&0x0303");	\      asm ("move.w (%sp)+,%ccr");	\    }#endif /* __HPUX_ASM__ */#endif /* __mcf5200__ */#else /* !MOTOROLA */#if defined(__mcf5200__)#define MACHINE_STATE_RESTORE(id)	\    {					\      asm ("movml %/sp@,%/d0" : );	\      asm ("movew %/d0,%/cc" : );	\      asm ("movml %/sp@(4),%/d0/%/d1/%/a0/%/a1" : ); \      asm ("addl %#20,%/sp" : );	\    }#else /* !__mcf5200__ */#define MACHINE_STATE_RESTORE(id)	\    {					\      asm ("moveml %/sp@+,%/d0/%/d1/%/a0/%/a1" : ); \      asm ("movew %/sp@+,%/cc" : );	\    }#endif /* __mcf5200__ */#endif /* MOTOROLA *//* 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 1/* Generate the assembly code for function exit. */#define FUNCTION_EPILOGUE(FILE, SIZE) output_function_epilogue (FILE, SIZE)  /* This is a hook for other tm files to change.  *//* #define FUNCTION_EXTRA_EPILOGUE(FILE, SIZE) *//* Determine if the epilogue should be output as RTL.   You should override this if you define FUNCTION_EXTRA_EPILOGUE.  */#define USE_RETURN_INSN use_return_insn ()/* Store in the variable DEPTH the initial difference between the   frame pointer reg contents and the stack pointer reg contents,   as of the start of the function body.  This depends on the layout   of the fixed parts of the stack frame and on how registers are saved.   On the 68k, if we have a frame, we must add one word to its length   to allow for the place that a6 is stored when we do have a frame pointer.   Otherwise, we would need to compute the offset from the frame pointer   of a local variable as a function of frame_pointer_needed, which   is hard.  */#define INITIAL_FRAME_POINTER_OFFSET(DEPTH)			\{ int regno;							\  int offset = -4;						\  for (regno = 16; regno < FIRST_PSEUDO_REGISTER; regno++)	\    if (regs_ever_live[regno] && ! call_used_regs[regno])	\      offset += 12;						\  for (regno = 0; regno < 16; regno++)				\    if (regs_ever_live[regno] && ! call_used_regs[regno])	\      offset += 4;						\  if (flag_pic && current_function_uses_pic_offset_table)	\    offset += 4;						\  (DEPTH) = (offset + ((get_frame_size () + 3) & -4)		\	     + (get_frame_size () == 0 ? 0 : 4));		\}/* Output assembler code for a block containing the constant parts   of a trampoline, leaving space for the variable parts.  *//* On the 68k, the trampoline looks like this:     movl #STATIC,a0     jmp  FUNCTION   WARNING: Targets that may run on 68040+ cpus must arrange for   the instruction cache to be flushed.  Previous incarnations of   the m68k trampoline code attempted to get around this by either   using an out-of-line transfer function or pc-relative data, but   the fact remains that the code to jump to the transfer function   or the code to load the pc-relative data needs to be flushed   just as much as the "variable" portion of the trampoline.     Recognizing that a cache flush is going to be required anyway,   dispense with such notions and build a smaller trampoline.  *//* Since more instructions are required to move a template into   place than to create it on the spot, don't use a template.  *//* Length in units of the trampoline for entering a nested function.  */#define TRAMPOLINE_SIZE 12/* Alignment required for a trampoline in bits.  */#define TRAMPOLINE_ALIGNMENT 16/* Targets redefine this to invoke code to either flush the cache,   or enable stack execution (or both).  */#ifndef FINALIZE_TRAMPOLINE#define FINALIZE_TRAMPOLINE(TRAMP)#endif/* 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.   We generate a two-instructions program at address TRAMP :	movea.l &CXT,%a0	jmp FNADDR					*/#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT)			\{									\  emit_move_insn (gen_rtx_MEM (HImode, TRAMP), GEN_INT(0x207C));	\  emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 2)), CXT); \  emit_move_insn (gen_rtx_MEM (HImode, plus_constant (TRAMP, 6)),	\		  GEN_INT(0x4EF9));					\  emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 8)), FNADDR); \  FINALIZE_TRAMPOLINE(TRAMP);						\}/* This is the library routine that is used   to transfer control from the trampoline   to the actual nested function.   It is defined for backward compatibility,   for linking with object code that used the old   trampoline definition.  *//* A colon is used with no explicit operands   to cause the template string to be scanned for %-constructs.  *//* The function name __transfer_from_trampoline is not actually used.   The function definition just permits use of "asm with operands"   (though the operand list is empty).  */#define TRANSFER_FROM_TRAMPOLINE				\void								\__transfer_from_trampoline ()					\{								\  register char *a0 asm ("%a0");				\  asm (GLOBAL_ASM_OP " ___trampoline");				\  asm ("___trampoline:");					\  asm volatile ("move%.l %0,%@" : : "m" (a0[22]));		\  asm volatile ("move%.l %1,%0" : "=a" (a0) : "m" (a0[18]));	\  asm ("rts":);							\}/* Addressing modes, and classification of registers for them.  */#define HAVE_POST_INCREMENT 1/* #define HAVE_POST_DECREMENT 0 */#define HAVE_PRE_DECREMENT 1/* #define HAVE_PRE_INCREMENT 0 *//* Macros to check register numbers against specific register classes.  *//* These assume that REGNO is a hard or pseudo reg number.   They give nonzero only if REGNO is a hard reg of the suitable class   or a pseudo reg currently allocated to a suitable hard reg.   Since they use reg_renumber, they are safe only once reg_renumber   has been allocated, which happens in local-alloc.c.  */#define REGNO_OK_FOR_INDEX_P(REGNO) \((REGNO) < 16 || (unsigned) reg_renumber[REGNO] < 16)#define REGNO_OK_FOR_BASE_P(REGNO) \(((REGNO) ^ 010) < 8 || (unsigned) (reg_renumber[REGNO] ^ 010) < 8)#define REGNO_OK_FOR_DATA_P(REGNO) \((REGNO) < 8 || (unsigned) reg_renumber[REGNO] < 8)#define REGNO_OK_FOR_FP_P(REGNO) \(((REGNO) ^ 020) < 8 || (unsigned) (reg_renumber[REGNO] ^ 020) < 8)#ifdef SUPPORT_SUN_FPA#define REGNO_OK_FOR_FPA_P(REGNO) \(((REGNO) >= 24 && (REGNO) < 56) || (reg_renumber[REGNO] >= 24 && reg_renumber[REGNO] < 56))#endif/* Now macros that check whether X is a register and also,   strictly, whether it is in a specified class.   These macros are specific to the 68000, and may be used only   in code for printing assembler insns and in conditions for   define_optimization.  *//* 1 if X is a data register.  */#define DATA_REG_P(X) (REG_P (X) && REGNO_OK_FOR_DATA_P (REGNO (X)))/* 1 if X is an fp register.  */#define FP_REG_P(X) (REG_P (X) && REGNO_OK_FOR_FP_P (REGNO (X)))/* 1 if X is an address register  */#define ADDRESS_REG_P(X) (REG_P (X) && REGNO_OK_FOR_BASE_P (REGNO (X)))#ifdef SUPPORT_SUN_FPA/* 1 if X is a register in the Sun FPA.  */#define FPA_REG_P(X) (REG_P (X) && REGNO_OK_FOR_FPA_P (REGNO (X)))#else/* Answer must be no if we don't have an FPA.  */#define FPA_REG_P(X) 0#endif/* Maximum number of registers that can appear in a valid memory address.  */#define MAX_REGS_PER_ADDRESS 2/* Recognize any constant value that is a valid address.  */#define CONSTANT_ADDRESS_P(X)   \  (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF		\   || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST		\   || GET_CODE (X) == HIGH)/* Nonzero if the constant value X is a legitimate general operand.   It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE.  */#define LEGITIMATE_CONSTANT_P(X) 1/* Nonzero if the constant value X is a legitimate general operand   when generating PIC code.  It is given that flag_pic is on and    that X satisfies CONSTANT_P or is a CONST_DOUBLE.  */#define LEGITIMATE_PIC_OPERAND_P(X)	\  ((! symbolic_operand (X, VOIDmode)				\    && ! (GET_CODE (X) == CONST_DOUBLE && CONST_DOUBLE_MEM (X)	\	  && GET_CODE (CONST_DOUBLE_MEM (X)) == MEM		\	  && symbolic_operand (XEXP (CONST_DOUBLE_MEM (X), 0),	\			       VOIDmode)))			\   || (GET_CODE (X) == SYMBOL_REF && SYMBOL_REF_FLAG (X)))

⌨️ 快捷键说明

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