📄 mips.h
字号:
whether we're using GAS. These options can only be used properly with GAS, and it is better to get an error from a non-GAS assembler than to silently generate bad code. */#undef ASM_SPEC#define ASM_SPEC "\%{G*} %(endian_spec) %{mips1} %{mips2} %{mips3} %{mips4} %{mips32} %{mips64}\%{mips16:%{!mno-mips16:-mips16}} %{mno-mips16:-no-mips16} \%(subtarget_asm_optimizing_spec) \%(subtarget_asm_debugging_spec) \%{membedded-pic} \%{mabi=32:-32}%{mabi=n32:-n32}%{mabi=64:-64}%{mabi=n64:-64} \%{mabi=eabi} %{mabi=o64} %{!mabi*: %(asm_abi_default_spec)} \%{mgp32} %{mgp64} %{march=*} \%(target_asm_spec) \%(subtarget_asm_spec)"/* Specify to run a post-processor, mips-tfile after the assembler has run to stuff the mips debug information into the object file. This is needed because the $#!%^ MIPS assembler provides no way of specifying such information in the assembly file. If we are cross compiling, disable mips-tfile unless the user specifies -mmips-tfile. */#ifndef ASM_FINAL_SPEC#if ((TARGET_CPU_DEFAULT | TARGET_DEFAULT) & MASK_GAS) != 0/* GAS */#define ASM_FINAL_SPEC "\%{mmips-as: %{!mno-mips-tfile: \ \n mips-tfile %{v*: -v} \ %{K: -I %b.o~} \ %{!K: %{save-temps: -I %b.o~}} \ %{c:%W{o*}%{!o*:-o %b.o}}%{!c:-o %U.o} \ %{.s:%i} %{!.s:%g.s}}}"#else/* not GAS */#define ASM_FINAL_SPEC "\%{!mgas: %{!mno-mips-tfile: \ \n mips-tfile %{v*: -v} \ %{K: -I %b.o~} \ %{!K: %{save-temps: -I %b.o~}} \ %{c:%W{o*}%{!o*:-o %b.o}}%{!c:-o %U.o} \ %{.s:%i} %{!.s:%g.s}}}"#endif#endif /* ASM_FINAL_SPEC *//* Redefinition of libraries used. Mips doesn't support normal UNIX style profiling via calling _mcount. It does offer profiling that samples the PC, so do what we can... */#ifndef LIB_SPEC#define LIB_SPEC "%{pg:-lprof1} %{p:-lprof1} -lc"#endif/* Extra switches sometimes passed to the linker. *//* ??? The bestGnum will never be passed to the linker, because the gcc driver will interpret it as a -b option. */#ifndef LINK_SPEC#define LINK_SPEC "\%(endian_spec) \%{G*} %{mips1} %{mips2} %{mips3} %{mips4} %{mips32} %{mips64} \%{bestGnum} %{shared} %{non_shared}"#endif /* LINK_SPEC defined *//* Specs for the compiler proper *//* SUBTARGET_CC1_SPEC is passed to the compiler proper. It may be overridden by subtargets. */#ifndef SUBTARGET_CC1_SPEC#define SUBTARGET_CC1_SPEC ""#endif/* CC1_SPEC is the set of arguments to pass to the compiler proper. *//* Note, we will need to adjust the following if we ever find a MIPS variant that has 32-bit GPRs and 64-bit FPRs as well as fix all of the reload bugs that show up in this case. */#ifndef CC1_SPEC#define CC1_SPEC "\%{gline:%{!g:%{!g0:%{!g1:%{!g2: -g1}}}}} \%{G*} %{EB:-meb} %{EL:-mel} %{EB:%{EL:%emay not use both -EB and -EL}} \%{save-temps: } \%(subtarget_cc1_spec)"#endif/* Preprocessor specs. *//* SUBTARGET_CPP_SPEC is passed to the preprocessor. It may be overridden by subtargets. */#ifndef SUBTARGET_CPP_SPEC#define SUBTARGET_CPP_SPEC ""#endif#define CPP_SPEC "%(subtarget_cpp_spec)"/* This macro defines names of additional specifications to put in the specs that can be used in various specifications like CC1_SPEC. Its definition is an initializer with a subgrouping for each command option. Each subgrouping contains a string constant, that defines the specification name, and a string constant that used by the GNU CC driver program. Do not define this macro if it does not need to do anything. */#define EXTRA_SPECS \ { "subtarget_cc1_spec", SUBTARGET_CC1_SPEC }, \ { "subtarget_cpp_spec", SUBTARGET_CPP_SPEC }, \ { "mips_as_asm_spec", MIPS_AS_ASM_SPEC }, \ { "gas_asm_spec", GAS_ASM_SPEC }, \ { "target_asm_spec", TARGET_ASM_SPEC }, \ { "subtarget_mips_as_asm_spec", SUBTARGET_MIPS_AS_ASM_SPEC }, \ { "subtarget_asm_optimizing_spec", SUBTARGET_ASM_OPTIMIZING_SPEC }, \ { "subtarget_asm_debugging_spec", SUBTARGET_ASM_DEBUGGING_SPEC }, \ { "mdebug_asm_spec", MDEBUG_ASM_SPEC }, \ { "subtarget_asm_spec", SUBTARGET_ASM_SPEC }, \ { "asm_abi_default_spec", ASM_ABI_DEFAULT_SPEC }, \ { "endian_spec", ENDIAN_SPEC }, \ SUBTARGET_EXTRA_SPECS#ifndef SUBTARGET_EXTRA_SPECS#define SUBTARGET_EXTRA_SPECS#endif/* If defined, this macro is an additional prefix to try after `STANDARD_EXEC_PREFIX'. */#ifndef MD_EXEC_PREFIX#define MD_EXEC_PREFIX "/usr/lib/cmplrs/cc/"#endif#ifndef MD_STARTFILE_PREFIX#define MD_STARTFILE_PREFIX "/usr/lib/cmplrs/cc/"#endif/* Print subsidiary information on the compiler version in use. */#define MIPS_VERSION "[AL 1.1, MM 40]"#ifndef MACHINE_TYPE#define MACHINE_TYPE "BSD Mips"#endif#ifndef TARGET_VERSION_INTERNAL#define TARGET_VERSION_INTERNAL(STREAM) \ fprintf (STREAM, " %s %s", MIPS_VERSION, MACHINE_TYPE)#endif#ifndef TARGET_VERSION#define TARGET_VERSION TARGET_VERSION_INTERNAL (stderr)#endif#define SDB_DEBUGGING_INFO 1 /* generate info for mips-tfile */#define DBX_DEBUGGING_INFO 1 /* generate stabs (OSF/rose) */#define MIPS_DEBUGGING_INFO 1 /* MIPS specific debugging info */#ifndef PREFERRED_DEBUGGING_TYPE /* assume SDB_DEBUGGING_INFO */#define PREFERRED_DEBUGGING_TYPE SDB_DEBUG#endif/* By default, turn on GDB extensions. */#define DEFAULT_GDB_EXTENSIONS 1/* If we are passing smuggling stabs through the MIPS ECOFF object format, put a comment in front of the .stab<x> operation so that the MIPS assembler does not choke. The mips-tfile program will correctly put the stab into the object file. */#define ASM_STABS_OP ((TARGET_GAS) ? "\t.stabs\t" : " #.stabs\t")#define ASM_STABN_OP ((TARGET_GAS) ? "\t.stabn\t" : " #.stabn\t")#define ASM_STABD_OP ((TARGET_GAS) ? "\t.stabd\t" : " #.stabd\t")/* Local compiler-generated symbols must have a prefix that the assembler understands. By default, this is $, although some targets (e.g., NetBSD-ELF) need to override this. */#ifndef LOCAL_LABEL_PREFIX#define LOCAL_LABEL_PREFIX "$"#endif/* By default on the mips, external symbols do not have an underscore prepended, but some targets (e.g., NetBSD) require this. */#ifndef USER_LABEL_PREFIX#define USER_LABEL_PREFIX ""#endif/* Forward references to tags are allowed. */#define SDB_ALLOW_FORWARD_REFERENCES/* Unknown tags are also allowed. */#define SDB_ALLOW_UNKNOWN_REFERENCES/* On Sun 4, this limit is 2048. We use 1500 to be safe, since the length can run past this up to a continuation point. */#undef DBX_CONTIN_LENGTH#define DBX_CONTIN_LENGTH 1500/* How to renumber registers for dbx and gdb. */#define DBX_REGISTER_NUMBER(REGNO) mips_dbx_regno[ (REGNO) ]/* The mapping from gcc register number to DWARF 2 CFA column number. This mapping does not allow for tracking register 0, since SGI's broken dwarf reader thinks column 0 is used for the frame address, but since register 0 is fixed this is not a problem. */#define DWARF_FRAME_REGNUM(REG) \ (REG == GP_REG_FIRST + 31 ? DWARF_FRAME_RETURN_COLUMN : REG)/* The DWARF 2 CFA column which tracks the return address. */#define DWARF_FRAME_RETURN_COLUMN (FP_REG_LAST + 1)/* Before the prologue, RA lives in r31. */#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (VOIDmode, GP_REG_FIRST + 31)/* Describe how we implement __builtin_eh_return. */#define EH_RETURN_DATA_REGNO(N) ((N) < (TARGET_MIPS16 ? 2 : 4) ? (N) + GP_ARG_FIRST : INVALID_REGNUM)#define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, GP_REG_FIRST + 3)/* Offsets recorded in opcodes are a multiple of this alignment factor. The default for this in 64-bit mode is 8, which causes problems with SFmode register saves. */#define DWARF_CIE_DATA_ALIGNMENT 4/* Overrides for the COFF debug format. */#define PUT_SDB_SCL(a) \do { \ extern FILE *asm_out_text_file; \ fprintf (asm_out_text_file, "\t.scl\t%d;", (a)); \} while (0)#define PUT_SDB_INT_VAL(a) \do { \ extern FILE *asm_out_text_file; \ fprintf (asm_out_text_file, "\t.val\t"); \ fprintf (asm_out_text_file, HOST_WIDE_INT_PRINT_DEC, (HOST_WIDE_INT)(a)); \ fprintf (asm_out_text_file, ";"); \} while (0)#define PUT_SDB_VAL(a) \do { \ extern FILE *asm_out_text_file; \ fputs ("\t.val\t", asm_out_text_file); \ output_addr_const (asm_out_text_file, (a)); \ fputc (';', asm_out_text_file); \} while (0)#define PUT_SDB_DEF(a) \do { \ extern FILE *asm_out_text_file; \ fprintf (asm_out_text_file, "\t%s.def\t", \ (TARGET_GAS) ? "" : "#"); \ ASM_OUTPUT_LABELREF (asm_out_text_file, a); \ fputc (';', asm_out_text_file); \} while (0)#define PUT_SDB_PLAIN_DEF(a) \do { \ extern FILE *asm_out_text_file; \ fprintf (asm_out_text_file, "\t%s.def\t.%s;", \ (TARGET_GAS) ? "" : "#", (a)); \} while (0)#define PUT_SDB_ENDEF \do { \ extern FILE *asm_out_text_file; \ fprintf (asm_out_text_file, "\t.endef\n"); \} while (0)#define PUT_SDB_TYPE(a) \do { \ extern FILE *asm_out_text_file; \ fprintf (asm_out_text_file, "\t.type\t0x%x;", (a)); \} while (0)#define PUT_SDB_SIZE(a) \do { \ extern FILE *asm_out_text_file; \ fprintf (asm_out_text_file, "\t.size\t"); \ fprintf (asm_out_text_file, HOST_WIDE_INT_PRINT_DEC, (HOST_WIDE_INT)(a)); \ fprintf (asm_out_text_file, ";"); \} while (0)#define PUT_SDB_DIM(a) \do { \ extern FILE *asm_out_text_file; \ fprintf (asm_out_text_file, "\t.dim\t%d;", (a)); \} while (0)#ifndef PUT_SDB_START_DIM#define PUT_SDB_START_DIM \do { \ extern FILE *asm_out_text_file; \ fprintf (asm_out_text_file, "\t.dim\t"); \} while (0)#endif#ifndef PUT_SDB_NEXT_DIM#define PUT_SDB_NEXT_DIM(a) \do { \ extern FILE *asm_out_text_file; \ fprintf (asm_out_text_file, "%d,", a); \} while (0)#endif#ifndef PUT_SDB_LAST_DIM#define PUT_SDB_LAST_DIM(a) \do { \ extern FILE *asm_out_text_file; \ fprintf (asm_out_text_file, "%d;", a); \} while (0)#endif#define PUT_SDB_TAG(a) \do { \ extern FILE *asm_out_text_file; \ fprintf (asm_out_text_file, "\t.tag\t"); \ ASM_OUTPUT_LABELREF (asm_out_text_file, a); \ fputc (';', asm_out_text_file); \} while (0)/* For block start and end, we create labels, so that later we can figure out where the correct offset is. The normal .ent/.end serve well enough for functions, so those are just commented out. */#define PUT_SDB_BLOCK_START(LINE) \do { \ extern FILE *asm_out_text_file; \ fprintf (asm_out_text_file, \ "%sLb%d:\n\t%s.begin\t%sLb%d\t%d\n", \ LOCAL_LABEL_PREFIX, \ sdb_label_count, \ (TARGET_GAS) ? "" : "#", \ LOCAL_LABEL_PREFIX, \ sdb_label_count, \ (LINE)); \ sdb_label_count++; \} while (0)#define PUT_SDB_BLOCK_END(LINE) \do { \ extern FILE *asm_out_text_file; \ fprintf (asm_out_text_file, \ "%sLe%d:\n\t%s.bend\t%sLe%d\t%d\n", \ LOCAL_LABEL_PREFIX, \ sdb_label_count, \ (TARGET_GAS) ? "" : "#", \ LOCAL_LABEL_PREFIX, \ sdb_label_count, \ (LINE)); \ sdb_label_count++; \
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -