⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mips.h

📁 早期freebsd实现
💻 H
📖 第 1 页 / 共 5 页
字号:
/* Definitions of target machine for GNU compiler.  MIPS version.   Contributed by   A. Lichnewsky,	lich@inria.inria.fr   Changed by Michael Meissner,		meissner@osf.org   Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.This file is part of GNU CC.GNU CC is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation; either version 2, or (at your option)any later version.GNU CC is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See theGNU General Public License for more details.You should have received a copy of the GNU General Public Licensealong with GNU CC; see the file COPYING.  If not, write tothe Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  *//* Make Saber happier on obstack.[ch].  */#if defined(__mips__) || defined(mips)#define __PTR_TO_INT(P) ((int)(P))#define __INT_TO_PTR(P) ((char *)(P))#endif/* Standard GCC variables that we reference.  */extern char    *asm_file_name;extern char	call_used_regs[];extern int	current_function_calls_alloca;extern int	flag_omit_frame_pointer;extern int	frame_pointer_needed;extern char    *language_string;extern int	may_call_alloca;extern int	optimize;extern char   **save_argv;extern int	target_flags;extern char    *version_string;/* MIPS external variables defined in mips.c.  *//* comparison type */enum cmp_type {  CMP_SI,				/* compare integers */  CMP_SF,				/* compare single precision floats */  CMP_DF,				/* compare double precision floats */  CMP_MAX				/* max comparison type */};/* types of delay slot */enum delay_type {  DELAY_NONE,				/* no delay slot */  DELAY_LOAD,				/* load from memory delay */  DELAY_HILO,				/* move from/to hi/lo registers */  DELAY_FCMP				/* delay after doing c.<xx>.{d,s} */};/* Which processor to schedule for.  Since there is no difference between   a R2000 and R3000 in terms of the scheduler, we collapse them into   just an R3000.  The elements of the enumeration must match exactly   the cpu attribute in the mips.md machine description.  */enum processor_type {  PROCESSOR_DEFAULT,  PROCESSOR_R3000,  PROCESSOR_R6000,  PROCESSOR_R4000};/* Recast the cpu class to be the cpu attribute.  */#define mips_cpu_attr ((enum attr_cpu)mips_cpu)/* Which type of block move to do (whether or not the last store is   split out so it can fill a branch delay slot).  */enum block_move_type {  BLOCK_MOVE_NORMAL,			/* generate complete block move */  BLOCK_MOVE_NOT_LAST,			/* generate all but last store */  BLOCK_MOVE_LAST			/* generate just the last store */};extern char mips_reg_names[][8];	/* register names (a0 vs. $4). */extern char mips_print_operand_punct[];	/* print_operand punctuation chars */extern char *current_function_name;	/* current function being compiled */extern char *current_function_file;	/* filename current function is in */extern int num_source_filenames;	/* current .file # */extern int inside_function;		/* != 0 if inside of a function */extern int ignore_line_number;		/* != 0 if we are to ignore next .loc */extern int file_in_function_warning;	/* warning given about .file in func */extern int sdb_label_count;		/* block start/end next label # */extern int mips_section_threshold;	/* # bytes of data/sdata cutoff */extern int g_switch_value;		/* value of the -G xx switch */extern int g_switch_set;		/* whether -G xx was passed.  */extern int sym_lineno;			/* sgi next label # for each stmt */extern int set_noreorder;		/* # of nested .set noreorder's  */extern int set_nomacro;			/* # of nested .set nomacro's  */extern int set_noat;			/* # of nested .set noat's  */extern int set_volatile;		/* # of nested .set volatile's  */extern int mips_branch_likely;		/* emit 'l' after br (branch likely) */extern int mips_dbx_regno[];		/* Map register # to debug register # */extern char mips_rtx_classify[];	/* classify an RTX code */extern struct rtx_def *branch_cmp[2];	/* operands for compare */extern enum cmp_type branch_type;	/* what type of branch to use */extern enum processor_type mips_cpu;	/* which cpu are we scheduling for */extern int mips_isa;			/* architectural level */extern char *mips_cpu_string;		/* for -mcpu=<xxx> */extern char *mips_isa_string;		/* for -mips{1,2,3} */extern int dslots_load_total;		/* total # load related delay slots */extern int dslots_load_filled;		/* # filled load delay slots */extern int dslots_jump_total;		/* total # jump related delay slots */extern int dslots_jump_filled;		/* # filled jump delay slots */extern int dslots_number_nops;		/* # of nops needed by previous insn */extern int num_refs[3];			/* # 1/2/3 word references */extern struct rtx_def *mips_load_reg;	/* register to check for load delay */extern struct rtx_def *mips_load_reg2;	/* 2nd reg to check for load delay */extern struct rtx_def *mips_load_reg3;	/* 3rd reg to check for load delay */extern struct rtx_def *mips_load_reg4;	/* 4th reg to check for load delay *//* Functions within mips.c that we reference.  */extern void		abort_with_insn ();extern int		arith32_operand ();extern int		arith_operand ();extern int		cmp_op ();extern int		cmp2_op ();extern long		compute_frame_size ();extern int		epilogue_reg_mentioned_p ();extern void		expand_block_move ();extern int		equality_op ();extern int		fcmp_op ();extern void		final_prescan_insn ();extern int		fpsw_register_operand ();extern struct rtx_def *	function_arg ();extern void		function_arg_advance ();extern int		function_arg_partial_nregs ();extern void		function_epilogue ();extern void		function_prologue ();extern void		gen_conditional_branch ();extern struct rtx_def * gen_int_relational ();extern void		init_cumulative_args ();extern int		large_int ();extern int		md_register_operand ();extern int		mips_address_cost ();extern void		mips_asm_file_end ();extern void		mips_asm_file_start ();extern int		mips_const_double_ok ();extern void		mips_count_memory_refs ();extern int		mips_debugger_offset ();extern void		mips_declare_object ();extern int		mips_epilogue_delay_slots ();extern void		mips_expand_epilogue ();extern void		mips_expand_prologue ();extern char	       *mips_fill_delay_slot ();extern char	       *mips_move_1word ();extern char	       *mips_move_2words ();extern void		mips_output_double ();extern int		mips_output_external ();extern void		mips_output_float ();extern void		mips_output_filename ();extern void		mips_output_lineno ();extern char	       *output_block_move ();extern void		override_options ();extern int		pc_or_label_operand ();extern void		print_operand_address ();extern void		print_operand ();extern void		print_options ();extern int		reg_or_0_operand ();extern int		simple_epilogue_p ();extern int		simple_memory_operand ();extern int		small_int ();extern void		trace();extern int		uns_arith_operand ();extern int		uns_cmp_op ();/* Recognition functions that return if a condition is true.  */extern int		address_operand ();extern int		const_double_operand ();extern int		const_int_operand ();extern int		general_operand ();extern int		immediate_operand ();extern int		memory_address_p ();extern int		memory_operand ();extern int		nonimmediate_operand ();extern int		nonmemory_operand ();extern int		register_operand ();extern int		scratch_operand ();/* Functions to change what output section we are using.  */extern void		data_section ();extern void		rdata_section ();extern void		readonly_data_section ();extern void		sdata_section ();extern void		text_section ();/* Functions in the rest of the compiler that we reference.  */extern void		abort_with_insn ();extern void		debug_rtx ();extern void		fatal_io_error ();extern int		get_frame_size ();extern int		offsettable_address_p ();extern void		output_address ();extern char	       *permalloc ();extern int		reg_mentioned_p ();/* Functions in the standard library that we reference.  */extern void		abort ();extern int		atoi ();extern char	       *getenv ();extern char	       *mktemp ();/* Stubs for half-pic support if not OSF/1 reference platform.  */#ifndef HALF_PIC_P#define HALF_PIC_P() 0#define HALF_PIC_NUMBER_PTRS 0#define HALF_PIC_NUMBER_REFS 0#define HALF_PIC_ENCODE(DECL)#define HALF_PIC_DECLARE(NAME)#define HALF_PIC_INIT()	error ("half-pic init called on systems that don't support it.")#define HALF_PIC_ADDRESS_P(X) 0#define HALF_PIC_PTR(X) X#define HALF_PIC_FINISH(STREAM)#endif/* Switch  Recognition by gcc.c.  Add -G xx support */#ifdef SWITCH_TAKES_ARG#undef SWITCH_TAKES_ARG#endif#define SWITCH_TAKES_ARG(CHAR)						\  ((CHAR) == 'D' || (CHAR) == 'U' || (CHAR) == 'o'			\   || (CHAR) == 'e' || (CHAR) == 'T' || (CHAR) == 'u'			\   || (CHAR) == 'I' || (CHAR) == 'm'					\   || (CHAR) == 'L' || (CHAR) == 'A' || (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 ()/* Zero or more C statements that may conditionally modify two   variables `fixed_regs' and `call_used_regs' (both of type `char   []') after they have been initialized from the two preceding   macros.   This is necessary in case the fixed or call-clobbered registers   depend on target flags.   You need not define this macro if it has no work to do.   If the usage of an entire class of registers depends on the target   flags, you may indicate this to GCC by using this macro to modify   `fixed_regs' and `call_used_regs' to 1 for each of the registers in   the classes which should not be used by GCC.  Also define the macro   `REG_CLASS_FROM_LETTER' to return `NO_REGS' if it is called with a   letter for a class that shouldn't be used.   (However, if this class is not included in `GENERAL_REGS' and all   of the insn patterns whose constraints permit this class are   controlled by target switches, then GCC will automatically avoid   using these registers when the target switches are opposed to   them.)  */#define CONDITIONAL_REGISTER_USAGE					\do									\  {									\    if (!TARGET_HARD_FLOAT)						\      {									\	int regno;							\									\	for (regno = FP_REG_FIRST; regno <= FP_REG_LAST; regno++)	\	  fixed_regs[regno] = call_used_regs[regno] = 1;		\      }									\  }									\while (0)/* Some machines may desire to change what optimizations are   performed for various optimization levels.   This macro, if   defined, is executed once just after the optimization level is   determined and before the remainder of the command options have   been parsed.  Values set in this macro are used as the default   values for the other command line options.   LEVEL is the optimization level specified; 2 if -O2 is   specified, 1 if -O is specified, and 0 if neither is specified.  */#define OPTIMIZATION_OPTIONS(LEVEL)					\{									\  flag_no_function_cse			= TRUE;				\  flag_gnu_linker			= FALSE;			\									\  if (LEVEL)								\    {									\      flag_omit_frame_pointer		= TRUE;				\      flag_delayed_branch		= TRUE;				\      flag_thread_jumps			= TRUE;				\      flag_schedule_insns_after_reload	= TRUE;				\    }									\									\  if (LEVEL >= 2)							\    {									\      flag_strength_reduce		= TRUE;				\      flag_cse_follow_jumps		= TRUE;				\      flag_expensive_optimizations	= TRUE;				\      flag_rerun_cse_after_loop		= TRUE;				\      flag_schedule_insns		= TRUE;				\    }									\									\  if (LEVEL >= 3)							\    {									\      flag_inline_functions		= TRUE;				\    }									\}/* Complain about missing specs and predefines that should be defined in each   of the target tm files to override the defaults.  This is mostly a place-   holder until I can get each of the files updated [mm].  */#if defined(OSF_OS) \    || defined(DECSTATION) \    || defined(SGI_TARGET) \    || defined(MIPS_NEWS) \    || defined(MIPS_SYSV) \    || defined(MIPS_SVR4) \    || defined(MIPS_BSD43)#ifndef CPP_PREDEFINES	#error "Define CPP_PREDEFINES in the appropriate tm.h file"#endif#ifndef CPP_SPEC	#error "Define CPP_SPEC in the appropriate tm.h file"#endif#ifndef LINK_SPEC	#error "Define LINK_SPEC in the appropriate tm.h file"#endif#ifndef LIB_SPEC	#error "Define LIB_SPEC in the appropriate tm.h file"#endif#ifndef STARTFILE_SPEC	#error "Define STARTFILE_SPEC in the appropriate tm.h file"#endif#ifndef MACHINE_TYPE

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -