📄 dsp16xx.h
字号:
which require the macro to do something nontrivial. */#if 0#define LIMIT_RELOAD_CLASS(MODE, CLASS) dsp16xx_limit_reload_class (MODE, CLASS)#endif/* A C expression for the maximum number of consecutive registers of class CLASS needed to hold a value of mode MODE */#define CLASS_MAX_NREGS(CLASS, MODE) \ class_max_nregs(CLASS, MODE)/* The letters 'I' through '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 16xx, the following constraints are used: 'I' requires a non-negative 16-bit value. 'J' requires a non-negative 9-bit value 'K' requires a constant 0 operand. 'L' requires 16-bit value 'M' 32-bit value -- low 16-bits zero */#define SMALL_INT(X) (SMALL_INTVAL (INTVAL (X)))#define SMALL_INTVAL(I) ((unsigned) (I) < 0x10000)#define SHORT_IMMEDIATE(X) (SHORT_INTVAL (INTVAL(X)))#define SHORT_INTVAL(I) ((unsigned) (I) < 0x100)#define CONST_OK_FOR_LETTER_P(VALUE, C) \ ((C) == 'I' ? (SMALL_INTVAL(VALUE)) \ : (C) == 'J' ? (SHORT_INTVAL(VALUE)) \ : (C) == 'K' ? ((VALUE) == 0) \ : (C) == 'L' ? ! ((VALUE) & ~0x0000ffff) \ : (C) == 'M' ? ! ((VALUE) & ~0xffff0000) \ : (C) == 'N' ? ((VALUE) == -1 || (VALUE) == 1 || \ (VALUE) == -2 || (VALUE) == 2) \ : 0)#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) 1/* Optional extra constraints for this machine */#define EXTRA_CONSTRAINT(OP,C) \ ((C) == 'R' ? symbolic_address_p (OP) \ : 0)/* DESCRIBING STACK LAYOUT AND CALLING CONVENTIONS *//* 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 */#define ARGS_GROW_DOWNWARD/* We use post decrement on the 1600 because there isn't a pre-decrement addressing mode. This means that we assume the stack pointer always points at the next FREE location on the stack. */#define STACK_PUSH_CODE POST_INC/* 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/* Offset from the stack pointer register to the first location at which outgoing arguments are placed. */#define STACK_POINTER_OFFSET (0)struct dsp16xx_frame_info{ unsigned long total_size; /* # bytes that the entire frame takes up */ unsigned long var_size; /* # bytes that variables take up */ unsigned long args_size; /* # bytes that outgoing arguments take up */ unsigned long extra_size; /* # bytes of extra gunk */ unsigned int reg_size; /* # bytes needed to store regs */ long fp_save_offset; /* offset from vfp to store registers */ unsigned long sp_save_offset; /* offset from new sp to store registers */ int initialized; /* != 0 if frame size already calculated */ int num_regs; /* number of registers saved */ int function_makes_calls; /* Does the function make calls */};extern struct dsp16xx_frame_info current_frame_info;/* If we generate an insn to push BYTES bytes, this says how many the stack pointer really advances by. *//* #define PUSH_ROUNDING(BYTES) ((BYTES)) *//* If defined, the maximum amount of space required for outgoing arguments will be computed and placed into the variable 'current_function_outgoing_args_size'. No space will be pushed onto the stack for each call; instead, the function prologue should increase the stack frame size by this amount. It is not proper to define both 'PUSH_ROUNDING' and 'ACCUMULATE_OUTGOING_ARGS'. */#define ACCUMULATE_OUTGOING_ARGS/* Offset of first parameter from the argument pointer register value. */#define FIRST_PARM_OFFSET(FNDECL) (0)/* 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. On the 1610 all function return their values in a0 (i.e. the upper 16 bits). If the return value is 32-bits the entire register is significant. */#define VALUE_REGNO(MODE) (REG_Y)#define FUNCTION_VALUE(VALTYPE, FUNC) \ gen_rtx_REG (TYPE_MODE (VALTYPE), VALUE_REGNO(TYPE_MODE(VALTYPE)))/* 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, VALUE_REGNO(MODE))/* 1 if N is a possible register number for a function value. */#define FUNCTION_VALUE_REGNO_P(N) ((N) == REG_Y)/* 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 1610 all args are pushed, except if -mregparm is specified then the first two words of arguments are passed in a0, a1. */#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ dsp16xx_function_arg (CUM, MODE, TYPE, NAMED)/* Define the first register to be used for argument passing */#define FIRST_REG_FOR_FUNCTION_ARG REG_Y/* Define the profitability of saving registers around calls. NOTE: For now we turn this off because of a bug in the caller-saves code and also because i'm not sure it is helpful on the 1610. */#define CALLER_SAVE_PROFITABLE(REFS,CALLS) 0/* This indicates that an argument is to be passed with an invisible reference (i.e., a pointer to the object is passed). On the dsp16xx, we do this if it must be passed on the stack. */#define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) \ (MUST_PASS_IN_STACK (MODE, TYPE))/* For an arg passed partly in registers and partly in memory, this is the number of registers used. For args passed entirely in registers or entirely in memory, zero. */#define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) (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. */#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. */#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) \ dsp16xx_function_arg_advance (&CUM, MODE,TYPE, NAMED)/* 1 if N is a possible register number for function argument passing. */#define FUNCTION_ARG_REGNO_P(N) \ ((N) == REG_Y || (N) == REG_YL || (N) == REG_PROD || (N) == REG_PRODL)/* 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) function_prologue(FILE, SIZE)/* Output assembler code to FILE to increment profiler label # LABELNO for profiling a function entry. */#define FUNCTION_PROFILER(FILE, LABELNO) fatal("Profiling not implemented yet.")/* 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) fatal("Profiling not implemented yet.")/* 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) fatal("Profiling not implemented yet.")/* 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)#define TRAMPOLINE_TEMPLATE(FILE) fatal ("Trampolines not yet implemented");/* Length in units of the trampoline for entering a nested function. This is a dummy value */#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. */#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ fatal ("Trampolines not yet implemented");/* 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) function_epilogue(FILE, SIZE)/* A C expression which is nonzero if a function must have and use a frame pointer. If its value is nonzero the functions will have a frame pointer. */#define FRAME_POINTER_REQUIRED (current_function_calls_alloca)/* A C statement to store in the variable 'DEPTH' the difference between the frame pointer and the stack pointer values immediately after the function prologue. */#define INITIAL_FRAME_POINTER_OFFSET(DEPTH) \{ (DEPTH) = initial_frame_pointer_offset(); \}/* IMPLICIT CALLS TO LIBRARY ROUTINES */#define ADDHF3_LIBCALL "__Emulate_addhf3"#define SUBHF3_LIBCALL "__Emulate_subhf3"#define MULHF3_LIBCALL "__Emulate_mulhf3"#define DIVHF3_LIBCALL "__Emulate_divhf3"#define CMPHF3_LIBCALL "__Emulate_cmphf3"#define FIXHFHI2_LIBCALL "__Emulate_fixhfhi2"#define FLOATHIHF2_LIBCALL "__Emulate_floathihf2"#define NEGHF2_LIBCALL "__Emulate_neghf2"#define UMULHI3_LIBCALL "__Emulate_umulhi3"#define MULHI3_LIBCALL "__Emulate_mulhi3"#define UDIVQI3_LIBCALL "__Emulate_udivqi3"#define UDIVHI3_LIBCALL "__Emulate_udivhi3"#define DIVQI3_LIBCALL "__Emulate_divqi3"#define DIVHI3_LIBCALL "__Emulate_divhi3"#define MODQI3_LIBCALL "__Emulate_modqi3"#define MODHI3_LIBCALL "__Emulate_modhi3"#define UMODQI3_LIBCALL "__Emulate_umodqi3"#define UMODHI3_LIBCALL "__Emulate_umodhi3"#define ASHRHI3_LIBCALL "__Emulate_ashrhi3"#define LSHRHI3_LIBCALL "__Emulate_lshrhi3"#define ASHLHI3_LIBCALL "__Emulate_ashlhi3"#define LSHLHI3_LIBCALL "__Emulate_lshlhi3" /* NOT USED *//* Define this macro if calls to the ANSI C library functions memcpy and memset should be generated instead of the BSD function bcopy & bzero. */#define TARGET_MEM_FUNCTIONS/* ADDRESSING MODES *//* The 1610 has post-increment and decrement, but no pre-modify */#define HAVE_POST_INCREMENT 1#define HAVE_POST_DECREMENT 1/* #define HAVE_PRE_DECREMENT 0 *//* #define HAVE_PRE_INCREMENT 0 *//* Recognize any constant value that is a valid address. */#define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)/* Maximum number of registers that can appear in a valid memory address. */#define MAX_REGS_PER_ADDRESS 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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -