📄 mips.h
字号:
/* Allocation boundary (in *bits*) for storing pointers in memory. */#define POINTER_BOUNDARY (TARGET_LONG64 ? 64 : 32)/* Allocation boundary (in *bits*) for storing arguments in argument list. */#define PARM_BOUNDARY (TARGET_64BIT ? 64 : 32)/* Allocation boundary (in *bits*) for the code of a function. */#define FUNCTION_BOUNDARY 32/* Alignment of field after `int : 0' in a structure. */#define EMPTY_FIELD_BOUNDARY (TARGET_LONG64 ? 64 : 32)/* Every structure's size must be a multiple of this. *//* 8 is observed right on a DECstation and on riscos 4.02. */#define STRUCTURE_SIZE_BOUNDARY 8/* There is no point aligning anything to a rounder boundary than this. */#define BIGGEST_ALIGNMENT 64/* Biggest alignment any structure field can require in bits. */#define BIGGEST_FIELD_ALIGNMENT 64/* Set this nonzero if move instructions will actually fail to work when given unaligned data. */#define STRICT_ALIGNMENT 1/* Define this if you wish to imitate the way many other C compilers handle alignment of bitfields and the structures that contain them. The behavior is that the type written for a bitfield (`int', `short', or other integer type) imposes an alignment for the entire structure, as if the structure really did contain an ordinary field of that type. In addition, the bitfield is placed within the structure so that it would fit within such a field, not crossing a boundary for it. Thus, on most machines, a bitfield whose type is written as `int' would not cross a four-byte boundary, and would force four-byte alignment for the whole structure. (The alignment used may not be four bytes; it is controlled by the other alignment parameters.) If the macro is defined, its definition should be a C expression; a nonzero value for the expression enables this behavior. */#define PCC_BITFIELD_TYPE_MATTERS 1/* If defined, a C expression to compute the alignment given to a constant that is being placed in memory. CONSTANT is the constant and ALIGN is the alignment that the object would ordinarily have. The value of this macro is used instead of that alignment to align the object. If this macro is not defined, then ALIGN is used. The typical use of this macro is to increase alignment for string constants to be word aligned so that `strcpy' calls that copy constants can be done inline. */#define CONSTANT_ALIGNMENT(EXP, ALIGN) \ ((TREE_CODE (EXP) == STRING_CST || TREE_CODE (EXP) == CONSTRUCTOR) \ && (ALIGN) < BITS_PER_WORD \ ? BITS_PER_WORD \ : (ALIGN))/* If defined, a C expression to compute the alignment for a static variable. TYPE is the data type, and ALIGN is the alignment that the object would ordinarily have. The value of this macro is used instead of that alignment to align the object. If this macro is not defined, then ALIGN is used. One use of this macro is to increase alignment of medium-size data to make it all fit in fewer cache lines. Another is to cause character arrays to be word-aligned so that `strcpy' calls that copy constants to character arrays can be done inline. */#undef DATA_ALIGNMENT#define DATA_ALIGNMENT(TYPE, ALIGN) \ ((((ALIGN) < BITS_PER_WORD) \ && (TREE_CODE (TYPE) == ARRAY_TYPE \ || TREE_CODE (TYPE) == UNION_TYPE \ || TREE_CODE (TYPE) == RECORD_TYPE)) ? BITS_PER_WORD : (ALIGN))/* Define this macro if an argument declared as `char' or `short' in a prototype should actually be passed as an `int'. In addition to avoiding errors in certain cases of mismatch, it also makes for better code on certain machines. */#define PROMOTE_PROTOTYPES/* Define if operations between registers always perform the operation on the full register even if a narrower mode is specified. */#define WORD_REGISTER_OPERATIONS/* Define if loading in MODE, an integral mode narrower than BITS_PER_WORD will either zero-extend or sign-extend. The value of this macro should be the code that says which one of the two operations is implicitly done, NIL if none. */#define LOAD_EXTEND_OP(MODE) ZERO_EXTEND/* Standard register usage. *//* Number of actual hardware registers. The hardware registers are assigned numbers for the compiler from 0 to just below FIRST_PSEUDO_REGISTER. All registers that the compiler knows about must be given numbers, even those that are not normally considered general registers. On the Mips, we have 32 integer registers, 32 floating point registers and the special registers hi, lo, hilo, and fp status. The hilo register is only used in 64 bit mode. It represents a 64 bit value stored as two 32 bit values in the hi and lo registers; this is the result of the mult instruction. */#define FIRST_PSEUDO_REGISTER 68/* 1 for registers that have pervasive standard uses and are not available for the register allocator. On the MIPS, see conventions, page D-2 */#define FIXED_REGISTERS \{ \ 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ 0, 0, 0, 1 \}/* 1 for registers not available across function calls. These must include the FIXED_REGISTERS and also any registers that can be used without being saved. The latter must include the registers where values are returned and the register where structure-value addresses are passed. Aside from that, you can include as many other registers as you like. */#define CALL_USED_REGISTERS \{ \ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, \ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ 1, 1, 1, 1 \}/* Internal macros to classify a register number as to whether it's a general purpose register, a floating point register, a multiply/divide register, or a status register. */#define GP_REG_FIRST 0#define GP_REG_LAST 31#define GP_REG_NUM (GP_REG_LAST - GP_REG_FIRST + 1)#define GP_DBX_FIRST 0#define FP_REG_FIRST 32#define FP_REG_LAST 63#define FP_REG_NUM (FP_REG_LAST - FP_REG_FIRST + 1)#define FP_DBX_FIRST ((write_symbols == DBX_DEBUG) ? 38 : 32)#define MD_REG_FIRST 64#define MD_REG_LAST 66#define MD_REG_NUM (MD_REG_LAST - MD_REG_FIRST + 1)#define ST_REG_FIRST 67#define ST_REG_LAST 67#define ST_REG_NUM (ST_REG_LAST - ST_REG_FIRST + 1)#define AT_REGNUM (GP_REG_FIRST + 1)#define HI_REGNUM (MD_REG_FIRST + 0)#define LO_REGNUM (MD_REG_FIRST + 1)#define HILO_REGNUM (MD_REG_FIRST + 2)#define FPSW_REGNUM ST_REG_FIRST#define GP_REG_P(REGNO) ((unsigned) ((REGNO) - GP_REG_FIRST) < GP_REG_NUM)#define FP_REG_P(REGNO) ((unsigned) ((REGNO) - FP_REG_FIRST) < FP_REG_NUM)#define MD_REG_P(REGNO) ((unsigned) ((REGNO) - MD_REG_FIRST) < MD_REG_NUM)#define ST_REG_P(REGNO) ((REGNO) == ST_REG_FIRST)/* Return number of consecutive hard regs needed starting at reg REGNO to hold something of mode MODE. This is ordinarily the length in words of a value of mode MODE but can be less for certain modes in special long registers. On the MIPS, all general registers are one word long. Except on the R4000 with the FR bit set, the floating point uses register pairs, with the second register not being allocatable. */#define HARD_REGNO_NREGS(REGNO, MODE) \ (! FP_REG_P (REGNO) \ ? ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) \ : ((GET_MODE_SIZE (MODE) + UNITS_PER_FPREG - 1) / UNITS_PER_FPREG))/* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. In 32 bit mode, require that DImode and DFmode be in even registers. For DImode, this makes some of the insns easier to write, since you don't have to worry about a DImode value in registers 3 & 4, producing a result in 4 & 5. To make the code simpler HARD_REGNO_MODE_OK now just references an array built in override_options. Because machmodes.h is not yet included before this file is processed, the MODE bound can't be expressed here. */extern char mips_hard_regno_mode_ok[][FIRST_PSEUDO_REGISTER];#define HARD_REGNO_MODE_OK(REGNO, MODE) \ mips_hard_regno_mode_ok[ (int)(MODE) ][ (REGNO) ]/* Value is 1 if it is a good idea to tie two pseudo registers when one has mode MODE1 and one has mode MODE2. If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2, for any hard reg, then this must be 0 for correct output. */#define MODES_TIEABLE_P(MODE1, MODE2) \ ((GET_MODE_CLASS (MODE1) == MODE_FLOAT || \ GET_MODE_CLASS (MODE1) == MODE_COMPLEX_FLOAT) \ == (GET_MODE_CLASS (MODE2) == MODE_FLOAT || \ GET_MODE_CLASS (MODE2) == MODE_COMPLEX_FLOAT))/* MIPS pc is not overloaded on a register. *//* #define PC_REGNUM xx *//* Register to use for pushing function arguments. */#define STACK_POINTER_REGNUM (GP_REG_FIRST + 29)/* Offset from the stack pointer to the first available location. */#define STACK_POINTER_OFFSET 0/* Base register for access to local variables of the function. */#define FRAME_POINTER_REGNUM (GP_REG_FIRST + 30)/* Value should be nonzero if functions must have frame pointers. Zero means the frame pointer need not be set up (and parms may be accessed via the stack pointer) in functions that seem suitable. This is computed in `reload', in reload1.c. */#define FRAME_POINTER_REQUIRED (current_function_calls_alloca)/* Base register for access to arguments of the function. */#define ARG_POINTER_REGNUM GP_REG_FIRST/* Register in which static-chain is passed to a function. */#define STATIC_CHAIN_REGNUM (GP_REG_FIRST + 2)/* If the structure value address is passed in a register, then `STRUCT_VALUE_REGNUM' should be the number of that register. *//* #define STRUCT_VALUE_REGNUM (GP_REG_FIRST + 4) *//* If the structure value address is not passed in a register, define `STRUCT_VALUE' as an expression returning an RTX for the place where the address is passed. If it returns 0, the address is passed as an "invisible" first argument. */#define STRUCT_VALUE 0/* Mips registers used in prologue/epilogue code when the stack frame is larger than 32K bytes. These registers must come from the scratch register set, and not used for passing and returning arguments and any other information used in the calling sequence (such as pic). Must start at 12, since t0/t3 are parameter passing registers in the 64 bit ABI. */#define MIPS_TEMP1_REGNUM (GP_REG_FIRST + 12)#define MIPS_TEMP2_REGNUM (GP_REG_FIRST + 13)/* 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 1/* 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 1/* The register number of the register used to address a table of static data addresses in memory. In some cases this register is defined by a processor's "application binary interface" (ABI). When this macro is defined, RTL is generated for this register once, as with the stack pointer and frame pointer registers. If this macro is not defined, it is up to the machine-dependent files to allocate such a register (if necessary). */#define PIC_OFFSET_TABLE_REGNUM (GP_REG_FIRST + 28)#define PIC_FUNCTION_ADDR_REGNUM (GP_REG_FIRST + 25)/* Initialize embedded_pic_fnaddr_rtx before RTL generation for each function. We used to do this in FINALIZE_PIC, but FINALIZE_PIC isn't always called for static inline functions. */#define INIT_EXPANDERS embedded_pic_fnaddr_rtx = NULL;/* Define the classes of registers for register constraints in the machine description. Also define ranges of constants. One of the classes must always be named ALL_REGS and include all hard regs. If there is more than one class, another class must be named NO_REGS and contain no registers. The name GENERAL_REGS must be the name of a class (or an alias for another name such as ALL_REGS). This is the class of registers that is allowed by "g" or "r" in a register constraint. Also, registers outside this class are allocated only when instructions express preferences for them. The classes must be numbered in nondecreasing order; that is, a larger-numbered class must never be contained completely in a smaller-numbered class. For any two classes, it is very desirable that there be another class that represents their union. */enum reg_class{ NO_REGS, /* no registers in set */ GR_REGS, /* integer registers */ FP_REGS, /* floating point registers */ HI_REG, /* hi register */ LO_REG, /* lo register */ HILO_REG, /* hilo register pair for 64 bit mode mult */ MD_REGS, /* multiply/divide registers (hi/lo) */ ST_REGS, /* status registers (fp status) */ ALL_REGS, /* all registers */ LIM_REG_CLASSES /* max value + 1 */};#define N_REG_CLASSES (int) LIM_REG_CLASSES#define GENERAL_REGS GR_REGS/* An initializer containing the names of the register classes as C string constants. These names are used in writing some of the debugging dumps. */#define REG_CLASS_NAMES \{ \ "NO_REGS", \ "GR_REGS", \ "FP_REGS", \ "HI_REG", \ "LO_REG", \ "HILO_REG", \ "MD_REGS", \ "ST_REGS", \ "ALL_REGS" \}/* An initializer containing the contents of the register classes, as integers which are bit masks. The Nth integer specifies the contents of class N. The way the integer MASK is interpreted is that register R is in the class if `MASK & (1 << R)' is 1. When the machine has more than 32 registers, an integer does not suffice. Then the integers are replaced by sub-initializers,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -