📄 mips.h
字号:
# endif# endif# endif# endif# endif#endif#ifndef MULTILIB_DEFAULTS#define MULTILIB_DEFAULTS \ { MULTILIB_ENDIAN_DEFAULT, MULTILIB_ISA_DEFAULT, MULTILIB_ABI_DEFAULT }#endif/* We must pass -EL to the linker by default for little endian embedded targets using linker scripts with a OUTPUT_FORMAT line. Otherwise, the linker will default to using big-endian output files. The OUTPUT_FORMAT line must be in the linker script, otherwise -EB/-EL will not work. */#ifndef ENDIAN_SPEC#if TARGET_ENDIAN_DEFAULT == 0#define ENDIAN_SPEC "%{!EB:%{!meb:-EL}} %{EB|meb:-EB}"#else#define ENDIAN_SPEC "%{!EL:%{!mel:-EB}} %{EL|mel:-EL}"#endif#endif#define TARGET_OPTIONS \{ \ SUBTARGET_TARGET_OPTIONS \ { "tune=", &mips_tune_string, \ N_("Specify CPU for scheduling purposes")}, \ { "arch=", &mips_arch_string, \ N_("Specify CPU for code generation purposes")}, \ { "abi=", &mips_abi_string, \ N_("Specify an ABI")}, \ { "ips", &mips_isa_string, \ N_("Specify a Standard MIPS ISA")}, \ { "entry", &mips_entry_string, \ N_("Use mips16 entry/exit psuedo ops")}, \ { "no-mips16", &mips_no_mips16_string, \ N_("Don't use MIPS16 instructions")}, \ { "no-flush-func", &mips_cache_flush_func, \ N_("Don't call any cache flush functions")}, \ { "flush-func=", &mips_cache_flush_func, \ N_("Specify cache flush function")}, \}/* This is meant to be redefined in the host dependent files. */#define SUBTARGET_TARGET_OPTIONS#define GENERATE_BRANCHLIKELY (TARGET_BRANCHLIKELY \ && !TARGET_SR71K \ && !TARGET_MIPS16)/* Generate three-operand multiply instructions for SImode. */#define GENERATE_MULT3_SI ((TARGET_MIPS3900 \ || TARGET_MIPS5400 \ || TARGET_MIPS5500 \ || ISA_MIPS32 \ || ISA_MIPS64) \ && !TARGET_MIPS16)/* Generate three-operand multiply instructions for DImode. */#define GENERATE_MULT3_DI ((TARGET_MIPS3900) \ && !TARGET_MIPS16)/* Macros to decide whether certain features are available or not, depending on the instruction set architecture level. */#define HAVE_SQRT_P() (!ISA_MIPS1)/* True if the ABI can only work with 64-bit integer registers. We generally allow ad-hoc variations for TARGET_SINGLE_FLOAT, but otherwise floating-point registers must also be 64-bit. */#define ABI_NEEDS_64BIT_REGS (mips_abi == ABI_64 \ || mips_abi == ABI_O64 \ || mips_abi == ABI_N32)/* Likewise for 32-bit regs. */#define ABI_NEEDS_32BIT_REGS (mips_abi == ABI_32)/* ISA has instructions for managing 64 bit fp and gp regs (eg. mips3). */#define ISA_HAS_64BIT_REGS (ISA_MIPS3 \ || ISA_MIPS4 \ || ISA_MIPS64)/* ISA has branch likely instructions (eg. mips2). *//* Disable branchlikely for tx39 until compare rewrite. They haven't been generated up to this point. */#define ISA_HAS_BRANCHLIKELY (!ISA_MIPS1 \ && !TARGET_MIPS5500)/* ISA has the conditional move instructions introduced in mips4. */#define ISA_HAS_CONDMOVE ((ISA_MIPS4 \ || ISA_MIPS32 \ || ISA_MIPS64) \ && !TARGET_MIPS5500 \ && !TARGET_MIPS16)/* ISA has just the integer condition move instructions (movn,movz) */#define ISA_HAS_INT_CONDMOVE 0/* ISA has the mips4 FP condition code instructions: FP-compare to CC, branch on CC, and move (both FP and non-FP) on CC. */#define ISA_HAS_8CC (ISA_MIPS4 \ || ISA_MIPS32 \ || ISA_MIPS64)/* This is a catch all for the other new mips4 instructions: indexed load and indexed prefetch instructions, the FP madd and msub instructions, and the FP recip and recip sqrt instructions */#define ISA_HAS_FP4 ((ISA_MIPS4 \ || ISA_MIPS64) \ && !TARGET_MIPS16)/* ISA has conditional trap instructions. */#define ISA_HAS_COND_TRAP (!ISA_MIPS1 \ && !TARGET_MIPS16)/* ISA has integer multiply-accumulate instructions, madd and msub. */#define ISA_HAS_MADD_MSUB ((ISA_MIPS32 \ || ISA_MIPS64 \ ) && !TARGET_MIPS16)/* ISA has floating-point nmadd and nmsub instructions. */#define ISA_HAS_NMADD_NMSUB ((ISA_MIPS4 \ || ISA_MIPS64) \ && (!TARGET_MIPS5400 || TARGET_MAD) \ && ! TARGET_MIPS16)/* ISA has count leading zeroes/ones instruction (not implemented). */#define ISA_HAS_CLZ_CLO ((ISA_MIPS32 \ || ISA_MIPS64 \ ) && !TARGET_MIPS16)/* ISA has double-word count leading zeroes/ones instruction (not implemented). */#define ISA_HAS_DCLZ_DCLO (ISA_MIPS64 \ && !TARGET_MIPS16)/* ISA has three operand multiply instructions that put the high part in an accumulator: mulhi or mulhiu. */#define ISA_HAS_MULHI (TARGET_MIPS5400 \ || TARGET_MIPS5500 \ || TARGET_SR71K \ )/* ISA has three operand multiply instructions that negates the result and puts the result in an accumulator. */#define ISA_HAS_MULS (TARGET_MIPS5400 \ || TARGET_MIPS5500 \ || TARGET_SR71K \ )/* ISA has three operand multiply instructions that subtracts the result from a 4th operand and puts the result in an accumulator. */#define ISA_HAS_MSAC (TARGET_MIPS5400 \ || TARGET_MIPS5500 \ || TARGET_SR71K \ )/* ISA has three operand multiply instructions that the result from a 4th operand and puts the result in an accumulator. */#define ISA_HAS_MACC (TARGET_MIPS5400 \ || TARGET_MIPS5500 \ || TARGET_SR71K \ )/* ISA has 32-bit rotate right instruction. */#define ISA_HAS_ROTR_SI (TARGET_MIPS5400 \ || TARGET_MIPS5500 \ || TARGET_SR71K \ )/* ISA has 32-bit rotate right instruction. */#define ISA_HAS_ROTR_DI (TARGET_64BIT \ && (TARGET_MIPS5400 \ || TARGET_MIPS5500 \ || TARGET_SR71K \ ))/* ISA has data prefetch instruction. */#define ISA_HAS_PREFETCH ((ISA_MIPS4 \ || ISA_MIPS32 \ || ISA_MIPS64) \ && !TARGET_MIPS16)/* True if trunc.w.s and trunc.w.d are real (not synthetic) instructions. Both require TARGET_HARD_FLOAT, and trunc.w.d also requires TARGET_DOUBLE_FLOAT. */#define ISA_HAS_TRUNC_W (!ISA_MIPS1)/* CC1_SPEC causes -mips3 and -mips4 to set -mfp64 and -mgp64; -mips1 or -mips2 sets -mfp32 and -mgp32. This can be overridden by an explicit -mfp32, -mfp64, -mgp32 or -mgp64. -mfp64 sets MASK_FLOAT64 in target_flags, and -mgp64 sets MASK_64BIT. Setting MASK_64BIT in target_flags will cause gcc to assume that registers are 64 bits wide. int, long and void * will be 32 bit; this may be changed with -mint64 or -mlong64. The gen* programs link code that refers to MASK_64BIT. They don't actually use the information in target_flags; they just refer to it. *//* Switch Recognition by gcc.c. Add -G xx support */#undef SWITCH_TAKES_ARG#define SWITCH_TAKES_ARG(CHAR) \ (DEFAULT_SWITCH_TAKES_ARG (CHAR) || (CHAR) == 'G')/* Sometimes certain combinations of command options do not make sense on a particular target machine. You can define a macro `OVERRIDE_OPTIONS' to take account of this. This macro, if defined, is executed once just after all the command options have been parsed. On the MIPS, it is used to handle -G. We also use it to set up all of the tables referenced in the other macros. */#define OVERRIDE_OPTIONS override_options ()#define CONDITIONAL_REGISTER_USAGE mips_conditional_register_usage ()/* Show we can debug even without a frame pointer. */#define CAN_DEBUG_WITHOUT_FP/* Tell collect what flags to pass to nm. */#ifndef NM_FLAGS#define NM_FLAGS "-Bn"#endif/* Assembler specs. *//* MIPS_AS_ASM_SPEC is passed when using the MIPS assembler rather than gas. */#define MIPS_AS_ASM_SPEC "\%{!.s:-nocpp} %{.s: %{cpp} %{nocpp}} \%{pipe: %e-pipe is not supported} \%{K} %(subtarget_mips_as_asm_spec)"/* SUBTARGET_MIPS_AS_ASM_SPEC is passed when using the MIPS assembler rather than gas. It may be overridden by subtargets. */#ifndef SUBTARGET_MIPS_AS_ASM_SPEC#define SUBTARGET_MIPS_AS_ASM_SPEC "%{v}"#endif/* GAS_ASM_SPEC is passed when using gas, rather than the MIPS assembler. */#define GAS_ASM_SPEC "%{mtune=*} %{v}"extern int mips_abi;#ifndef MIPS_ABI_DEFAULT#define MIPS_ABI_DEFAULT ABI_32#endif/* Use the most portable ABI flag for the ASM specs. */#if MIPS_ABI_DEFAULT == ABI_32#define MULTILIB_ABI_DEFAULT "mabi=32"#define ASM_ABI_DEFAULT_SPEC "-32"#endif#if MIPS_ABI_DEFAULT == ABI_O64#define MULTILIB_ABI_DEFAULT "mabi=o64"#define ASM_ABI_DEFAULT_SPEC "-mabi=o64"#endif#if MIPS_ABI_DEFAULT == ABI_N32#define MULTILIB_ABI_DEFAULT "mabi=n32"#define ASM_ABI_DEFAULT_SPEC "-n32"#endif#if MIPS_ABI_DEFAULT == ABI_64#define MULTILIB_ABI_DEFAULT "mabi=64"#define ASM_ABI_DEFAULT_SPEC "-64"#endif#if MIPS_ABI_DEFAULT == ABI_EABI#define MULTILIB_ABI_DEFAULT "mabi=eabi"#define ASM_ABI_DEFAULT_SPEC "-mabi=eabi"#endif#if MIPS_ABI_DEFAULT == ABI_MEABI/* Most GAS don't know about MEABI. */#define MULTILIB_ABI_DEFAULT "mabi=meabi"#define ASM_ABI_DEFAULT_SPEC ""#endif/* Only ELF targets can switch the ABI. */#ifndef OBJECT_FORMAT_ELF#undef ASM_ABI_DEFAULT_SPEC#define ASM_ABI_DEFAULT_SPEC ""#endif/* TARGET_ASM_SPEC is used to select either MIPS_AS_ASM_SPEC or GAS_ASM_SPEC as the default, depending upon the value of TARGET_DEFAULT. */#if ((TARGET_CPU_DEFAULT | TARGET_DEFAULT) & MASK_GAS) != 0/* GAS */#define TARGET_ASM_SPEC "\%{mmips-as: %(mips_as_asm_spec)} \%{!mmips-as: %(gas_asm_spec)}"#else /* not GAS */#define TARGET_ASM_SPEC "\%{!mgas: %(mips_as_asm_spec)} \%{mgas: %(gas_asm_spec)}"#endif /* not GAS *//* SUBTARGET_ASM_OPTIMIZING_SPEC handles passing optimization options to the assembler. It may be overridden by subtargets. */#ifndef SUBTARGET_ASM_OPTIMIZING_SPEC#define SUBTARGET_ASM_OPTIMIZING_SPEC "\%{noasmopt:-O0} \%{!noasmopt:%{O:-O2} %{O1:-O2} %{O2:-O2} %{O3:-O3}}"#endif/* SUBTARGET_ASM_DEBUGGING_SPEC handles passing debugging options to the assembler. It may be overridden by subtargets. */#ifndef SUBTARGET_ASM_DEBUGGING_SPEC#define SUBTARGET_ASM_DEBUGGING_SPEC "\%{g} %{g0} %{g1} %{g2} %{g3} \%{ggdb:-g} %{ggdb0:-g0} %{ggdb1:-g1} %{ggdb2:-g2} %{ggdb3:-g3} \%{gstabs:-g} %{gstabs0:-g0} %{gstabs1:-g1} %{gstabs2:-g2} %{gstabs3:-g3} \%{gstabs+:-g} %{gstabs+0:-g0} %{gstabs+1:-g1} %{gstabs+2:-g2} %{gstabs+3:-g3} \%{gcoff:-g} %{gcoff0:-g0} %{gcoff1:-g1} %{gcoff2:-g2} %{gcoff3:-g3} \%(mdebug_asm_spec)"#endif/* Beginning with gas 2.13, -mdebug must be passed to correctly handle COFF and stabs debugging info. */#if ((TARGET_CPU_DEFAULT | TARGET_DEFAULT) & MASK_GAS) != 0/* GAS */#define MDEBUG_ASM_SPEC "%{!gdwarf*:-mdebug} %{gdwarf*:-no-mdebug}"#else /* not GAS */#define MDEBUG_ASM_SPEC ""#endif /* not GAS *//* SUBTARGET_ASM_SPEC is always passed to the assembler. It may be overridden by subtargets. */#ifndef SUBTARGET_ASM_SPEC#define SUBTARGET_ASM_SPEC ""#endif/* ASM_SPEC is the set of arguments to pass to the assembler. Note: we pass -mgp32, -mgp64, -march, -mabi=eabi and -meabi=o64 regardless of
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -