📄 frv.h
字号:
Sometimes returning a more restrictive class makes better code. For example, on the 68000, when X is an integer constant that is in range for a `moveq' instruction, the value of this macro is always `DATA_REGS' as long as CLASS includes the data registers. Requiring a data register guarantees that a `moveq' will be used. If X is a `const_double', by returning `NO_REGS' you can force X into a memory constant. This is useful on certain machines where immediate floating values cannot be loaded into certain kinds of registers. This declaration must be present. */#define PREFERRED_RELOAD_CLASS(X, CLASS) CLASS#define SECONDARY_INPUT_RELOAD_CLASS(CLASS, MODE, X) \ frv_secondary_reload_class (CLASS, MODE, X, TRUE)#define SECONDARY_OUTPUT_RELOAD_CLASS(CLASS, MODE, X) \ frv_secondary_reload_class (CLASS, MODE, X, FALSE)/* A C expression whose value is nonzero if pseudos that have been assigned to registers of class CLASS would likely be spilled because registers of CLASS are needed for spill registers. The default value of this macro returns 1 if CLASS has exactly one register and zero otherwise. On most machines, this default should be used. Only define this macro to some other expression if pseudo allocated by `local-alloc.c' end up in memory because their hard registers were needed for spill registers. If this macro returns nonzero for those classes, those pseudos will only be allocated by `global.c', which knows how to reallocate the pseudo to another register. If there would not be another register available for reallocation, you should not change the definition of this macro since the only effect of such a definition would be to slow down register allocation. */#define CLASS_LIKELY_SPILLED_P(CLASS) frv_class_likely_spilled_p (CLASS)/* A C expression for the maximum number of consecutive registers of class CLASS needed to hold a value of mode MODE. This is closely related to the macro `HARD_REGNO_NREGS'. In fact, the value of the macro `CLASS_MAX_NREGS (CLASS, MODE)' should be the maximum value of `HARD_REGNO_NREGS (REGNO, MODE)' for all REGNO values in the class CLASS. This macro helps control the handling of multiple-word values in the reload pass. This declaration is required. */#define CLASS_MAX_NREGS(CLASS, MODE) frv_class_max_nregs (CLASS, MODE)#define ZERO_P(x) (x == CONST0_RTX (GET_MODE (x)))/* 6 bit signed immediate. */#define CONST_OK_FOR_I(VALUE) IN_RANGE_P(VALUE, -32, 31)/* 10 bit signed immediate. */#define CONST_OK_FOR_J(VALUE) IN_RANGE_P(VALUE, -512, 511)/* Unused */#define CONST_OK_FOR_K(VALUE) 0/* 16 bit signed immediate. */#define CONST_OK_FOR_L(VALUE) IN_RANGE_P(VALUE, -32768, 32767)/* 16 bit unsigned immediate. */#define CONST_OK_FOR_M(VALUE) IN_RANGE_P (VALUE, 0, 65535)/* 12 bit signed immediate that is negative. */#define CONST_OK_FOR_N(VALUE) IN_RANGE_P(VALUE, -2048, -1)/* Zero */#define CONST_OK_FOR_O(VALUE) ((VALUE) == 0)/* 12 bit signed immediate that is negative. */#define CONST_OK_FOR_P(VALUE) IN_RANGE_P(VALUE, 1, 2047)/* A C expression that defines the machine-dependent operand constraint letters (`I', `J', `K', .. 'P') that specify particular ranges of integer values. If C is one of those letters, the expression should check that VALUE, an integer, is in the appropriate range and return 1 if so, 0 otherwise. If C is not one of those letters, the value should be 0 regardless of 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)/* A C expression that defines the machine-dependent operand constraint letters (`G', `H') that specify particular ranges of `const_double' values. If C is one of those letters, the expression should check that VALUE, an RTX of code `const_double', is in the appropriate range and return 1 if so, 0 otherwise. If C is not one of those letters, the value should be 0 regardless of VALUE. `const_double' is used for all floating-point constants and for `DImode' fixed-point constants. A given letter can accept either or both kinds of values. It can use `GET_MODE' to distinguish between these kinds. */#define CONST_DOUBLE_OK_FOR_G(VALUE) \ ((GET_MODE (VALUE) == VOIDmode \ && CONST_DOUBLE_LOW (VALUE) == 0 \ && CONST_DOUBLE_HIGH (VALUE) == 0) \ || ((GET_MODE (VALUE) == SFmode \ || GET_MODE (VALUE) == DFmode) \ && (VALUE) == CONST0_RTX (GET_MODE (VALUE))))#define CONST_DOUBLE_OK_FOR_H(VALUE) 0#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \ ( (C) == 'G' ? CONST_DOUBLE_OK_FOR_G (VALUE) \ : (C) == 'H' ? CONST_DOUBLE_OK_FOR_H (VALUE) \ : 0)/* A C expression that defines the optional machine-dependent constraint letters (`Q', `R', `S', `T', `U') that can be used to segregate specific types of operands, usually memory references, for the target machine. Normally this macro will not be defined. If it is required for a particular 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. For example, on the ROMP, load instructions cannot have their output in r0 if the memory reference contains a symbolic address. Constraint letter `Q' is defined as representing a memory address that does *not* contain a symbolic address. An alternative is specified with a `Q' constraint on the input and `r' on the output. The next alternative specifies `m' on the input and a register class that does not include r0 on the output. *//* 12-bit relocations. */#define EXTRA_CONSTRAINT_FOR_Q(VALUE) \ (got12_operand (VALUE, GET_MODE (VALUE)))/* Double word memory ops that take one instruction. */#define EXTRA_CONSTRAINT_FOR_R(VALUE) \ (dbl_memory_one_insn_operand (VALUE, GET_MODE (VALUE)))/* SYMBOL_REF */#define EXTRA_CONSTRAINT_FOR_S(VALUE) \ (CONSTANT_P (VALUE) && call_operand (VALUE, VOIDmode))/* Double word memory ops that take two instructions. */#define EXTRA_CONSTRAINT_FOR_T(VALUE) \ (dbl_memory_two_insn_operand (VALUE, GET_MODE (VALUE)))/* Memory operand for conditional execution. */#define EXTRA_CONSTRAINT_FOR_U(VALUE) \ (condexec_memory_operand (VALUE, GET_MODE (VALUE)))#define EXTRA_CONSTRAINT(VALUE, C) \ ( (C) == 'Q' ? EXTRA_CONSTRAINT_FOR_Q (VALUE) \ : (C) == 'R' ? EXTRA_CONSTRAINT_FOR_R (VALUE) \ : (C) == 'S' ? EXTRA_CONSTRAINT_FOR_S (VALUE) \ : (C) == 'T' ? EXTRA_CONSTRAINT_FOR_T (VALUE) \ : (C) == 'U' ? EXTRA_CONSTRAINT_FOR_U (VALUE) \ : 0)#define CONSTRAINT_LEN(C, STR) \ ((C) == 'D' ? 3 : DEFAULT_CONSTRAINT_LEN ((C), (STR)))#define REG_CLASS_FROM_CONSTRAINT(C, STR) \ (((C) == 'D' && (STR)[1] == '8' && (STR)[2] == '9') ? GR89_REGS : \ ((C) == 'D' && (STR)[1] == '0' && (STR)[2] == '9') ? GR9_REGS : \ ((C) == 'D' && (STR)[1] == '0' && (STR)[2] == '8') ? GR8_REGS : \ ((C) == 'D' && (STR)[1] == '1' && (STR)[2] == '4') ? FDPIC_FPTR_REGS : \ ((C) == 'D' && (STR)[1] == '1' && (STR)[2] == '5') ? FDPIC_REGS : \ REG_CLASS_FROM_LETTER ((C)))/* Basic Stack Layout. *//* Structure to describe information about a saved range of registers */typedef struct frv_stack_regs { const char * name; /* name of the register ranges */ int first; /* first register in the range */ int last; /* last register in the range */ int size_1word; /* # of bytes to be stored via 1 word stores */ int size_2words; /* # of bytes to be stored via 2 word stores */ unsigned char field_p; /* true if the registers are a single SPR */ unsigned char dword_p; /* true if we can do dword stores */ unsigned char special_p; /* true if the regs have a fixed save loc. */} frv_stack_regs_t;/* Register ranges to look into saving. */#define STACK_REGS_GPR 0 /* Gprs (normally gr16..gr31, gr48..gr63) */#define STACK_REGS_FPR 1 /* Fprs (normally fr16..fr31, fr48..fr63) */#define STACK_REGS_LR 2 /* LR register */#define STACK_REGS_CC 3 /* CCrs (normally not saved) */#define STACK_REGS_LCR 5 /* lcr register */#define STACK_REGS_STDARG 6 /* stdarg registers */#define STACK_REGS_STRUCT 7 /* structure return (gr3) */#define STACK_REGS_FP 8 /* FP register */#define STACK_REGS_MAX 9 /* # of register ranges *//* Values for save_p field. */#define REG_SAVE_NO_SAVE 0 /* register not saved */#define REG_SAVE_1WORD 1 /* save the register */#define REG_SAVE_2WORDS 2 /* save register and register+1 *//* Structure used to define the frv stack. */typedef struct frv_stack { int total_size; /* total bytes allocated for stack */ int vars_size; /* variable save area size */ int parameter_size; /* outgoing parameter size */ int stdarg_size; /* size of regs needed to be saved for stdarg */ int regs_size; /* size of the saved registers */ int regs_size_1word; /* # of bytes to be stored via 1 word stores */ int regs_size_2words; /* # of bytes to be stored via 2 word stores */ int header_size; /* size of the old FP, struct ret., LR save */ int pretend_size; /* size of pretend args */ int vars_offset; /* offset to save local variables from new SP*/ int regs_offset; /* offset to save registers from new SP */ /* register range information */ frv_stack_regs_t regs[STACK_REGS_MAX]; /* offset to store each register */ int reg_offset[FIRST_PSEUDO_REGISTER]; /* whether to save register (& reg+1) */ unsigned char save_p[FIRST_PSEUDO_REGISTER];} frv_stack_t;/* Define this macro if pushing a word onto the stack moves the stack pointer to a smaller address. */#define STACK_GROWS_DOWNWARD 1/* Define this macro to nonzero if the addresses of local variable slots are at negative offsets from the frame pointer. */#define FRAME_GROWS_DOWNWARD 1/* Offset from the frame pointer to the first local variable slot to be allocated. If `FRAME_GROWS_DOWNWARD', find the next slot's offset by subtracting the first slot's length from `STARTING_FRAME_OFFSET'. Otherwise, it is found by adding the length of the first slot to the value `STARTING_FRAME_OFFSET'. */#define STARTING_FRAME_OFFSET 0/* Offset from the stack pointer register to the first location at which outgoing arguments are placed. If not specified, the default value of zero is used. This is the proper value for most machines. If `ARGS_GROW_DOWNWARD', this is the offset to the location above the first location at which outgoing arguments are placed. */#define STACK_POINTER_OFFSET 0/* Offset from the argument pointer register to the first argument's address. On some machines it may depend on the data type of the function. If `ARGS_GROW_DOWNWARD', this is the offset to the location above the first argument's address. */#define FIRST_PARM_OFFSET(FUNDECL) 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) frv_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, after the prologue. 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 value of the expression must always be the correct address when COUNT is zero, but may be `NULL_RTX' if there is not way to determine the return address of other frames. */#define RETURN_ADDR_RTX(COUNT, FRAMEADDR) frv_return_addr_rtx (COUNT, FRAMEADDR)#define RETURN_POINTER_REGNUM LR_REGNO/* A C expression whose value is RTL representing the location of the incoming return address at the beginning of any function, before the prologue. This RTL is either a `REG', indicating that the return value is saved in `REG', or a `MEM' representing a location in the stack. You only need to define this macro if you want to support call frame debugging information like that provided by DWARF 2. */#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (SImode, RETURN_POINTER_REGNUM)/* Register That Address the Stack Frame. *//* The register number of the stack pointer register, which must also be a fixed register according to `FIXED_REGISTERS'. On most machines, the hardware determines which register this is. */#define STACK_POINTER_REGNUM (GPR_FIRST + 1)/* The register number of the frame pointer register, which is used to access automatic variables in the stack frame. On some machines, the hardware determines which register this is. On other machines, you can choose any register you wish for this purpose. */#define FRAME_POINTER_REGNUM (GPR_FIRST + 2)/* The register number of the arg pointer register, which is used to access the function's argument list. On some machines, this is the same as the frame pointer register. On some machines, the hardware determines which register this is. On other machines, you can choose any register you wish for this purpose. If this is not the same register as the frame pointer register, then you must mark it as a fixed register according to `FIXED_REGISTERS', or arrange to be able to eliminate it.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -