📄 1750a.h
字号:
(REGNO) >= 12 ? INDEX_REGS : (REGNO) > 0 ? BASE_REGS : ALL_REGS)/* The class value for index registers, and the one for base regs. */#define BASE_REG_CLASS BASE_REGS#define INDEX_REG_CLASS INDEX_REGS/* Get reg_class from a letter such as appears in the machine description. For the 1750, we have 'z' for R0_1, 't' for R2, 'b' for gcc Base regs and 'x' for gcc Index regs. */#define REG_CLASS_FROM_LETTER(C) ((C) == 't' ? R2 : \ (C) == 'z' ? R0_1 : \ (C) == 'b' ? BASE_REGS : \ (C) == 'x' ? INDEX_REGS : NO_REGS)/* The letters I,J,K,.. to P in a register constraint string can be used to stand for particular ranges of immediate operands. This macro defines what the ranges are. C is the letter, and VALUE is a constant value. Return 1 if VALUE is in the range specified by C. For the 1750A, `I' is used for ISP mode instructions, `J' is used for ISN mode instructions, `K' is used for the STC instruction's constant range, `L' is used for unsigned 8-bit address displacements in instructions of addressing mode "Base Relative", `M' is for IM mode instructions et al., `O' is a synonym for (const_int 0). */#define CONST_OK_FOR_LETTER_P(VALUE, C) \ ((C) == 'I' ? (VALUE) > 0 && (VALUE) <= 16 : \ (C) == 'J' ? (VALUE) < 0 && (VALUE) >= -16 : \ (C) == 'K' ? (VALUE) >= 0 && (VALUE) <= 15 : \ (C) == 'L' ? (VALUE) >= 0 && (VALUE) <= 0xFF : \ (C) == 'M' ? (VALUE) >= -0x8000 && (VALUE) <= 0x7FFF : \ (C) == 'O' ? (VALUE) == 0 : 0)/* Similar, but for floating constants, and defining letter 'G'. Here VALUE is the CONST_DOUBLE rtx itself. */#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \ ((C) == 'G' ? ((VALUE) == CONST0_RTX (HFmode) \ || (VALUE) == CONST0_RTX (TQFmode)) : 0)/* Optional extra constraints for this machine. For the 1750, `Q' means that this is a memory operand consisting of the sum of an Index Register (in the GCC sense, i.e. R12..R15) and a constant in the range 0..255. This constraint is used for the Base Register with Offset address mode instructions (LB,STB,AB,..) */#define EXTRA_CONSTRAINT(OP, C) \ ((C) == 'Q' && b_mode_operand (OP))/* 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. */#define PREFERRED_RELOAD_CLASS(X,CLASS) CLASS/* Return the maximum number of consecutive registers needed to represent mode MODE in a register of class CLASS. On the 1750A, this is the size of MODE in words, since class doesn't make any difference. */#define CLASS_MAX_NREGS(CLASS,MODE) GET_MODE_SIZE(MODE)/*****************************************************************************//* 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 1/* Define this if the nominal address of the stack frame is at the high-address end of the local variables; 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 1/* This is the default anyway: #define DYNAMIC_CHAIN_ADDRESS(FRAMEADDR) FRAMEADDR*//* If we generate an insn to push BYTES bytes, this says how many the stack pointer really advances by. 1750 note: what GCC calls a "byte" is really a 16-bit word, because BITS_PER_UNIT is 16. */#define PUSH_ROUNDING(BYTES) (BYTES)/* Define this macro if functions should assume that stack space has been allocated for arguments even when their values are passed in registers. Size, in bytes, of the area reserved for arguments passed in registers for the function represented by FNDECL. #define REG_PARM_STACK_SPACE(FNDECL) 14 *//* Define this if it is the responsibility of the caller to allocate the area reserved for arguments passed in registers. #define OUTGOING_REG_PARM_STACK_SPACE *//* Offset of first parameter from the argument pointer register value. 1750 note: Parameters appear in reversed order on the frame (so when they are popped, they come off in the normal left-to-right order.) Computed as follows: one word for the caller's (PC+1) (i.e. the return address) plus total size of called function's "auto" variables plus one word for the caller's frame pointer (i.e. the old FP) */#define FIRST_PARM_OFFSET(FNDECL) \ (1 + get_frame_size() + 1)/* Value is 1 if returning from a function call automatically pops the arguments described by the number-of-args field in the 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.*/#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. */#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. *//* 1750 note: no libcalls yet */#define LIBCALL_VALUE(MODE) printf("LIBCALL_VALUE called!\n"), \ gen_rtx(REG,MODE,0)/* 1 if N is a possible register number for a function value. */#define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)/* 1 if the tree TYPE should be returned in memory instead of in regs. #define RETURN_IN_MEMORY(TYPE) \ (int_size_in_bytes(TYPE) > 12)*//* 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 function argument passing. */#define FUNCTION_ARG_REGNO_P(N) ((N) < 12)/*****************************************************************************//* 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. For 1750A, this is a single integer, which is a number of words 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. For 1750A, 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.) 1750 note: "int_size_in_bytes()" returns a unit relative to BITS_PER_UNIT, so in our case not bytes, but 16-bit words. */#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ ((CUM) += (MODE) == BLKmode ? int_size_in_bytes(TYPE) : GET_MODE_SIZE(MODE))/* 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). */#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) function_arg (CUM,MODE,TYPE,NAMED)/* Define the following macro if function calls on the target machine do not preserve any registers; in other words, if `CALL_USED_REGISTERS' has 1 for all registers. This macro enables `-fcaller-saves' by default. Eventually that option will be enabled by default on all machines and both the option and this macro will be eliminated. */#define DEFAULT_CALLER_SAVES/* This macro generates the assembly code for function entry. FILE is a stdio stream to output the code to. SIZE is an int: how many units of temporary storage to allocate. Refer to the array `regs_ever_live' to determine which registers to save; `regs_ever_live[I]' is nonzero if register number I is ever used in the function. This macro is responsible for knowing which registers should not be saved even if used. */#define FUNCTION_PROLOGUE(FILE, SIZE) { \ if (flag_verbose_asm) \ { \ int regno, regs_used = 0; \ fprintf (FILE, "\t; registers used: "); \ for (regno = 0; regno < 14; regno++) \ if (regs_ever_live[regno]) \ { \ fprintf (FILE, " %s", reg_names[regno]); \ regs_used++; \ } \ if (regs_used == 0) \ fprintf (FILE, "(none)"); \ } \ if (SIZE > 0) \ { \ fprintf (FILE, "\n\t%s\tr15,%d", \ (SIZE <= 16 ? "sisp" : "sim"), SIZE); \ if (flag_verbose_asm) \ fprintf (FILE, " ; reserve local-variable space"); \ } \ if (frame_pointer_needed) \ { \ fprintf(FILE, "\n\tpshm\tr14,r14"); \ if (flag_verbose_asm) \ fprintf (FILE, " ; push old frame"); \ fprintf (FILE, "\n\tlr\tr14,r15"); \ if (flag_verbose_asm) \ fprintf (FILE, " ; set new frame"); \ } \ fprintf (FILE, "\n"); \ program_counter = 0; \ jmplbl_ndx = -1; \}/************* 1750: PROFILER HANDLING NOT YET DONE !!!!!!! *************//* Output assembler code to FILE to increment profiler label # LABELNO for profiling a function entry. */#define FUNCTION_PROFILER(FILE, LABELNO) \ fprintf (FILE, "; got into FUNCTION_PROFILER with label # %d\n", (LABELNO))/* Output assembler code to FILE to initialize this source file's basic block profiling info, if that has not already been done. */#define FUNCTION_BLOCK_PROFILER(FILE, LABELNO) \ fprintf (FILE, "; got into FUNCTION_BLOCK_PROFILER with label # %d\n",LABELNO)/* Output assembler code to FILE to increment the entry-count for the BLOCKNO'th basic block in this source file. */#define BLOCK_PROFILER(FILE, BLOCKNO) \ fprintf (FILE, "; got into BLOCK_PROFILER with block # %d\n",BLOCKNO)/* 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 0/* This macro generates the assembly code for function exit, on machines that need it. If FUNCTION_EPILOGUE is not defined then individual return instructions are generated for each return statement. Args are same as for FUNCTION_PROLOGUE. The function epilogue should not depend on the current stack pointer! It should use the frame pointer only. This is mandatory because of alloca; we also take advantage of it to omit stack adjustments before returning. */#define FUNCTION_EPILOGUE(FILE, SIZE) { \ if (frame_pointer_needed) \ { \ fprintf (FILE, "\tlr\tr15,r14"); \ if (flag_verbose_asm) \ fprintf (FILE, " ; set stack ptr to frame ptr"); \ fprintf (FILE, "\n\tpopm\tr14,r14"); \ if (flag_verbose_asm) \ fprintf (FILE, " ; restore previous frame ptr"); \ fprintf (FILE, "\n"); \ } \ if (SIZE > 0) \ { \ fprintf (FILE, "\t%s\tr15,%d", \ (SIZE <= 16 ? "aisp" : "aim"), SIZE); \ if (flag_verbose_asm) \ fprintf (FILE, " ; free up local-var space"); \ fprintf (FILE, "\n"); \ } \ fprintf (FILE, "\turs\tr15\n\n"); \}/* If the memory address ADDR is relative to the frame pointer, correct it to be relative to the stack pointer instead. This is for when we don't use a frame pointer. ADDR should be a variable name. #define FIX_FRAME_POINTER_ADDRESS(ADDR,DEPTH) *//* 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.#define INITIAL_FRAME_POINTER_OFFSET(DEPTH) DEPTH = 0*/#define ELIMINABLE_REGS { \ { ARG_POINTER_REGNUM, STACK_POINTER_REGNUM }, \ { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM }, \ { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -