📄 netbsd-elf.h
字号:
#define BSS_SECTION_ASM_OP ".section\t.bss"/* Like `ASM_OUTPUT_BSS' except takes the required alignment as a separate, explicit argument. If you define this macro, it is used in place of `ASM_OUTPUT_BSS', and gives you more flexibility in handling the required alignment of the variable. The alignment is specified as the number of bits. Try to use function `asm_output_aligned_bss' defined in file `varasm.c' when defining this macro. */#undef ASM_OUTPUT_ALIGNED_BSS#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)#undef ASM_OUTPUT_COMMON#define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \( fputs (".comm ", (FILE)), \ assemble_name ((FILE), (NAME)), \ fprintf ((FILE), ",%u\n", (SIZE)))#undef ASM_OUTPUT_LOCAL#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \( fputs (".lcomm ", (FILE)), \ assemble_name ((FILE), (NAME)), \ fprintf ((FILE), ",%u\n", (SIZE)))/* Turn off function cse if we are doing PIC. We always want function call to be done as `bsr foo@PLTPC', so it will force the assembler to create the PLT entry for `foo'. Doing function cse will cause the address of `foo' to be loaded into a register, which is exactly what we want to avoid when we are doing PIC on svr4 m68k. */#undef SUBTARGET_OVERRIDE_OPTIONS#define SUBTARGET_OVERRIDE_OPTIONS \ if (flag_pic) flag_no_function_cse = 1;/* XXX This is the end of the chunk lifted from m68kelf.h *//* XXX The following chunk is more or less lifted from m68kv4.h. We'd like to just #include that file, but it has not yet been converted to the new include style. Should there be a m68kv4-abi.h ?? *//* Register in which address to store a structure value is passed to a function. The default in m68k.h is a1. For m68k/SVR4 it is a0. */#undef STRUCT_VALUE_REGNUM#define STRUCT_VALUE_REGNUM 8/* Register in which static-chain is passed to a function. The default isn m68k.h is a0, but that is already the struct value regnum. Make it a1 instead. */#undef STATIC_CHAIN_REGNUM#define STATIC_CHAIN_REGNUM 9/* Now to renumber registers for dbx and gdb. We use the Sun-3 convention, which is: floating point registers have numbers 18 to 25, not 16 to 23 as they do in the compiler. */#undef DBX_REGISTER_NUMBER#define DBX_REGISTER_NUMBER(REGNO) ((REGNO) < 16 ? (REGNO) : (REGNO) + 2)/* 1 if N is a possible register number for a function value. For m68k/SVR4 allow d0, a0, or fp0 as return registers, for integral, pointer, or floating types, respectively. Reject fp0 if not using a 68881 coprocessor. */#undef FUNCTION_VALUE_REGNO_P#define FUNCTION_VALUE_REGNO_P(N) \ ((N) == 0 || (N) == 8 || (TARGET_68881 && (N) == 16))/* Define this to be true when FUNCTION_VALUE_REGNO_P is true for more than one register. */#undef NEEDS_UNTYPED_CALL#define NEEDS_UNTYPED_CALL 1/* Define how to generate (in the callee) the output value of a function and how to find (in the caller) 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. For m68k/SVR4 generate the result in d0, a0, or fp0 as appropriate. */#undef FUNCTION_VALUE#define FUNCTION_VALUE(VALTYPE, FUNC) \ (TREE_CODE (VALTYPE) == REAL_TYPE && TARGET_68881 \ ? gen_rtx_REG (TYPE_MODE (VALTYPE), 16) \ : (POINTER_TYPE_P (VALTYPE) \ ? gen_rtx_REG (TYPE_MODE (VALTYPE), 8) \ : gen_rtx_REG (TYPE_MODE (VALTYPE), 0)))/* For compatibility with the large body of existing code which does not always properly declare external functions returning pointer types, the m68k/SVR4 convention is to copy the value returned for pointer functions from a0 to d0 in the function epilogue, so that callers that have neglected to properly declare the callee can still find the correct return value. */extern int current_function_returns_pointer;#define FUNCTION_EXTRA_EPILOGUE(FILE, SIZE) \do \ { \ if (current_function_returns_pointer \ && ! find_equiv_reg (0, get_last_insn (), 0, 0, 0, 8, Pmode)) \ asm_fprintf (FILE, "\tmove.l %Ra0,%Rd0\n"); \ } \while (0)/* Define how to find the value returned by a library function assuming the value has mode MODE. For m68k/SVR4 look for integer values in d0, pointer values in d0 (returned in both d0 and a0), and floating values in fp0. */#undef LIBCALL_VALUE#define LIBCALL_VALUE(MODE) \ ((((MODE) == SFmode || (MODE) == DFmode || (MODE) == XFmode) \ && TARGET_68881) \ ? gen_rtx_REG (MODE, 16) \ : gen_rtx_REG (MODE, 0))/* Boundary (in *bits*) on which stack pointer should be aligned. The m68k/SVR4 convention is to keep the stack pointer longword aligned. */#undef STACK_BOUNDARY#define STACK_BOUNDARY 32/* Alignment of field after `int : 0' in a structure. For m68k/SVR4, this is the next longword boundary. */#undef EMPTY_FIELD_BOUNDARY#define EMPTY_FIELD_BOUNDARY 32/* No data type wants to be aligned rounder than this. For m68k/SVR4, some types (doubles for example) are aligned on 8 byte boundaries */#undef BIGGEST_ALIGNMENT#define BIGGEST_ALIGNMENT 64/* In m68k svr4, a symbol_ref rtx can be a valid PIC operand if it is an operand of a function call. */#undef LEGITIMATE_PIC_OPERAND_P#define LEGITIMATE_PIC_OPERAND_P(X) \ ((! symbolic_operand (X, VOIDmode) \ && ! (GET_CODE (X) == CONST_DOUBLE && mem_for_const_double (X) \ && 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)/* For m68k SVR4, structures are returned using the reentrant technique. */#undef PCC_STATIC_STRUCT_RETURN/* The svr4 ABI for the m68k says that records and unions are returned in memory. */#undef DEFAULT_PCC_STRUCT_RETURN#define DEFAULT_PCC_STRUCT_RETURN 1/* Output code to add DELTA to the first argument, and then jump to FUNCTION. Used for C++ multiple inheritance. */#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \do \ { \ if (DELTA > 0 && DELTA <= 8) \ asm_fprintf (FILE, "\taddq.l %I%d,4(%Rsp)\n", DELTA); \ else if (DELTA < 0 && DELTA >= -8) \ asm_fprintf (FILE, "\tsubq.l %I%d,4(%Rsp)\n", -DELTA); \ else \ asm_fprintf (FILE, "\tadd.l %I%d,4(%Rsp)\n", DELTA); \ \ if (flag_pic) \ { \ fprintf (FILE, "\tbra.l "); \ assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \ fprintf (FILE, "@PLTPC\n"); \ } \ else \ { \ fprintf (FILE, "\tjmp "); \ assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \ fprintf (FILE, "\n"); \ } \ } \while (0)/* Output assembler code for a block containing the constant parts of a trampoline, leaving space for the variable parts. *//* On m68k svr4, the trampoline is different from the generic version in that we use a1 as the static call chain. */#undef TRAMPOLINE_TEMPLATE#define TRAMPOLINE_TEMPLATE(FILE) \{ \ assemble_aligned_integer (2, GEN_INT (0x227a)); \ assemble_aligned_integer (2, GEN_INT (8)); \ assemble_aligned_integer (2, GEN_INT (0x2f3a)); \ assemble_aligned_integer (2, GEN_INT (8)); \ assemble_aligned_integer (2, GEN_INT (0x4e75)); \ assemble_aligned_integer (4, const0_rtx); \ assemble_aligned_integer (4, const0_rtx); \}/* Redefine since we are using a different trampoline */#undef TRAMPOLINE_SIZE#define TRAMPOLINE_SIZE 18/* 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. */#undef INITIALIZE_TRAMPOLINE#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \{ \ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 10)), CXT); \ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 14)), FNADDR); \}/* XXX This is the end of the chunk lifted from m68kv4.h */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -