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

📄 m32r.h

📁 gcc编译工具没有什么特别
💻 H
📖 第 1 页 / 共 5 页
字号:
/* 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.  */#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.  */#define LIBCALL_VALUE(MODE) gen_rtx (REG, MODE, 0)/* 1 if N is a possible register number for a function value   as seen by the caller.  *//* ??? What about r1 in DI/DF values.  */#define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)/* A C expression which can inhibit the returning of certain function   values in registers, based on the type of value.  A nonzero value says   to return the function value in memory, just as large structures are   always returned.  Here TYPE will be a C expression of type `tree',   representing the data type of the value.  */#define RETURN_IN_MEMORY(TYPE) \(int_size_in_bytes (TYPE) > 8)/* Tell GCC to use RETURN_IN_MEMORY.  */#define DEFAULT_PCC_STRUCT_RETURN 0/* Register in which address to store a structure value   is passed to a function, or 0 to use `invisible' first argument.  */#define STRUCT_VALUE 0/* Function entry and exit.  *//* Initialize data used by insn expanders.  This is called from   init_emit, once for each function, before code is generated.  */#define INIT_EXPANDERS m32r_init_expanders ()/* This macro generates the assembly code for function entry.   FILE is a stdio stream to output the code to.   SIZE is an int: how many units of temporary storage to allocate.   Refer to the array `regs_ever_live' to determine which registers   to save; `regs_ever_live[I]' is nonzero if register number I   is ever used in the function.  This macro is responsible for   knowing which registers should not be saved even if used.  */#define FUNCTION_PROLOGUE(FILE, SIZE) \m32r_output_function_prologue (FILE, SIZE)/* 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/* 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.   The function epilogue should not depend on the current stack pointer!   It should use the frame pointer only.  This is mandatory because   of alloca; we also take advantage of it to omit stack adjustments   before returning.  */#define FUNCTION_EPILOGUE(FILE, SIZE) \m32r_output_function_epilogue (FILE, SIZE)/* Output assembler code to FILE to increment profiler label # LABELNO   for profiling a function entry.  */#define FUNCTION_PROFILER(FILE, LABELNO) abort ()/* Trampolines.  *//* On the M32R, the trampoline is	ld24 r7,STATIC	ld24 r6,FUNCTION	jmp r6	nop   ??? Need addr32 support.*//* Length in bytes of the trampoline for entering a nested function.  */#define TRAMPOLINE_SIZE 12/* 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.  */#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \do { \  emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 0)), \		  plus_constant ((CXT), 0xe7000000)); \  emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 4)), \		  plus_constant ((FNADDR), 0xe6000000)); \  emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 8)), \		  GEN_INT (0x1fc67000)); \  emit_insn (gen_flush_icache (validize_mem (gen_rtx (MEM, SImode, TRAMP)))); \} while (0)/* Library calls.  *//* Generate calls to memcpy, memcmp and memset.  */#define TARGET_MEM_FUNCTIONS/* Addressing modes, and classification of registers for them.  *//* Maximum number of registers that can appear in a valid memory address.  */#define MAX_REGS_PER_ADDRESS 1/* We have post-inc load and pre-dec,pre-inc store,   but only for 4 byte vals.  */#if 0#define HAVE_PRE_DECREMENT 1#define HAVE_PRE_INCREMENT 1#define HAVE_POST_INCREMENT 1#endif/* 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)/* Nonzero if the constant value X is a legitimate general operand.   We don't allow (plus symbol large-constant) as the relocations can't   describe it.  INTVAL > 32767 handles both 16 bit and 24 bit relocations.   We allow all CONST_DOUBLE's as the md file patterns will force the   constant to memory if they can't handle them.  */#define LEGITIMATE_CONSTANT_P(X) \(! (GET_CODE (X) == CONST \    && GET_CODE (XEXP (X, 0)) == PLUS \    && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF \    && GET_CODE (XEXP (XEXP (X, 0), 1)) == CONST_INT \    && (unsigned HOST_WIDE_INT) INTVAL (XEXP (XEXP (X, 0), 1)) > 32767))/* The macros REG_OK_FOR..._P assume that the arg is a REG rtx   and check its validity for a certain class.   We have two alternate definitions for each of them.   The usual definition accepts all pseudo regs; the other rejects   them unless they have been allocated suitable hard regs.   The symbol REG_OK_STRICT causes the latter definition to be used.   Most source files want to accept pseudo regs in the hope that   they will get allocated to the class that the insn wants them to be in.   Source files for reload pass need to be strict.   After reload, it makes no difference, since pseudo regs have   been eliminated by then.  */#ifdef REG_OK_STRICT/* Nonzero if X is a hard reg that can be used as a base reg.  */#define REG_OK_FOR_BASE_P(X) GPR_P (REGNO (X))/* Nonzero if X is a hard reg that can be used as an index.  */#define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_BASE_P (X)#else/* Nonzero if X is a hard reg that can be used as a base reg   or if it is a pseudo reg.  */#define REG_OK_FOR_BASE_P(X) \(GPR_P (REGNO (X))			\ || (REGNO (X)) == ARG_POINTER_REGNUM	\ || REGNO (X) >= FIRST_PSEUDO_REGISTER)/* Nonzero if X is a hard reg that can be used as an index   or if it is a pseudo reg.  */#define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_BASE_P (X)#endif/* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression   that is a valid memory address for an instruction.   The MODE argument is the machine mode for the MEM expression   that wants to use this address.  *//* local to this file */#define RTX_OK_FOR_BASE_P(X) \(REG_P (X) && REG_OK_FOR_BASE_P (X))/* local to this file */#define RTX_OK_FOR_OFFSET_P(X) \(GET_CODE (X) == CONST_INT && INT16_P (INTVAL (X)))/* local to this file */#define LEGITIMATE_OFFSET_ADDRESS_P(MODE, X)				\(GET_CODE (X) == PLUS							\ && RTX_OK_FOR_BASE_P (XEXP (X, 0))					\ && RTX_OK_FOR_OFFSET_P (XEXP (X, 1)))/* local to this file *//* For LO_SUM addresses, do not allow them if the MODE is > 1 word,   since more than one instruction will be required.  */#define LEGITIMATE_LO_SUM_ADDRESS_P(MODE, X)				\(GET_CODE (X) == LO_SUM							\ && (MODE != BLKmode && GET_MODE_SIZE (MODE) <= UNITS_PER_WORD)		\ && RTX_OK_FOR_BASE_P (XEXP (X, 0))					\ && CONSTANT_P (XEXP (X, 1)))/* local to this file *//* Memory address that is a push/pop of the stack pointer.  */#define PUSH_POP_P(MODE, X)						\((MODE) == SImode							\ && (GET_CODE (X) == POST_INC						\     || GET_CODE (X) == PRE_INC						\     || GET_CODE (X) == PRE_DEC))#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)				\{ if (RTX_OK_FOR_BASE_P (X))						\    goto ADDR;								\  if (LEGITIMATE_OFFSET_ADDRESS_P ((MODE), (X)))			\    goto ADDR;								\  if (LEGITIMATE_LO_SUM_ADDRESS_P ((MODE), (X)))			\    goto ADDR;								\  if (PUSH_POP_P ((MODE), (X)))						\    goto ADDR;								\}/* Try machine-dependent ways of modifying an illegitimate address   to be legitimate.  If we find one, return the new, valid address.   This macro is used in only one place: `memory_address' in explow.c.   OLDX is the address as it was before break_out_memory_refs was called.   In some cases it is useful to look at this to decide what needs to be done.   MODE and WIN are passed so that this macro can use   GO_IF_LEGITIMATE_ADDRESS.   It is always safe for this macro to do nothing.  It exists to recognize   opportunities to optimize the output.   ??? Is there anything useful we can do here for the M32R?  */#define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN)/* Go to LABEL if ADDR (a legitimate address expression)   has an effect that depends on the machine mode it is used for.  */#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL)			\do {									\  if (GET_CODE (ADDR) == PRE_DEC					\      || GET_CODE (ADDR) == PRE_INC					\      || GET_CODE (ADDR) == POST_INC					\      || GET_CODE (ADDR) == LO_SUM)					\    goto LABEL;								\} while (0)/* Condition code usage.  *//* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,   return the mode to be used for the comparison.  */#define SELECT_CC_MODE(OP, X, Y) \((enum machine_mode)m32r_select_cc_mode ((int)OP, X, Y))/* Return non-zero if SELECT_CC_MODE will never return MODE for a   floating point inequality comparison.  */#define REVERSIBLE_CC_MODE(MODE) 1 /*???*//* Costs.  *//* ??? I'm quite sure I don't understand enough of the subtleties involved   in choosing the right numbers to use here, but there doesn't seem to be   enough documentation on this.  What I've done is define an insn to cost   4 "units" and work from there.  COSTS_N_INSNS (N) is defined as (N) * 4 - 2   so that seems reasonable.  Some values are supposed to be defined relative   to each other and thus aren't necessarily related to COSTS_N_INSNS.  *//* 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.  *//* Small integers are as cheap as registers.  4 byte values can be fetched   as immediate constants - let's give that the cost of an extra insn.  */#define CONST_COSTS(X, CODE, OUTER_CODE) \  case CONST_INT :						\    if (INT16_P (INTVAL (X)))					\      return 0;							\    /* fall through */						\  case CONST :							\  case LABEL_REF :						\  case SYMBOL_REF :						\    return 4;							\  case CONST_DOUBLE :						\    {								\      rtx high, low;						\      split_double (X, &high, &low);				\      return 4 * (!INT16_P (INTVAL (high))			\		  + !INT16_P (INTVAL (low)));			\    }/* Compute the cost of an address.  */#define ADDRESS_COST(ADDR) m32r_address_cost (ADDR)/* Compute extra cost of moving data between one register class   and another.  */#define REGISTER_MOVE_COST(CLASS1, CLASS2) 2/* Compute the cost of moving data between registers and memory.  *//* Memory is 3 times as expensive as registers.   ??? Is that the right way to look at it?  */#define MEMORY_MOVE_COST(MODE,CLASS,IN_P) \(GET_MODE_SIZE (MODE) <= UNITS_PER_WORD ? 6 : 12)/* The cost of a branch insn.  *//* A value of 2 here causes GCC to avoid using branches in comparisons like   while (a < N && a).  Branches aren't that expensive on the M32R so   we define this as 1.  Defining it as 2 had a heavy hit in fp-bit.c.  */#define BRANCH_COST 1/* Provide the costs of a rtl expression.  This is in the body of a   switch on CODE.  The purpose for the cost of MULT is to encourage   `synth_mult' to find a synthetic multiply when reasonable.   If we need more than 12 insns to do a multiply, then go out-of-line,   since the call overhead will be < 10% of the cost of the multiply.  */#define RTX_COSTS(X, CODE, OUTER_CODE) \  case MULT :						\    return COSTS_N_INSNS (3);				\  case DIV :						\  case UDIV :						\  case MOD :						\  case UMOD :						\    return COSTS_N_INSNS (10);				\/* Nonzero if access to memory by bytes is slow and undesirable.   For RISC chips, it means that access to memory by bytes is no   better than access by words when possible, so grab a whole word   and maybe make use of that.  */#define SLOW_BYTE_ACCESS 1/* Define this macro if it is as good or better to call a constant   function address than to call an address kept in a register.  */#define NO_FUNCTION_CSE/* Define this macro if it is as good or better for a function to call   itself with an explicit address than to call an address kept in a   register.  */#define NO_RECURSIVE_FUNCTION_CSE/* Enable the register move pass.   This is useful for machines with only 2 address instructions.   It's not currently enabled by default because on the stanford benchmarks   the improvement wasn't significant and in a couple of cases caused a

⌨️ 快捷键说明

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