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

📄 mips.h

📁 GCC编译器源代码
💻 H
📖 第 1 页 / 共 5 页
字号:
/* Definitions of target machine for GNU compiler.  MIPS version.   Copyright (C) 1989, 90-6, 1997 Free Software Foundation, Inc.   Contributed by A. Lichnewsky (lich@inria.inria.fr).   Changed by Michael Meissner	(meissner@osf.org).   64 bit r4000 support by Ian Lance Taylor (ian@cygnus.com) and   Brendan Eich (brendan@microunity.com).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, 59 Temple Place - Suite 330,Boston, MA 02111-1307, USA.  *//* Standard GCC variables that we reference.  */extern char    *asm_file_name;extern char	call_used_regs[];extern int	current_function_calls_alloca;extern char    *language_string;extern int	may_call_alloca;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 four byte integers */  CMP_DI,				/* compare eight byte 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_R3900,  PROCESSOR_R6000,  PROCESSOR_R4000,  PROCESSOR_R4100,  PROCESSOR_R4300,  PROCESSOR_R4600,  PROCESSOR_R4650,  PROCESSOR_R5000,  PROCESSOR_R8000};/* Recast the cpu class to be the cpu attribute.  */#define mips_cpu_attr ((enum attr_cpu)mips_cpu)/* Which ABI to use.  This is only used by the Irix 6 port currently.  */enum mips_abi_type {  ABI_32,  ABI_N32,  ABI_64,  ABI_EABI};#ifndef MIPS_ABI_DEFAULT/* We define this away so that there is no extra runtime cost if the target   doesn't support multiple ABIs.  */#define mips_abi ABI_32#elseextern enum mips_abi_type mips_abi;#endif/* Whether to emit abicalls code sequences or not.  */enum mips_abicalls_type {  MIPS_ABICALLS_NO,  MIPS_ABICALLS_YES};/* Recast the abicalls class to be the abicalls attribute.  */#define mips_abicalls_attr ((enum attr_abicalls)mips_abicalls)/* 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_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 sdb_begin_function_line;     /* Starting Line of current function */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 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 enum mips_abicalls_type mips_abicalls;/* for svr4 abi pic calls */extern int mips_isa;			/* architectural level */extern char *mips_cpu_string;		/* for -mcpu=<xxx> */extern char *mips_isa_string;		/* for -mips{1,2,3,4} */extern char *mips_abi_string;		/* for -misa={32,n32,64} */extern int mips_split_addresses;	/* perform high/lo_sum support */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 */extern struct rtx_def *embedded_pic_fnaddr_rtx;	/* function address *//* 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 long		compute_frame_size ();extern int		epilogue_reg_mentioned_p ();extern void		expand_block_move ();extern int		equality_op ();extern void		final_prescan_insn ();extern struct rtx_def *	function_arg ();extern void		function_arg_advance ();extern int		function_arg_partial_nregs ();extern int		function_arg_pass_by_reference ();extern void		function_epilogue ();extern void		function_prologue ();extern void		gen_conditional_branch ();extern void		gen_conditional_move ();extern struct rtx_def * gen_int_relational ();extern void		init_cumulative_args ();extern int		large_int ();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 int		mips_check_split ();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 struct rtx_def *	embedded_pic_offset ();/* 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 ();extern int		move_operand ();extern int		movdi_operand ();extern int		se_register_operand ();extern int		se_reg_or_0_operand ();extern int		se_uns_arith_operand ();extern int		se_arith_operand ();extern int		se_nonmemory_operand ();extern int		se_nonimmediate_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 ();/* 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/* Run-time compilation parameters selecting different hardware subsets.  *//* Macros used in the machine description to test the flags.  */					/* Bits for real switches */#define MASK_INT64	0x00000001	/* ints are 64 bits */#define MASK_LONG64	0x00000002	/* longs and pointers are 64 bits */#define MASK_SPLIT_ADDR	0x00000004	/* Address splitting is enabled.  */#define MASK_GPOPT	0x00000008	/* Optimize for global pointer */#define MASK_GAS	0x00000010	/* Gas used instead of MIPS as */#define MASK_NAME_REGS	0x00000020	/* Use MIPS s/w reg name convention */#define MASK_STATS	0x00000040	/* print statistics to stderr */#define MASK_MEMCPY	0x00000080	/* call memcpy instead of inline code*/#define MASK_SOFT_FLOAT	0x00000100	/* software floating point */#define MASK_FLOAT64	0x00000200	/* fp registers are 64 bits */#define MASK_ABICALLS	0x00000400	/* emit .abicalls/.cprestore/.cpload */#define MASK_HALF_PIC	0x00000800	/* Emit OSF-style pic refs to externs*/#define MASK_LONG_CALLS	0x00001000	/* Always call through a register */#define MASK_64BIT	0x00002000	/* Use 64 bit GP registers and insns */#define MASK_EMBEDDED_PIC 0x00004000	/* Generate embedded PIC code */#define MASK_EMBEDDED_DATA 0x00008000	/* Reduce RAM usage, not fast code */#define MASK_BIG_ENDIAN	0x00010000	/* Generate big endian code */#define MASK_SINGLE_FLOAT 0x00020000	/* Only single precision FPU.  */#define MASK_MAD	0x00040000	/* Generate mad/madu as on 4650.  */#define MASK_4300_MUL_FIX 0x00080000    /* Work-around early Vr4300 CPU bug */#define MASK_MIPS3900	0x00100000	/* like -mips1 only 3900 */					/* Dummy switches used only in spec's*/#define MASK_MIPS_TFILE	0x00000000	/* flag for mips-tfile usage */					/* Debug switches, not documented */#define MASK_DEBUG	0x40000000	/* Eliminate version # in .s file */#define MASK_DEBUG_A	0x20000000	/* don't allow <label>($reg) addrs */#define MASK_DEBUG_B	0x10000000	/* GO_IF_LEGITIMATE_ADDRESS debug */#define MASK_DEBUG_C	0x08000000	/* don't expand seq, etc. */#define MASK_DEBUG_D	0x04000000	/* don't do define_split's */#define MASK_DEBUG_E	0x02000000	/* function_arg debug */#define MASK_DEBUG_F	0x01000000	/* don't try to suppress load nop's */#define MASK_DEBUG_G	0x00800000	/* don't support 64 bit arithmetic */#define MASK_DEBUG_H	0x00400000	/* allow ints in FP registers */#define MASK_DEBUG_I	0x00200000	/* unused */					/* r4000 64 bit sizes */#define TARGET_INT64		(target_flags & MASK_INT64)#define TARGET_LONG64		(target_flags & MASK_LONG64)#define TARGET_FLOAT64		(target_flags & MASK_FLOAT64)#define TARGET_64BIT		(target_flags & MASK_64BIT)					/* Mips vs. GNU linker */#define TARGET_SPLIT_ADDRESSES	(target_flags & MASK_SPLIT_ADDR)/* generate mips 3900 insns */#define TARGET_MIPS3900         (target_flags & MASK_MIPS3900)					/* Mips vs. GNU assembler */#define TARGET_GAS		(target_flags & MASK_GAS)#define TARGET_UNIX_ASM		(!TARGET_GAS)#define TARGET_MIPS_AS		TARGET_UNIX_ASM					/* Debug Mode */#define TARGET_DEBUG_MODE	(target_flags & MASK_DEBUG)#define TARGET_DEBUG_A_MODE	(target_flags & MASK_DEBUG_A)#define TARGET_DEBUG_B_MODE	(target_flags & MASK_DEBUG_B)#define TARGET_DEBUG_C_MODE	(target_flags & MASK_DEBUG_C)#define TARGET_DEBUG_D_MODE	(target_flags & MASK_DEBUG_D)#define TARGET_DEBUG_E_MODE	(target_flags & MASK_DEBUG_E)#define TARGET_DEBUG_F_MODE	(target_flags & MASK_DEBUG_F)#define TARGET_DEBUG_G_MODE	(target_flags & MASK_DEBUG_G)#define TARGET_DEBUG_H_MODE	(target_flags & MASK_DEBUG_H)#define TARGET_DEBUG_I_MODE	(target_flags & MASK_DEBUG_I)					/* Reg. Naming in .s ($21 vs. $a0) */#define TARGET_NAME_REGS	(target_flags & MASK_NAME_REGS)					/* Optimize for Sdata/Sbss */#define TARGET_GP_OPT		(target_flags & MASK_GPOPT)					/* print program statistics */#define TARGET_STATS		(target_flags & MASK_STATS)					/* call memcpy instead of inline code */#define TARGET_MEMCPY		(target_flags & MASK_MEMCPY)					/* .abicalls, etc from Pyramid V.4 */#define TARGET_ABICALLS		(target_flags & MASK_ABICALLS)					/* OSF pic references to externs */#define TARGET_HALF_PIC		(target_flags & MASK_HALF_PIC)					/* software floating point */#define TARGET_SOFT_FLOAT	(target_flags & MASK_SOFT_FLOAT)#define TARGET_HARD_FLOAT	(! TARGET_SOFT_FLOAT)					/* always call through a register */#define TARGET_LONG_CALLS	(target_flags & MASK_LONG_CALLS)					/* generate embedded PIC code;					   requires gas.  */#define TARGET_EMBEDDED_PIC	(target_flags & MASK_EMBEDDED_PIC)					/* for embedded systems, optimize for					   reduced RAM space instead of for					   fastest code.  */#define TARGET_EMBEDDED_DATA	(target_flags & MASK_EMBEDDED_DATA)					/* generate big endian code.  */#define TARGET_BIG_ENDIAN	(target_flags & MASK_BIG_ENDIAN)

⌨️ 快捷键说明

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