📄 vax.h
字号:
#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) \ ((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_POST_DECREMENT 0 */#define HAVE_PRE_DECREMENT 1/* #define HAVE_PRE_INCREMENT 0 *//* 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 \ && REG_OK_FOR_BASE_P (XEXP (X, 1)) \ && (xfooa = XEXP (X, 0), \ INDEX_TERM_P (xfooa, MODE))) \ goto ADDR; } }#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \{ register rtx xfoo, xfoo0, xfoo1; \ GO_IF_NONINDEXED_ADDRESS (X, ADDR); \ if (GET_CODE (X) == PLUS) \ { /* Handle <address>[index] represented with index-sum outermost */\ xfoo = XEXP (X, 0); \ if (INDEX_TERM_P (xfoo, MODE)) \ { GO_IF_NONINDEXED_ADDRESS (XEXP (X, 1), ADDR); } \ xfoo = XEXP (X, 1); \ if (INDEX_TERM_P (xfoo, MODE)) \ { GO_IF_NONINDEXED_ADDRESS (XEXP (X, 0), ADDR); } \ /* Handle offset(reg)[index] with offset added outermost */ \ if (INDIRECTABLE_CONSTANT_ADDRESS_P (XEXP (X, 0))) \ { if (GET_CODE (XEXP (X, 1)) == REG \ && REG_OK_FOR_BASE_P (XEXP (X, 1))) \ goto ADDR; \ GO_IF_REG_PLUS_INDEX (XEXP (X, 1), MODE, ADDR); } \ if (INDIRECTABLE_CONSTANT_ADDRESS_P (XEXP (X, 1))) \ { if (GET_CODE (XEXP (X, 0)) == REG \ && REG_OK_FOR_BASE_P (XEXP (X, 0))) \ goto ADDR; \ GO_IF_REG_PLUS_INDEX (XEXP (X, 0), MODE, 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. For the VAX, nothing needs to be done. */#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. On the VAX, the predecrement and postincrement address depend thus (the amount of decrement or increment being the length of the operand) and all indexed address depend thus (because the index scale factor is the length of the operand). */#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \ { if (GET_CODE (ADDR) == POST_INC || GET_CODE (ADDR) == PRE_DEC) \ goto LABEL; \ if (GET_CODE (ADDR) == PLUS) \ { if (CONSTANT_ADDRESS_P (XEXP (ADDR, 0)) \ && GET_CODE (XEXP (ADDR, 1)) == REG); \ else if (CONSTANT_ADDRESS_P (XEXP (ADDR, 1)) \ && GET_CODE (XEXP (ADDR, 0)) == REG); \ else goto LABEL; }}/* Specify the machine mode that this machine uses for the index in the tablejump instruction. */#define CASE_VECTOR_MODE HImode/* Define as C expression which evaluates to nonzero if the tablejump instruction expects the table to contain offsets from the address of the table. Do not define this if the table should contain absolute addresses. */#define CASE_VECTOR_PC_RELATIVE 1/* Indicate that jump tables go in the text section. This is necessary when compiling PIC code. */#define JUMP_TABLES_IN_TEXT_SECTION 1/* Define this as 1 if `char' should by default be signed; else as 0. */#define DEFAULT_SIGNED_CHAR 1/* This flag, if defined, says the same insns that convert to a signed fixnum also convert validly to an unsigned one. */#define FIXUNS_TRUNC_LIKE_FIX_TRUNC/* Max number of bytes we can move from memory to memory in one reasonably fast instruction. */#define MOVE_MAX 8/* Nonzero if access to memory by bytes is slow and undesirable. */#define SLOW_BYTE_ACCESS 0/* Define if shifts truncate the shift count which implies one can omit a sign-extension or zero-extension
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -