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

📄 i386.h

📁 Mac OS X 10.4.9 for x86 Source Code gcc 实现源代码
💻 H
📖 第 1 页 / 共 5 页
字号:
/* Definitions of target machine for GCC for IA-32.   Copyright (C) 1988, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000,   2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.This file is part of GCC.GCC 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.GCC 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 GCC; see the file COPYING.  If not, write tothe Free Software Foundation, 59 Temple Place - Suite 330,Boston, MA 02111-1307, USA.  *//* The purpose of this file is to define the characteristics of the i386,   independent of assembler syntax or operating system.   Three other files build on this one to describe a specific assembler syntax:   bsd386.h, att386.h, and sun386.h.   The actual tm.h file for a particular system should include   this file, and then the file for the appropriate assembler syntax.   Many macros that specify assembler syntax are omitted entirely from   this file because they really belong in the files for particular   assemblers.  These include RP, IP, LPREFIX, PUT_OP_SIZE, USE_STAR,   ADDR_BEG, ADDR_END, PRINT_IREG, PRINT_SCALE, PRINT_B_I_S, and many   that start with ASM_ or end in ASM_OP.  *//* Define the specific costs for a given cpu */struct processor_costs {  const int add;		/* cost of an add instruction */  const int lea;		/* cost of a lea instruction */  const int shift_var;		/* variable shift costs */  const int shift_const;	/* constant shift costs */  const int mult_init[5];	/* cost of starting a multiply				   in QImode, HImode, SImode, DImode, TImode*/  const int mult_bit;		/* cost of multiply per each bit set */  const int divide[5];		/* cost of a divide/mod				   in QImode, HImode, SImode, DImode, TImode*/  int movsx;			/* The cost of movsx operation.  */  int movzx;			/* The cost of movzx operation.  */  const int large_insn;		/* insns larger than this cost more */  const int move_ratio;		/* The threshold of number of scalar				   memory-to-memory move insns.  */  const int movzbl_load;	/* cost of loading using movzbl */  const int int_load[3];	/* cost of loading integer registers				   in QImode, HImode and SImode relative				   to reg-reg move (2).  */  const int int_store[3];	/* cost of storing integer register				   in QImode, HImode and SImode */  const int fp_move;		/* cost of reg,reg fld/fst */  const int fp_load[3];		/* cost of loading FP register				   in SFmode, DFmode and XFmode */  const int fp_store[3];	/* cost of storing FP register				   in SFmode, DFmode and XFmode */  const int mmx_move;		/* cost of moving MMX register.  */  const int mmx_load[2];	/* cost of loading MMX register				   in SImode and DImode */  const int mmx_store[2];	/* cost of storing MMX register				   in SImode and DImode */  const int sse_move;		/* cost of moving SSE register.  */  const int sse_load[3];	/* cost of loading SSE register				   in SImode, DImode and TImode*/  const int sse_store[3];	/* cost of storing SSE register				   in SImode, DImode and TImode*/  const int mmxsse_to_integer;	/* cost of moving mmxsse register to				   integer and vice versa.  */  const int prefetch_block;	/* bytes moved to cache for prefetch.  */  const int simultaneous_prefetches; /* number of parallel prefetch				   operations.  */  const int branch_cost;	/* Default value for BRANCH_COST.  */  const int fadd;		/* cost of FADD and FSUB instructions.  */  const int fmul;		/* cost of FMUL instruction.  */  const int fdiv;		/* cost of FDIV instruction.  */  const int fabs;		/* cost of FABS instruction.  */  const int fchs;		/* cost of FCHS instruction.  */  const int fsqrt;		/* cost of FSQRT instruction.  */};extern const struct processor_costs *ix86_cost;/* Run-time compilation parameters selecting different hardware subsets.  */extern int target_flags;/* Macros used in the machine description to test the flags.  *//* configure can arrange to make this 2, to force a 486.  *//* APPLE LOCAL begin mainline 2006-04-19 4434601 */#ifndef TARGET_CPU_DEFAULT#define TARGET_CPU_DEFAULT TARGET_CPU_DEFAULT_generic#endif/* APPLE LOCAL end mainline 2006-04-19 4434601 *//* APPLE LOCAL begin mainline 2005-04-11 4010614 */#ifndef TARGET_FPMATH_DEFAULT#define TARGET_FPMATH_DEFAULT \  (TARGET_64BIT && TARGET_SSE ? FPMATH_SSE : FPMATH_387)#endif/* APPLE LOCAL end mainline 2005-04-11 4010614 *//* Masks for the -m switches */#define MASK_80387		0x00000001	/* Hardware floating point */#define MASK_RTD		0x00000002	/* Use ret that pops args */#define MASK_ALIGN_DOUBLE	0x00000004	/* align doubles to 2 word boundary */#define MASK_SVR3_SHLIB		0x00000008	/* Uninit locals into bss */#define MASK_IEEE_FP		0x00000010	/* IEEE fp comparisons */#define MASK_FLOAT_RETURNS	0x00000020	/* Return float in st(0) */#define MASK_NO_FANCY_MATH_387	0x00000040	/* Disable sin, cos, sqrt */#define MASK_OMIT_LEAF_FRAME_POINTER 0x080      /* omit leaf frame pointers */#define MASK_STACK_PROBE	0x00000100	/* Enable stack probing */#define MASK_NO_ALIGN_STROPS	0x00000200	/* Enable aligning of string ops.  */#define MASK_INLINE_ALL_STROPS	0x00000400	/* Inline stringops in all cases */#define MASK_NO_PUSH_ARGS	0x00000800	/* Use push instructions */#define MASK_ACCUMULATE_OUTGOING_ARGS 0x00001000/* Accumulate outgoing args */#define MASK_MMX		0x00002000	/* Support MMX regs/builtins */#define MASK_SSE		0x00004000	/* Support SSE regs/builtins */#define MASK_SSE2		0x00008000	/* Support SSE2 regs/builtins */#define MASK_SSE3		0x00010000	/* Support SSE3 regs/builtins */#define MASK_3DNOW		0x00020000	/* Support 3Dnow builtins */#define MASK_3DNOW_A		0x00040000	/* Support Athlon 3Dnow builtins */#define MASK_128BIT_LONG_DOUBLE 0x00080000	/* long double size is 128bit */#define MASK_64BIT		0x00100000	/* Produce 64bit code */#define MASK_MS_BITFIELD_LAYOUT 0x00200000	/* Use native (MS) bitfield layout */#define MASK_TLS_DIRECT_SEG_REFS 0x00400000	/* Avoid adding %gs:0  *//* APPLE LOCAL begin regparmandstackparm; delete at 4.1 merge (when i386.opt file appears) */#define MASK_SSEREGPARM		0x01000000	/* Pass float & double in SSE regs */#define TARGET_SSEREGPARM (target_flags & MASK_SSEREGPARM)/* APPLE LOCAL end regparmandstackparm; delete at 4.1 merge (when i386.opt file appears) *//* APPLE LOCAL mni */#define MASK_MNI		0x02000000/* Unused:			0x03e0000	*//* APPLE LOCAL begin AT&T-style stub 4164563 */#define MACHOPIC_NL_SYMBOL_PTR_SECTION ".section __IMPORT,__pointers,non_lazy_symbol_pointers"/* APPLE LOCAL end AT&T-style stub 4164563 *//* ... overlap with subtarget options starts by 0x04000000.  */#define MASK_NO_RED_ZONE	0x04000000	/* Do not use red zone *//* Use the floating point instructions */#define TARGET_80387 (target_flags & MASK_80387)/* Compile using ret insn that pops args.   This will not work unless you use prototypes at least   for all functions that can take varying numbers of args.  */#define TARGET_RTD (target_flags & MASK_RTD)/* Align doubles to a two word boundary.  This breaks compatibility with   the published ABI's for structures containing doubles, but produces   faster code on the pentium.  */#define TARGET_ALIGN_DOUBLE (target_flags & MASK_ALIGN_DOUBLE)/* Use push instructions to save outgoing args.  */#define TARGET_PUSH_ARGS (!(target_flags & MASK_NO_PUSH_ARGS))/* Accumulate stack adjustments to prologue/epilogue.  */#define TARGET_ACCUMULATE_OUTGOING_ARGS \ (target_flags & MASK_ACCUMULATE_OUTGOING_ARGS)/* Put uninitialized locals into bss, not data.   Meaningful only on svr3.  */#define TARGET_SVR3_SHLIB (target_flags & MASK_SVR3_SHLIB)/* Use IEEE floating point comparisons.  These handle correctly the cases   where the result of a comparison is unordered.  Normally SIGFPE is   generated in such cases, in which case this isn't needed.  */#define TARGET_IEEE_FP (target_flags & MASK_IEEE_FP)/* Functions that return a floating point value may return that value   in the 387 FPU or in 386 integer registers.  If set, this flag causes   the 387 to be used, which is compatible with most calling conventions.  */#define TARGET_FLOAT_RETURNS_IN_80387 (target_flags & MASK_FLOAT_RETURNS)/* Long double is 128bit instead of 96bit, even when only 80bits are used.   This mode wastes cache, but avoid misaligned data accesses and simplifies   address calculations.  */#define TARGET_128BIT_LONG_DOUBLE (target_flags & MASK_128BIT_LONG_DOUBLE)/* Disable generation of FP sin, cos and sqrt operations for 387.   This is because FreeBSD lacks these in the math-emulator-code */#define TARGET_NO_FANCY_MATH_387 (target_flags & MASK_NO_FANCY_MATH_387)/* Generate 387 floating point intrinsics for the current target.  */#define TARGET_USE_FANCY_MATH_387 (! TARGET_NO_FANCY_MATH_387)/* Don't create frame pointers for leaf functions */#define TARGET_OMIT_LEAF_FRAME_POINTER \  (target_flags & MASK_OMIT_LEAF_FRAME_POINTER)/* Debug GO_IF_LEGITIMATE_ADDRESS */#define TARGET_DEBUG_ADDR (ix86_debug_addr_string != 0)/* Debug FUNCTION_ARG macros */#define TARGET_DEBUG_ARG (ix86_debug_arg_string != 0)/* 64bit Sledgehammer mode.  For libgcc2 we make sure this is a   compile-time constant.  */#ifdef IN_LIBGCC2#ifdef __x86_64__#define TARGET_64BIT 1#else#define TARGET_64BIT 0#endif#else#ifdef TARGET_BI_ARCH#define TARGET_64BIT (target_flags & MASK_64BIT)#else#if TARGET_64BIT_DEFAULT#define TARGET_64BIT 1#else#define TARGET_64BIT 0#endif#endif#endif#define HAS_LONG_COND_BRANCH 1#define HAS_LONG_UNCOND_BRANCH 1/* Avoid adding %gs:0 in TLS references; use %gs:address directly.  */#define TARGET_TLS_DIRECT_SEG_REFS (target_flags & MASK_TLS_DIRECT_SEG_REFS)#define TARGET_386 (ix86_tune == PROCESSOR_I386)#define TARGET_486 (ix86_tune == PROCESSOR_I486)#define TARGET_PENTIUM (ix86_tune == PROCESSOR_PENTIUM)#define TARGET_PENTIUMPRO (ix86_tune == PROCESSOR_PENTIUMPRO)#define TARGET_K6 (ix86_tune == PROCESSOR_K6)#define TARGET_ATHLON (ix86_tune == PROCESSOR_ATHLON)#define TARGET_PENTIUM4 (ix86_tune == PROCESSOR_PENTIUM4)#define TARGET_K8 (ix86_tune == PROCESSOR_K8)#define TARGET_ATHLON_K8 (TARGET_K8 || TARGET_ATHLON)#define TARGET_NOCONA (ix86_tune == PROCESSOR_NOCONA)/* APPLE LOCAL begin mainline 2006-04-19 4434601 */#define TARGET_GENERIC32 (ix86_tune == PROCESSOR_GENERIC32)#define TARGET_GENERIC64 (ix86_tune == PROCESSOR_GENERIC64)#define TARGET_GENERIC (TARGET_GENERIC32 || TARGET_GENERIC64)/* APPLE LOCAL end mainline 2006-04-19 4434601 */#define TUNEMASK (1 << ix86_tune)extern const int x86_use_leave, x86_push_memory, x86_zero_extend_with_and;/* APPLE LOCAL mainline 2005-03-16 4054919 */extern const int x86_use_bit_test, x86_cmove, x86_fisttp, x86_deep_branch;extern const int x86_branch_hints, x86_unroll_strlen;extern const int x86_double_with_add, x86_partial_reg_stall, x86_movx;extern const int x86_use_loop, x86_use_fiop, x86_use_mov0;extern const int x86_use_cltd, x86_read_modify_write;extern const int x86_read_modify, x86_split_long_moves;extern const int x86_promote_QImode, x86_single_stringop, x86_fast_prefix;extern const int x86_himode_math, x86_qimode_math, x86_promote_qi_regs;extern const int x86_promote_hi_regs, x86_integer_DFmode_moves;extern const int x86_add_esp_4, x86_add_esp_8, x86_sub_esp_4, x86_sub_esp_8;extern const int x86_partial_reg_dependency, x86_memory_mismatch_stall;extern const int x86_accumulate_outgoing_args, x86_prologue_using_move;extern const int x86_epilogue_using_move, x86_decompose_lea;extern const int x86_arch_always_fancy_math_387, x86_shift1;extern const int x86_sse_partial_reg_dependency, x86_sse_split_regs;extern const int x86_sse_typeless_stores, x86_sse_load0_by_pxor;extern const int x86_use_ffreep;extern const int x86_inter_unit_moves, x86_schedule;extern const int x86_use_bt;/* APPLE LOCAL begin mainline 2006-04-19 4434601 */extern const int x86_use_incdec;extern const int x86_pad_returns;/* APPLE LOCAL end mainline 2006-04-19 4434601 */extern int x86_prefetch_sse;#define TARGET_USE_LEAVE (x86_use_leave & TUNEMASK)#define TARGET_PUSH_MEMORY (x86_push_memory & TUNEMASK)#define TARGET_ZERO_EXTEND_WITH_AND (x86_zero_extend_with_and & TUNEMASK)#define TARGET_USE_BIT_TEST (x86_use_bit_test & TUNEMASK)#define TARGET_UNROLL_STRLEN (x86_unroll_strlen & TUNEMASK)/* For sane SSE instruction set generation we need fcomi instruction.  It is   safe to enable all CMOVE instructions.  */#define TARGET_CMOVE ((x86_cmove & (1 << ix86_arch)) || TARGET_SSE)/* APPLE LOCAL mainline 2005-03-16 4054919 *//* APPLE LOCAL begin mainline 2005-10-05 4196991 */#define TARGET_FISTTP (((x86_fisttp & (1 << ix86_arch)) || TARGET_SSE3) \			&& TARGET_80387)/* APPLE LOCAL end mainline 2005-10-05 4196991 */#define TARGET_DEEP_BRANCH_PREDICTION (x86_deep_branch & TUNEMASK)#define TARGET_BRANCH_PREDICTION_HINTS (x86_branch_hints & TUNEMASK)#define TARGET_DOUBLE_WITH_ADD (x86_double_with_add & TUNEMASK)#define TARGET_USE_SAHF ((x86_use_sahf & TUNEMASK) && !TARGET_64BIT)#define TARGET_MOVX (x86_movx & TUNEMASK)#define TARGET_PARTIAL_REG_STALL (x86_partial_reg_stall & TUNEMASK)#define TARGET_USE_LOOP (x86_use_loop & TUNEMASK)#define TARGET_USE_FIOP (x86_use_fiop & TUNEMASK)#define TARGET_USE_MOV0 (x86_use_mov0 & TUNEMASK)#define TARGET_USE_CLTD (x86_use_cltd & TUNEMASK)#define TARGET_SPLIT_LONG_MOVES (x86_split_long_moves & TUNEMASK)#define TARGET_READ_MODIFY_WRITE (x86_read_modify_write & TUNEMASK)#define TARGET_READ_MODIFY (x86_read_modify & TUNEMASK)#define TARGET_PROMOTE_QImode (x86_promote_QImode & TUNEMASK)#define TARGET_FAST_PREFIX (x86_fast_prefix & TUNEMASK)#define TARGET_SINGLE_STRINGOP (x86_single_stringop & TUNEMASK)#define TARGET_QIMODE_MATH (x86_qimode_math & TUNEMASK)#define TARGET_HIMODE_MATH (x86_himode_math & TUNEMASK)#define TARGET_PROMOTE_QI_REGS (x86_promote_qi_regs & TUNEMASK)#define TARGET_PROMOTE_HI_REGS (x86_promote_hi_regs & TUNEMASK)#define TARGET_ADD_ESP_4 (x86_add_esp_4 & TUNEMASK)#define TARGET_ADD_ESP_8 (x86_add_esp_8 & TUNEMASK)#define TARGET_SUB_ESP_4 (x86_sub_esp_4 & TUNEMASK)#define TARGET_SUB_ESP_8 (x86_sub_esp_8 & TUNEMASK)#define TARGET_INTEGER_DFMODE_MOVES (x86_integer_DFmode_moves & TUNEMASK)#define TARGET_PARTIAL_REG_DEPENDENCY (x86_partial_reg_dependency & TUNEMASK)#define TARGET_SSE_PARTIAL_REG_DEPENDENCY \				      (x86_sse_partial_reg_dependency & TUNEMASK)#define TARGET_SSE_SPLIT_REGS (x86_sse_split_regs & TUNEMASK)#define TARGET_SSE_TYPELESS_STORES (x86_sse_typeless_stores & TUNEMASK)#define TARGET_SSE_LOAD0_BY_PXOR (x86_sse_load0_by_pxor & TUNEMASK)

⌨️ 快捷键说明

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