📄 m32r.h
字号:
#endif#ifndef SUBTARGET_REG_CLASS_GENERAL#define SUBTARGET_REG_CLASS_GENERAL 0#endif#ifndef SUBTARGET_REG_CLASS_ALL#define SUBTARGET_REG_CLASS_ALL 0#endif#define REG_CLASS_CONTENTS \{ \ { 0x00000 }, \ { 0x20000 | SUBTARGET_REG_CLASS_CARRY }, \ { 0x40000 | SUBTARGET_REG_CLASS_ACCUM }, \ { 0x1ffff | SUBTARGET_REG_CLASS_GENERAL }, \ { 0x7ffff | SUBTARGET_REG_CLASS_ALL }, \}/* 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. */extern enum reg_class m32r_regno_reg_class[FIRST_PSEUDO_REGISTER];#define REGNO_REG_CLASS(REGNO) (m32r_regno_reg_class[REGNO])/* The class value for index registers, and the one for base regs. */#define INDEX_REG_CLASS GENERAL_REGS#define BASE_REG_CLASS GENERAL_REGS#define REG_CLASS_FROM_LETTER(C) \((C) == 'c' ? CARRY_REG \ : (C) == 'a' ? ACCUM_REGS \ : NO_REGS)/* 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_BASE_P(REGNO) \((REGNO) < FIRST_PSEUDO_REGISTER \ ? GPR_P (REGNO) || (REGNO) == ARG_POINTER_REGNUM \ : GPR_P (reg_renumber[REGNO]))#define REGNO_OK_FOR_INDEX_P(REGNO) REGNO_OK_FOR_BASE_P(REGNO)/* 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. */#define CLASS_MAX_NREGS(CLASS, MODE) \((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)/* 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. *//* 'I' is used for 8 bit signed immediates. 'J' is used for 16 bit signed immediates. 'K' is used for 16 bit unsigned immediates. 'L' is used for 16 bit immediates left shifted by 16 (sign ???). 'M' is used for 24 bit unsigned immediates. 'N' is used for any 32 bit non-symbolic value. 'O' is used for 5 bit unsigned immediates (shift count). 'P' is used for 16 bit signed immediates for compares (values in the range -32767 to +32768). *//* Return true if a value is inside a range. */#define IN_RANGE_P(VALUE, LOW, HIGH) \ (((unsigned HOST_WIDE_INT)((VALUE) - (LOW))) \ <= ((unsigned HOST_WIDE_INT)((HIGH) - (LOW))))/* Local to this file. */#define INT8_P(X) ((X) >= -0x80 && (X) <= 0x7f)#define INT16_P(X) ((X) >= -0x8000 && (X) <= 0x7fff)#define CMP_INT16_P(X) ((X) >= -0x7fff && (X) <= 0x8000)#define UPPER16_P(X) (((X) & 0xffff) == 0 \ && ((X) >> 16) >= -0x8000 \ && ((X) >> 16) <= 0x7fff)#define UINT16_P(X) (((unsigned HOST_WIDE_INT) (X)) <= 0x0000ffff)#define UINT24_P(X) (((unsigned HOST_WIDE_INT) (X)) <= 0x00ffffff)#define UINT32_P(X) (((unsigned HOST_WIDE_INT) (X)) <= 0xffffffff)#define UINT5_P(X) ((X) >= 0 && (X) < 32)#define INVERTED_SIGNED_8BIT(VAL) ((VAL) >= -127 && (VAL) <= 128)#define CONST_OK_FOR_LETTER_P(VALUE, C) \((C) == 'I' ? INT8_P (VALUE) \ : (C) == 'J' ? INT16_P (VALUE) \ : (C) == 'K' ? UINT16_P (VALUE) \ : (C) == 'L' ? UPPER16_P (VALUE) \ : (C) == 'M' ? UINT24_P (VALUE) \ : (C) == 'N' ? INVERTED_SIGNED_8BIT (VALUE) \ : (C) == 'O' ? UINT5_P (VALUE) \ : (C) == 'P' ? CMP_INT16_P (VALUE) \ : 0)/* Similar, but for floating constants, and defining letters G and H. Here VALUE is the CONST_DOUBLE rtx itself. For the m32r, handle a few constants inline. ??? We needn't treat DI and DF modes differently, but for now we do. */#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \((C) == 'G' ? easy_di_const (VALUE) \ : (C) == 'H' ? easy_df_const (VALUE) \ : 0)/* A C expression that defines the optional machine-dependent constraint letters that can be used to segregate specific types of operands, usually memory references, for the target machine. It should return 1 if VALUE corresponds to the operand type represented by the constraint letter C. If C is not defined as an extra constraint, the value returned should be 0 regardless of VALUE. *//* Q is for symbolic addresses loadable with ld24. R is for symbolic addresses when ld24 can't be used. S is for stores with pre {inc,dec}rement T is for indirect of a pointer. U is for loads with post increment. */#define EXTRA_CONSTRAINT(VALUE, C) \( (C) == 'Q' ? ((TARGET_ADDR24 && GET_CODE (VALUE) == LABEL_REF) \ || addr24_operand (VALUE, VOIDmode)) \ : (C) == 'R' ? ((TARGET_ADDR32 && GET_CODE (VALUE) == LABEL_REF) \ || addr32_operand (VALUE, VOIDmode)) \ : (C) == 'S' ? (GET_CODE (VALUE) == MEM \ && STORE_PREINC_PREDEC_P (GET_MODE (VALUE), \ XEXP (VALUE, 0))) \ : (C) == 'T' ? (GET_CODE (VALUE) == MEM \ && memreg_operand (VALUE, GET_MODE (VALUE))) \ : (C) == 'U' ? (GET_CODE (VALUE) == MEM \ && LOAD_POSTINC_P (GET_MODE (VALUE), \ XEXP (VALUE, 0))) \ : 0)/* Stack layout and stack pointer usage. *//* Define this macro if pushing a word onto the stack moves the stack pointer to 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 from the frame pointer. *//*#define FRAME_GROWS_DOWNWARD*//* Offset from frame pointer 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. *//* The frame pointer points at the same place as the stack pointer, except if alloca has been called. */#define STARTING_FRAME_OFFSET \M32R_STACK_ALIGN (current_function_outgoing_args_size)/* Offset from the stack pointer register to the first location at which outgoing arguments are placed. */#define STACK_POINTER_OFFSET 0/* Offset of first parameter from the argument pointer register value. */#define FIRST_PARM_OFFSET(FNDECL) 0/* A C expression whose value is RTL representing the address in a stack frame where the pointer to the caller's frame is stored. Assume that FRAMEADDR is an RTL expression for the address of the stack frame itself. If you don't define this macro, the default is to return the value of FRAMEADDR--that is, the stack frame address is also the address of the stack word that points to the previous frame. *//*define DYNAMIC_CHAIN_ADDRESS (FRAMEADDR)*//* A C expression whose value is RTL representing the value of the return address for the frame COUNT steps up from the current frame. FRAMEADDR is the frame pointer of the COUNT frame, or the frame pointer of the COUNT - 1 frame if `RETURN_ADDR_IN_PREVIOUS_FRAME' is defined. *//* The current return address is in r14. */#if 0 /* The default value should work. */#define RETURN_ADDR_RTX(COUNT, FRAME) \(((COUNT) == -1) \ ? gen_rtx_REG (Pmode, 14) \ : copy_to_reg (gen_rtx_MEM (Pmode, \ memory_address (Pmode, \ plus_constant ((FRAME), \ UNITS_PER_WORD)))))#endif/* Register to use for pushing function arguments. */#define STACK_POINTER_REGNUM 15/* Base register for access to local variables of the function. */#define FRAME_POINTER_REGNUM 13/* Base register for access to arguments of the function. */#define ARG_POINTER_REGNUM 16/* The register number of the return address pointer register, which is used to access the current function's return address from the stack. On some machines, the return address is not at a fixed offset from the frame pointer or stack pointer or argument pointer. This register can be defined to point to the return address on the stack, and then be converted by `ELIMINABLE_REGS' into either the frame pointer or stack pointer. Do not define this macro unless there is no other way to get the return address from the stack. *//* ??? revisit *//* #define RETURN_ADDRESS_POINTER_REGNUM *//* Register in which static-chain is passed to a function. This must not be a register used by the prologue. */#define STATIC_CHAIN_REGNUM 7/* These aren't official macros. */#define PROLOGUE_TMP_REGNUM 4#define RETURN_ADDR_REGNUM 14/* #define GP_REGNUM 12 */#define CARRY_REGNUM 17#define ACCUM_REGNUM 18#define M32R_MAX_INT_REGS 16#ifndef SUBTARGET_GPR_P#define SUBTARGET_GPR_P(REGNO) 0#endif#ifndef SUBTARGET_ACCUM_P#define SUBTARGET_ACCUM_P(REGNO) 0#endif#ifndef SUBTARGET_CARRY_P#define SUBTARGET_CARRY_P(REGNO) 0#endif#define GPR_P(REGNO) (IN_RANGE_P ((REGNO), 0, 15) || SUBTARGET_GPR_P (REGNO))#define ACCUM_P(REGNO) ((REGNO) == ACCUM_REGNUM || SUBTARGET_ACCUM_P (REGNO))#define CARRY_P(REGNO) ((REGNO) == CARRY_REGNUM || SUBTARGET_CARRY_P (REGNO))/* Eliminating the frame and arg pointers. *//* A C expression which is nonzero if a function must have and use a frame pointer. This expression is evaluated in the reload pass. If its value is nonzero the function will have a frame pointer. */#define FRAME_POINTER_REQUIRED current_function_calls_alloca#if 0/* C statement to store the difference between the frame pointer and the stack pointer values immediately after the function prologue. If `ELIMINABLE_REGS' is defined, this macro will be not be used and need not be defined. */#define INITIAL_FRAME_POINTER_OFFSET(VAR) \((VAR) = m32r_compute_frame_size (get_frame_size ()))#endif/* If defined, this macro specifies a table of register pairs used to eliminate unneeded registers that point into the stack frame. If it is not defined, the only elimination attempted by the compiler is to replace references to the frame pointer with references to the stack pointer. Note that the elimination of the argument pointer with the stack pointer is specified first since that is the preferred elimination. */#define ELIMINABLE_REGS \{{ FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM }, \ { ARG_POINTER_REGNUM, STACK_POINTER_REGNUM }, \ { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM }}/* A C expression that returns nonzero if the compiler is allowed to try to replace register number FROM-REG with register number TO-REG. This macro need only be defined if `ELIMINABLE_REGS' is defined, and will usually be the constant 1, since most of the cases preventing register elimination are things that the compiler already knows about. */#define CAN_ELIMINATE(FROM, TO) \ ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM \ ? ! frame_pointer_needed \ : 1)/* This macro is similar to `INITIAL_FRAME_POINTER_OFFSET'. It specifies the initial difference between the specified pair of registers. This macro must be defined if `ELIMINABLE_REGS' is defined. */#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \{ \ int size = m32r_compute_frame_size (get_frame_size ()); \ \ if ((FROM) == FRAME_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM) \ (OFFSET) = 0; \ else if ((FROM) == ARG_POINTER_REGNUM && (TO) == FRAME_POINTER_REGNUM) \ (OFFSET) = size - current_function_pretend_args_size; \ else if ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM) \ (OFFSET) = size - current_function_pretend_args_size; \ else \ abort (); \}/* Function argument passing. *//* When a prototype says `char' or `short', really pass an `int'. */#define PROMOTE_PROTOTYPES 1/* If defined, the maximum amount of space required for outgoing arguments will be computed and placed into the variable `current_function_outgoing_args_size'. No space will be pushed onto the stack for each call; instead, the function prologue should increase the stack frame size by this amount. */#define ACCUMULATE_OUTGOING_ARGS 1/* Define this macro if functions should assume that stack space has been allocated for arguments even when their values are passed in registers. The value of this macro is the size, in bytes, of the area reserved for arguments passed in registers for the function represented by FNDECL. This space can be allocated by the caller, or be a part of the machine-dependent stack frame: `OUTGOING_REG_PARM_STACK_SPACE' says which. */#if 0#define REG_PARM_STACK_SPACE(FNDECL) \ (M32R_MAX_PARM_REGS * UNITS_PER_WORD)#endif/* 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. */#define RETURN_POPS_ARGS(DECL, FUNTYPE, SIZE) 0/* Nonzero if we do not know how to pass TYPE solely in registers. */#define MUST_PASS_IN_STACK(MODE, TYPE) \ ((TYPE) != 0 \ && (TREE_CODE (TYPE_SIZE (TYPE)) != INTEGER_CST \ || TREE_ADDRESSABLE (TYPE)))/* 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. */#define CUMULATIVE_ARGS int
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -