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

📄 i386.md

📁 linux下编程用 编译软件
💻 MD
📖 第 1 页 / 共 5 页
字号:
;; GCC machine description for IA-32 and x86-64.;; Copyright (C) 1988, 1994, 1995, 1996, 1997, 1998, 1999, 2000,;; 2001, 2002, 2003, 2004, 2005;; Free Software Foundation, Inc.;; Mostly by William Schelter.;; x86_64 support added by Jan Hubicka;;;; This file is part of GCC.;;;; GCC is free software; you can redistribute it and/or modify;; it under the terms of the GNU General Public License as published by;; the 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 of;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the;; GNU General Public License for more details.;;;; You should have received a copy of the GNU General Public License;; along with GCC; see the file COPYING.  If not, write to;; the Free Software Foundation, 51 Franklin Street, Fifth Floor,;; Boston, MA 02110-1301, USA.  */;;;; The original PO technology requires these to be ordered by speed,;; so that assigner will pick the fastest.;;;; See file "rtl.def" for documentation on define_insn, match_*, et. al.;;;; Macro REG_CLASS_FROM_LETTER in file i386.h defines the register;; constraint letters.;;;; The special asm out single letter directives following a '%' are:;; 'z' mov%z1 would be movl, movw, or movb depending on the mode of;;     operands[1].;; 'L' Print the opcode suffix for a 32-bit integer opcode.;; 'W' Print the opcode suffix for a 16-bit integer opcode.;; 'B' Print the opcode suffix for an 8-bit integer opcode.;; 'Q' Print the opcode suffix for a 64-bit float opcode.;; 'S' Print the opcode suffix for a 32-bit float opcode.;; 'T' Print the opcode suffix for an 80-bit extended real XFmode float opcode.;; 'J' Print the appropriate jump operand.;;;; 'b' Print the QImode name of the register for the indicated operand.;;     %b0 would print %al if operands[0] is reg 0.;; 'w' Likewise, print the HImode name of the register.;; 'k' Likewise, print the SImode name of the register.;; 'h' Print the QImode name for a "high" register, either ah, bh, ch or dh.;; 'y' Print "st(0)" instead of "st" as a register.;; UNSPEC usage:(define_constants  [; Relocation specifiers   (UNSPEC_GOT			0)   (UNSPEC_GOTOFF		1)   (UNSPEC_GOTPCREL		2)   (UNSPEC_GOTTPOFF		3)   (UNSPEC_TPOFF		4)   (UNSPEC_NTPOFF		5)   (UNSPEC_DTPOFF		6)   (UNSPEC_GOTNTPOFF		7)   (UNSPEC_INDNTPOFF		8)   ; Prologue support   (UNSPEC_STACK_ALLOC		11)   (UNSPEC_SET_GOT		12)   (UNSPEC_SSE_PROLOGUE_SAVE	13)   (UNSPEC_REG_SAVE		14)   (UNSPEC_DEF_CFA		15)   ; TLS support   (UNSPEC_TP			16)   (UNSPEC_TLS_GD		17)   (UNSPEC_TLS_LD_BASE		18)   ; Other random patterns   (UNSPEC_SCAS			20)   (UNSPEC_FNSTSW		21)   (UNSPEC_SAHF			22)   (UNSPEC_FSTCW		23)   (UNSPEC_ADD_CARRY		24)   (UNSPEC_FLDCW		25)   (UNSPEC_REP			26)   (UNSPEC_EH_RETURN		27)   ; For SSE/MMX support:   (UNSPEC_FIX_NOTRUNC		30)   (UNSPEC_MASKMOV		31)   (UNSPEC_MOVMSK		32)   (UNSPEC_MOVNT		33)   (UNSPEC_MOVU			34)   (UNSPEC_RCP			35)   (UNSPEC_RSQRT		36)   (UNSPEC_SFENCE		37)   (UNSPEC_NOP			38)	; prevents combiner cleverness   (UNSPEC_PFRCP		39)   (UNSPEC_PFRCPIT1		40)   (UNSPEC_PFRCPIT2		41)   (UNSPEC_PFRSQRT		42)   (UNSPEC_PFRSQIT1		43)   (UNSPEC_MFENCE		44)   (UNSPEC_LFENCE		45)   (UNSPEC_PSADBW		46)   (UNSPEC_LDQQU		47)   ; Generic math support   (UNSPEC_COPYSIGN		50)   (UNSPEC_IEEE_MIN		51)	; not commutative   (UNSPEC_IEEE_MAX		52)	; not commutative   ; x87 Floating point   (UNSPEC_SIN			60)   (UNSPEC_COS			61)   (UNSPEC_FPATAN		62)   (UNSPEC_FYL2X		63)   (UNSPEC_FYL2XP1		64)   (UNSPEC_FRNDINT		65)   (UNSPEC_FIST			66)   (UNSPEC_F2XM1		67)   ; x87 Rounding   (UNSPEC_FRNDINT_FLOOR	70)   (UNSPEC_FRNDINT_CEIL 	71)   (UNSPEC_FRNDINT_TRUNC	72)   (UNSPEC_FRNDINT_MASK_PM	73)   (UNSPEC_FIST_FLOOR		74)   (UNSPEC_FIST_CEIL 		75)   ; x87 Double output FP   (UNSPEC_SINCOS_COS		80)   (UNSPEC_SINCOS_SIN		81)   (UNSPEC_TAN_ONE		82)   (UNSPEC_TAN_TAN		83)   (UNSPEC_XTRACT_FRACT		84)   (UNSPEC_XTRACT_EXP		85)   (UNSPEC_FSCALE_FRACT		86)   (UNSPEC_FSCALE_EXP		87)   (UNSPEC_FPREM_F		88)   (UNSPEC_FPREM_U		89)   (UNSPEC_FPREM1_F		90)   (UNSPEC_FPREM1_U		91)   ; SSP patterns   (UNSPEC_SP_SET		100)   (UNSPEC_SP_TEST		101)   (UNSPEC_SP_TLS_SET		102)   (UNSPEC_SP_TLS_TEST		103)  ])(define_constants  [(UNSPECV_BLOCKAGE		0)   (UNSPECV_STACK_PROBE		1)   (UNSPECV_EMMS		2)   (UNSPECV_LDMXCSR		3)   (UNSPECV_STMXCSR		4)   (UNSPECV_FEMMS		5)   (UNSPECV_CLFLUSH		6)   (UNSPECV_ALIGN		7)   (UNSPECV_MONITOR		8)   (UNSPECV_MWAIT		9)   (UNSPECV_CMPXCHG_1		10)   (UNSPECV_CMPXCHG_2		11)   (UNSPECV_XCHG		12)   (UNSPECV_LOCK		13)  ]);; Registers by name.(define_constants  [(BP_REG			 6)   (SP_REG			 7)   (FLAGS_REG			17)   (FPSR_REG			18)   (DIRFLAG_REG			19)  ]);; Insns whose names begin with "x86_" are emitted by gen_FOO calls;; from i386.c.;; In C guard expressions, put expressions which may be compile-time;; constants first.  This allows for better optimization.  For;; example, write "TARGET_64BIT && reload_completed", not;; "reload_completed && TARGET_64BIT".;; Processor type.  This attribute must exactly match the processor_type;; enumeration in i386.h.(define_attr "cpu" "i386,i486,pentium,pentiumpro,k6,athlon,pentium4,k8,nocona"  (const (symbol_ref "ix86_tune")));; A basic instruction type.  Refinements due to arguments to be;; provided in other attributes.(define_attr "type"  "other,multi,   alu,alu1,negnot,imov,imovx,lea,   incdec,ishift,ishift1,rotate,rotate1,imul,idiv,   icmp,test,ibr,setcc,icmov,   push,pop,call,callv,leave,   str,cld,   fmov,fop,fsgn,fmul,fdiv,fpspc,fcmov,fcmp,fxch,fistp,fisttp,frndint,   sselog,sselog1,sseiadd,sseishft,sseimul,   sse,ssemov,sseadd,ssemul,ssecmp,ssecomi,ssecvt,sseicvt,ssediv,   mmx,mmxmov,mmxadd,mmxmul,mmxcmp,mmxcvt,mmxshft"  (const_string "other"));; Main data type used by the insn(define_attr "mode"  "unknown,none,QI,HI,SI,DI,SF,DF,XF,TI,V4SF,V2DF,V2SF,V1DF"  (const_string "unknown"));; The CPU unit operations uses.(define_attr "unit" "integer,i387,sse,mmx,unknown"  (cond [(eq_attr "type" "fmov,fop,fsgn,fmul,fdiv,fpspc,fcmov,fcmp,fxch,fistp,fisttp,frndint")	   (const_string "i387")	 (eq_attr "type" "sselog,sselog1,sseiadd,sseishft,sseimul,			  sse,ssemov,sseadd,ssemul,ssecmp,ssecomi,ssecvt,sseicvt,ssediv")	   (const_string "sse")	 (eq_attr "type" "mmx,mmxmov,mmxadd,mmxmul,mmxcmp,mmxcvt,mmxshft")	   (const_string "mmx")	 (eq_attr "type" "other")	   (const_string "unknown")]	 (const_string "integer")));; The (bounding maximum) length of an instruction immediate.(define_attr "length_immediate" ""  (cond [(eq_attr "type" "incdec,setcc,icmov,str,cld,lea,other,multi,idiv,leave")	   (const_int 0)	 (eq_attr "unit" "i387,sse,mmx")	   (const_int 0)	 (eq_attr "type" "alu,alu1,negnot,imovx,ishift,rotate,ishift1,rotate1,			  imul,icmp,push,pop")	   (symbol_ref "ix86_attr_length_immediate_default(insn,1)")	 (eq_attr "type" "imov,test")	   (symbol_ref "ix86_attr_length_immediate_default(insn,0)")	 (eq_attr "type" "call")	   (if_then_else (match_operand 0 "constant_call_address_operand" "")	     (const_int 4)	     (const_int 0))	 (eq_attr "type" "callv")	   (if_then_else (match_operand 1 "constant_call_address_operand" "")	     (const_int 4)	     (const_int 0))	 ;; We don't know the size before shorten_branches.  Expect	 ;; the instruction to fit for better scheduling.	 (eq_attr "type" "ibr")	   (const_int 1)	 ]	 (symbol_ref "/* Update immediate_length and other attributes! */		      gcc_unreachable (),1")));; The (bounding maximum) length of an instruction address.(define_attr "length_address" ""  (cond [(eq_attr "type" "str,cld,other,multi,fxch")	   (const_int 0)	 (and (eq_attr "type" "call")	      (match_operand 0 "constant_call_address_operand" ""))	     (const_int 0)	 (and (eq_attr "type" "callv")	      (match_operand 1 "constant_call_address_operand" ""))	     (const_int 0)	 ]	 (symbol_ref "ix86_attr_length_address_default (insn)")));; Set when length prefix is used.(define_attr "prefix_data16" ""  (if_then_else (ior (eq_attr "mode" "HI")		     (and (eq_attr "unit" "sse") (eq_attr "mode" "V2DF")))    (const_int 1)    (const_int 0)));; Set when string REP prefix is used.(define_attr "prefix_rep" ""   (if_then_else (and (eq_attr "unit" "sse") (eq_attr "mode" "SF,DF"))    (const_int 1)    (const_int 0)));; Set when 0f opcode prefix is used.(define_attr "prefix_0f" ""  (if_then_else     (ior (eq_attr "type" "imovx,setcc,icmov")	 (eq_attr "unit" "sse,mmx"))    (const_int 1)    (const_int 0)));; Set when REX opcode prefix is used.(define_attr "prefix_rex" ""  (cond [(and (eq_attr "mode" "DI")  	      (eq_attr "type" "!push,pop,call,callv,leave,ibr"))	   (const_int 1)	 (and (eq_attr "mode" "QI")	      (ne (symbol_ref "x86_extended_QIreg_mentioned_p (insn)")		  (const_int 0)))	   (const_int 1)	 (ne (symbol_ref "x86_extended_reg_mentioned_p (insn)")	     (const_int 0))	   (const_int 1)	]	(const_int 0)));; Set when modrm byte is used.(define_attr "modrm" ""  (cond [(eq_attr "type" "str,cld,leave")	   (const_int 0)	 (eq_attr "unit" "i387")	   (const_int 0)         (and (eq_attr "type" "incdec")	      (ior (match_operand:SI 1 "register_operand" "")		   (match_operand:HI 1 "register_operand" "")))	   (const_int 0)	 (and (eq_attr "type" "push")	      (not (match_operand 1 "memory_operand" "")))	   (const_int 0)	 (and (eq_attr "type" "pop")	      (not (match_operand 0 "memory_operand" "")))	   (const_int 0)	 (and (eq_attr "type" "imov")	      (and (match_operand 0 "register_operand" "")	           (match_operand 1 "immediate_operand" "")))	   (const_int 0)	 (and (eq_attr "type" "call")	      (match_operand 0 "constant_call_address_operand" ""))	     (const_int 0)	 (and (eq_attr "type" "callv")	      (match_operand 1 "constant_call_address_operand" ""))	     (const_int 0)	 ]	 (const_int 1)));; The (bounding maximum) length of an instruction in bytes.;; ??? fistp and frndint are in fact fldcw/{fistp,frndint}/fldcw sequences.;; Later we may want to split them and compute proper length as for;; other insns.(define_attr "length" ""  (cond [(eq_attr "type" "other,multi,fistp,frndint")	   (const_int 16)	 (eq_attr "type" "fcmp")	   (const_int 4)	 (eq_attr "unit" "i387")	   (plus (const_int 2)		 (plus (attr "prefix_data16")		       (attr "length_address")))]	 (plus (plus (attr "modrm")		     (plus (attr "prefix_0f")			   (plus (attr "prefix_rex")				 (const_int 1))))	       (plus (attr "prefix_rep")		     (plus (attr "prefix_data16")			   (plus (attr "length_immediate")				 (attr "length_address")))))));; The `memory' attribute is `none' if no memory is referenced, `load' or;; `store' if there is a simple memory reference therein, or `unknown';; if the instruction is complex.(define_attr "memory" "none,load,store,both,unknown"  (cond [(eq_attr "type" "other,multi,str")	   (const_string "unknown")	 (eq_attr "type" "lea,fcmov,fpspc,cld")	   (const_string "none")	 (eq_attr "type" "fistp,leave")	   (const_string "both")	 (eq_attr "type" "frndint")	   (const_string "load")	 (eq_attr "type" "push")	   (if_then_else (match_operand 1 "memory_operand" "")	     (const_string "both")	     (const_string "store"))	 (eq_attr "type" "pop")	   (if_then_else (match_operand 0 "memory_operand" "")	     (const_string "both")	     (const_string "load"))	 (eq_attr "type" "setcc")	   (if_then_else (match_operand 0 "memory_operand" "")	     (const_string "store")	     (const_string "none"))	 (eq_attr "type" "icmp,test,ssecmp,ssecomi,mmxcmp,fcmp")	   (if_then_else (ior (match_operand 0 "memory_operand" "")			      (match_operand 1 "memory_operand" ""))	     (const_string "load")	     (const_string "none"))	 (eq_attr "type" "ibr")	   (if_then_else (match_operand 0 "memory_operand" "")	     (const_string "load")	     (const_string "none"))	 (eq_attr "type" "call")	   (if_then_else (match_operand 0 "constant_call_address_operand" "")	     (const_string "none")	     (const_string "load"))	 (eq_attr "type" "callv")	   (if_then_else (match_operand 1 "constant_call_address_operand" "")	     (const_string "none")	     (const_string "load"))	 (and (eq_attr "type" "alu1,negnot,ishift1,sselog1")	      (match_operand 1 "memory_operand" ""))	   (const_string "both")	 (and (match_operand 0 "memory_operand" "")	      (match_operand 1 "memory_operand" ""))	   (const_string "both")	 (match_operand 0 "memory_operand" "")	   (const_string "store")	 (match_operand 1 "memory_operand" "")	   (const_string "load")	 (and (eq_attr "type"		 "!alu1,negnot,ishift1,		   imov,imovx,icmp,test,		   fmov,fcmp,fsgn,		   sse,ssemov,ssecmp,ssecomi,ssecvt,sseicvt,sselog1,		   mmx,mmxmov,mmxcmp,mmxcvt")	      (match_operand 2 "memory_operand" ""))	   (const_string "load")	 (and (eq_attr "type" "icmov")	      (match_operand 3 "memory_operand" ""))	   (const_string "load")	]	(const_string "none")))

⌨️ 快捷键说明

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