📄 i860.h
字号:
to negate the constant sometimes. `J' is used for the range which is just zero (since that is R0). `K' is used for the range allowed in bte. `L' is used for the range allowed in logical insns. */#define SMALL_INT(X) ((unsigned) (INTVAL (X) + 0x7fff) < 0xffff)#define LOGIC_INT(X) ((unsigned) INTVAL (X) < 0x10000)#define SMALL_INTVAL(X) ((unsigned) ((X) + 0x7fff) < 0xffff)#define LOGIC_INTVAL(X) ((unsigned) (X) < 0x10000)#define CONST_OK_FOR_LETTER_P(VALUE, C) \ ((C) == 'I' ? ((unsigned) (VALUE) + 0x7fff) < 0xffff \ : (C) == 'J' ? (VALUE) == 0 \ : (C) == 'K' ? (unsigned) (VALUE) < 0x20 \ : (C) == 'L' ? (unsigned) (VALUE) < 0x10000 \ : 0)/* Return nonzero if the given VALUE is acceptable for the constraint letter C. For the i860, constraint letter 'G' permits only a floating-point zero value. */#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \ ((C) == 'G' && CONST_DOUBLE_LOW ((VALUE)) == 0 \ && CONST_DOUBLE_HIGH ((VALUE)) == 0)/* 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. If we are trying to put an integer constant into some register, prefer an integer register to an FP register. If we are trying to put a nonzero floating-point constant into some register, use an integer register if the constant is SFmode and GENERAL_REGS is one of our options. Otherwise, put the constant into memory. When reloading something smaller than a word, use a general reg rather than an FP reg. */#define PREFERRED_RELOAD_CLASS(X,CLASS) \ ((CLASS) == ALL_REGS && GET_CODE (X) == CONST_INT ? GENERAL_REGS \ : ((GET_MODE (X) == HImode || GET_MODE (X) == QImode) \ && (CLASS) == ALL_REGS) \ ? GENERAL_REGS \ : (GET_CODE (X) == CONST_DOUBLE \ && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \ && ! CONST_DOUBLE_OK_FOR_LETTER_P (X, 'G')) \ ? ((CLASS) == ALL_REGS && GET_MODE (X) == SFmode ? GENERAL_REGS \ : (CLASS) == GENERAL_REGS && GET_MODE (X) == SFmode ? (CLASS) \ : NO_REGS) \ : (CLASS))/* Return the register class of a scratch register needed to copy IN into a register in CLASS in MODE. If it can be done directly, NO_REGS is returned. */#define SECONDARY_INPUT_RELOAD_CLASS(CLASS,MODE,IN) \ ((CLASS) == FP_REGS && CONSTANT_P (IN) ? GENERAL_REGS : NO_REGS)/* Return the maximum number of consecutive registers needed to represent mode MODE in a register of class CLASS. *//* On the i860, this is the size of MODE in words. */#define CLASS_MAX_NREGS(CLASS, MODE) \ ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)/* Stack layout; function entry, exit and calling. *//* Define this if pushing a word on the stack makes the stack pointer 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 in the frame. */#define FRAME_GROWS_DOWNWARD/* Offset within stack frame 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. */#define STARTING_FRAME_OFFSET 0/* If we generate an insn to push BYTES bytes, this says how many the stack pointer really advances by. On the i860, don't define this because there are no push insns. *//* #define PUSH_ROUNDING(BYTES) *//* Offset of first parameter from the argument pointer register value. */#define FIRST_PARM_OFFSET(FNDECL) 0/* 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(FUNDECL,FUNTYPE,SIZE) 0/* 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 i860, the value register depends on the mode. */#define FUNCTION_VALUE(VALTYPE, FUNC) \ gen_rtx_REG (TYPE_MODE (VALTYPE), \ (GET_MODE_CLASS (TYPE_MODE (VALTYPE)) == MODE_FLOAT \ ? 40 : 16))/* Define how to find the value returned by a library function assuming the value has mode MODE. */#define LIBCALL_VALUE(MODE) \ gen_rtx_REG (MODE, \ (GET_MODE_CLASS ((MODE)) == MODE_FLOAT \ ? 40 : 16))/* 1 if N is a possible register number for a function value as seen by the caller. */#define FUNCTION_VALUE_REGNO_P(N) ((N) == 40 || (N) == 16)/* 1 if N is a possible register number for function argument passing. On the i860, these are r16-r27 and f8-f15. */#define FUNCTION_ARG_REGNO_P(N) \ (((N) < 28 && (N) > 15) || ((N) < 48 && (N) >= 40))/* 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 i860, we must count separately the number of general registers used and the number of float registers used. */struct cumulative_args { int ints, floats; };#define CUMULATIVE_ARGS struct cumulative_args/* 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 i860, the general-reg offset normally starts at 0, but starts at 4 bytes when the function gets a structure-value-address as an invisible first argument. */#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \ ((CUM).ints = ((FNTYPE) != 0 && aggregate_value_p (TREE_TYPE ((FNTYPE)), 0) \ ? 4 : 0), \ (CUM).floats = 0)/* Machine-specific subroutines of the following macros. */#define CEILING(X,Y) (((X) + (Y) - 1) / (Y))#define ROUNDUP(X,Y) (CEILING ((X), (Y)) * (Y))/* 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.) Floats, and doubleword ints, are returned in f regs; other ints, in r regs. Aggregates, even short ones, are passed in memory. */#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ ((TYPE) != 0 && (TREE_CODE ((TYPE)) == RECORD_TYPE \ || TREE_CODE ((TYPE)) == UNION_TYPE) \ ? 0 \ : GET_MODE_CLASS ((MODE)) == MODE_FLOAT || (MODE) == DImode \ ? ((CUM).floats = (ROUNDUP ((CUM).floats, GET_MODE_SIZE ((MODE))) \ + ROUNDUP (GET_MODE_SIZE (MODE), 4))) \ : GET_MODE_CLASS ((MODE)) == MODE_INT \ ? ((CUM).ints = (ROUNDUP ((CUM).ints, GET_MODE_SIZE ((MODE))) \ + ROUNDUP (GET_MODE_SIZE (MODE), 4))) \ : 0)/* Determine where to put an argument 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 i860, the first 12 words of integer arguments go in r16-r27, and the first 8 words of floating arguments go in f8-f15. DImode values are treated as floats. */#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ ((TYPE) != 0 && (TREE_CODE ((TYPE)) == RECORD_TYPE \ || TREE_CODE ((TYPE)) == UNION_TYPE) \ ? 0 \ : GET_MODE_CLASS ((MODE)) == MODE_FLOAT || (MODE) == DImode \ ? (ROUNDUP ((CUM).floats, GET_MODE_SIZE ((MODE))) < 32 \ ? gen_rtx_REG ((MODE), \ 40 + (ROUNDUP ((CUM).floats, \ GET_MODE_SIZE ((MODE))) \ / 4)) \ : 0) \ : GET_MODE_CLASS ((MODE)) == MODE_INT \ ? (ROUNDUP ((CUM).ints, GET_MODE_SIZE ((MODE))) < 48 \ ? gen_rtx_REG ((MODE), \ 16 + (ROUNDUP ((CUM).ints, \ GET_MODE_SIZE ((MODE))) \ / 4)) \ : 0) \ : 0)/* If defined, a C expression that gives the alignment boundary, in bits, of an argument with the specified mode and type. If it is not defined, `PARM_BOUNDARY' is used for all arguments. */#define FUNCTION_ARG_BOUNDARY(MODE, TYPE) \ (((TYPE) != 0) \ ? ((TYPE_ALIGN(TYPE) <= PARM_BOUNDARY) \ ? PARM_BOUNDARY \ : TYPE_ALIGN(TYPE)) \ : ((GET_MODE_ALIGNMENT(MODE) <= PARM_BOUNDARY) \ ? PARM_BOUNDARY \ : GET_MODE_ALIGNMENT(MODE)))/* Output a no-op just before the beginning of the function, to ensure that there does not appear to be a delayed branch there. Such a thing would confuse interrupt recovery. */#define ASM_OUTPUT_FUNCTION_PREFIX(FILE,NAME) \ fprintf (FILE, "\tnop\n")/* Output assembler code to FILE to increment profiler label # LABELNO for profiling a function entry. */#define FUNCTION_PROFILER(FILE, LABELNO) \ abort ();/* 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/* Implement `va_start' for varargs and stdarg. */#define EXPAND_BUILTIN_VA_START(valist, nextarg) \ i860_va_start (valist, nextarg)/* 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 i860, 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) \ do { (DEPTH) = 0; } while (0)/* Output assembler code for a block containing the constant parts of a trampoline, leaving space for the variable parts. *//* On the i860, the trampoline contains five instructions: orh #TOP_OF_FUNCTION,r0,r31 or #BOTTOM_OF_FUNCTION,r31,r31 orh #TOP_OF_STATIC,r0,r29 bri r31 or #BOTTOM_OF_STATIC,r29,r29 */#define TRAMPOLINE_TEMPLATE(FILE) \{ \ assemble_aligned_integer (UNITS_PER_WORD, GEN_INT (0xec1f0000)); \ assemble_aligned_integer (UNITS_PER_WORD, GEN_INT (0xe7ff0000)); \ assemble_aligned_integer (UNITS_PER_WORD, GEN_INT (0xec1d0000)); \ assemble_aligned_integer (UNITS_PER_WORD, GEN_INT (0x4000f800)); \ assemble_aligned_integer (UNITS_PER_WORD, GEN_INT (0xe7bd0000)); \}/* Length in units of the trampoline for entering a nested function. */#define TRAMPOLINE_SIZE 20/* 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. Store hi function at +0, low function at +4, hi static at +8, low static at +16 */#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \{ \ rtx cxt = force_reg (Pmode, CXT); \ rtx fn = force_reg (Pmode, FNADDR); \ rtx hi_cxt = expand_shift (RSHIFT_EXPR, SImode, cxt, \ size_int (16), 0, 0); \ rtx hi_fn = expand_shift (RSHIFT_EXPR, SImode, fn, \ size_int (16), 0, 0); \ emit_move_insn (gen_rtx_MEM (HImode, plus_constant (TRAMP, 16)), \ gen_lowpart (HImode, cxt)); \ emit_move_insn (gen_rtx_MEM (HImode, plus_constant (TRAMP, 4)), \ gen_lowpart (HImode, fn)); \ emit_move_insn (gen_rtx_MEM (HImode, plus_constant (TRAMP, 8)), \ gen_lowpart (HImode, hi_cxt)); \ emit_move_insn (gen_rtx_MEM (HImode, plus_constant (TRAMP, 0)), \ gen_lowpart (HImode, hi_fn)); \}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -