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

📄 i386.md

📁 gcc-you can use this code to learn something about gcc, and inquire further into linux,
💻 MD
📖 第 1 页 / 共 5 页
字号:
{  if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM)    operands[0] = force_reg (HImode, operands[0]);  ix86_compare_op0 = operands[0];  ix86_compare_op1 = operands[1];  DONE;})(define_expand "cmpqi"  [(set (reg:CC 17)	(compare:CC (match_operand:QI 0 "nonimmediate_operand" "")		    (match_operand:QI 1 "general_operand" "")))]  "TARGET_QIMODE_MATH"{  if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM)    operands[0] = force_reg (QImode, operands[0]);  ix86_compare_op0 = operands[0];  ix86_compare_op1 = operands[1];  DONE;})(define_insn "cmpdi_ccno_1_rex64"  [(set (reg 17)	(compare (match_operand:DI 0 "nonimmediate_operand" "r,?mr")		 (match_operand:DI 1 "const0_operand" "n,n")))]  "TARGET_64BIT && ix86_match_ccmode (insn, CCNOmode)"  "@   test{q}\t{%0, %0|%0, %0}   cmp{q}\t{%1, %0|%0, %1}"  [(set_attr "type" "test,icmp")   (set_attr "length_immediate" "0,1")   (set_attr "mode" "DI")])(define_insn "*cmpdi_minus_1_rex64"  [(set (reg 17)	(compare (minus:DI (match_operand:DI 0 "nonimmediate_operand" "rm,r")			   (match_operand:DI 1 "x86_64_general_operand" "re,mr"))		 (const_int 0)))]  "TARGET_64BIT && ix86_match_ccmode (insn, CCGOCmode)"  "cmp{q}\t{%1, %0|%0, %1}"  [(set_attr "type" "icmp")   (set_attr "mode" "DI")])(define_expand "cmpdi_1_rex64"  [(set (reg:CC 17)	(compare:CC (match_operand:DI 0 "nonimmediate_operand" "")		    (match_operand:DI 1 "general_operand" "")))]  "TARGET_64BIT"  "")(define_insn "cmpdi_1_insn_rex64"  [(set (reg 17)	(compare (match_operand:DI 0 "nonimmediate_operand" "mr,r")		 (match_operand:DI 1 "x86_64_general_operand" "re,mr")))]  "TARGET_64BIT && ix86_match_ccmode (insn, CCmode)"  "cmp{q}\t{%1, %0|%0, %1}"  [(set_attr "type" "icmp")   (set_attr "mode" "DI")])(define_insn "*cmpsi_ccno_1"  [(set (reg 17)	(compare (match_operand:SI 0 "nonimmediate_operand" "r,?mr")		 (match_operand:SI 1 "const0_operand" "n,n")))]  "ix86_match_ccmode (insn, CCNOmode)"  "@   test{l}\t{%0, %0|%0, %0}   cmp{l}\t{%1, %0|%0, %1}"  [(set_attr "type" "test,icmp")   (set_attr "length_immediate" "0,1")   (set_attr "mode" "SI")])(define_insn "*cmpsi_minus_1"  [(set (reg 17)	(compare (minus:SI (match_operand:SI 0 "nonimmediate_operand" "rm,r")			   (match_operand:SI 1 "general_operand" "ri,mr"))		 (const_int 0)))]  "ix86_match_ccmode (insn, CCGOCmode)"  "cmp{l}\t{%1, %0|%0, %1}"  [(set_attr "type" "icmp")   (set_attr "mode" "SI")])(define_expand "cmpsi_1"  [(set (reg:CC 17)	(compare:CC (match_operand:SI 0 "nonimmediate_operand" "rm,r")		    (match_operand:SI 1 "general_operand" "ri,mr")))]  ""  "")(define_insn "*cmpsi_1_insn"  [(set (reg 17)	(compare (match_operand:SI 0 "nonimmediate_operand" "rm,r")		 (match_operand:SI 1 "general_operand" "ri,mr")))]  "(GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)    && ix86_match_ccmode (insn, CCmode)"  "cmp{l}\t{%1, %0|%0, %1}"  [(set_attr "type" "icmp")   (set_attr "mode" "SI")])(define_insn "*cmphi_ccno_1"  [(set (reg 17)	(compare (match_operand:HI 0 "nonimmediate_operand" "r,?mr")		 (match_operand:HI 1 "const0_operand" "n,n")))]  "ix86_match_ccmode (insn, CCNOmode)"  "@   test{w}\t{%0, %0|%0, %0}   cmp{w}\t{%1, %0|%0, %1}"  [(set_attr "type" "test,icmp")   (set_attr "length_immediate" "0,1")   (set_attr "mode" "HI")])(define_insn "*cmphi_minus_1"  [(set (reg 17)	(compare (minus:HI (match_operand:HI 0 "nonimmediate_operand" "rm,r")			   (match_operand:HI 1 "general_operand" "ri,mr"))		 (const_int 0)))]  "ix86_match_ccmode (insn, CCGOCmode)"  "cmp{w}\t{%1, %0|%0, %1}"  [(set_attr "type" "icmp")   (set_attr "mode" "HI")])(define_insn "*cmphi_1"  [(set (reg 17)	(compare (match_operand:HI 0 "nonimmediate_operand" "rm,r")		 (match_operand:HI 1 "general_operand" "ri,mr")))]  "(GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)   && ix86_match_ccmode (insn, CCmode)"  "cmp{w}\t{%1, %0|%0, %1}"  [(set_attr "type" "icmp")   (set_attr "mode" "HI")])(define_insn "*cmpqi_ccno_1"  [(set (reg 17)	(compare (match_operand:QI 0 "nonimmediate_operand" "q,?mq")		 (match_operand:QI 1 "const0_operand" "n,n")))]  "ix86_match_ccmode (insn, CCNOmode)"  "@   test{b}\t{%0, %0|%0, %0}   cmp{b}\t{$0, %0|%0, 0}"  [(set_attr "type" "test,icmp")   (set_attr "length_immediate" "0,1")   (set_attr "mode" "QI")])(define_insn "*cmpqi_1"  [(set (reg 17)	(compare (match_operand:QI 0 "nonimmediate_operand" "qm,q")		 (match_operand:QI 1 "general_operand" "qi,mq")))]  "(GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)    && ix86_match_ccmode (insn, CCmode)"  "cmp{b}\t{%1, %0|%0, %1}"  [(set_attr "type" "icmp")   (set_attr "mode" "QI")])(define_insn "*cmpqi_minus_1"  [(set (reg 17)	(compare (minus:QI (match_operand:QI 0 "nonimmediate_operand" "qm,q")			   (match_operand:QI 1 "general_operand" "qi,mq"))		 (const_int 0)))]  "ix86_match_ccmode (insn, CCGOCmode)"  "cmp{b}\t{%1, %0|%0, %1}"  [(set_attr "type" "icmp")   (set_attr "mode" "QI")])(define_insn "*cmpqi_ext_1"  [(set (reg 17)	(compare	  (match_operand:QI 0 "general_operand" "Qm")	  (subreg:QI	    (zero_extract:SI	      (match_operand 1 "ext_register_operand" "Q")	      (const_int 8)	      (const_int 8)) 0)))]  "!TARGET_64BIT && ix86_match_ccmode (insn, CCmode)"  "cmp{b}\t{%h1, %0|%0, %h1}"  [(set_attr "type" "icmp")   (set_attr "mode" "QI")])(define_insn "*cmpqi_ext_1_rex64"  [(set (reg 17)	(compare	  (match_operand:QI 0 "register_operand" "Q")	  (subreg:QI	    (zero_extract:SI	      (match_operand 1 "ext_register_operand" "Q")	      (const_int 8)	      (const_int 8)) 0)))]  "TARGET_64BIT && ix86_match_ccmode (insn, CCmode)"  "cmp{b}\t{%h1, %0|%0, %h1}"  [(set_attr "type" "icmp")   (set_attr "mode" "QI")])(define_insn "*cmpqi_ext_2"  [(set (reg 17)	(compare	  (subreg:QI	    (zero_extract:SI	      (match_operand 0 "ext_register_operand" "Q")	      (const_int 8)	      (const_int 8)) 0)	  (match_operand:QI 1 "const0_operand" "n")))]  "ix86_match_ccmode (insn, CCNOmode)"  "test{b}\t%h0, %h0"  [(set_attr "type" "test")   (set_attr "length_immediate" "0")   (set_attr "mode" "QI")])(define_expand "cmpqi_ext_3"  [(set (reg:CC 17)	(compare:CC	  (subreg:QI	    (zero_extract:SI	      (match_operand 0 "ext_register_operand" "")	      (const_int 8)	      (const_int 8)) 0)	  (match_operand:QI 1 "general_operand" "")))]  ""  "")(define_insn "cmpqi_ext_3_insn"  [(set (reg 17)	(compare	  (subreg:QI	    (zero_extract:SI	      (match_operand 0 "ext_register_operand" "Q")	      (const_int 8)	      (const_int 8)) 0)	  (match_operand:QI 1 "general_operand" "Qmn")))]  "!TARGET_64BIT && ix86_match_ccmode (insn, CCmode)"  "cmp{b}\t{%1, %h0|%h0, %1}"  [(set_attr "type" "icmp")   (set_attr "mode" "QI")])(define_insn "cmpqi_ext_3_insn_rex64"  [(set (reg 17)	(compare	  (subreg:QI	    (zero_extract:SI	      (match_operand 0 "ext_register_operand" "Q")	      (const_int 8)	      (const_int 8)) 0)	  (match_operand:QI 1 "nonmemory_operand" "Qn")))]  "TARGET_64BIT && ix86_match_ccmode (insn, CCmode)"  "cmp{b}\t{%1, %h0|%h0, %1}"  [(set_attr "type" "icmp")   (set_attr "mode" "QI")])(define_insn "*cmpqi_ext_4"  [(set (reg 17)	(compare	  (subreg:QI	    (zero_extract:SI	      (match_operand 0 "ext_register_operand" "Q")	      (const_int 8)	      (const_int 8)) 0)	  (subreg:QI	    (zero_extract:SI	      (match_operand 1 "ext_register_operand" "Q")	      (const_int 8)	      (const_int 8)) 0)))]  "ix86_match_ccmode (insn, CCmode)"  "cmp{b}\t{%h1, %h0|%h0, %h1}"  [(set_attr "type" "icmp")   (set_attr "mode" "QI")]);; These implement float point compares.;; %%% See if we can get away with VOIDmode operands on the actual insns,;; which would allow mix and match FP modes on the compares.  Which is what;; the old patterns did, but with many more of them.(define_expand "cmpxf"  [(set (reg:CC 17)	(compare:CC (match_operand:XF 0 "cmp_fp_expander_operand" "")		    (match_operand:XF 1 "cmp_fp_expander_operand" "")))]  "!TARGET_64BIT && TARGET_80387"{  ix86_compare_op0 = operands[0];  ix86_compare_op1 = operands[1];  DONE;})(define_expand "cmptf"  [(set (reg:CC 17)	(compare:CC (match_operand:TF 0 "cmp_fp_expander_operand" "")		    (match_operand:TF 1 "cmp_fp_expander_operand" "")))]  "TARGET_80387"{  ix86_compare_op0 = operands[0];  ix86_compare_op1 = operands[1];  DONE;})(define_expand "cmpdf"  [(set (reg:CC 17)	(compare:CC (match_operand:DF 0 "cmp_fp_expander_operand" "")		    (match_operand:DF 1 "cmp_fp_expander_operand" "")))]  "TARGET_80387 || TARGET_SSE2"{  ix86_compare_op0 = operands[0];  ix86_compare_op1 = operands[1];  DONE;})(define_expand "cmpsf"  [(set (reg:CC 17)	(compare:CC (match_operand:SF 0 "cmp_fp_expander_operand" "")		    (match_operand:SF 1 "cmp_fp_expander_operand" "")))]  "TARGET_80387 || TARGET_SSE"{  ix86_compare_op0 = operands[0];  ix86_compare_op1 = operands[1];  DONE;});; FP compares, step 1:;; Set the FP condition codes.;;;; CCFPmode	compare with exceptions;; CCFPUmode	compare with no exceptions;; %%% It is an unfortunate fact that ftst has no non-popping variant,;; and that fp moves clobber the condition codes, and that there is;; currently no way to describe this fact to reg-stack.  So there are;; no splitters yet for this.;; %%% YIKES!  This scheme does not retain a strong connection between ;; the real compare and the ultimate cc0 user, so CC_REVERSE does not;; work!  Only allow tos/mem with tos in op 0.;;;; Hmm, of course, this is what the actual _hardware_ does.  Perhaps;; things aren't as bad as they sound...(define_insn "*cmpfp_0"  [(set (match_operand:HI 0 "register_operand" "=a")	(unspec:HI	  [(compare:CCFP (match_operand 1 "register_operand" "f")		         (match_operand 2 "const0_operand" "X"))]	  UNSPEC_FNSTSW))]  "TARGET_80387   && FLOAT_MODE_P (GET_MODE (operands[1]))   && GET_MODE (operands[1]) == GET_MODE (operands[2])"{  if (find_regno_note (insn, REG_DEAD, REGNO (operands[1])))    return "ftst\;fnstsw\t%0\;fstp\t%y0";  else    return "ftst\;fnstsw\t%0";}  [(set_attr "type" "multi")   (set_attr "mode" "unknownfp")]);; We may not use "#" to split and emit these, since the REG_DEAD notes;; used to manage the reg stack popping would not be preserved.(define_insn "*cmpfp_2_sf"  [(set (reg:CCFP 18)	(compare:CCFP	  (match_operand:SF 0 "register_operand" "f")	  (match_operand:SF 1 "nonimmediate_operand" "fm")))]  "TARGET_80387"  "* return output_fp_compare (insn, operands, 0, 0);"  [(set_attr "type" "fcmp")   (set_attr "mode" "SF")])(define_insn "*cmpfp_2_sf_1"  [(set (match_operand:HI 0 "register_operand" "=a")	(unspec:HI	  [(compare:CCFP	     (match_operand:SF 1 "register_operand" "f")	     (match_operand:SF 2 "nonimmediate_operand" "fm"))]	  UNSPEC_FNSTSW))]  "TARGET_80387"  "* return output_fp_compare (insn, operands, 2, 0);"  [(set_attr "type" "fcmp")   (set_attr "mode" "SF")])(define_insn "*cmpfp_2_df"  [(set (reg:CCFP 18)	(compare:CCFP	  (match_operand:DF 0 "register_operand" "f")	  (match_operand:DF 1 "nonimmediate_operand" "fm")))]  "TARGET_80387"  "* return output_fp_compare (insn, operands, 0, 0);"  [(set_attr "type" "fcmp")   (set_attr "mode" "DF")])(define_insn "*cmpfp_2_df_1"  [(set (match_operand:HI 0 "register_operand" "=a")	(unspec:HI	  [(compare:CCFP	     (match_operand:DF 1 "register_operand" "f")	     (match_operand:DF 2 "nonimmediate_operand" "fm"))]	  UNSPEC_FNSTSW))]  "TARGET_80387"  "* return output_fp_compare (insn, operands, 2, 0);"  [(set_attr "type" "multi")   (set_attr "mode" "DF")])(define_insn "*cmpfp_2_xf"  [(set (reg:CCFP 18)	(compare:CCFP	  (match_operand:XF 0 "register_operand" "f")	  (match_operand:XF 1 "register_operand" "f")))]  "!TARGET_64BIT && TARGET_80387"  "* return output_fp_compare (insn, operands, 0, 0);"  [(set_attr "type" "fcmp")   (set_attr "mode" "XF")])(define_insn "*cmpfp_2_tf"  [(set (reg:CCFP 18)	(compare:CCFP	  (match_operand:TF 0 "register_operand" "f")	  (match_operand:TF 1 "register_operand" "f")))]  "TARGET_80387"

⌨️ 快捷键说明

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