📄 vax.h
字号:
of the first local allocated. */#define STARTING_FRAME_OFFSET 0/* Given an rtx for the address of a frame, return an rtx for the address of the word in the frame that holds the dynamic chain--the previous frame's address. */#define DYNAMIC_CHAIN_ADDRESS(FRAME) plus_constant ((FRAME), 12)/* If we generate an insn to push BYTES bytes, this says how many the stack pointer really advances by. On the VAX, -(sp) pushes only the bytes of the operands. */#define PUSH_ROUNDING(BYTES) (BYTES)/* Offset of first parameter from the argument pointer register value. */#define FIRST_PARM_OFFSET(FNDECL) 4/* 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. On the VAX, the RET insn pops a maximum of 255 args for any function. */#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \ ((SIZE) > 255*4 ? 0 : (SIZE))/* 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. *//* On the VAX the return value is in R0 regardless. */ #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. *//* On the VAX the return value is in R0 regardless. */ #define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, 0)/* Define this if PCC uses the nonreentrant convention for returning structure and union values. */#define PCC_STATIC_STRUCT_RETURN/* 1 if N is a possible register number for a function value. On the VAX, R0 is the only register thus used. */#define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)/* 1 if N is a possible register number for function argument passing. On the VAX, no registers are used in this way. */#define FUNCTION_ARG_REGNO_P(N) 0/* 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. On the VAX, this is a single integer, which is a number of bytes of arguments scanned so far. */#define CUMULATIVE_ARGS int/* Initialize a variable CUM of type CUMULATIVE_ARGS for a call to a function whose data type is FNTYPE. For a library call, FNTYPE is 0. On the VAX, the offset starts at 0. */#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \ ((CUM) = 0)/* Update the data in CUM to advance over an argument of mode MODE and data type TYPE. (TYPE is null for libcalls where that information may not be available.) */#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ ((CUM) += ((MODE) != BLKmode \ ? (GET_MODE_SIZE (MODE) + 3) & ~3 \ : (int_size_in_bytes (TYPE) + 3) & ~3))/* Define where to put the arguments to a function. Value is zero to push the argument on the stack, or a hard register in which to store the argument. MODE is the argument's machine mode. TYPE is the data type of the argument (as a tree). This is null for libcalls where that information may not be available. CUM is a variable of type CUMULATIVE_ARGS which gives info about the preceding args and about the function being called. NAMED is nonzero if this argument is a named parameter (otherwise it is an extra parameter matching an ellipsis). *//* On the VAX all args are pushed. */ #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) 0/* Output assembler code to FILE to increment profiler label # LABELNO for profiling a function entry. */#define VAX_FUNCTION_PROFILER_NAME "mcount"#define FUNCTION_PROFILER(FILE, LABELNO) \ do \ { \ char label[256]; \ ASM_GENERATE_INTERNAL_LABEL (label, "LP", (LABELNO)); \ fprintf (FILE, "\tmovab "); \ assemble_name (FILE, label); \ asm_fprintf (FILE, ",%Rr0\n\tjsb %s\n", \ VAX_FUNCTION_PROFILER_NAME); \ } \ while (0)/* 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/* 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 VAX, FRAME_POINTER_REQUIRED is always 1, so the definition of this macro doesn't matter. But it must be defined. */#define INITIAL_FRAME_POINTER_OFFSET(DEPTH) (DEPTH) = 0;/* Output assembler code for a block containing the constant parts of a trampoline, leaving space for the variable parts. *//* On the VAX, the trampoline contains an entry mask and two instructions: .word NN movl $STATIC,r0 (store the functions static chain) jmp *$FUNCTION (jump to function code at address FUNCTION) */#define TRAMPOLINE_TEMPLATE(FILE) \{ \ assemble_aligned_integer (2, const0_rtx); \ assemble_aligned_integer (2, GEN_INT (0x8fd0)); \ assemble_aligned_integer (4, const0_rtx); \ assemble_aligned_integer (1, GEN_INT (0x50 + STATIC_CHAIN_REGNUM)); \ assemble_aligned_integer (2, GEN_INT (0x9f17)); \ assemble_aligned_integer (4, const0_rtx); \}/* Length in units of the trampoline for entering a nested function. */#define TRAMPOLINE_SIZE 15/* 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 copy the register-mask from the function's pure code to the start of the trampoline. */#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \{ \ emit_move_insn (gen_rtx_MEM (HImode, TRAMP), \ gen_rtx_MEM (HImode, FNADDR)); \ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 4)), CXT); \ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 11)), \ plus_constant (FNADDR, 2)); \ emit_insn (gen_sync_istream ()); \}/* Byte offset of return address in a stack frame. The "saved PC" field is in element [4] when treating the frame as an array of longwords. */#define RETURN_ADDRESS_OFFSET (4 * UNITS_PER_WORD) /* 16 *//* 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 already the frame pointer of the COUNT frame, so we can ignore COUNT. */#define RETURN_ADDR_RTX(COUNT, FRAME) \ ((COUNT == 0) \ ? gen_rtx_MEM (Pmode, plus_constant (FRAME, RETURN_ADDRESS_OFFSET)) \ : (rtx) 0)/* Addressing modes, and classification of registers for them. */#define HAVE_POST_INCREMENT 1#define HAVE_PRE_DECREMENT 1/* 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) < FIRST_PSEUDO_REGISTER || reg_renumber[regno] >= 0)#define REGNO_OK_FOR_BASE_P(regno) \((regno) < FIRST_PSEUDO_REGISTER || reg_renumber[regno] >= 0)/* Maximum number of registers that can appear in a valid memory address. */#define MAX_REGS_PER_ADDRESS 2/* 1 if X is an rtx for a constant 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/* 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. */#ifndef REG_OK_STRICT/* 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) 1/* 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) 1#else/* Nonzero if X is a hard reg that can be used as an index. */#define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))/* Nonzero if X is a hard reg that can be used as a base reg. */#define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (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. The other macros defined here are used only in GO_IF_LEGITIMATE_ADDRESS, except for CONSTANT_ADDRESS_P which is actually machine-independent. */#ifdef NO_EXTERNAL_INDIRECT_ADDRESS/* Zero if this contains a (CONST (PLUS (SYMBOL_REF) (...))) and the symbol in the SYMBOL_REF is an external symbol. */#define INDIRECTABLE_CONSTANT_P(X) \ (! (GET_CODE ((X)) == CONST \ && GET_CODE (XEXP ((X), 0)) == PLUS \ && GET_CODE (XEXP (XEXP ((X), 0), 0)) == SYMBOL_REF \ && SYMBOL_REF_FLAG (XEXP (XEXP ((X), 0), 0))))/* Re-definition of CONSTANT_ADDRESS_P, which is true only when there are no SYMBOL_REFs for external symbols present. */#define INDIRECTABLE_CONSTANT_ADDRESS_P(X) \ (GET_CODE (X) == LABEL_REF \ || (GET_CODE (X) == SYMBOL_REF && !SYMBOL_REF_FLAG (X)) \ || (GET_CODE (X) == CONST && INDIRECTABLE_CONSTANT_P(X)) \ || GET_CODE (X) == CONST_INT)/* Nonzero if X is an address which can be indirected. External symbols could be in a sharable image library, so we disallow those. */#define INDIRECTABLE_ADDRESS_P(X) \ (INDIRECTABLE_CONSTANT_ADDRESS_P (X) \ || (GET_CODE (X) == REG && REG_OK_FOR_BASE_P (X)) \ || (GET_CODE (X) == PLUS \ && GET_CODE (XEXP (X, 0)) == REG \ && REG_OK_FOR_BASE_P (XEXP (X, 0)) \ && INDIRECTABLE_CONSTANT_ADDRESS_P (XEXP (X, 1))))#else /* not NO_EXTERNAL_INDIRECT_ADDRESS */#define INDIRECTABLE_CONSTANT_ADDRESS_P(X) CONSTANT_ADDRESS_P(X)/* Nonzero if X is an address which can be indirected. */#define INDIRECTABLE_ADDRESS_P(X) \ (CONSTANT_ADDRESS_P (X) \ || (GET_CODE (X) == REG && REG_OK_FOR_BASE_P (X)) \ || (GET_CODE (X) == PLUS \ && GET_CODE (XEXP (X, 0)) == REG \ && REG_OK_FOR_BASE_P (XEXP (X, 0)) \ && CONSTANT_ADDRESS_P (XEXP (X, 1))))#endif /* not NO_EXTERNAL_INDIRECT_ADDRESS *//* Go to ADDR if X is a valid address not using indexing. (This much is the easy part.) */#define GO_IF_NONINDEXED_ADDRESS(X, ADDR) \{ register rtx xfoob = (X); \ if (GET_CODE (xfoob) == REG) \ { \ extern rtx *reg_equiv_mem; \ if (! reload_in_progress \ || reg_equiv_mem[REGNO (xfoob)] == 0 \ || INDIRECTABLE_ADDRESS_P (reg_equiv_mem[REGNO (xfoob)])) \ goto ADDR; \ } \ if (CONSTANT_ADDRESS_P (xfoob)) goto ADDR; \ if (INDIRECTABLE_ADDRESS_P (xfoob)) goto ADDR; \ xfoob = XEXP (X, 0); \ if (GET_CODE (X) == MEM && INDIRECTABLE_ADDRESS_P (xfoob)) \ goto ADDR; \ if ((GET_CODE (X) == PRE_DEC || GET_CODE (X) == POST_INC) \ && GET_CODE (xfoob) == REG && REG_OK_FOR_BASE_P (xfoob)) \ goto ADDR; }/* 1 if PROD is either a reg times size of mode MODE and MODE is less than or equal 8 bytes, or just a reg if MODE is one byte. This macro's expansion uses the temporary variables xfoo0 and xfoo1 that must be declared in the surrounding context. */#define INDEX_TERM_P(PROD, MODE) \(GET_MODE_SIZE (MODE) == 1 \ ? (GET_CODE (PROD) == REG && REG_OK_FOR_BASE_P (PROD)) \ : (GET_CODE (PROD) == MULT && GET_MODE_SIZE (MODE) <= 8 \ && \ (xfoo0 = XEXP (PROD, 0), xfoo1 = XEXP (PROD, 1), \ ((((GET_CODE (xfoo0) == CONST_INT \ && GET_CODE (xfoo1) == REG) \ && INTVAL (xfoo0) == (int)GET_MODE_SIZE (MODE)) \ && REG_OK_FOR_INDEX_P (xfoo1)) \ || \ (((GET_CODE (xfoo1) == CONST_INT \ && GET_CODE (xfoo0) == REG) \ && INTVAL (xfoo1) == (int)GET_MODE_SIZE (MODE)) \ && REG_OK_FOR_INDEX_P (xfoo0))))))/* Go to ADDR if X is the sum of a register and a valid index term for mode MODE. */#define GO_IF_REG_PLUS_INDEX(X, MODE, ADDR) \{ register rtx xfooa; \ if (GET_CODE (X) == PLUS) \ { if (GET_CODE (XEXP (X, 0)) == REG \ && REG_OK_FOR_BASE_P (XEXP (X, 0)) \ && (xfooa = XEXP (X, 1), \ INDEX_TERM_P (xfooa, MODE))) \ goto ADDR; \ if (GET_CODE (XEXP (X, 1)) == REG \
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -