📄 m68k.h
字号:
#define NEEDS_UNTYPED_CALL 0/* 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. On the 68000, 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 m68k, 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 m68k, 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 68000 all args are pushed, except if -mregparm is specified then the first two words of arguments are passed in d0, d1. *NOTE* -mregparm does not work. It exists only to test register calling conventions. */#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \((TARGET_REGPARM && (CUM) < 8) ? gen_rtx_REG ((MODE), (CUM) / 4) : 0)/* 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) \((TARGET_REGPARM && (CUM) < 8 \ && 8 < ((CUM) + ((MODE) == BLKmode \ ? int_size_in_bytes (TYPE) \ : GET_MODE_SIZE (MODE)))) \ ? 2 - (CUM) / 4 : 0)/* Output assembler code to FILE to increment profiler label # LABELNO for profiling a function entry. */#define FUNCTION_PROFILER(FILE, LABELNO) \ asm_fprintf (FILE, "\tlea %LLP%d,%Ra0\n\tjsr mcount\n", (LABELNO))/* 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/* This is a hook for other tm files to change. *//* #define FUNCTION_EXTRA_EPILOGUE(FILE, SIZE) *//* Determine if the epilogue should be output as RTL. You should override this if you define FUNCTION_EXTRA_EPILOGUE. */#define USE_RETURN_INSN use_return_insn ()/* 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 68k, if we have a frame, we must add one word to its length to allow for the place that a6 is stored when we do have a frame pointer. Otherwise, we would need to compute the offset from the frame pointer of a local variable as a function of frame_pointer_needed, which is hard. */#define INITIAL_FRAME_POINTER_OFFSET(DEPTH) \{ int regno; \ int offset = -4; \ for (regno = 16; regno < FIRST_PSEUDO_REGISTER; regno++) \ if (regs_ever_live[regno] && ! call_used_regs[regno]) \ offset += 12; \ for (regno = 0; regno < 16; regno++) \ if (regs_ever_live[regno] && ! call_used_regs[regno]) \ offset += 4; \ if (flag_pic && current_function_uses_pic_offset_table) \ offset += 4; \ (DEPTH) = (offset + ((get_frame_size () + 3) & -4) \ + (get_frame_size () == 0 ? 0 : 4)); \}/* Output assembler code for a block containing the constant parts of a trampoline, leaving space for the variable parts. *//* On the 68k, the trampoline looks like this: movl #STATIC,a0 jmp FUNCTION WARNING: Targets that may run on 68040+ cpus must arrange for the instruction cache to be flushed. Previous incarnations of the m68k trampoline code attempted to get around this by either using an out-of-line transfer function or pc-relative data, but the fact remains that the code to jump to the transfer function or the code to load the pc-relative data needs to be flushed just as much as the "variable" portion of the trampoline. Recognizing that a cache flush is going to be required anyway, dispense with such notions and build a smaller trampoline. *//* Since more instructions are required to move a template into place than to create it on the spot, don't use a template. *//* Length in units of the trampoline for entering a nested function. */#define TRAMPOLINE_SIZE 12/* Alignment required for a trampoline in bits. */#define TRAMPOLINE_ALIGNMENT 16/* Targets redefine this to invoke code to either flush the cache, or enable stack execution (or both). */#ifndef FINALIZE_TRAMPOLINE#define FINALIZE_TRAMPOLINE(TRAMP)#endif/* 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 generate a two-instructions program at address TRAMP : movea.l &CXT,%a0 jmp FNADDR */#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \{ \ emit_move_insn (gen_rtx_MEM (HImode, TRAMP), GEN_INT(0x207C)); \ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 2)), CXT); \ emit_move_insn (gen_rtx_MEM (HImode, plus_constant (TRAMP, 6)), \ GEN_INT(0x4EF9)); \ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 8)), FNADDR); \ FINALIZE_TRAMPOLINE(TRAMP); \}/* This is the library routine that is used to transfer control from the trampoline to the actual nested function. It is defined for backward compatibility, for linking with object code that used the old trampoline definition. *//* A colon is used with no explicit operands to cause the template string to be scanned for %-constructs. *//* The function name __transfer_from_trampoline is not actually used. The function definition just permits use of "asm with operands" (though the operand list is empty). */#define TRANSFER_FROM_TRAMPOLINE \void \__transfer_from_trampoline () \{ \ register char *a0 asm ("%a0"); \ asm (GLOBAL_ASM_OP "___trampoline"); \ asm ("___trampoline:"); \ asm volatile ("move%.l %0,%@" : : "m" (a0[22])); \ asm volatile ("move%.l %1,%0" : "=a" (a0) : "m" (a0[18])); \ asm ("rts":); \}/* 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) < 16 || (unsigned) reg_renumber[REGNO] < 16)#define REGNO_OK_FOR_BASE_P(REGNO) \(((REGNO) ^ 010) < 8 || (unsigned) (reg_renumber[REGNO] ^ 010) < 8)#define REGNO_OK_FOR_DATA_P(REGNO) \((REGNO) < 8 || (unsigned) reg_renumber[REGNO] < 8)#define REGNO_OK_FOR_FP_P(REGNO) \(((REGNO) ^ 020) < 8 || (unsigned) (reg_renumber[REGNO] ^ 020) < 8)#ifdef SUPPORT_SUN_FPA#define REGNO_OK_FOR_FPA_P(REGNO) \(((REGNO) >= 24 && (REGNO) < 56) || (reg_renumber[REGNO] >= 24 && reg_renumber[REGNO] < 56))#endif/* Now macros that check whether X is a register and also, strictly, whether it is in a specified class. These macros are specific to the 68000, and may be used only in code for printing assembler insns and in conditions for define_optimization. *//* 1 if X is a data register. */#define DATA_REG_P(X) (REG_P (X) && REGNO_OK_FOR_DATA_P (REGNO (X)))/* 1 if X is an fp register. */#define FP_REG_P(X) (REG_P (X) && REGNO_OK_FOR_FP_P (REGNO (X)))/* 1 if X is an address register */#define ADDRESS_REG_P(X) (REG_P (X) && REGNO_OK_FOR_BASE_P (REGNO (X)))#ifdef SUPPORT_SUN_FPA/* 1 if X is a register in the Sun FPA. */#define FPA_REG_P(X) (REG_P (X) && REGNO_OK_FOR_FPA_P (REGNO (X)))#else/* Answer must be no if we don't have an FPA. */#define FPA_REG_P(X) 0#endif/* Maximum number of registers that can appear in a valid memory address. */#define MAX_REGS_PER_ADDRESS 2/* Recognize any constant value 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/* Nonzero if the constant value X is a legitimate general operand when generating PIC code. It is given that flag_pic is on and that X satisfies CONSTANT_P or is a CONST_DOUBLE. PCREL_GENERAL_OPERAND_OK makes reload accept addresses that are accepted by insn predicates, but which would otherwise fail the `general_operand' test. */#ifndef REG_OK_STRICT#define PCREL_GENERAL_OPERAND_OK 0#else#define PCREL_GENERAL_OPERAND_OK (TARGET_PCREL)#endif#define LEGITIMATE_PIC_OPERAND_P(X) \ ((! symbolic_operand (X, VOIDmode) \ && ! (GET_CODE (X) == CONST_DOUBLE && mem_for_const_double (X) != 0 \ && GET_CODE (mem_for_const_double (X)) == MEM \ && symbolic_operand (XEXP (mem_for_const_double (X), 0), \ VOIDmode))) \ || (GET_CODE (X) == SYMBOL_REF && SYMBOL_REF_FLAG (X)) \ || PCREL_GENERAL_OPERAND_OK)/* 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) ((REGNO (X) ^ 020) >= 8)/* 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) ((REGNO (X) & ~027) != 0)#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. When generating PIC, an address involving a SYMBOL_REF is legitimate if and only if it is the sum of pic_offset_table_rtx and the SYMBOL_REF. We use LEGITIMATE_PIC_OPERAND_P to throw out the illegitimate addresses, and we explicitly check for the sum of pic_offset_table_rtx and a SYMBOL_REF.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -