📄 alpha.h
字号:
are integers whose size is larger than 64 bits. */#define RETURN_IN_MEMORY(TYPE) \ (TYPE_MODE (TYPE) == BLKmode \ || (TREE_CODE (TYPE) == INTEGER_TYPE && TYPE_PRECISION (TYPE) > 64))/* 1 if N is a possible register number for a function value as seen by the caller. */#define FUNCTION_VALUE_REGNO_P(N) \ ((N) == 0 || (N) == 1 || (N) == 32 || (N) == 33)/* 1 if N is a possible register number for function argument passing. On Alpha, these are $16-$21 and $f16-$f21. */#define FUNCTION_ARG_REGNO_P(N) \ (((N) >= 16 && (N) <= 21) || ((N) >= 16 + 32 && (N) <= 21 + 32))/* 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 Alpha, this is a single integer, which is a number of words of arguments scanned so far. Thus 6 or more means all following args should go on the stack. */#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/* Define intermediate macro to compute the size (in registers) of an argument for the Alpha. */#define ALPHA_ARG_SIZE(MODE, TYPE, NAMED) \((MODE) != BLKmode \ ? (GET_MODE_SIZE (MODE) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD \ : (int_size_in_bytes (TYPE) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD)/* 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) \ if (MUST_PASS_IN_STACK (MODE, TYPE)) \ (CUM) = 6; \ else \ (CUM) += ALPHA_ARG_SIZE (MODE, TYPE, NAMED)/* 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 Alpha the first 6 words of args are normally in registers and the rest are pushed. */#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \((CUM) < 6 && ! MUST_PASS_IN_STACK (MODE, TYPE) \ ? gen_rtx(REG, (MODE), \ (CUM) + 16 + ((TARGET_FPREGS \ && (GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT \ || GET_MODE_CLASS (MODE) == MODE_FLOAT)) \ * 32)) \ : 0)/* Specify the padding direction of arguments. On the Alpha, we must pad upwards in order to be able to pass args in registers. */#define FUNCTION_ARG_PADDING(MODE, TYPE) upward/* 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) \((CUM) < 6 && 6 < (CUM) + ALPHA_ARG_SIZE (MODE, TYPE, NAMED) \ ? 6 - (CUM) : 0)/* Perform any needed actions needed for a function that is receiving a variable number of arguments. CUM is as above. MODE and TYPE are the mode and type of the current parameter. PRETEND_SIZE is a variable that should be set to the amount of stack that must be pushed by the prolog to pretend that our caller pushed it. Normally, this macro will push all remaining incoming registers on the stack and set PRETEND_SIZE to the length of the registers pushed. On the Alpha, we allocate space for all 12 arg registers, but only push those that are remaining. However, if NO registers need to be saved, don't allocate any space. This is not only because we won't need the space, but because AP includes the current_pretend_args_size and we don't want to mess up any ap-relative addresses already made. If we are not to use the floating-point registers, save the integer registers where we would put the floating-point registers. This is not the most efficient way to implement varargs with just one register class, but it isn't worth doing anything more efficient in this rare case. */ #define SETUP_INCOMING_VARARGS(CUM,MODE,TYPE,PRETEND_SIZE,NO_RTL) \{ if ((CUM) < 6) \ { \ if (! (NO_RTL)) \ { \ move_block_from_reg \ (16 + CUM, \ gen_rtx (MEM, BLKmode, \ plus_constant (virtual_incoming_args_rtx, \ ((CUM) + 6)* UNITS_PER_WORD)), \ 6 - (CUM), (6 - (CUM)) * UNITS_PER_WORD); \ move_block_from_reg \ (16 + (TARGET_FPREGS ? 32 : 0) + CUM, \ gen_rtx (MEM, BLKmode, \ plus_constant (virtual_incoming_args_rtx, \ (CUM) * UNITS_PER_WORD)), \ 6 - (CUM), (6 - (CUM)) * UNITS_PER_WORD); \ emit_insn (gen_blockage ()); \ } \ PRETEND_SIZE = 12 * UNITS_PER_WORD; \ } \}/* Try to output insns to set TARGET equal to the constant C if it can be done in less than N insns. Do all computations in MODE. Returns the place where the output has been placed if it can be done and the insns have been emitted. If it would take more than N insns, zero is returned and no insns and emitted. */extern struct rtx_def *alpha_emit_set_const ();extern struct rtx_def *alpha_emit_set_long_const ();extern struct rtx_def *alpha_emit_conditional_branch ();extern struct rtx_def *alpha_emit_conditional_move ();/* Generate necessary RTL for __builtin_saveregs(). ARGLIST is the argument list; see expr.c. */extern struct rtx_def *alpha_builtin_saveregs ();#define EXPAND_BUILTIN_SAVEREGS(ARGLIST) alpha_builtin_saveregs (ARGLIST)/* Define the information needed to generate branch and scc insns. This is stored from the compare operation. Note that we can't use "rtx" here since it hasn't been defined! */extern struct rtx_def *alpha_compare_op0, *alpha_compare_op1;extern int alpha_compare_fp_p;/* Define the information needed to modify the epilogue for EH. */extern struct rtx_def *alpha_eh_epilogue_sp_ofs;/* Make (or fake) .linkage entry for function call. IS_LOCAL is 0 if name is used in call, 1 if name is used in definition. */extern void alpha_need_linkage ();/* This macro defines the start of an assembly comment. */#define ASM_COMMENT_START " #"/* This macro produces the initial definition of a function. */#define ASM_DECLARE_FUNCTION_NAME(FILE,NAME,DECL) \ alpha_start_function(FILE,NAME,DECL);extern void alpha_start_function ();/* This macro closes up a function definition for the assembler. */#define ASM_DECLARE_FUNCTION_SIZE(FILE,NAME,DECL) \ alpha_end_function(FILE,NAME,DECL)extern void alpha_end_function (); /* This macro notes the end of the prologue. */#define FUNCTION_END_PROLOGUE(FILE) output_end_prologue (FILE)extern void output_end_prologue ();/* Output any profiling code before the prologue. */#define PROFILE_BEFORE_PROLOGUE 1/* Output assembler code to FILE to increment profiler label # LABELNO for profiling a function entry. Under OSF/1, profiling is enabled by simply passing -pg to the assembler and linker. */#define FUNCTION_PROFILER(FILE, LABELNO)/* Output assembler code to FILE to initialize this source file's basic block profiling info, if that has not already been done. This assumes that __bb_init_func doesn't garble a1-a5. */#define FUNCTION_BLOCK_PROFILER(FILE, LABELNO) \ do { \ ASM_OUTPUT_REG_PUSH (FILE, 16); \ fputs ("\tlda $16,$PBX32\n", (FILE)); \ fputs ("\tldq $26,0($16)\n", (FILE)); \ fputs ("\tbne $26,1f\n", (FILE)); \ fputs ("\tlda $27,__bb_init_func\n", (FILE)); \ fputs ("\tjsr $26,($27),__bb_init_func\n", (FILE)); \ fputs ("\tldgp $29,0($26)\n", (FILE)); \ fputs ("1:\n", (FILE)); \ ASM_OUTPUT_REG_POP (FILE, 16); \ } while (0);/* 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) \ do { \ int blockn = (BLOCKNO); \ fputs ("\tsubq $30,16,$30\n", (FILE)); \ fputs ("\tstq $26,0($30)\n", (FILE)); \ fputs ("\tstq $27,8($30)\n", (FILE)); \ fputs ("\tlda $26,$PBX34\n", (FILE)); \ fprintf ((FILE), "\tldq $27,%d($26)\n", 8*blockn); \ fputs ("\taddq $27,1,$27\n", (FILE)); \ fprintf ((FILE), "\tstq $27,%d($26)\n", 8*blockn); \ fputs ("\tldq $26,0($30)\n", (FILE)); \ fputs ("\tldq $27,8($30)\n", (FILE)); \ fputs ("\taddq $30,16,$30\n", (FILE)); \ } 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/* Output assembler code for a block containing the constant parts of a trampoline, leaving space for the variable parts. The trampoline should set the static chain pointer to value placed into the trampoline and should branch to the specified routine. Note that $27 has been set to the address of the trampoline, so we can use it for addressability of the two data items. Trampolines are always aligned to FUNCTION_BOUNDARY, which is 64 bits. */#define TRAMPOLINE_TEMPLATE(FILE) \do { \ fprintf (FILE, "\tldq $1,24($27)\n"); \ fprintf (FILE, "\tldq $27,16($27)\n"); \ fprintf (FILE, "\tjmp $31,($27),0\n"); \ fprintf (FILE, "\tnop\n"); \ fprintf (FILE, "\t.quad 0,0\n"); \} while (0)/* Section in which to place the trampoline. On Alpha, instructions may only be placed in a text segment. */#define TRAMPOLINE_SECTION text_section/* Length in units of the trampoline for entering a nested function. */#define TRAMPOLINE_SIZE 32/* 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) \ alpha_initialize_trampoline (TRAMP, FNADDR, CXT, 16, 24, 8)extern void alpha_initialize_trampoline ();/* 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 the frame pointer of the COUNT frame, or the frame pointer of the COUNT-1 frame if RETURN_ADDR_IN_PREVIOUS_FRAME is defined. */#define RETURN_ADDR_RTX alpha_return_addrextern struct rtx_def *alpha_return_addr ();/* Before the prologue, RA lives in $26. */#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (Pmode, 26)/* Initialize data used by insn expanders. This is called from insn_emit, once for every function before code is generated. */#define INIT_EXPANDERS alpha_init_expanders ()extern void alpha_init_expanders ();/* Addressing modes, and classification of registers for them. *//* #define HAVE_POST_INCREMENT 0 *//* #define HAVE_POST_DECREMENT 0 *//* #define HAVE_PRE_DECREMENT 0 *//* #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) 0#define REGNO_OK_FOR_BASE_P(REGNO) \((REGNO) < 32 || (unsigned) reg_renumber[REGNO] < 32 \ || (REGNO) == 63 || reg_renumber[REGNO] == 63)/* Maximum number of registers that can appear in a valid memory address. */#define MAX_REGS_PER_ADDRESS 1/* Recognize any constant value that is a valid address. For the Alpha, there are only constants none since we want to use LDA to load any symbolic addresses into registers. */#define CONSTANT_ADDRESS_P(X) \ (GET_CODE (X) == CONST_INT \ && (unsigned HOST_WIDE_INT) (INTVAL (X) + 0x8000) < 0x10000)/* Include all constant integers and constant doubles, but not floating-point, except for floating-point zero. */#define LEGITIMATE_CONSTANT_P(X) \ (GET_MODE_CLASS (GET_MODE (X)) != MODE_FLOAT \ || (X) == CONST0_RTX (GET_MODE (X)))/* 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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -