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

📄 mips.md

📁 GUN开源阻止下的编译器GCC
💻 MD
📖 第 1 页 / 共 5 页
字号:
  dslots_jump_filled += 2;  operands[4] = const0_rtx;  if (optimize && find_reg_note (insn, REG_DEAD, operands[1]))    return \"%(\\move\\t%0,%z4\\n\\\\tbeq\\t%1,%z4,2f\\n\\1:\\tand\\t%2,%1,0x0001\\n\\\\tdaddu\\t%0,%0,1\\n\\\\tbeq\\t%2,%z4,1b\\n\\\\tdsrl\\t%1,%1,1\\n\\2:%)\";  return \"%(\\move\\t%0,%z4\\n\\\\tmove\\t%3,%1\\n\\\\tbeq\\t%3,%z4,2f\\n\\1:\\tand\\t%2,%3,0x0001\\n\\\\tdaddu\\t%0,%0,1\\n\\\\tbeq\\t%2,%z4,1b\\n\\\\tdsrl\\t%3,%3,1\\n\\2:%)\";}"  [(set_attr "type"	"multi")   (set_attr "mode"	"DI")   (set_attr "length"	"6")]);;;;  ....................;;;;	NEGATION and ONE'S COMPLEMENT;;;;  ....................(define_insn "negsi2"  [(set (match_operand:SI 0 "register_operand" "=d")	(neg:SI (match_operand:SI 1 "register_operand" "d")))]  ""  "*{  operands[2] = const0_rtx;  return \"subu\\t%0,%z2,%1\";}"  [(set_attr "type"	"arith")   (set_attr "mode"	"SI")   (set_attr "length"	"1")])(define_expand "negdi2"  [(parallel [(set (match_operand:DI 0 "register_operand" "=d")		   (neg:DI (match_operand:DI 1 "register_operand" "d")))	      (clobber (match_dup 2))])]  "TARGET_64BIT || !TARGET_DEBUG_G_MODE"  "{  if (TARGET_64BIT)    {      emit_insn (gen_negdi2_internal_2 (operands[0], operands[1]));      DONE;    }  operands[2] = gen_reg_rtx (SImode);}")(define_insn "negdi2_internal"  [(set (match_operand:DI 0 "register_operand" "=d")	(neg:DI (match_operand:DI 1 "register_operand" "d")))   (clobber (match_operand:SI 2 "register_operand" "=d"))]  "! TARGET_64BIT && !TARGET_DEBUG_G_MODE"  "*{  operands[3] = const0_rtx;  return \"subu\\t%L0,%z3,%L1\;subu\\t%M0,%z3,%M1\;sltu\\t%2,%z3,%L0\;subu\\t%M0,%M0,%2\";}"  [(set_attr "type"	"darith")   (set_attr "mode"	"DI")   (set_attr "length"	"4")])(define_insn "negdi2_internal_2"  [(set (match_operand:DI 0 "register_operand" "=d")	(neg:DI (match_operand:DI 1 "register_operand" "d")))]  "TARGET_64BIT"  "*{  operands[2] = const0_rtx;  return \"dsubu\\t%0,%z2,%1\";}"  [(set_attr "type"	"arith")   (set_attr "mode"	"DI")   (set_attr "length"	"1")])(define_insn "negdf2"  [(set (match_operand:DF 0 "register_operand" "=f")	(neg:DF (match_operand:DF 1 "register_operand" "f")))]  "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT"  "neg.d\\t%0,%1"  [(set_attr "type"	"fneg")   (set_attr "mode"	"DF")   (set_attr "length"	"1")])(define_insn "negsf2"  [(set (match_operand:SF 0 "register_operand" "=f")	(neg:SF (match_operand:SF 1 "register_operand" "f")))]  "TARGET_HARD_FLOAT"  "neg.s\\t%0,%1"  [(set_attr "type"	"fneg")   (set_attr "mode"	"SF")   (set_attr "length"	"1")])(define_insn "one_cmplsi2"  [(set (match_operand:SI 0 "register_operand" "=d")	(not:SI (match_operand:SI 1 "register_operand" "d")))]  ""  "*{  operands[2] = const0_rtx;  return \"nor\\t%0,%z2,%1\";}"  [(set_attr "type"	"arith")   (set_attr "mode"	"SI")   (set_attr "length"	"1")])(define_insn "one_cmpldi2"  [(set (match_operand:DI 0 "register_operand" "=d")	(not:DI (match_operand:DI 1 "register_operand" "d")))]  ""  "*{  operands[2] = const0_rtx;  if (TARGET_64BIT)    return \"nor\\t%0,%z2,%1\";  return \"nor\\t%M0,%z2,%M1\;nor\\t%L0,%z2,%L1\";}"  [(set_attr "type"	"darith")   (set_attr "mode"	"DI")   (set (attr "length")	(if_then_else (ge (symbol_ref "mips_isa") (const_int 3))		       (const_int 1)		       (const_int 2)))])(define_split  [(set (match_operand:DI 0 "register_operand" "")	(not:DI (match_operand:DI 1 "register_operand" "")))]  "reload_completed && !TARGET_64BIT && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE   && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))   && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))"  [(set (subreg:SI (match_dup 0) 0) (not:SI (subreg:SI (match_dup 1) 0)))   (set (subreg:SI (match_dup 0) 1) (not:SI (subreg:SI (match_dup 1) 1)))]  "");; Simple hack to recognize the "nor" instruction on the MIPS;; This must appear before the normal or patterns, so that the;; combiner will correctly fold things.(define_insn "norsi3"  [(set (match_operand:SI 0 "register_operand" "=d")	(not:SI (ior:SI (match_operand:SI 1 "reg_or_0_operand" "dJ")			(match_operand:SI 2 "reg_or_0_operand" "dJ"))))]  ""  "nor\\t%0,%z1,%z2"  [(set_attr "type"	"arith")   (set_attr "mode"	"SI")   (set_attr "length"	"1")])(define_insn "nordi3"  [(set (match_operand:DI 0 "register_operand" "=d")	(not:DI (ior:DI (match_operand:DI 1 "register_operand" "d")			(match_operand:DI 2 "register_operand" "d"))))]  ""  "*{  if (TARGET_64BIT)    return \"nor\\t%0,%z1,%z2\";  return \"nor\\t%M0,%M1,%M2\;nor\\t%L0,%L1,%L2\";}"  [(set_attr "type"	"darith")   (set_attr "mode"	"DI")   (set (attr "length")	(if_then_else (ge (symbol_ref "mips_isa") (const_int 3))		       (const_int 1)		       (const_int 2)))])(define_split  [(set (match_operand:DI 0 "register_operand" "")	(not:DI (ior:DI (match_operand:DI 1 "register_operand" "")			(match_operand:DI 2 "register_operand" ""))))]  "reload_completed && !TARGET_64BIT && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE   && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))   && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))   && GET_CODE (operands[2]) == REG && GP_REG_P (REGNO (operands[2]))"  [(set (subreg:SI (match_dup 0) 0) (not:SI (ior:SI (subreg:SI (match_dup 1) 0) (subreg:SI (match_dup 2) 0))))   (set (subreg:SI (match_dup 0) 1) (not:SI (ior:SI (subreg:SI (match_dup 1) 1) (subreg:SI (match_dup 2) 1))))]  "");;;;  ....................;;;;	LOGICAL;;;;  ....................;;(define_insn "andsi3"  [(set (match_operand:SI 0 "register_operand" "=d,d")	(and:SI (match_operand:SI 1 "uns_arith_operand" "%d,d")		(match_operand:SI 2 "uns_arith_operand" "d,K")))]  ""  "@   and\\t%0,%1,%2   andi\\t%0,%1,%x2"  [(set_attr "type"	"arith")   (set_attr "mode"	"SI")   (set_attr "length"	"1")])(define_insn "anddi3"  [(set (match_operand:DI 0 "register_operand" "=d")	(and:DI (match_operand:DI 1 "register_operand" "d")		(match_operand:DI 2 "register_operand" "d")))]  "TARGET_64BIT || !TARGET_DEBUG_G_MODE"  "*{  if (TARGET_64BIT)    return \"and\\t%0,%1,%2\";  return \"and\\t%M0,%M1,%M2\;and\\t%L0,%L1,%L2\";}"  [(set_attr "type"	"darith")   (set_attr "mode"	"DI")   (set (attr "length")	(if_then_else (ge (symbol_ref "mips_isa") (const_int 3))		       (const_int 1)		       (const_int 2)))])(define_split  [(set (match_operand:DI 0 "register_operand" "")	(and:DI (match_operand:DI 1 "register_operand" "")		(match_operand:DI 2 "register_operand" "")))]  "reload_completed && !TARGET_64BIT && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE   && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))   && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))   && GET_CODE (operands[2]) == REG && GP_REG_P (REGNO (operands[2]))"  [(set (subreg:SI (match_dup 0) 0) (and:SI (subreg:SI (match_dup 1) 0) (subreg:SI (match_dup 2) 0)))   (set (subreg:SI (match_dup 0) 1) (and:SI (subreg:SI (match_dup 1) 1) (subreg:SI (match_dup 2) 1)))]  "")(define_insn "anddi3_internal1"  [(set (match_operand:DI 0 "register_operand" "=d,d")	(and:DI (match_operand:DI 1 "register_operand" "%d,d")		(match_operand:DI 2 "uns_arith_operand" "d,K")))]  "TARGET_64BIT"  "@   and\\t%0,%1,%2   andi\\t%0,%1,%x2"  [(set_attr "type"	"arith")   (set_attr "mode"	"DI")   (set_attr "length"	"1")])(define_insn "iorsi3"  [(set (match_operand:SI 0 "register_operand" "=d,d")	(ior:SI (match_operand:SI 1 "uns_arith_operand" "%d,d")		(match_operand:SI 2 "uns_arith_operand" "d,K")))]  ""  "@   or\\t%0,%1,%2   ori\\t%0,%1,%x2"  [(set_attr "type"	"arith")   (set_attr "mode"	"SI")   (set_attr "length"	"1")]);;; ??? There is no iordi3 pattern which accepts 'K' constants when;;; TARGET_64BIT(define_insn "iordi3"  [(set (match_operand:DI 0 "register_operand" "=d")	(ior:DI (match_operand:DI 1 "register_operand" "d")		(match_operand:DI 2 "register_operand" "d")))]  "TARGET_64BIT || !TARGET_DEBUG_G_MODE"  "*{  if (TARGET_64BIT)    return \"or\\t%0,%1,%2\";  return \"or\\t%M0,%M1,%M2\;or\\t%L0,%L1,%L2\";}"  [(set_attr "type"	"darith")   (set_attr "mode"	"DI")   (set (attr "length")	(if_then_else (ge (symbol_ref "mips_isa") (const_int 3))		       (const_int 1)		       (const_int 2)))])(define_split  [(set (match_operand:DI 0 "register_operand" "")	(ior:DI (match_operand:DI 1 "register_operand" "")		(match_operand:DI 2 "register_operand" "")))]  "reload_completed && !TARGET_64BIT && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE   && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))   && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))   && GET_CODE (operands[2]) == REG && GP_REG_P (REGNO (operands[2]))"  [(set (subreg:SI (match_dup 0) 0) (ior:SI (subreg:SI (match_dup 1) 0) (subreg:SI (match_dup 2) 0)))   (set (subreg:SI (match_dup 0) 1) (ior:SI (subreg:SI (match_dup 1) 1) (subreg:SI (match_dup 2) 1)))]  "")(define_insn "xorsi3"  [(set (match_operand:SI 0 "register_operand" "=d,d")	(xor:SI (match_operand:SI 1 "uns_arith_operand" "%d,d")		(match_operand:SI 2 "uns_arith_operand" "d,K")))]  ""  "@   xor\\t%0,%1,%2   xori\\t%0,%1,%x2"  [(set_attr "type"	"arith")   (set_attr "mode"	"SI")   (set_attr "length"	"1")]);; ??? If delete the 32-bit long long patterns, then could merge this with;; the following xordi3_internal pattern.(define_insn "xordi3"  [(set (match_operand:DI 0 "register_operand" "=d")	(xor:DI (match_operand:DI 1 "register_operand" "d")		(match_operand:DI 2 "register_operand" "d")))]  "TARGET_64BIT || !TARGET_DEBUG_G_MODE"  "*{  if (TARGET_64BIT)    return \"xor\\t%0,%1,%2\";  return \"xor\\t%M0,%M1,%M2\;xor\\t%L0,%L1,%L2\";}"  [(set_attr "type"	"darith")   (set_attr "mode"	"DI")   (set (attr "length")	(if_then_else (ge (symbol_ref "mips_isa") (const_int 3))		       (const_int 1)		       (const_int 2)))])(define_split  [(set (match_operand:DI 0 "register_operand" "")	(xor:DI (match_operand:DI 1 "register_operand" "")		(match_operand:DI 2 "register_operand" "")))]  "reload_completed && !TARGET_64BIT && !TARGET_DEBUG_D_MODE && !TARGET_DEBUG_G_MODE   && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))   && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))   && GET_CODE (operands[2]) == REG && GP_REG_P (REGNO (operands[2]))"  [(set (subreg:SI (match_dup 0) 0) (xor:SI (subreg:SI (match_dup 1) 0) (subreg:SI (match_dup 2) 0)))   (set (subreg:SI (match_dup 0) 1) (xor:SI (subreg:SI (match_dup 1) 1) (subreg:SI (match_dup 2) 1)))]  "")(define_insn "xordi3_immed"  [(set (match_operand:DI 0 "register_operand" "d")	(xor:DI (match_operand:DI 1 "register_operand" "d")		(match_operand:DI 2 "uns_arith_operand" "K")))]  "TARGET_64BIT"  "xori\\t%0,%1,%x2"  [(set_attr "type"	"arith")   (set_attr "mode"	"DI")   (set_attr "length"	"1")]);;;;  ....................;;;;	TRUNCATION;;;;  ....................(define_insn "truncdfsf2"  [(set (match_operand:SF 0 "register_operand" "=f")	(float_truncate:SF (match_operand:DF 1 "register_operand" "f")))]  "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT"  "cvt.s.d\\t%0,%1"  [(set_attr "type"	"fcvt")   (set_attr "mode"	"SF")   (set_attr "length"	"1")])(define_insn "truncdisi2"  [(set (match_operand:SI 0 "register_operand" "=d")	(truncate:SI (match_operand:DI 1 "register_operand" "d")))]  "TARGET_64BIT"  "dsll\\t%0,%1,32\;dsra\\t%0,%0,32"  [(set_attr "type"	"darith")   (set_attr "mode"	"SI")   (set_attr "length"	"2")])(define_insn "truncdihi2"  [(set (match_operand:HI 0 "register_operand" "=d")	(truncate:HI (match_operand:DI 1 "register_operand" "d")))]  "TARGET_64BIT"  "andi\\t%0,%1,0xffff"  [(set_attr "type"	"darith")   (set_attr "mode"	"HI")   (set_attr "length"	"1")])(define_insn "truncdiqi2"  [(set (match_operand:QI 0 "register_operand" "=d")	(truncate:QI (match_operand:DI 1 "register_operand" "d")))]  "TARGET_64BIT"  "andi\\t%0,%1,0x00ff"  [(set_attr "type"	"darith")   (set_attr "mode"	"QI")   (set_attr "length"	"1")]);; Combiner patterns to optimize shift/truncate combinations.(define_insn ""  [(set (match_operand:SI 0 "register_operand" "=d")	(truncate:SI (ashiftrt:DI (match_operand:DI 1 "register_opera

⌨️ 快捷键说明

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